/* The webmail: folders, search, tabs, rows, the reading pane. Each newsletter's own look is in letters.css. */
:root {
  --bg: #f6f8fc; --panel: #fff; --line: #e8eaed; --ink: #1f1f1f; --muted: #5f6368; --blue: #0b57d0;
  --folder-on: #d3e3fd; --compose: #c2e7ff; --read: #f2f6fc; --open: #c2e7ff; --sel: #d3e3fd;
  --nav-w: 220px; --list-w: 384px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body { font: 14px/1.4 Roboto, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif; overflow: hidden; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; }
a { color: var(--blue); }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ib { width: 44px; height: 44px; flex: none; display: inline-grid; place-items: center; border: 0; border-radius: 50%; background: none; color: #444746; cursor: pointer; text-decoration: none; }
.ib.sm { width: 36px; height: 36px; }
.ib:hover { background: rgba(68, 71, 70, .08); }
.ib:focus-visible, .row:focus-visible, .tab:focus-visible, .folder:focus-visible, .compose:focus-visible, .pill:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }

/* ---- frame */
.app { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); grid-template-rows: 64px minmax(0, 1fr); height: 100vh; height: 100dvh; opacity: 0; transition: opacity .25s; }
html.ready .app { opacity: 1; }
.top { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 12px; min-width: 0; }
.search { flex: 1 1 auto; max-width: 720px; height: 48px; margin-left: calc(var(--nav-w) - 12px - 44px - 8px); display: flex; align-items: center; gap: 6px; padding: 0 6px 0 16px; border-radius: 24px; background: #e9eef6; color: #444746; min-width: 0; transition: background .15s, box-shadow .15s; }
.search:focus-within { background: #fff; box-shadow: 0 1px 1px rgba(65, 69, 73, .3), 0 1px 3px 1px rgba(65, 69, 73, .15); }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: none; font: 16px Roboto, system-ui, sans-serif; color: var(--ink); outline: none; }
.search input::-webkit-search-cancel-button { display: none; }
.search input:placeholder-shown ~ #qClear { visibility: hidden; }
.me { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; background: #e8eaed; color: #80868b; display: grid; place-items: center; flex: none; }
.me .i { width: 26px; height: 26px; margin-top: 4px; }

/* ---- folders */
.nav { padding: 4px 16px 16px 8px; min-height: 0; overflow: auto; }
.compose { display: inline-flex; align-items: center; gap: 12px; height: 56px; padding: 0 24px 0 18px; margin: 4px 0 14px; border-radius: 16px; background: var(--compose); color: #001d35; font-weight: 500; text-decoration: none; transition: box-shadow .15s; }
.compose:hover { box-shadow: 0 1px 3px rgba(60, 64, 67, .3), 0 4px 8px 3px rgba(60, 64, 67, .15); }
.compose .i { width: 22px; height: 22px; }
.folders { list-style: none; margin: 0; padding: 0; }
.folder { width: 100%; height: 32px; display: flex; align-items: center; gap: 18px; padding: 0 12px 0 18px; border: 0; border-radius: 0 16px 16px 0; background: none; color: #202124; cursor: pointer; text-align: left; }
.folder:hover { background: #eaebef; }
.folder.on { background: var(--folder-on); font-weight: 700; color: #001d35; }
.scrim { display: none; }

/* ---- the panel: list and reader */
.main { display: grid; grid-template-columns: minmax(300px, var(--list-w)) minmax(0, 1fr); min-width: 0; min-height: 0; margin: 0 16px 16px 0; background: var(--panel); border-radius: 16px; overflow: hidden; }
.listpane { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--line); }
.toolbar { display: flex; align-items: center; gap: 2px; height: 48px; padding: 0 8px; flex: none; }
.cb .i:last-child, .cb.on .i:first-child { display: none; }
.cb.on .i:last-child { display: block; color: #444746; }
#refresh.spin .i { animation: spin .6s ease; }
@keyframes spin { to { transform: rotate(360deg); } }

.tabs { display: flex; flex: none; border-bottom: 1px solid var(--line); }
.tab { flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 14px; border: 0; border-bottom: 3px solid transparent; background: none; color: #444746; cursor: pointer; text-align: left; font-weight: 500; }
.tab:hover { background: #f5f5f5; }
.tab.on { color: var(--blue); border-bottom-color: var(--blue); }
.tab-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.tab-hint { font-size: 12px; font-weight: 400; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-hint:empty { display: none; }
.tab.new .tab-t > span { font-weight: 700; color: var(--ink); }
.app[data-folder="search"] .tabs, .app[data-folder="starred"] .tabs, .app[data-folder="sent"] .tabs, .app[data-folder="drafts"] .tabs, .app[data-folder="spam"] .tabs, .app[data-folder="trash"] .tabs { display: none; }

.rows { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.row { position: relative; display: grid; grid-template-columns: 32px 32px minmax(0, 1fr) auto; grid-template-areas: "cb star txt pv"; align-items: start; column-gap: 4px; padding: 10px 14px 10px 6px; border-bottom: 1px solid #eef0f2; background: var(--read); cursor: pointer; }
.row.unread { background: #fff; }
.row:hover { box-shadow: inset 1px 0 0 #dadce0, inset -1px 0 0 #dadce0, 0 1px 2px rgba(60, 64, 67, .3), 0 1px 3px 1px rgba(60, 64, 67, .15); z-index: 1; }
.row.sel { background: var(--sel); }
.row.open { background: var(--open); }
.row .cb { grid-area: cb; width: 32px; height: 32px; display: grid; place-items: center; border: 0; background: none; color: #80868b; cursor: pointer; padding: 0; margin-top: 4px; }
.row .star { grid-area: star; }
.star { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 50%; background: none; color: #80868b; cursor: pointer; padding: 0; margin-top: 4px; }
.star.on { color: #f4b400; }
.star:hover { background: rgba(68, 71, 70, .08); }
.row .av { display: none; }
.txt { grid-area: txt; min-width: 0; padding: 4px 8px 0 4px; }
.txt > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.from { font-size: 14px; color: #3c4043; }
.subj { font-size: 14px; color: #3c4043; }
.l3 { font-size: 13px; color: var(--muted); margin-top: 1px; }
.row.unread .from, .row.unread .subj { font-weight: 700; color: #1f1f1f; }
.pv { grid-area: pv; width: 96px; height: 54px; margin-top: 6px; border-radius: 6px; object-fit: cover; background: #e8eaed; display: block; }
.empty { padding: 48px 24px; text-align: center; color: var(--muted); font-size: 14px; }
.empty a { cursor: pointer; }

/* ---- reader */
.reader { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #fff; }
.reader-bar { display: none; align-items: center; justify-content: flex-end; height: 48px; padding: 0 12px; flex: none; border-bottom: 1px solid var(--line); }
.msg-from .star { width: 40px; height: 40px; margin-top: 0; }
.reader-bar #back { display: none; margin-right: auto; }
.reader-star .star { width: 40px; height: 40px; }
.reader-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; }
.reader-empty { height: 100%; min-height: 240px; display: grid; place-content: center; justify-items: center; gap: 8px; color: #80868b; }
.reader-empty .i { width: 64px; height: 64px; stroke-width: 1; }
.reader-empty p { margin: 0; font-size: 14px; }
.msg-head { padding: 18px 24px 14px; }
.msg-subject { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font: 400 22px/1.3 Roboto, system-ui, sans-serif; color: #1f1f1f; }
.chip { font-size: 12px; line-height: 18px; padding: 0 6px; border-radius: 4px; background: #e8eaed; color: #444746; }
.msg-from { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.av { width: 40px; height: 40px; border-radius: 50%; background: var(--c, #5f6368); color: #fff; display: grid; place-items: center; font: 500 18px Roboto, system-ui, sans-serif; flex: none; text-transform: uppercase; }
.who { flex: 1; min-width: 0; }
.who-1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.who-1 b { font-size: 14px; }
.unsub { font-size: 12px; color: #444746; }
.who-2 { font-size: 12px; color: var(--muted); }
.msg-actions { display: flex; flex-wrap: wrap; gap: 12px; padding: 24px 24px 48px; }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 18px 0 14px; border: 1px solid #747775; border-radius: 19px; color: #444746; font-weight: 500; text-decoration: none; }
.pill:hover { background: #f3f6fb; }

/* Mike's email: a plain one */
.plain { padding: 8px 24px 8px 76px; max-width: 760px; font-size: 14px; line-height: 1.6; color: #222; }
.plain p { margin: 0 0 16px; }
.plain-exp { margin: 0 0 18px; padding: 0 0 0 18px; }
.plain-exp .co { color: var(--muted); }
.sig { color: #555; }
.sig-name { color: #222; }

/* "View in browser" */
.web-page { display: none; }
html.web body { overflow: auto; background: #fff; }
html.web .app { display: none; }
html.web .web-page { display: block; }
html.web .web-page .nl-outer { min-height: 100vh; }

/* ---- narrower desktops: the folder list becomes a rail */
@media (max-width: 1200px) and (min-width: 861px) {
  :root { --nav-w: 72px; --list-w: 340px; }
  .nav { padding: 4px 8px 16px; }
  .compose { width: 56px; padding: 0; justify-content: center; }
  .compose span, .folder span { display: none; }
  .folder { justify-content: center; padding: 0; border-radius: 16px; }
  .search { margin-left: 0; }
}
.app.rail { --nav-w: 72px; }
.app.rail .compose { width: 56px; padding: 0; justify-content: center; }
.app.rail .compose span, .app.rail .folder span { display: none; }
.app.rail .folder { justify-content: center; padding: 0; border-radius: 16px; }

/* ---- phones: the list first; an email opens full width */
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: 64px minmax(0, 1fr); }
  .top { padding: 8px 10px; gap: 4px; }
  .search { margin-left: 0; height: 46px; padding-left: 12px; }
  .nav { position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: min(300px, 84vw); background: #fff; padding: 16px 12px 16px 0; transform: translateX(-105%); transition: transform .22s ease; box-shadow: 0 0 24px rgba(0, 0, 0, .2); }
  .compose { margin-left: 12px; }
  .app.drawer .nav { transform: none; }
  .app.drawer .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(0, 0, 0, .32); }
  .main { grid-template-columns: minmax(0, 1fr); margin: 0; border-radius: 0; }
  .listpane { border-right: 0; }
  .toolbar { display: none; }
  .tab { height: 52px; gap: 10px; padding: 0 12px; }
  .row { grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas: "av txt pv"; padding: 10px 12px 10px 12px; }
  .row .cb, .row .star { display: none; }
  .row .av { display: grid; grid-area: av; margin-top: 4px; }
  .txt { padding: 2px 8px 0 4px; }
  .pv { width: 80px; height: 45px; }
  .reader { display: none; }
  .app.reading .reader { display: flex; position: fixed; inset: 0; z-index: 30; }
  .reader-bar { display: flex; justify-content: space-between; padding: 0 4px; }
  .msg-from .star { display: none; }
  .reader-bar #back { display: grid; }
  .msg-head { padding: 14px 16px 12px; }
  .msg-subject { font-size: 20px; }
  .plain { padding: 8px 16px; }
  .msg-actions { padding: 20px 16px 40px; }
}
