/* Lull Mail — a document, not a console.
   One centered column. Chrome only when summoned. Editorial serif subjects
   over a quiet sans. Light and dark. Keyboard-first.

   Everything is driven by the token block: adjust a token, not a rule. */

/* ============================================================ tokens */

:root {
  --bg: #fbfbfd;
  --panel: #ffffff;
  --raise: #f2f3f7;
  --ink: #15161a;
  --ink-2: #565b65;
  --ink-3: #626873;
  --line: #e9eaef;
  --line-strong: #d7d8e0;
  --hover: #f4f5f9;
  --sel: #eef1fa;
  --accent: #d8402a;
  --accent-ink: #ffffff;
  --accent-soft: #fcefec;
  --danger: #b8362c;
  --danger-soft: #faeeec;
  --ok: #2f9c58;
  --scroll: #d3d4db;
  --shadow-1: 0 1px 2px rgba(21, 22, 26, 0.05);
  --shadow-3: 0 1px 2px rgba(21, 22, 26, 0.05), 0 24px 64px rgba(21, 22, 26, 0.16);
  --veil: rgba(14, 15, 18, 0.32);
  color-scheme: light;

  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  /* The type scale rides one factor so Text size can move the whole app. */
  --t-xs: calc(11.5px * var(--ts, 1));
  --t-sm: calc(12.5px * var(--ts, 1));
  --t-base: calc(13.5px * var(--ts, 1));
  --t-md: calc(14.5px * var(--ts, 1));
  --t-lg: calc(16px * var(--ts, 1));
  --t-subject: calc(20px * var(--ts, 1));
  --t-hero: calc(34px * var(--ts, 1));

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 22px;
  --sp-6: 30px;
  --sp-7: 44px;
  --sp-8: 64px;

  /* The column. Everything on screen aligns to these two numbers. */
  --page: 820px;
  --workspace: 1180px;
  --edge: 28px;
  /* Left rail inside the column, holding unread dots and checkboxes only. */
  --rail: 22px;

  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-pill: 999px;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
}

:root[data-theme="dark"] {
  --bg: #0f1013;
  --panel: #15161a;
  --raise: #1b1d23;
  --ink: #eceef2;
  --ink-2: #a2a7b3;
  --ink-3: #8e95a3;
  --line: #23252b;
  --line-strong: #31343c;
  --hover: #1a1c21;
  --sel: #1d2230;
  --accent: #ff6a44;
  --accent-ink: #1a0d08;
  --accent-soft: #2a1a14;
  --danger: #e5695f;
  --danger-soft: #2a1c1a;
  --ok: #4cbf7a;
  --scroll: #383b44;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-3: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 64px rgba(0, 0, 0, 0.55);
  --veil: rgba(6, 7, 9, 0.55);
  color-scheme: dark;
}

/* Sepia: paper-in-a-warm-room. Darker than light, nowhere near dark —
   beige ground, grey-blue ink, burnt orange accent. No pure black
   anywhere; shadows are brown, not charcoal. */
:root[data-theme="sepia"] {
  --bg: #e7dfd2;
  --panel: #efe8db;
  --raise: #e2d9c8;
  --ink: #3d3833;
  --ink-2: #6b635a;
  --ink-3: #675f56;
  --line: #d8cfbe;
  --line-strong: #c4b9a4;
  --hover: #e0d7c6;
  --sel: #e9dfc9;
  --accent: #c25a24;
  --accent-ink: #fdf8ef;
  --accent-soft: #f3e0cd;
  --danger: #a53c2c;
  --danger-soft: #ecdccd;
  --ok: #6c8a3f;
  --scroll: #c9bfae;
  --shadow-1: 0 1px 2px rgba(90, 74, 50, 0.08);
  --shadow-3: 0 1px 2px rgba(90, 74, 50, 0.08), 0 24px 64px rgba(90, 74, 50, 0.22);
  --veil: rgba(70, 58, 40, 0.34);
  color-scheme: light;
}

/* ---- character themes: full palettes with opinions. Users who want "theirs"
   pick one of these and tune accent/type on top. ---- */

/* Terminal: green phosphor on a switched-off screen. */
:root[data-theme="terminal"] {
  --bg: #060906;
  --panel: #0a0f0a;
  --raise: #0f170f;
  --ink: #b8f5b4;
  --ink-2: #7ccf7c;
  --ink-3: #559355;
  --line: #142014;
  --line-strong: #233423;
  --hover: #121c12;
  --sel: #17251a;
  --accent: #3dff88;
  --accent-ink: #04160a;
  --accent-soft: rgba(61, 255, 136, 0.1);
  --danger: #ff6d5e;
  --danger-soft: rgba(255, 109, 94, 0.1);
  --ok: #3dff88;
  --scroll: #1d2b1d;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-3: 0 1px 2px rgba(0, 0, 0, 0.5), 0 24px 64px rgba(0, 0, 0, 0.6);
  --veil: rgba(2, 5, 2, 0.6);
  color-scheme: dark;
}

/* Amber: the warmer CRT — honey phosphor instead of green. */
:root[data-theme="amber"] {
  --bg: #0f0a04;
  --panel: #171108;
  --raise: #1e170b;
  --ink: #f2c078;
  --ink-2: #c99a56;
  --ink-3: #a17e49;
  --line: #241b0f;
  --line-strong: #38301c;
  --hover: #1d150a;
  --sel: #251c10;
  --accent: #ffab40;
  --accent-ink: #1a1206;
  --accent-soft: rgba(255, 171, 64, 0.1);
  --danger: #ff7a6b;
  --danger-soft: rgba(255, 122, 107, 0.1);
  --ok: #a8c46a;
  --scroll: #2c2213;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-3: 0 1px 2px rgba(0, 0, 0, 0.5), 0 24px 64px rgba(0, 0, 0, 0.6);
  --veil: rgba(8, 5, 2, 0.6);
  color-scheme: dark;
}

/* Nord: the fjord palette — polar night ground, frost accents. */
:root[data-theme="nord"] {
  --bg: #2e3440;
  --panel: #343c4b;
  --raise: #3b4252;
  --ink: #eceff4;
  --ink-2: #d1d9e4;
  --ink-3: #9aa7bb;
  --line: #3b4252;
  --line-strong: #4c566a;
  --hover: #3f4859;
  --sel: #434c5e;
  --accent: #88c0d0;
  --accent-ink: #1d242c;
  --accent-soft: rgba(136, 192, 208, 0.12);
  --danger: #e98076;
  --danger-soft: rgba(233, 128, 118, 0.12);
  --ok: #a3be8c;
  --scroll: #434c5e;
  --shadow-1: 0 1px 2px rgba(20, 25, 35, 0.4);
  --shadow-3: 0 1px 2px rgba(20, 25, 35, 0.4), 0 24px 64px rgba(12, 16, 24, 0.55);
  --veil: rgba(16, 20, 28, 0.55);
  color-scheme: dark;
}

/* Dracula: the night market — purple ground, lavender accent. */
:root[data-theme="dracula"] {
  --bg: #282a36;
  --panel: #2e313f;
  --raise: #343849;
  --ink: #f8f8f2;
  --ink-2: #ced0e0;
  --ink-3: #919bc1;
  --line: #3a3d4e;
  --line-strong: #4d5268;
  --hover: #383b4b;
  --sel: #40435a;
  --accent: #bd93f9;
  --accent-ink: #1e1526;
  --accent-soft: rgba(189, 147, 249, 0.12);
  --danger: #ff79c6;
  --danger-soft: rgba(255, 121, 198, 0.1);
  --ok: #50fa7b;
  --scroll: #414560;
  --shadow-1: 0 1px 2px rgba(15, 16, 25, 0.4);
  --shadow-3: 0 1px 2px rgba(15, 16, 25, 0.4), 0 24px 64px rgba(10, 10, 18, 0.55);
  --veil: rgba(18, 18, 28, 0.55);
  color-scheme: dark;
}

/* Rosé: muted rose and gold on plum night. */
:root[data-theme="rose"] {
  --bg: #191724;
  --panel: #1f1d2e;
  --raise: #26233a;
  --ink: #e0def4;
  --ink-2: #b8b4d4;
  --ink-3: #9691b2;
  --line: #2a2740;
  --line-strong: #3a3655;
  --hover: #252238;
  --sel: #2d2a45;
  --accent: #ebbcba;
  --accent-ink: #241b1a;
  --accent-soft: rgba(235, 188, 190, 0.11);
  --danger: #eb6f92;
  --danger-soft: rgba(235, 111, 146, 0.1);
  --ok: #9ccfd8;
  --scroll: #322e4d;
  --shadow-1: 0 1px 2px rgba(10, 8, 20, 0.45);
  --shadow-3: 0 1px 2px rgba(10, 8, 20, 0.45), 0 24px 64px rgba(8, 6, 16, 0.6);
  --veil: rgba(12, 10, 22, 0.6);
  color-scheme: dark;
}

/* Solarized: the classic warm cream with restrained ink. */
:root[data-theme="solarized"] {
  --bg: #fdf6e3;
  --panel: #fffdf4;
  --raise: #f2ead2;
  --ink: #2c3f45;
  --ink-2: #586e75;
  --ink-3: #586e74;
  --line: #e9e0c8;
  --line-strong: #d3cab0;
  --hover: #f4ecd6;
  --sel: #efe6cb;
  --accent: #b58900;
  --accent-ink: #fffbef;
  --accent-soft: #f0e4bd;
  --danger: #cb4b16;
  --danger-soft: #f6e3d7;
  --ok: #859900;
  --scroll: #d8cfb4;
  --shadow-1: 0 1px 2px rgba(101, 88, 60, 0.08);
  --shadow-3: 0 1px 2px rgba(101, 88, 60, 0.08), 0 24px 64px rgba(101, 88, 60, 0.2);
  --veil: rgba(88, 76, 48, 0.32);
  color-scheme: light;
}

/* Blueprint: drafting-table blue with a pencil-yellow accent. */
:root[data-theme="blueprint"] {
  --bg: #0d2440;
  --panel: #112c4d;
  --raise: #15345c;
  --ink: #dbe9ff;
  --ink-2: #b3cbef;
  --ink-3: #7d9cc7;
  --line: #1c3a63;
  --line-strong: #2b4f80;
  --hover: #16335a;
  --sel: #1c3f6e;
  --accent: #ffd23f;
  --accent-ink: #0d2440;
  --accent-soft: rgba(255, 210, 63, 0.12);
  --danger: #ff8f7a;
  --danger-soft: rgba(255, 143, 122, 0.1);
  --ok: #7fd4a8;
  --scroll: #25466f;
  --shadow-1: 0 1px 2px rgba(5, 14, 28, 0.45);
  --shadow-3: 0 1px 2px rgba(5, 14, 28, 0.45), 0 24px 64px rgba(3, 10, 22, 0.6);
  --veil: rgba(5, 15, 30, 0.58);
  color-scheme: dark;
}

/* Y2K: Luna blue and Aqua gloss — the optimistic internet. */
:root[data-theme="y2k"] {
  --bg: #eaf3fc;
  --panel: #ffffff;
  --raise: #eaf2fb;
  --ink: #16344f;
  --ink-2: #47617a;
  --ink-3: #566f87;
  --line: #c9dcef;
  --line-strong: #a8c4e0;
  --hover: #f0f6fd;
  --sel: #dbe9f8;
  --accent: #2f7dc9;
  --accent-ink: #ffffff;
  --accent-soft: #dcebfa;
  --danger: #c0392b;
  --danger-soft: #f9e4e0;
  --ok: #3f9c58;
  --scroll: #b7c9dd;
  --shadow-1: 0 1px 3px rgba(31, 78, 121, 0.14);
  --shadow-3: 0 1px 3px rgba(31, 78, 121, 0.14), 0 24px 64px rgba(31, 78, 121, 0.22);
  --veil: rgba(35, 70, 110, 0.28);
  color-scheme: light;
}

/* 1999: the beige box — grey chrome, hard bevels, navy title bars,
   Tahoma doing its best. */
:root[data-theme="1999"] {
  --bg: #d4d0c8;
  --panel: #ffffff;
  --raise: #d8d4cc;
  --ink: #101010;
  --ink-2: #3c3c3c;
  --ink-3: #555555;
  --line: #b4b0a8;
  --line-strong: #8f8b84;
  --hover: #e6e2da;
  --sel: #d8e0ec;
  --accent: #000080;
  --accent-ink: #ffffff;
  --accent-soft: #d4d8ec;
  --danger: #a02818;
  --danger-soft: #efded8;
  --ok: #2e7d32;
  --scroll: #a8a49c;
  --shadow-1: inset 1px 1px #ffffff, inset -1px -1px #808080;
  --shadow-3: inset 1px 1px #ffffff, inset -1px -1px #808080;
  --veil: rgba(60, 60, 60, 0.35);
  --sans: Tahoma, "MS Sans Serif", Geneva, sans-serif;
  --serif: "Times New Roman", Times, serif;
  color-scheme: light;
}

/* Vapor: pink-and-cyan sunset over a purple grid; titles lean italic. */
:root[data-theme="vapor"] {
  --bg: #1b0e33;
  --panel: #251342;
  --raise: #2f1a52;
  --ink: #f4e9ff;
  --ink-2: #cdaef0;
  --ink-3: #aa87da;
  --line: #3a1f63;
  --line-strong: #55307f;
  --hover: #351e5c;
  --sel: #3d2570;
  --accent: #38f0ff;
  --accent-ink: #05272b;
  --accent-soft: rgba(56, 240, 255, 0.1);
  --danger: #ff6bd6;
  --danger-soft: rgba(255, 107, 214, 0.1);
  --ok: #58e6c6;
  --scroll: #4a2a75;
  --shadow-1: 0 1px 2px rgba(12, 4, 24, 0.5);
  --shadow-3: 0 1px 2px rgba(12, 4, 24, 0.5), 0 24px 64px rgba(8, 2, 18, 0.6);
  --veil: rgba(10, 4, 20, 0.6);
  color-scheme: dark;
}

/* ---- era detailing: the layers that make the three novelty themes feel
       like their decade rather than just colored like it ---- */

[data-theme="y2k"] body {
  background: linear-gradient(180deg, #9cc3ee 0%, #eaf3fc 420px) fixed;
}
[data-theme="y2k"] .btn {
  border-radius: 8px;
  background: linear-gradient(180deg, #b3d7f7, #5a9bd8);
  color: #ffffff;
  border: 1px solid #2f6cab;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 1px 2px rgba(31, 78, 121, 0.35);
}
[data-theme="y2k"] .btn:hover { filter: brightness(1.05); }
[data-theme="y2k"] .btn-accent {
  background: linear-gradient(180deg, #8fe07c, #3d9e3d);
  border-color: #2e7d2e;
}
[data-theme="y2k"] .topline { background: linear-gradient(180deg, #eaf3fc, #d7e8f8); }
[data-theme="y2k"] .gate, [data-theme="y2k"] .panel { border-radius: 12px; }

[data-theme="1999"] body { background: #d4d0c8; }
[data-theme="1999"] .btn {
  border-radius: 0;
  background: #c0c0c0;
  color: #101010;
  border: 1px solid;
  border-color: #dfdfdf #404040 #404040 #dfdfdf;
  box-shadow: inset 1px 1px #ffffff, inset -1px -1px #808080;
}
[data-theme="1999"] .btn:active {
  border-color: #404040 #dfdfdf #dfdfdf #404040;
  box-shadow: inset 1px 1px #808080;
}
[data-theme="1999"] .btn-accent { background: #000080; color: #ffffff; }
[data-theme="1999"] .panel, [data-theme="1999"] .gate {
  border-radius: 0;
  background: #c0c0c0;
  border: 1px solid;
  border-color: #dfdfdf #404040 #404040 #dfdfdf;
}
[data-theme="1999"] .topline { background: #c0c0c0; border-bottom: 1px solid #808080; }
[data-theme="1999"] .theme-card, [data-theme="1999"] .type-card, [data-theme="1999"] .acct-toggle { border-radius: 0; }
[data-theme="1999"] .recovery-grid code, [data-theme="1999"] .menu { border-radius: 0; }

/* 1999 classic panes: one Win98 window — silver frame, white wells.
   The sidebar is chrome (the Outlook Express folder tree), the list and
   reader are sunken white paper, navy owns the selection. */
[data-theme="1999"] .sidebar {
  background: #c0c0c0;
  border-right: 1px solid #808080;
}
[data-theme="1999"] .side-item { border-radius: 0; }
[data-theme="1999"] .side-item:hover { background: #dfdfdf; }
[data-theme="1999"] .side-item.active {
  background: #000080; color: #ffffff; box-shadow: none;
}
[data-theme="1999"] .side-item.active .side-count { color: #ffffff; }
[data-theme="1999"] .side-item.active .side-count.urgent { background: #ffffff; color: #000080; }
[data-theme="1999"] .page.classic .list-pane {
  background: #ffffff;
  border-right: 1px solid #808080;
}
[data-theme="1999"] .pane-split::after { background: #808080; }
[data-theme="1999"] .page.classic .thread-bar {
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
}
[data-theme="1999"] .hints-in {
  border-radius: 0;
  background: #c0c0c0;
  border-color: #dfdfdf #404040 #404040 #dfdfdf;
}
/* Inputs are sunken white wells; focus keeps the navy border. */
[data-theme="1999"] .field input, [data-theme="1999"] .field select,
[data-theme="1999"] .gate input, [data-theme="1999"] .inline-form input,
[data-theme="1999"] .compose-form input, [data-theme="1999"] .compose-form textarea {
  border-radius: 0;
  border: 1px solid;
  border-color: #808080 #dfdfdf #dfdfdf #808080;
  background: #ffffff;
}
[data-theme="1999"] .compose-form input, [data-theme="1999"] .compose-form textarea {
  padding: 6px 8px;
}
[data-theme="1999"] .compose-to { border-bottom: none !important; }
[data-theme="1999"] .compose-btns { background: #c0c0c0; border-top-color: #808080; }
[data-theme="1999"] .nudge {
  background: #c0c0c0;
  border-bottom: 1px solid #808080;
}
[data-theme="1999"] .toast {
  border-radius: 0;
  background: #000080;
  color: #ffffff;
}
[data-theme="1999"] .toast .btn { background: #c0c0c0; color: #101010; }
[data-theme="1999"] .kbd {
  border-radius: 0;
  background: #c0c0c0;
  border-color: #dfdfdf #404040 #404040 #dfdfdf;
}
[data-theme="1999"] .chip, [data-theme="1999"] .attach-chip,
[data-theme="1999"] .img-notice { border-radius: 0; }
[data-theme="1999"] .img-notice {
  background: #c0c0c0;
  border: 1px solid;
  border-color: #dfdfdf #404040 #404040 #dfdfdf;
}

[data-theme="vapor"] body {
  background: linear-gradient(180deg, #140a24 0%, #2d1150 55%, #7c2a86 100%) fixed;
}
[data-theme="vapor"] h1, [data-theme="vapor"] h2, [data-theme="vapor"] .thread-title {
  font-style: italic;
  text-shadow: 0 0 14px rgba(56, 240, 255, 0.35);
}
[data-theme="vapor"] .nav-item.active { text-shadow: 0 0 10px rgba(56, 240, 255, 0.5); }
[data-theme="vapor"] .side-item.active {
  box-shadow: inset 2px 0 0 var(--accent), 0 0 12px rgba(56, 240, 255, 0.15);
}
[data-theme="vapor"] .btn-accent { text-shadow: none; }

/* ============================================================ base */

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
html, body { margin: 0; min-height: 100%; }
neutron-island { display: contents; }

body {
  font-family: var(--sans);
  font-size: var(--t-md);
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r-sm); }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--scroll); border-radius: var(--r-pill);
  border: 3px solid transparent; background-clip: content-box;
}

@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@keyframes fadein { from { opacity: 0; } }
@keyframes shimmer { to { background-position: 200% 0; } }
@keyframes sync-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================================ controls */

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--r-pill); padding: 7px 15px;
  min-height: 34px;
  font-size: var(--t-base); font-weight: 620; white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}
.btn:active { transform: scale(0.975); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }
.btn-primary { background: var(--ink); color: var(--bg); font-weight: 660; }
.btn-primary:hover:not(:disabled) { opacity: 0.86; }
.btn-accent { background: var(--accent); color: var(--accent-ink); font-weight: 660; }
.btn-accent:hover:not(:disabled) { opacity: 0.88; }
.btn-outline { border: 1.5px solid var(--line-strong); color: var(--ink); font-weight: 660; }
.btn-outline:hover:not(:disabled) { border-color: var(--ink-3); color: var(--ink); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--hover); color: var(--ink); }
.btn-danger { color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: var(--danger-soft); }
.btn-quiet-danger { color: var(--ink-3); }
.btn-quiet-danger:hover:not(:disabled) { color: var(--danger); background: var(--danger-soft); }
.btn-sm { padding: 5px 12px; min-height: 32px; font-size: var(--t-sm); }
.btn-icon {
  width: 34px; height: 34px; padding: 0; border-radius: var(--r-sm);
  color: var(--ink-3); display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: var(--hover); color: var(--ink); }
.sync-button.syncing svg { animation: sync-spin 0.8s linear infinite; }

.kbd {
  font-family: var(--sans); font-size: var(--t-xs); font-weight: 700; line-height: 1.5;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px;
  padding: 1px 6px; color: var(--ink-2); background: var(--panel); white-space: nowrap;
}

.chip {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  font-size: var(--t-xs); font-weight: 660; color: var(--ink-3);
  background: var(--raise); border-radius: 6px; padding: 2px 7px;
}
.chip-danger { color: var(--danger); background: var(--danger-soft); }

/* Avatars survive only where a *person* is the subject — the Screener, the
   roster, a thread. Never on a list row, where the subject is a message. */
.avatar {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 38px; height: 38px; border-radius: var(--r-pill);
  font-size: var(--t-lg); font-weight: 700; color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.avatar-lg { width: 46px; height: 46px; font-size: 19px; }
.avatar-sm { width: 26px; height: 26px; font-size: var(--t-sm); }

/* ============================================================ the page */

.page { min-height: 100vh; display: flex; flex-direction: column; }

.column {
  width: 100%;
  max-width: var(--page);
  min-width: 0;
  margin: 0 auto;
  /* Bottom clearance so the last rows can always scroll clear of the hint bar. */
  padding: 0 var(--edge) 92px;
}
.workspace-column { max-width: var(--workspace); }
.calendar-column { max-width: 1440px; }

/* ---- topline: one quiet row, the only permanent chrome ---- */

.topline {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}
.topline.stuck { border-bottom-color: var(--line); }
/* The topline spans the window, not the column: horizontal room is free up here
   and scarce down there. Equal-weight flanks make the nav land dead centre
   regardless of how wide the wordmark or the actions are. */
.topline-in {
  display: flex; align-items: center; gap: var(--sp-4);
  height: 54px;
  max-width: none;
  padding: 0 var(--sp-5);
}
.topline-side { flex: 1 1 0; min-width: 0; display: flex; align-items: center; }
.topline-side.right { justify-content: flex-end; }

.wordmark {
  font-family: var(--serif); font-size: var(--t-lg); font-weight: 700;
  letter-spacing: -0.015em; flex: none;
}
.wordmark::after { content: "."; color: var(--accent); }

.nav { display: flex; align-items: center; gap: 2px; flex: none; min-width: 0; }
.nav-item {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 9px; border-radius: var(--r-sm);
  min-height: 34px;
  font-size: var(--t-base); font-weight: 540; color: var(--ink-3);
  white-space: nowrap;
  transition: color 0.1s ease, background 0.1s ease;
}
.nav-item:hover { color: var(--ink); background: var(--hover); }
.nav-item.active { color: var(--ink); font-weight: 700; }
/* The only badge in the app: the Screener is a to-do, the rest are places. */
.nav-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-ink);
  font-size: 10.5px; font-weight: 760;
}
.topline-acts { gap: var(--sp-2); }

/* ---- page head ---- */

.page-head { padding: var(--sp-7) 0 var(--sp-5); }

/* ---- calendar: a grid surface, not a reading page ----
   Mail is a document; a month is a grid. The calendar keeps the column's
   left edge but expands to the window, the same deal the topline gets —
   every extra pixel is another pixel of week. */
.cal-surface { max-width: 1440px; }
.cal-surface .page-head { padding: var(--sp-6) 0 var(--sp-3); }
.cal-surface .cal-topline { margin-bottom: var(--sp-2); }
.cal-surface .cal-weekdays { margin-bottom: 2px; }
.cal-surface .cal-cell { min-height: 108px; }
.cal-surface .cal-day { margin-top: var(--sp-4); }
.cal-surface .cal-year { gap: var(--sp-3) var(--sp-4); }
.cal-surface .cal-week { min-height: 52vh; }
.cal-surface .cal-wday { min-height: 340px; }
.page-kicker {
  font-size: var(--t-xs); font-weight: 740; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--sp-2);
}
.page-title {
  margin: 0; font-family: var(--serif);
  font-size: var(--t-hero); font-weight: 700; letter-spacing: -0.025em; line-height: 1.08;
}
.page-sub { margin-top: var(--sp-2); max-width: 72ch; color: var(--ink-3); font-size: var(--t-md); line-height: 1.55; }

.section-head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-6) 0 var(--sp-2);
}
.section-title {
  font-size: var(--t-xs); font-weight: 740; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-3);
}
.section-rule { flex: 1; height: 1px; background: var(--line); }
.section-count { font-size: var(--t-xs); font-weight: 720; color: var(--ink-3); }

/* ============================================================ message rows */

.msg-list { display: flex; flex-direction: column; }

.date-rule {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-6) 0 var(--sp-2);
  font-size: var(--t-xs); font-weight: 740; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-3);
}
.date-rule::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* No avatar, no border, no card. Sender, subject, snippet — that is the row. */
.msg-row {
  position: relative;
  padding: var(--sp-3) var(--sp-2) var(--sp-3) var(--rail);
  margin: 0 calc(var(--sp-2) * -1);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: background 0.08s ease;
}
.msg-row, .digest, .screener, .people-row {
  content-visibility: auto;
  contain-intrinsic-size: auto 78px;
}
.msg-row:hover { background: var(--hover); }
.msg-row.cursor { background: var(--hover); box-shadow: inset 2px 0 0 var(--line-strong); }
.msg-row.picked { background: var(--accent-soft); }

.msg-row.unread::before {
  content: ""; position: absolute; left: 4px; top: 20px;
  width: 7px; height: 7px; border-radius: var(--r-pill); background: var(--accent);
}

.row-check {
  position: absolute; left: 0; top: 15px;
  width: 16px; height: 16px; border-radius: 5px;
  border: 1.5px solid var(--line-strong); background: var(--panel);
  display: none; align-items: center; justify-content: center; color: transparent;
}
.msg-row:hover .row-check,
.msg-row.picked .row-check,
.has-selection .row-check { display: flex; }
.msg-row.picked .row-check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.msg-row:hover.unread::before, .has-selection .msg-row.unread::before { opacity: 0; }

.row-top { display: flex; align-items: baseline; gap: var(--sp-2); }
.row-sender {
  font-size: var(--t-base); font-weight: 680; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-meta { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); flex: none; }
.row-date { font-size: var(--t-sm); color: var(--ink-3); font-weight: 520; }
.row-subject {
  font-family: var(--serif);
  font-size: var(--t-subject); font-weight: 640; letter-spacing: -0.016em;
  line-height: 1.28; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-preview {
  font-size: var(--t-base); color: var(--ink-3); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* read mail recedes; unread owns the page */
.msg-row.read .row-subject { font-weight: 440; color: var(--ink-2); font-size: 18.5px; }
.msg-row.read .row-sender { font-weight: 520; color: var(--ink-3); }

.row-acts {
  position: absolute; right: var(--sp-2); top: 7px;
  display: none; gap: 2px; padding-left: var(--sp-4);
  background: linear-gradient(90deg, transparent, var(--hover) 22%);
  border-radius: var(--r-sm);
}
.msg-row:hover .row-acts, .msg-row.cursor .row-acts { display: flex; }
.msg-row:hover .row-date, .msg-row.cursor .row-date { opacity: 0; }

mark.hit { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 1px; font-weight: 700; }

/* ---- bulk bar ---- */

.bulkbar {
  position: sticky; top: 54px; z-index: 15;
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin: 0 calc(var(--sp-2) * -1);
  padding: var(--sp-2);
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  animation: rise 0.14s var(--ease);
}
.bulkbar-count { font-weight: 700; font-size: var(--t-base); padding: 0 var(--sp-2); white-space: nowrap; }
.bulkbar-spacer { flex: 1; }

/* ---- skeletons ---- */

.skel-row { padding: var(--sp-3) 0 var(--sp-3) var(--rail); display: flex; flex-direction: column; gap: 8px; }
.skel {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--raise) 25%, var(--hover) 50%, var(--raise) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s linear infinite;
}
.route-skeleton { display: flex; flex-direction: column; gap: var(--sp-3); padding-top: var(--sp-7); }
.route-skeleton-body { margin-top: var(--sp-4); }

/* ============================================================ Today */

/* Borderless: space and a hairline separate these, not a box with a shadow. */
.digest {
  padding: var(--sp-4) var(--sp-2) var(--sp-4) var(--rail);
  margin: 0 calc(var(--sp-2) * -1);
  border-top: 1px solid var(--line);
  transition: background 0.1s ease;
}
.digest:first-of-type { border-top: none; }
.digest.cursor { background: var(--hover); box-shadow: inset 2px 0 0 var(--accent); }
.digest-top { display: flex; align-items: baseline; gap: var(--sp-2); }
.digest-sender { font-size: var(--t-base); font-weight: 680; color: var(--ink-2); }
.digest-date { margin-left: auto; font-size: var(--t-sm); color: var(--ink-3); flex: none; }
.digest-subject {
  font-family: var(--serif); font-size: var(--t-subject); font-weight: 640;
  letter-spacing: -0.016em; line-height: 1.28; margin-top: 2px;
}
.digest-preview {
  font-size: var(--t-base); color: var(--ink-3); margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.digest-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--sp-3); }

.inline-reply { margin-top: var(--sp-3); }
.inline-ta {
  width: 100%; border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3); font: inherit; font-size: var(--t-md);
  line-height: 1.55; background: var(--panel); color: var(--ink); resize: vertical;
}
.inline-ta:focus { border-color: var(--accent); outline: none; }
.inline-btns { display: flex; align-items: center; gap: var(--sp-2); justify-content: flex-end; margin-top: var(--sp-2); }
.inline-hint { margin-right: auto; font-size: var(--t-sm); color: var(--ink-3); }

.wait-row {
  display: flex; align-items: baseline; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--rail);
  margin: 0 calc(var(--sp-2) * -1);
  border-radius: var(--r-md); cursor: pointer; color: var(--ink-2);
  transition: background 0.1s ease, color 0.1s ease;
}
.wait-row:hover { background: var(--hover); color: var(--ink); }
.wait-who { font-weight: 680; font-size: var(--t-base); white-space: nowrap; flex: none; }
.wait-what {
  font-family: var(--serif); font-size: var(--t-lg); color: var(--ink-3);
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wait-age { flex: none; font-size: var(--t-sm); color: var(--ink-3); }
.wait-age.stale { color: var(--accent); font-weight: 660; }

.quiet-row {
  display: flex; align-items: baseline; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-2) var(--sp-3) var(--rail);
  margin: 0 calc(var(--sp-2) * -1);
  border-top: 1px solid var(--line);
  color: var(--ink-2); font-size: var(--t-md);
}
.quiet-row:hover { background: var(--hover); color: var(--ink); }
.quiet-name { font-weight: 680; }
.quiet-stat { color: var(--accent); font-weight: 660; font-size: var(--t-base); }
.quiet-note { color: var(--ink-3); font-size: var(--t-base); }
.quiet-go { margin-left: auto; color: var(--ink-3); display: inline-flex; }

.more-link { display: inline-block; margin-top: var(--sp-3); font-size: var(--t-base); font-weight: 620; color: var(--ink-3); }
.more-link:hover { color: var(--ink); }

/* ============================================================ screener */

.screener {
  padding: var(--sp-5) var(--sp-2) var(--sp-5) 0;
  border-top: 1px solid var(--line);
}
.screener:first-of-type { border-top: none; }
.screener.cursor { box-shadow: inset 2px 0 0 var(--accent); padding-left: var(--rail); margin-left: calc(var(--rail) * -1); }
.screener-id { display: flex; gap: var(--sp-3); align-items: center; }
.screener-main { min-width: 0; flex: 1; }
.screener-name { font-family: var(--serif); font-size: var(--t-subject); font-weight: 660; letter-spacing: -0.014em; }
.screener-addr { font-size: var(--t-base); color: var(--ink-3); margin-top: 1px; }
.screener-sample {
  display: flex; align-items: center; gap: var(--sp-2);
  margin-top: 6px; color: var(--ink-3); min-width: 0;
}
.screener-subject { font-size: var(--t-base); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screener-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--sp-4); padding-left: 50px; }

.keys-hint {
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
  margin-top: var(--sp-4); color: var(--ink-3); font-size: var(--t-sm);
}

/* ============================================================ people + accounts */

.people-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) 0; border-top: 1px solid var(--line);
}
.people-row:first-of-type { border-top: none; }
.people-main { flex: 1; min-width: 0; }
.people-name { font-weight: 660; font-size: var(--t-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.people-note { font-size: var(--t-base); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.people-acts { display: flex; align-items: center; gap: 2px; flex: none; margin-left: var(--sp-3); }

.account { padding: var(--sp-5) 0; border-top: 1px solid var(--line); }
.account:first-of-type { border-top: none; }
.account-line { display: flex; gap: var(--sp-2); align-items: baseline; flex-wrap: wrap; }
.account-line strong { font-size: var(--t-lg); font-weight: 700; }
.account-sub { color: var(--ink-3); font-size: var(--t-base); }
.account-meta {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  color: var(--ink-3); font-size: var(--t-base); margin-top: 5px;
}
.dot { width: 7px; height: 7px; border-radius: var(--r-pill); flex: none; }
.dot-ok { background: var(--ok); }
.dot-bad { background: var(--danger); }
.account-btns { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }
.account-warning {
  max-width: 68ch; margin: var(--sp-2) 0 0; color: var(--danger);
  font-size: var(--t-sm); line-height: 1.45;
}
.retention-control { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-3); font-size: var(--t-xs); }
.retention-control select { min-height: 34px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 5px 28px 5px 11px; background: var(--panel); color: var(--ink); font: inherit; }
.provider-connect { padding: var(--sp-5); margin: var(--sp-2) 0 var(--sp-5); border-radius: var(--r-lg); background: var(--raise); }
.provider-connect h2 { margin: 0; font-family: var(--serif); font-size: var(--t-subject); }
.provider-connect p { margin: 4px 0; color: var(--ink-2); }
.provider-buttons { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }
.device-install {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  margin-top: var(--sp-5); padding: var(--sp-4); border-radius: var(--r-md);
  background: var(--raise);
}
.device-install strong { font-size: var(--t-md); }
.device-install p { margin: 3px 0 0; color: var(--ink-3); font-size: var(--t-sm); max-width: 60ch; }
.offline-note {
  padding: 7px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--ink); color: var(--bg); box-shadow: var(--shadow-1);
  font-size: var(--t-sm); font-weight: 620; white-space: nowrap;
}

.form { margin: var(--sp-6) 0 var(--sp-8); padding-top: var(--sp-5); border-top: 1px solid var(--line); }
.form h3 { margin: 0 0 var(--sp-4); font-family: var(--serif); font-size: var(--t-subject); font-weight: 680; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--sp-3); }
.field { display: flex; flex-direction: column; gap: 5px; font-size: var(--t-sm); font-weight: 650; color: var(--ink-2); }
.field input, .field select {
  min-height: 42px; border: 1.5px solid var(--line-strong); border-radius: 9px; padding: 9px 11px;
  font-size: var(--t-md); font-weight: 480; background: var(--panel); color: var(--ink);
}
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; }
.form-note { color: var(--ink-3); font-size: var(--t-sm); margin-top: var(--sp-3); max-width: 60ch; }
.form-btns { display: flex; align-items: center; gap: var(--sp-3); margin-top: var(--sp-4); }

/* ============================================================ thread, as a page */

.thread { padding-bottom: 120px; }

.back {
  display: inline-flex; align-items: center; gap: 6px;
  margin: var(--sp-5) 0 var(--sp-4);
  font-size: var(--t-base); font-weight: 620; color: var(--ink-3);
}
.back:hover { color: var(--ink); }

.thread-title {
  margin: 0; font-family: var(--serif);
  font-size: var(--t-hero); font-weight: 700; letter-spacing: -0.025em; line-height: 1.12;
}
.thread-meta { margin-top: var(--sp-2); font-size: var(--t-base); color: var(--ink-3); }

.thread-msg { padding: var(--sp-6) 0 var(--sp-4); border-top: 1px solid var(--line); }
.thread-msg:first-of-type { border-top: none; padding-top: var(--sp-5); }
.thread-msg-head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.thread-msg-names { display: flex; flex-direction: column; min-width: 0; }
.thread-msg-from { font-size: var(--t-md); font-weight: 700; }
.thread-msg-to { font-size: var(--t-sm); color: var(--ink-3); }
.thread-msg-date { margin-left: auto; font-size: var(--t-sm); color: var(--ink-3); flex: none; }
.message-export { color: var(--ink-3); flex: none; }
.message-export:hover:not(:disabled) { color: var(--ink); background: var(--hover); }
.thread-msg-body { font-size: var(--t-lg); line-height: 1.68; max-width: 68ch; }

/* The verbs ride with you down the page. */
.thread-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 18;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-top: 1px solid var(--line);
}
.thread-bar-in { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: var(--sp-3) 0; }
.thread-bar-in .spacer { flex: 1; }

.msg-text { white-space: pre-wrap; }
.quote {
  color: var(--ink-3); font-size: var(--t-md);
  border-left: 2.5px solid var(--line-strong);
  padding: 2px 0 2px var(--sp-3); margin: var(--sp-2) 0; white-space: pre-wrap;
}
.quote-toggle {
  font-size: var(--t-sm); font-weight: 660; color: var(--ink-3);
  border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  padding: 3px 12px; margin: 6px 0;
}
.quote-toggle:hover { color: var(--ink); border-color: var(--ink-3); }
.mail-frame { width: 100%; border: none; background: transparent; border-radius: var(--r-md); }

.attach-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }
.attach-chip {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  border: 1.5px solid var(--line-strong); border-radius: 9px;
  padding: 6px var(--sp-3); font-size: var(--t-base); font-weight: 620; color: var(--ink-2);
  transition: border-color 0.1s ease, color 0.1s ease, background 0.1s ease;
}
.attach-chip:hover { border-color: var(--ink-3); color: var(--ink); background: var(--hover); }
.attach-size { color: var(--ink-3); font-weight: 520; font-size: var(--t-sm); }

.img-notice {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  background: var(--raise); border-radius: var(--r-md);
  padding: 7px var(--sp-3); margin: 0 0 var(--sp-3);
  font-size: var(--t-base); color: var(--ink-2);
}
.img-notice svg { color: var(--ink-3); flex: none; }

/* ============================================================ empty states */

.empty { padding: var(--sp-8) 0; }
.empty-big { font-family: var(--serif); font-size: 27px; font-weight: 700; letter-spacing: -0.022em; }
.empty-sub { color: var(--ink-3); margin-top: var(--sp-2); font-size: var(--t-md); max-width: 46ch; }

/* ============================================================ overlays */

.veil {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 11vh var(--sp-5) var(--sp-5);
  background: var(--veil); backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: fadein 0.12s ease;
}
.veil-mid { align-items: center; padding-top: var(--sp-5); }

.panel {
  display: flex; flex-direction: column; width: 100%; max-width: 620px;
  max-height: 82vh; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-3);
  animation: rise 0.16s var(--ease);
}
.panel-narrow { max-width: 420px; }

/* Compose is a workspace, not a prompt: wide panel, tall body. */
.compose-panel { width: min(880px, 94vw); max-width: min(880px, 94vw); }
.compose-head-row { display: flex; align-items: center; gap: var(--sp-2); }
.compose-from {
  flex: 1; min-width: 0; font-size: var(--t-sm); color: var(--ink-2);
  background: transparent; border: 1px dashed var(--line); border-radius: var(--r-sm);
  padding: var(--sp-1) var(--sp-2);
}
.compose-from:focus { outline: none; border-color: var(--accent); border-style: solid; }
.compose-tool-i { font-style: italic; }
.compose-files { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-1) 0 0; }
.compose-file {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-2) var(--sp-1) var(--sp-3);
  border: 1px solid var(--line); border-radius: 999px;
  font-size: var(--t-xs); max-width: 100%;
}
.compose-file-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-1); }
.compose-file-size { color: var(--ink-3); white-space: nowrap; }
.compose-file .btn-icon { min-width: 20px; min-height: 20px; font-size: 13px; color: var(--ink-3); }
.compose-files-total { font-size: var(--t-xs); color: var(--ink-3); }

.palette-input-row {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--line); flex: none;
}
.palette-input-row svg { color: var(--ink-3); flex: none; }
.palette-input { flex: 1; min-width: 0; border: none; background: transparent; font: inherit; font-size: var(--t-lg); color: var(--ink); outline: none; }
.palette-input::placeholder { color: var(--ink-3); }
.palette-body { overflow-y: auto; padding: 6px 0 var(--sp-3); }
.palette-section {
  padding: var(--sp-3) var(--sp-4) var(--sp-1);
  font-size: 10.5px; font-weight: 760; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--ink-3);
}
.palette-row { display: flex; align-items: center; gap: var(--sp-3); padding: 9px var(--sp-4); cursor: pointer; }
.palette-row.cursor { background: var(--sel); box-shadow: inset 2.5px 0 0 var(--accent); }
.palette-row-main { flex: 1; min-width: 0; }
.palette-row-label { display: block; font-size: var(--t-md); font-weight: 620; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-row-sub { display: block; font-size: var(--t-sm); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-row-note { font-size: var(--t-sm); color: var(--ink-3); flex: none; }
.palette-empty { padding: var(--sp-6) var(--sp-4); color: var(--ink-3); text-align: center; }

.compose-form { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-5) var(--sp-6) var(--sp-4); overflow-y: auto; }
.compose-ring {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-3); color: var(--ink-3); font-size: var(--t-xs);
  border-bottom: 1px solid var(--line);
}
.compose-ring-count { letter-spacing: 0.06em; display: inline-flex; align-items: center; gap: 4px; }
.compose-ring .btn-icon { min-width: 30px; min-height: 30px; font-size: 18px; line-height: 1; color: var(--ink-2); }
.compose-kicker { font-size: var(--t-sm); font-weight: 720; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.compose-form input, .compose-form textarea {
  width: 100%; border: none; background: transparent; color: var(--ink); padding: var(--sp-1) 0; outline: none;
}
.compose-form input::placeholder, .compose-form textarea::placeholder { color: var(--ink-3); }
.compose-to { font-size: var(--t-md); border-bottom: 1px solid var(--line) !important; padding-bottom: var(--sp-2) !important; }
.compose-subject { font-family: var(--serif); font-size: 22px; font-weight: 680; letter-spacing: -0.018em; }
.compose-body { flex: 1; min-height: 320px; resize: none; line-height: 1.62; font-size: var(--t-lg); }
.compose-body.html-source { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: var(--t-sm); line-height: 1.5; }
.compose-modes { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) 0 0; }
.compose-modes-note { font-size: var(--t-xs); color: var(--ink-3); }
.compose-preview {
  flex: 1; min-height: 220px; width: 100%; border: 1px solid var(--line);
  border-radius: var(--r-md, 8px); background: #ffffff; color: #101010;
}
.compose-btns {
  display: flex; align-items: center; gap: var(--sp-3); justify-content: flex-end;
  padding: var(--sp-3) var(--sp-6); border-top: 1px solid var(--line); background: var(--bg);
}
.compose-btns .hint { margin-right: auto; font-size: var(--t-sm); color: var(--ink-3); }

.shortcuts-body { padding: var(--sp-5) var(--sp-6) var(--sp-6); overflow-y: auto; }
.shortcuts-title { margin: 0 0 var(--sp-4); font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: -0.018em; }
.shortcut-grid { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-3) var(--sp-4); align-items: center; }
.shortcut-desc { color: var(--ink-2); font-size: var(--t-base); }

.menu {
  position: absolute; z-index: 30; min-width: 190px; padding: var(--sp-1);
  background: var(--panel); border: 1px solid var(--line-strong);
  border-radius: var(--r-md); box-shadow: var(--shadow-3);
  animation: rise 0.12s var(--ease);
}
.menu-item {
  display: flex; align-items: center; gap: var(--sp-2); width: 100%;
  min-height: 38px; padding: 7px var(--sp-3); border-radius: var(--r-sm);
  font-size: var(--t-base); font-weight: 570; color: var(--ink-2); text-align: left;
}
.menu-item:hover { background: var(--hover); color: var(--ink); }
.menu-item .note { margin-left: auto; font-size: var(--t-sm); color: var(--ink-3); }

/* ---- gate ---- */

.gate-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: var(--sp-6); }
.gate {
  width: 100%; max-width: 390px; text-align: center; padding: 36px;
  border: 1px solid var(--line); border-radius: 24px; background: var(--panel);
  box-shadow: var(--shadow-3); animation: rise 0.2s var(--ease);
}
.gate-wide { max-width: 620px; }
.gate-fan { position: relative; width: 92px; height: 58px; margin: 0 auto var(--sp-3); }
.gate-fan-card {
  position: absolute; top: 7px; width: 42px; height: 42px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 11px; color: var(--ink-2);
  background: var(--panel); box-shadow: var(--shadow-2);
}
.gate-fan-card svg { width: 22px; height: 22px; }
.gate-fan-mail { left: 3px; transform: rotate(-13deg); animation: gate-float-left 5s ease-in-out infinite; }
.gate-fan-calendar { left: 25px; top: 0; z-index: 2; color: var(--accent); animation: gate-float-center 5s .35s ease-in-out infinite; }
.gate-fan-board { right: 3px; transform: rotate(13deg); animation: gate-float-right 5s .7s ease-in-out infinite; }
@keyframes gate-float-left { 50% { transform: translateY(-3px) rotate(-11deg); } }
@keyframes gate-float-center { 50% { transform: translateY(-4px); } }
@keyframes gate-float-right { 50% { transform: translateY(-3px) rotate(11deg); } }
.gate-brand { font-family: var(--serif); font-size: 28px; font-weight: 700; letter-spacing: -0.022em; }
.gate-brand::after { content: "."; color: var(--accent); }
.gate h1 { margin: var(--sp-3) 0 0; font-family: var(--serif); font-size: 22px; letter-spacing: -0.015em; }
.gate-sub { color: var(--ink-2); font-size: var(--t-md); margin: 7px auto var(--sp-5); max-width: 330px; }
.gate form { display: flex; flex-direction: column; gap: var(--sp-3); }
.gate input {
  width: 100%; border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  padding: 11px var(--sp-4); font-size: var(--t-md); text-align: center;
  background: var(--panel); color: var(--ink); outline: none;
}
.gate input:focus { border-color: var(--accent); }
.gate .btn { width: 100%; justify-content: center; margin-top: var(--sp-3); }
.gate form .btn { margin-top: 0; }
.gate-primary { min-height: 44px; }
.gate-link { margin-top: var(--sp-4); color: var(--ink-2); font-size: var(--t-sm); text-decoration: underline; text-underline-offset: 3px; }
.gate-link:disabled { opacity: 0.45; cursor: not-allowed; }
.gate-error { margin-top: var(--sp-3); padding: 9px 12px; border-radius: var(--r-md); color: var(--danger); background: var(--danger-soft); font-size: var(--t-sm); }
.gate-origin { margin: 0 0 var(--sp-3); padding: 10px 12px; border-radius: var(--r-md); color: var(--ink-2); background: var(--raise); font-size: var(--t-xs); line-height: 1.55; }
.gate-origin b { color: var(--ink); word-break: break-all; }
.gate-hint { margin: var(--sp-2) 0 0; color: var(--ink-3); font-size: var(--t-xs); }
.gate-hint code { padding: 1px 5px; border-radius: 5px; background: var(--raise); color: var(--ink-2); }
.gate-trust { margin: var(--sp-5) 0 0; color: var(--ink-3); font-size: var(--t-xs); }
.gate-switch { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--sp-4); margin-top: var(--sp-4); }
.gate-switch button { color: var(--ink-2); font-size: var(--t-xs); text-decoration: underline; text-underline-offset: 3px; }
.gate-progress { display: flex; align-items: center; gap: var(--sp-3); margin: var(--sp-4) 0 var(--sp-1); color: var(--ink-3); font-size: var(--t-xs); }
.gate-progress span { flex: none; }
.gate-progress i { flex: 1; height: 2px; overflow: hidden; border-radius: 99px; background: var(--line); }
.gate-progress b { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .2s var(--ease); }
.gate-step { animation: rise 0.18s var(--ease); }
.gate-nav { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.gate-nav .btn { flex: 1; width: auto; margin-top: 0; }
.gate-code-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.gate-code-actions .btn { flex: 1; width: auto; margin-top: 0; }
.recovery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin: var(--sp-4) 0; }
.recovery-grid code { padding: 7px 9px; border-radius: 7px; background: var(--raise); color: var(--ink); font-size: var(--t-sm); }

/* Post-recovery sign-in: one quiet line, not a modal. */
.nudge {
  display: flex; align-items: center; justify-content: center; gap: var(--sp-4);
  padding: 8px var(--edge); border-bottom: 1px solid var(--line);
  color: var(--ink-2); background: var(--raise); font-size: var(--t-sm);
}
.nudge a { color: var(--ink); font-weight: 640; text-underline-offset: 3px; }
.nudge button { color: var(--ink-3); font-size: var(--t-xs); text-decoration: underline; text-underline-offset: 3px; }
.nudge button:hover { color: var(--ink); }
/* Public-origin warning: same quiet line, warmer ground. Warn only. The
   translucent amber reads on light and dark grounds alike. */
.nudge-warn { color: var(--ink); background: rgba(191, 138, 22, 0.16); }

/* ---- settings: compact, explicit, and usable on touch ---- */
.settings-tabs { display: flex; gap: var(--sp-5); border-bottom: 1px solid var(--line); margin: calc(var(--sp-3) * -1) 0 var(--sp-6); }
.settings-tabs a { display: inline-flex; align-items: center; min-height: 42px; padding: var(--sp-3) 1px; color: var(--ink-3); font-weight: 650; font-size: var(--t-base); }
.settings-tabs a.active { color: var(--ink); box-shadow: inset 0 -2px var(--accent); }
.settings-section { padding: var(--sp-5) 0; border-bottom: 1px solid var(--line); }
.settings-section:last-child { border-bottom: 0; }
.settings-section h2 { margin: 0; font-family: var(--serif); font-size: var(--t-subject); letter-spacing: -0.01em; }
.settings-section p { margin: 5px 0 0; color: var(--ink-2); max-width: 620px; }
.settings-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-5); margin-bottom: var(--sp-3); }
/* Whatever sits opposite the description keeps its width — a button or a
   control. Without this a select is squeezed by a long paragraph beside it. */
.settings-section-head .btn,
.settings-section-head .retention-control { flex: none; }
/* A section whose head is all there is has nothing to separate from, so the
   head's bottom margin would only pad the section unevenly. */
.settings-section-head:only-child { margin-bottom: 0; }
.security-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); min-height: 58px; border-top: 1px solid var(--line); }
.security-row > div { min-width: 0; display: flex; flex-direction: column; }
.security-row strong { font-size: var(--t-base); }
.security-row span { color: var(--ink-3); font-size: var(--t-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recovery-sheet, .totp-setup { padding: var(--sp-4); background: var(--raise); border-radius: var(--r-lg); }
.recovery-sheet .recovery-grid code { background: var(--panel); }
.totp-setup > code { display: block; padding: 9px 12px; margin: var(--sp-3) 0; background: var(--panel); border-radius: var(--r-sm); overflow-wrap: anywhere; letter-spacing: 0.08em; }
.inline-form { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-4); }
.inline-form input { min-width: 0; flex: 1; border: 1.5px solid var(--line-strong); border-radius: var(--r-md); padding: 9px 12px; background: var(--panel); color: var(--ink); font: inherit; }
.danger-zone { margin-top: var(--sp-5); padding: var(--sp-5); border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line)); border-radius: var(--r-lg); background: var(--danger-soft); }
.danger-zone h2 { color: var(--danger); }
.settings-callout { padding: 9px 12px; border-radius: var(--r-md); background: var(--raise); color: var(--ink-2) !important; font-size: var(--t-sm); }

@media (max-width: 560px) {
  .gate-wrap { padding: var(--sp-3); align-items: flex-start; }
  .gate { margin-top: 7vh; padding: 28px 20px; border-radius: 20px; }
  .settings-section-head { flex-direction: column; }
  .settings-section-head .btn,
  .settings-section-head .retention-control { align-self: flex-start; }
  .security-row { align-items: flex-start; padding: var(--sp-3) 0; }
  .inline-form { align-items: stretch; flex-direction: column; }
  .recovery-grid { grid-template-columns: 1fr; }
  .people-row { align-items: flex-start; flex-wrap: wrap; padding: var(--sp-4) 0; }
  .people-main { width: calc(100% - 42px); }
  .people-acts { width: 100%; margin: 0; padding-left: 38px; flex-wrap: wrap; gap: 4px; }
}

/* ---- toast ---- */

.toast {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 9px 10px 9px var(--sp-5); border-radius: var(--r-pill);
  background: var(--ink); color: var(--bg);
  font-size: var(--t-base); font-weight: 580;
  box-shadow: 0 12px 32px rgba(8, 9, 12, 0.4);
  animation: rise 0.16s var(--ease);
  max-width: min(560px, calc(100vw - 32px));
}
.notice-stack {
  position: fixed; z-index: 70; left: 50%; bottom: max(var(--sp-5), env(safe-area-inset-bottom));
  transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  width: min(620px, calc(100vw - 24px)); pointer-events: none;
}
.notice-stack > * { pointer-events: auto; }
.toast.error { background: var(--danger); color: #fff; }
.toast-msg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast .btn { background: var(--bg); color: var(--ink); padding: 5px 13px; font-size: var(--t-sm); flex: none; }
.toast.error .btn { background: #fff; color: var(--danger); }

/* ============================================================ teaching the app

   Everything here exists because the vocabulary is invented and the
   interactions are invisible. It is deliberately temporary: the hint bar
   retires itself, the welcome disappears once a mailbox exists. */

.nav-rule {
  width: 1px; height: 16px; margin: 0 var(--sp-2);
  background: var(--line-strong); flex: none;
}
/* A plain numeral, not a badge — "where did my mail go" deserves an answer,
   but only the Screener is a to-do. */
.nav-n { font-size: var(--t-xs); font-weight: 700; color: var(--ink-3); }
.nav-item.active .nav-n { color: var(--ink-2); }

.explainer {
  margin: var(--sp-2) 0 var(--sp-4);
  color: var(--ink-3); font-size: var(--t-base); line-height: 1.55; max-width: 62ch;
}

.hints {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 12;
  display: flex; justify-content: center; pointer-events: none;
  padding: 0 var(--sp-4) var(--sp-3);
}
.hints-in {
  display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap;
  pointer-events: auto;
  padding: 6px 6px 6px var(--sp-4);
  border-radius: var(--r-pill);
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-1);
  font-size: var(--t-sm); color: var(--ink-3);
}
.hint { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.hint-link {
  font-size: var(--t-sm); font-weight: 640; color: var(--ink-2);
  text-decoration: underline; text-underline-offset: 2px; white-space: nowrap;
}
.hint-link:hover { color: var(--ink); }
.hint-close { padding: 4px; }

.welcome { padding: var(--sp-8) 0; max-width: 60ch; }
.welcome-lede { margin: var(--sp-4) 0 var(--sp-5); color: var(--ink-2); font-size: var(--t-lg); line-height: 1.6; }
.welcome-cta { padding: 10px 22px; font-size: var(--t-md); }
.welcome-how { margin-top: var(--sp-8); display: flex; flex-direction: column; gap: var(--sp-5); }
.welcome-step { display: flex; gap: var(--sp-4); align-items: flex-start; }
.welcome-num {
  flex: none; width: 26px; height: 26px; border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: center;
  background: var(--raise); color: var(--ink-2);
  font-size: var(--t-sm); font-weight: 740;
}
.welcome-step strong { font-size: var(--t-md); font-weight: 700; }
.welcome-step p { margin: 5px 0 0; color: var(--ink-3); font-size: var(--t-base); line-height: 1.6; }

.menu-right { top: 100%; right: 0; margin-top: 6px; min-width: 236px; }
.menu-left { top: 100%; left: 0; margin-top: 6px; min-width: 236px; max-width: 300px; }
.menu-rule { height: 1px; background: var(--line); margin: var(--sp-1) 0; }
.menu-item svg { flex: none; color: var(--ink-3); }
.menu-item .lens-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item.lens-on { color: var(--ink); font-weight: 700; box-shadow: inset 2px 0 0 var(--accent); }

/* The mailbox lens: quiet, because "All" is the normal state. */
.acct-toggle {
  display: inline-flex; align-items: center; gap: 4px; margin-left: var(--sp-3);
  padding: 5px 9px; border: 1px solid transparent; border-radius: var(--r-pill);
  color: var(--ink-3); font-size: var(--t-sm); font-weight: 620;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.acct-toggle svg { flex: none; }
.acct-toggle:hover { color: var(--ink); border-color: var(--line-strong); }

/* ============================================================ classic shell

   The optional three-column layout. Same components, same state — only the
   frame differs, so nothing is reimplemented for it. */

.page.classic {
  display: grid;
  grid-template-rows: 54px auto minmax(0, 1fr);
  /* The rail is deliberately narrow; the list pane defaults wide, then takes
     whatever the dragged splitter last chose (--list-w, persisted). */
  grid-template-columns: 196px minmax(320px, var(--list-w, 42vw)) 7px minmax(0, 1fr);
  height: 100vh;
  overflow: hidden;
}
/* The loading shell, before the island has mounted and can render the real
   three-column frame. data-layout is set pre-paint, so the prerendered
   skeleton can already hold the classic geometry — an empty rail and a
   bounded list column — instead of painting one full-width column that
   snaps into three the moment JavaScript arrives. Gated on the same 1080px
   the layout itself uses, so a narrow window is untouched. */
@media (min-width: 1080px) {
  :root[data-layout="classic"] .page:not(.classic) {
    display: grid;
    grid-template-rows: 54px auto minmax(0, 1fr);
    grid-template-columns: 196px minmax(320px, var(--list-w, 42vw)) 7px minmax(0, 1fr);
    height: 100vh;
    overflow: hidden;
  }
  :root[data-layout="classic"] .page:not(.classic) > .topline { grid-column: 1 / -1; grid-row: 1; position: static; }
  :root[data-layout="classic"] .page:not(.classic) > .column {
    grid-row: 3; grid-column: 2; min-width: 0;
    overflow-y: auto; border-right: 1px solid var(--line);
  }
}

.page.classic .topline { grid-column: 1 / -1; grid-row: 1; position: static; }
.page.classic .nudges { grid-column: 1 / -1; grid-row: 2; display: flex; flex-direction: column; }
/* Nav lives in the sidebar here, so the flanks stop competing for the centre. */
.page.classic .topline-side { flex: none; }
.page.classic .topline-side.left { flex: 1; }

.page.classic .sidebar { grid-row: 3; grid-column: 1; }
.page.classic .list-pane {
  grid-row: 3; grid-column: 2; min-width: 0;
  overflow-y: auto; border-right: 1px solid var(--line);
}
.pane-split {
  grid-row: 3; grid-column: 3;
  cursor: col-resize; touch-action: none;
  position: relative;
}
.pane-split::after {
  content: ""; position: absolute; inset: 0 auto 0 3px; width: 1px;
  background: var(--line);
}
.pane-split:hover::after, .pane-split:active::after {
  width: 2px; inset: 0 auto 0 2.5px; background: var(--accent);
}
.pane-split:focus-visible::after { width: 3px; inset: 0 auto 0 2px; background: var(--accent); }
.page.classic .reader-pane {
  grid-row: 3; grid-column: 4; min-width: 0;
  display: flex; flex-direction: column;
  overflow: hidden; background: var(--panel);
}
/* Panes supply their own gutters; the centred measure is a document-mode idea. */
.page.classic .column { max-width: none; padding: 0 var(--sp-5); }
.page.classic .page-head { padding-top: var(--sp-5); }
.page.classic .bulkbar { top: 0; }
.page.classic .thread {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  padding-bottom: var(--sp-5); display: flex; flex-direction: column;
}
.page.classic .thread-close { position: sticky; top: var(--sp-2); align-self: flex-end; z-index: 3; }
.page.classic .thread-title { font-size: 26px; }
.page.classic .thread-bar {
  position: static; flex: none;
  background: var(--panel);
}
.page.classic .thread-msg-body { max-width: none; }
.page.classic .board { grid-template-columns: 1fr; }
.page.classic .cal-year { grid-template-columns: repeat(2, 1fr); }

.sidebar {
  overflow-y: auto;
  padding: var(--sp-4) var(--sp-3);
  background: var(--panel);
  border-right: 1px solid var(--line);
}
.sidebar nav { display: flex; flex-direction: column; gap: 1px; height: 100%; }
.side-spacer { margin-top: auto; }
.side-label {
  padding: var(--sp-5) var(--sp-3) var(--sp-1);
  font-size: 11px; font-weight: 760; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-3);
}
.side-item {
  display: flex; align-items: center; gap: var(--sp-2);
  width: 100%; min-height: 40px; padding: 7px var(--sp-3);
  border-radius: var(--r-sm); border: 0; background: none; cursor: pointer;
  font-size: var(--t-md); font-weight: 560; color: var(--ink-2); text-align: left;
  transition: background 0.1s ease, color 0.1s ease;
}
.side-item:hover { background: var(--hover); color: var(--ink); }
.side-item.active {
  background: var(--raise); color: var(--ink); font-weight: 700;
  box-shadow: inset 2px 0 0 var(--accent);
}
.side-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-count { font-size: var(--t-xs); font-weight: 720; color: var(--ink-3); flex: none; }
.side-count.urgent {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-ink);
}

/* ============================================================ appearance

   Users make it theirs: accent palettes ride on top of any base theme via
   [data-accent] on the root; the type flavor swaps the editorial serif
   subjects for the interface sans via [data-type]. Everything downstream
   already reads tokens, so these few lines re-skin the whole product. */

[data-accent="ocean"]   { --accent: #2f6fed; --accent-ink: #ffffff; }
[data-accent="forest"]  { --accent: #2e7d4f; --accent-ink: #ffffff; }
[data-accent="violet"]  { --accent: #7a4fd8; --accent-ink: #ffffff; }
[data-accent="rose"]    { --accent: #d84a7a; --accent-ink: #ffffff; }
[data-accent="teal"]    { --accent: #12909a; --accent-ink: #ffffff; }
[data-accent="graphite"]{ --accent: #4a5568; --accent-ink: #ffffff; }
/* Dark-accent variants apply to every dark-grounded theme. */
:is([data-theme="dark"], [data-theme="terminal"], [data-theme="amber"], [data-theme="nord"], [data-theme="dracula"], [data-theme="rose"], [data-theme="blueprint"])[data-accent="ocean"]    { --accent: #6b9aff; --accent-ink: #101528; }
:is([data-theme="dark"], [data-theme="terminal"], [data-theme="amber"], [data-theme="nord"], [data-theme="dracula"], [data-theme="rose"], [data-theme="blueprint"])[data-accent="forest"]   { --accent: #57b87e; --accent-ink: #0e1a12; }
:is([data-theme="dark"], [data-theme="terminal"], [data-theme="amber"], [data-theme="nord"], [data-theme="dracula"], [data-theme="rose"], [data-theme="blueprint"])[data-accent="violet"]   { --accent: #a98bff; --accent-ink: #171029; }
:is([data-theme="dark"], [data-theme="terminal"], [data-theme="amber"], [data-theme="nord"], [data-theme="dracula"], [data-theme="rose"], [data-theme="blueprint"])[data-accent="rose"]     { --accent: #ff7aa5; --accent-ink: #29101c; }
:is([data-theme="dark"], [data-theme="terminal"], [data-theme="amber"], [data-theme="nord"], [data-theme="dracula"], [data-theme="rose"], [data-theme="blueprint"])[data-accent="teal"]     { --accent: #4fc7cf; --accent-ink: #0c1e20; }
:is([data-theme="dark"], [data-theme="terminal"], [data-theme="amber"], [data-theme="nord"], [data-theme="dracula"], [data-theme="rose"], [data-theme="blueprint"])[data-accent="graphite"] { --accent: #9aa7ba; --accent-ink: #141a24; }
[data-type="sans"] { --serif: var(--sans); }

/* ---- the four living dimensions: text size, density, measure ---- */

[data-textsize="s"]  { --ts: 0.92; }
[data-textsize="l"]  { --ts: 1.1; }
[data-textsize="xl"] { --ts: 1.24; }

/* Compact trades preview lines for rows; roomy breathes between them. */
[data-density="compact"] .msg-row,
[data-density="compact"] .digest,
[data-density="compact"] .screener { padding-top: 7px; padding-bottom: 7px; }
[data-density="compact"] .row-preview,
[data-density="compact"] .digest-preview { display: none; }
[data-density="roomy"] .msg-row,
[data-density="roomy"] .digest,
[data-density="roomy"] .screener { padding-top: 17px; padding-bottom: 17px; }

/* The reading column: how wide a document the mail gets to be. */
[data-measure="narrow"] { --page: 660px; --workspace: 980px; }
[data-measure="wide"] { --page: 1060px; --workspace: 1420px; }

/* Custom accent: any brand color, set as inline variables on the root by
   the store — the wheel dot is the invitation. */
.accent-dot.custom {
  background: conic-gradient(#e74c3c, #e67e22, #f1c40f, #2ecc71, #1abc9c, #3498db, #9b59b6, #e74c3c);
  position: relative;
}
.accent-dot.custom input[type="color"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; border: none; padding: 0;
}

.theme-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-3); }
.theme-card {
  padding: 0; border: 1.5px solid var(--line-strong); border-radius: var(--r-lg);
  overflow: hidden; background: none; cursor: pointer; font: inherit; text-align: left;
  transition: border-color 0.1s ease, box-shadow 0.1s ease;
}
.theme-card:hover { border-color: var(--ink-3); }
.theme-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme-card-surface { padding: 12px 14px; display: grid; gap: 7px; }
.theme-card-name { padding: 9px 14px; font-size: var(--t-md); font-weight: 660; border-top: 1px solid var(--line); }
.theme-chip { height: 10px; border-radius: var(--r-pill); }
.accent-dots { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.accent-dot {
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid transparent;
  cursor: pointer; padding: 0; position: relative;
}
.accent-dot.active { border-color: var(--ink); }
.accent-dot.active::after {
  content: ""; position: absolute; inset: -6px; border: 1.5px solid var(--line-strong); border-radius: 50%;
}
.type-row { display: flex; gap: var(--sp-2); }
.type-card {
  flex: 1; padding: var(--sp-4) var(--sp-3); border: 1.5px solid var(--line-strong);
  border-radius: var(--r-lg); background: none; cursor: pointer; font: inherit; text-align: center;
}
.type-card.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.type-card-sample { font-size: 22px; line-height: 1.2; }
.type-card-note { display: block; margin-top: 4px; color: var(--ink-3); font-size: var(--t-xs); }
.measure-bar { display: block; height: 4px; border-radius: var(--r-pill); background: var(--accent); margin: 6px auto 10px; }

.reader-empty {
  height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  padding: var(--sp-6); text-align: center; color: var(--ink-3);
}
.reader-empty-mark { font-family: var(--serif); font-size: 44px; line-height: 1; opacity: 0.3; }
.reader-empty-big {
  font-family: var(--serif); font-size: var(--t-subject);
  font-weight: 650; letter-spacing: -0.018em; color: var(--ink-2);
}
.reader-empty-sub { font-size: var(--t-base); }

/* ============================================================ responsive */

@media (max-width: 720px) {
  :root { --edge: 18px; --t-hero: calc(27px * var(--ts, 1)); --t-subject: calc(18px * var(--ts, 1)); }
  .topline-in { height: 50px; gap: var(--sp-2); padding: 0 var(--edge); }
  /* Below this width there is no room to centre anything: the nav takes what is
     left and scrolls. */
  .topline-side { flex: none; }
  .topline-side.left { display: flex; flex: 0 1 auto; }
  .topline-side.left .wordmark { display: none; }
  .topline-side.left .acct-toggle { margin-left: 0; max-width: 88px; }
  .nav {
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 24px), transparent);
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { min-height: 38px; padding-inline: var(--sp-2); }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 38px; }
  .btn-icon { width: 40px; height: 40px; }
  .page-head { padding: var(--sp-6) 0 var(--sp-4); }
  .column { padding-bottom: 80px; }
  .screener-btns { padding-left: 0; }
  .topline-acts .label { display: none; }
  .thread-msg-head { flex-wrap: wrap; gap: var(--sp-2); }
  .thread-msg-names { flex: 1; }
  .device-install { align-items: flex-start; flex-direction: column; }
  .offline-note { max-width: calc(100vw - 24px); white-space: normal; text-align: center; }
  .thread { padding-bottom: 96px; }
  .thread-bar-in {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    padding: var(--sp-2) var(--edge);
  }
  .thread-bar-in::-webkit-scrollbar { display: none; }
  .thread-bar-in .spacer { display: none; }
  .thread-bar-in .btn { flex: none; }
  .thread-bar-in .kbd { display: none; }
  /* Shortcut coaching is useful with a keyboard and obstructive on a phone.
     The full list remains in the More menu on every screen size. */
  .hints { display: none; }
  .sticky-tools { opacity: 1; }

  .compose-veil {
    align-items: stretch; padding: var(--sp-3) var(--sp-3) max(var(--sp-3), env(safe-area-inset-bottom));
    height: 100dvh;
  }
  .compose-panel { max-height: 100%; }
  .compose-form { min-height: 0; padding: var(--sp-4); }
  .compose-btns {
    flex: none; padding: var(--sp-2) var(--sp-4) max(var(--sp-2), env(safe-area-inset-bottom));
  }
  .compose-btns .hint { display: none; }
}

@media (hover: none), (pointer: coarse) {
  :root { --rail: 36px; }
  .row-check {
    display: flex; left: 0; top: 12px; width: 28px; height: 28px;
  }
  .msg-row.unread::before { display: none; }
  .row-acts {
    position: static; display: flex; justify-content: flex-end; gap: var(--sp-2);
    margin-top: var(--sp-2); padding-left: 0; background: none;
  }
  .row-acts .btn-icon { border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); }
}

/* ============================================================ Board */

/* Three columns of one person's mail-derived state. Columns get equal room;
   cards stay borderless like the Today digest — the column rule is the only
   chrome. Cards are tighter than digest cards because a column is narrower. */
.board { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-7); align-items: start; }
.board-col { min-width: 0; }
.board-col-head {
  display: flex; align-items: baseline; gap: var(--sp-2);
  padding-bottom: var(--sp-2); border-bottom: 2px solid var(--ink);
}
.board-col-title { font-size: var(--t-md); font-weight: 700; letter-spacing: -0.01em; }
.board-col-count { font-size: var(--t-sm); color: var(--ink-3); font-weight: 660; }
.board-col-sub { font-size: var(--t-sm); color: var(--ink-3); margin-top: 4px; }
.board-col-empty {
  font-size: var(--t-base); color: var(--ink-3); padding: var(--sp-4) 0;
  border-top: 1px solid var(--line); margin-top: var(--sp-2);
}

.board-card {
  padding: var(--sp-4) var(--sp-2) var(--sp-4) var(--sp-3);
  margin: 0 calc(var(--sp-2) * -1);
  border-top: 1px solid var(--line);
  transition: background 0.1s ease;
}
.board-card:first-of-type { border-top: none; }
.board-card.cursor { background: var(--hover); box-shadow: inset 2px 0 0 var(--accent); }
.board-card-top { display: flex; align-items: baseline; gap: var(--sp-2); }
.board-card-who { font-size: var(--t-base); font-weight: 680; color: var(--ink-2); }
.board-card-date { margin-left: auto; font-size: var(--t-sm); color: var(--ink-3); flex: none; }
.board-card-subject {
  font-family: var(--serif); font-size: var(--t-lg); font-weight: 640;
  letter-spacing: -0.014em; line-height: 1.3; margin-top: 2px;
}
.board-card-preview {
  font-size: var(--t-base); color: var(--ink-3); margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.board-card-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--sp-2); }

.board-card.wait, .board-card.snoozed { cursor: pointer; color: var(--ink-2); }
.board-card.wait:hover, .board-card.snoozed:hover { background: var(--hover); color: var(--ink); }

.board-head-row { display: flex; justify-content: flex-end; margin-bottom: var(--sp-2); }

.board-note-composer { width: 100%; }
.board-note-input {
  width: 100%; border: 1.5px solid var(--line-strong); border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3); font: inherit; font-size: var(--t-md);
  background: var(--panel); color: var(--ink);
}
.board-note-input:focus { border-color: var(--accent); outline: none; }

.done-pile { margin-top: var(--sp-7); border-top: 1px solid var(--line); padding-top: var(--sp-3); }
.done-pile-head {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--t-base); font-weight: 660; color: var(--ink-3);
}
.done-pile-head:hover { color: var(--ink); }
.done-pile-note { font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.done-row {
  display: flex; align-items: baseline; gap: var(--sp-3);
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--rail);
  margin: 0 calc(var(--sp-2) * -1);
  border-top: 1px solid var(--line);
}
.done-what {
  font-family: var(--serif); font-size: var(--t-md); color: var(--ink-3);
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.done-acts { display: flex; gap: 6px; flex: none; }

/* The board needs three columns' worth of room; below that it stacks rather
   than squeezes, same deal as the Classic layout. */
@media (max-width: 1079px) {
  .board { grid-template-columns: 1fr; }
}
/* ============================================================ Notes (the wall) */

:root {
  --st0: #f4e5a3; --st1: #f6cdc3; --st2: #cfe1f0;
  --st3: #d6e8cd; --st4: #e2d8ef;
  --st-ink: #2a2519;
}
:is([data-theme="dark"], [data-theme="terminal"], [data-theme="amber"], [data-theme="nord"], [data-theme="dracula"], [data-theme="rose"], [data-theme="blueprint"]) {
  --st0: #5f5624; --st1: #6e453b; --st2: #37536b;
  --st3: #3f5e39; --st4: #4e4166;
  --st-ink: #f1ecdd;
}
:root[data-theme="sepia"] {
  --st0: #b3a15c; --st1: #b78371; --st2: #7f95a3;
  --st3: #8a9c72; --st4: #97844f;
  --st-ink: #2e2a20;
}

.notes-topline { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); }
.notes-topline .page-head { padding-bottom: 0; }
.notes-topline .btn { flex: none; margin-bottom: var(--sp-6); }

.canvas-frame { margin-top: var(--sp-4); }
.canvas-error, .canvas-hint { color: var(--ink-3); font-size: var(--t-md); }
.note-canvas {
  height: min(74vh, 920px);
  overflow: auto; position: relative;
  border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background-color: var(--panel);
  background-image: radial-gradient(var(--line-strong) 1px, transparent 1px);
  background-size: 26px 26px;
}
.note-wall { position: relative; width: 2400px; height: 1600px; }
.canvas-hint {
  position: absolute; left: 50%; top: 120px; transform: translateX(-50%);
  font-family: var(--serif); font-size: var(--t-xl); color: var(--ink-3);
}

.sticky {
  position: absolute; width: 210px; min-height: 132px;
  padding: 14px 14px 18px;
  border-radius: 3px;
  color: var(--st-ink);
  font-family: var(--serif); font-size: var(--t-md); line-height: 1.45;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12), 0 1px 3px rgba(0, 0, 0, 0.14);
  cursor: grab; touch-action: none;
}
.sticky:active { cursor: grabbing; }
.sticky-0 { background: var(--st0); }
.sticky-1 { background: var(--st1); }
.sticky-2 { background: var(--st2); }
.sticky-3 { background: var(--st3); }
.sticky-4 { background: var(--st4); }
.sticky-tools {
  position: absolute; top: 2px; right: 2px;
  display: flex; opacity: 0; transition: opacity 0.12s ease;
}
.sticky:hover .sticky-tools, .sticky:focus-within .sticky-tools { opacity: 1; }
.sticky-tool { color: rgba(0, 0, 0, 0.45); }
.sticky-tool:hover { background: rgba(0, 0, 0, 0.08); color: rgba(0, 0, 0, 0.7); }
.sticky-swatch {
  width: 12px; height: 12px; border-radius: 50%;
  background: currentColor; border: 1.5px solid rgba(0, 0, 0, 0.35);
  display: inline-block;
}
.sticky-text { white-space: pre-wrap; word-break: break-word; cursor: text; }
.sticky-empty { opacity: 0.55; }
.sticky-ta {
  width: 100%; min-height: 100px; border: none; outline: none; resize: none;
  background: transparent; color: inherit; font: inherit; line-height: inherit;
  padding: 0; display: block;
}

/* ============================================================ Calendar */

.cal-topline { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.cal-weekdays {
  display: grid; grid-template-columns: repeat(7, 1fr);
  margin-bottom: 4px;
}
.cal-weekdays span {
  font-size: var(--t-xs); font-weight: 740; letter-spacing: 0.14em;
  color: var(--ink-2); text-align: center; text-transform: uppercase;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-cell {
  min-height: 84px; padding: 8px;
  border-top: 1px solid var(--line); border-left: 1px solid var(--line);
  text-align: left; font: inherit; color: var(--ink);
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  transition: background 0.1s ease;
}
.cal-cell:nth-child(7n + 1) { border-left: none; }
.cal-cell.blank { pointer-events: none; }
/* Weekends get a wash: the month reads as weeks at a glance. */
.cal-cell:nth-child(7n), .cal-cell:nth-child(7n + 1) {
  background: color-mix(in srgb, var(--ink) 3.5%, transparent);
}
.cal-cell:hover { background: var(--hover); }
.cal-cell.today .cal-daynum {
  background: var(--accent); color: var(--accent-ink);
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; margin: -3px 0 0 -3px;
}
.cal-cell.sel { box-shadow: inset 0 0 0 2px var(--ink); border-radius: var(--r-sm); }
.cal-daynum { font-family: var(--serif); font-size: var(--t-lg); font-weight: 660; }
.cal-dots {
  font-size: var(--t-xs); font-weight: 740;
  background: var(--accent); color: var(--accent-ink);
  padding: 2px 9px; border-radius: 99px;
}

.cal-day { margin-top: var(--sp-6); }
.cal-day-head { padding-bottom: var(--sp-2); border-bottom: 3px solid var(--ink); }
.cal-day-title { font-family: var(--serif); font-size: var(--t-xl); font-weight: 700; }
.cal-day-now { color: var(--accent); }
.cal-day-empty { color: var(--ink-3); padding: var(--sp-3) 0; font-size: var(--t-md); }
.cal-return {
  display: flex; align-items: baseline; gap: var(--sp-3); width: 100%;
  padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--rail);
  margin: 0 calc(var(--sp-2) * -1);
  border-top: 1px solid var(--line);
  font: inherit; text-align: left; color: var(--ink-2);
}
.cal-return:hover { background: var(--hover); color: var(--ink); }
.cal-return-what {
  font-family: var(--serif); font-size: var(--t-lg); color: var(--ink);
  flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-return-who { flex: none; font-size: var(--t-sm); color: var(--ink-3); }

@media (max-width: 719px) {
  .cal-cell { min-height: 56px; padding: 5px; }
  .cal-daynum { font-size: var(--t-md); }
  .cal-dots { max-width: 100%; padding: 2px 5px; font-size: 9px; white-space: nowrap; overflow: hidden; }
  .note-wall { width: 1400px; height: 1100px; }
}
/* ---- calendar zoom ---- */

.cal-zoom {
  display: inline-flex; border: 2px solid var(--ink);
  border-radius: 99px; overflow: hidden;
}
.cal-zoom-btn {
  padding: 6px 18px; font: inherit; font-size: var(--t-md); font-weight: 720;
  color: var(--ink-2); border: none; background: transparent; cursor: pointer;
  transition: color 0.1s ease;
}
.cal-zoom-btn:hover { color: var(--ink); }
.cal-zoom-btn.active { background: var(--accent); color: var(--accent-ink); }
.cal-topline .btn-icon { width: 36px; height: 36px; justify-content: center; }
.cal-topline .btn-icon svg { transition: transform 0.12s ease; }
.cal-topline .btn-icon:hover svg { transform: scale(1.25); }

/* Year: twelve quiet mini-months, dots where mail returns. */
.cal-year {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-4) var(--sp-5);
}
.cal-mini-name {
  font-family: var(--serif); font-size: var(--t-md); font-weight: 680;
  color: var(--ink); margin-bottom: 6px; padding: 0;
  border: none; background: none; cursor: pointer; text-align: left;
}
.cal-mini-name:hover { color: var(--accent); }
.cal-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.cal-mini-day {
  position: relative; padding: 0; border: none; background: none; cursor: pointer;
  font: inherit; font-size: var(--t-xs); color: var(--ink-2);
  width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm);
}
.cal-mini-day:hover { background: var(--hover); color: var(--ink); }
.cal-mini-day.today {
  background: var(--accent); color: var(--accent-ink);
  border-radius: 50%; font-weight: 700;
}
.cal-mini-day.has::after {
  content: ""; position: absolute; bottom: 1px; left: 50%; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
}
.cal-year-note { margin-top: var(--sp-4); font-size: var(--t-md); color: var(--ink-3); }

/* Week: seven open columns, the items themselves inside. */
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-wday {
  min-height: 260px; padding: var(--sp-2);
  border-top: 3px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
}
.cal-wday:nth-child(1), .cal-wday:nth-child(7) {
  background: color-mix(in srgb, var(--ink) 3.5%, transparent);
}
.cal-wday.today { border-top: 4px solid var(--accent); }
.cal-wday-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.cal-wday-name {
  font-size: var(--t-xs); font-weight: 740; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-2);
}
.cal-wday-num {
  font-family: var(--serif); font-size: 30px; font-weight: 720; color: var(--ink);
  margin-left: auto; line-height: 1;
}
.cal-wday.today .cal-wday-num { color: var(--accent); }
.cal-wday-quiet { color: var(--ink-3); font-size: var(--t-md); }
.cal-witem {
  border: none; background: var(--panel); cursor: pointer; text-align: left; font: inherit;
  padding: 8px 10px; border-radius: var(--r-md); color: var(--ink-2);
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  box-shadow: 0 1px 0 var(--line-strong);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.cal-witem:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  color: var(--ink);
}
.cal-witem-when {
  font-size: var(--t-xs); font-weight: 740; color: var(--accent-ink);
  background: var(--accent); padding: 1px 7px; border-radius: 99px;
}
.cal-witem-what {
  font-family: var(--serif); font-size: var(--t-md); color: var(--ink); line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cal-witem-who { font-size: var(--t-xs); color: var(--ink-3); }

@media (max-width: 1079px) {
  .cal-year { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 719px) {
  .cal-year { grid-template-columns: repeat(2, 1fr); }
  .cal-week { grid-template-columns: 1fr; }
  .cal-wday { min-height: 0; }
  .cal-zoom-btn { padding: 4px 10px; }
  .cal-topline { flex-wrap: nowrap; gap: var(--sp-1); }
  .cal-topline .spacer { display: none; }
  .cal-topline > .btn.btn-ghost { margin-left: auto; }
  .cal-topline .btn-icon { width: 32px; height: 38px; }
}

/* ---- the bold pass: poster title, filled chips, month day-detail ---- */

/* The month name is the poster: bigger than anything else on the page,
   because the calendar is the one surface whose subject is time itself. */
.cal-surface .page-title {
  font-size: clamp(44px, 5.5vw, 68px);
  letter-spacing: -0.03em; line-height: 1.02;
}
.cal-surface .page-head { padding: var(--sp-5) 0 var(--sp-2); }
.cal-surface .page-sub { color: var(--ink-2); }

.cal-return:hover { background: var(--hover); color: var(--ink); }
.cal-return-when {
  flex: none; font-size: var(--t-xs); font-weight: 740;
  color: var(--accent-ink); background: var(--accent);
  padding: 2px 8px; border-radius: 99px;
}
/* The day surfaces' front door on Today — quiet text links, not nav items. */
.day-row {
  display: flex; gap: var(--sp-4); margin: 0 0 var(--sp-5);
}
.day-link {
  display: inline-flex; align-items: center; min-height: 34px;
  font-size: var(--t-md); font-weight: 620; color: var(--ink-3);
  text-decoration: none; padding-bottom: 2px;
  border-bottom: 1px solid transparent;
}
.day-link:hover { color: var(--ink); border-bottom-color: var(--line-strong); }
