/* =====================================================================
   golawskimail portal — "g;mail" (Dovecote layout) in Frutiger Aero
   Glass panels over a sky-to-aqua gradient, azure + leaf-green two-tone,
   soft specular sheen, glossy orb avatars and bead status lights.
   Source of truth: reports/rebrand/b-aero (aero.css, README, contrast-check.py).
   Light is the default; dark ("night-sky glass") via [data-theme=dark] or
   prefers-color-scheme when no theme is saved. Every component reads tokens,
   so the dark block is the only place colours change.
   Motion lives in motion.css (loaded after this file).
   ===================================================================== */

/* ---------------------------------------------------------------- tokens */
:root {
  color-scheme: light;
  /* page gradient: sky to aqua */
  --bg-1: #dff1fb; --bg-2: #eaf7f1; --bg-3: #f5fbf8;

  /* ink */
  --ink: #132233; --ink-2: #3f5a73; --ink-3: #4d6c82;
  --hair: rgba(19,34,51,.14); --hair-strong: rgba(19,34,51,.22);

  /* azure: chrome, links, primary action, unread, "you" */
  --azure: #1f7fd1; --azure-deep: #15609f; --azure-wash: #dbeefb;
  /* leaf: success, selection */
  --leaf: #1f7a46; --leaf-deep: #175c35; --leaf-wash: #dff3e4;
  /* sun: attention */
  --sun: #8a5d0a; --sun-deep: #7a4e06; --sun-wash: #f8ecd2;
  /* coral: critical */
  --coral: #b23229; --coral-deep: #a12a21; --coral-wash: #fbdedb;

  /* glass: high-opacity fill carries contrast; blur is decoration only */
  --glass-panel: rgba(255,255,255,.88);
  --glass-panel-held: rgba(255,255,255,.94);
  --glass-chrome: rgba(255,255,255,.72);
  --glass-blur: 18px; --glass-sat: 160%;
  --sheen: linear-gradient(180deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.12) 45%, rgba(255,255,255,0) 100%);

  /* translucent washes used on top of glass (one value per theme) */
  --wash-hover: rgba(255,255,255,.5);
  --wash-soft: rgba(255,255,255,.35);
  --wash-field: rgba(255,255,255,.6);
  --wash-sel: linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,.4));
  --wash-reading: rgba(255,255,255,.3);
  --btn-face: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.5));
  --btn-primary-face: linear-gradient(180deg, color-mix(in srgb, var(--azure) 70%, white), var(--azure-deep));
  --btn-primary-ink: #fff;
  --scrim: rgba(10,30,50,.35);
  --glint-1: radial-gradient(circle, rgba(255,255,255,.55), rgba(255,255,255,0) 70%);
  --glint-2: radial-gradient(circle, rgba(130,230,180,.35), rgba(130,230,180,0) 70%);
  --orb-hi: #cfe9fb;
  --bubble-hi: rgba(255,255,255,.9); --bubble-lo: rgba(255,255,255,.3); --bubble-glint: rgba(255,255,255,.75);

  /* icon sprite tones (oe98 sprite recoloured, zero path edits) */
  --ic-stroke: #15314a; --ic-fill: #bfe4fb; --ic-fill2: #f2fbff; --ic-accent: #2f9e5c;

  /* type: Hind (one humanist sans, the Segoe/Frutiger stand-in) */
  --sans: "Hind", "Segoe UI", "Noto Sans", system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 12.5px; --fs-sm: 14px; --fs-base: 15px; --fs-md: 16px; --fs-lg: 19px; --fs-xl: 24px; --fs-2xl: 32px; --fs-3xl: 40px;

  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 24px; --sp-7: 32px; --sp-8: 48px;
  --r-1: 8px; --r-2: 12px; --r-3: 18px; --r-pill: 999px;
  --lift: 0 1px 0 rgba(255,255,255,.6) inset, 0 10px 24px -16px rgba(15,60,90,.28);
  --lift-held: 0 1px 0 rgba(255,255,255,.7) inset, 0 20px 36px -18px rgba(15,60,90,.38);

  --ease: cubic-bezier(.22,.72,.2,1);
  --ease-float: cubic-bezier(.26,1.1,.32,1);
  --dur-1: 120ms; --dur-2: 220ms; --dur-3: 420ms; --dur-4: 720ms;

  --side-w: 248px; --list-w: 440px; --status-h: 28px; --topbar-h: 64px; --tabs-h: 62px;
  --max-content: 1180px;

  /* ---- aliases: the names pages, inline styles and motion.css already use ---- */
  --bg: var(--bg-2); --bg-raised: var(--glass-panel-held); --bg-sunken: var(--wash-field);
  --card: var(--glass-panel); --card-hover: var(--wash-hover);
  --line: var(--hair); --line-soft: var(--hair);
  --text: var(--ink); --text-dim: var(--ink-2); --text-faint: var(--ink-3);
  --accent: var(--azure); --accent-dim: var(--azure-wash); --accent-wash: var(--azure-wash); --accent-text-on: #fff;
  --good: var(--leaf); --good-wash: var(--leaf-wash);
  --warn: var(--sun); --warn-wash: var(--sun-wash);
  --bad: var(--coral); --bad-wash: var(--coral-wash);
  --neutral-pill: var(--wash-soft);
  --r-sm: var(--r-1); --r-md: var(--r-2); --r-lg: var(--r-3);
  --font: var(--sans);
  --dur-fast: var(--dur-1); --dur: var(--dur-2);
  --shadow-card: var(--lift); --shadow-pop: var(--lift-held);
  --bottomtab-h: var(--tabs-h);
  --m-shadow-lift: var(--lift); --m-shadow-held: var(--lift-held);
}

/* night-sky glass: deep navy and teal, never grey. Same block twice:
   once for an explicit choice, once for the OS preference. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-1: #06121f; --bg-2: #0a2235; --bg-3: #0d2b36;
  --ink: #eaf5fb; --ink-2: #a9c6d8; --ink-3: #86abc0;
  --hair: rgba(170,220,240,.16); --hair-strong: rgba(170,220,240,.26);
  --azure: #7fcdfb; --azure-deep: #9fdcff; --azure-wash: #16344a;
  --leaf: #7cf0a6; --leaf-deep: #a6f5c4; --leaf-wash: #163a28;
  --sun: #ffd98a; --sun-deep: #ffe3ad; --sun-wash: #3a2f12;
  --coral: #ff9a90; --coral-deep: #ffb3ab; --coral-wash: #3a1512;
  --glass-panel: rgba(12,35,54,.84); --glass-panel-held: rgba(14,40,61,.92); --glass-chrome: rgba(7,23,38,.70);
  --sheen: linear-gradient(180deg, rgba(180,225,255,.14) 0%, rgba(180,225,255,.04) 45%, rgba(180,225,255,0) 100%);
  --wash-hover: rgba(255,255,255,.07); --wash-soft: rgba(255,255,255,.05); --wash-field: rgba(255,255,255,.06);
  --wash-sel: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.05)); --wash-reading: rgba(0,0,0,.1);
  --btn-face: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.04));
  --btn-primary-face: linear-gradient(180deg, #d6f0ff, var(--azure)); --btn-primary-ink: #06141f;
  --scrim: rgba(0,0,0,.55);
  --glint-1: radial-gradient(circle, rgba(90,160,220,.18), rgba(90,160,220,0) 70%);
  --glint-2: radial-gradient(circle, rgba(60,200,150,.14), rgba(60,200,150,0) 70%);
  --orb-hi: #e3f5ff;
  --bubble-hi: rgba(200,235,255,.22); --bubble-lo: rgba(255,255,255,.04); --bubble-glint: rgba(255,255,255,.22);
  --ic-stroke: #d8eefb; --ic-fill: #1d3f57; --ic-fill2: #0c2336; --ic-accent: #5fe3a0;
  --lift: 0 1px 0 rgba(130,200,255,.14) inset, 0 10px 26px -16px rgba(0,0,0,.6);
  --lift-held: 0 1px 0 rgba(130,200,255,.18) inset, 0 20px 40px -18px rgba(0,0,0,.7);
  --accent-text-on: #06141f;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg-1: #06121f; --bg-2: #0a2235; --bg-3: #0d2b36;
    --ink: #eaf5fb; --ink-2: #a9c6d8; --ink-3: #86abc0;
    --hair: rgba(170,220,240,.16); --hair-strong: rgba(170,220,240,.26);
    --azure: #7fcdfb; --azure-deep: #9fdcff; --azure-wash: #16344a;
    --leaf: #7cf0a6; --leaf-deep: #a6f5c4; --leaf-wash: #163a28;
    --sun: #ffd98a; --sun-deep: #ffe3ad; --sun-wash: #3a2f12;
    --coral: #ff9a90; --coral-deep: #ffb3ab; --coral-wash: #3a1512;
    --glass-panel: rgba(12,35,54,.84); --glass-panel-held: rgba(14,40,61,.92); --glass-chrome: rgba(7,23,38,.70);
    --sheen: linear-gradient(180deg, rgba(180,225,255,.14) 0%, rgba(180,225,255,.04) 45%, rgba(180,225,255,0) 100%);
    --wash-hover: rgba(255,255,255,.07); --wash-soft: rgba(255,255,255,.05); --wash-field: rgba(255,255,255,.06);
    --wash-sel: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.05)); --wash-reading: rgba(0,0,0,.1);
    --btn-face: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.04));
    --btn-primary-face: linear-gradient(180deg, #d6f0ff, var(--azure)); --btn-primary-ink: #06141f;
    --scrim: rgba(0,0,0,.55);
    --glint-1: radial-gradient(circle, rgba(90,160,220,.18), rgba(90,160,220,0) 70%);
    --glint-2: radial-gradient(circle, rgba(60,200,150,.14), rgba(60,200,150,0) 70%);
    --orb-hi: #e3f5ff;
    --bubble-hi: rgba(200,235,255,.22); --bubble-lo: rgba(255,255,255,.04); --bubble-glint: rgba(255,255,255,.22);
    --ic-stroke: #d8eefb; --ic-fill: #1d3f57; --ic-fill2: #0c2336; --ic-accent: #5fe3a0;
    --lift: 0 1px 0 rgba(130,200,255,.14) inset, 0 10px 26px -16px rgba(0,0,0,.6);
    --lift-held: 0 1px 0 rgba(130,200,255,.18) inset, 0 20px 40px -18px rgba(0,0,0,.7);
    --accent-text-on: #06141f;
  }
}

/* ------------------------------------------------------------------ base */
* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  margin: 0; min-height: 100vh;
  background: linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 55%, var(--bg-3) 100%) fixed;
  background-color: var(--bg-2);
  color: var(--ink);
  font: 400 var(--fs-base)/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* two soft light glints: the sense of sky and water behind the glass */
body::before, body::after { content: ""; position: fixed; pointer-events: none; z-index: 0; border-radius: 50%; }
body::before { width: 46vw; height: 46vw; top: -18vw; right: -12vw; background: var(--glint-1); }
body::after  { width: 30vw; height: 30vw; bottom: -10vw; left: -8vw; background: var(--glint-2); }
a { color: var(--azure-deep); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; color: var(--ink); line-height: 1.2; }
h1 { font-size: var(--fs-2xl); } h2 { font-size: var(--fs-xl); } h3 { font-size: var(--fs-lg); } h4 { font-size: var(--fs-md); }
p { margin: 0; }
hr { border: none; border-top: 1px solid var(--hair); margin: var(--sp-4) 0; }
code, .mono, pre { font-family: var(--font-mono); }
pre { white-space: pre-wrap; }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-sm); }
th { text-align: left; font-weight: 600; color: var(--ink-3); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; padding: 8px 12px; border-bottom: 1px solid var(--hair); }
td { padding: 9px 12px; border-bottom: 1px solid var(--hair); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
::selection { background: var(--azure-wash); color: var(--ink); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

:focus-visible { outline: 2px solid var(--azure); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--azure-deep); color: #fff; padding: 8px 12px; border-radius: var(--r-1); }
.skip-link:focus { left: 8px; }

/* ----------------------------------------------------------------- icons */
/* oe98 two-tone symbols, recoloured through the --ic-* tokens */
symbol.oe path, symbol.oe rect, symbol.oe circle, symbol.oe ellipse, symbol.oe polygon, symbol.oe line {
  stroke: var(--ic-stroke); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; fill: none; }
symbol.oe .f  { fill: var(--ic-fill); }
symbol.oe .f2 { fill: var(--ic-fill2); }
symbol.oe .a  { fill: var(--ic-accent); }
symbol.oe .as { stroke: var(--ic-accent); }
symbol.oe .ns { stroke: none; }
symbol.oe .ls { stroke: var(--ic-fill2); }
symbol.oe .thin { stroke-width: 1.25; }
symbol.oe .thick { stroke-width: 2.4; }
.ic { width: 18px; height: 18px; flex: none; vertical-align: -4px; }
.btn .ic { width: 16px; height: 16px; vertical-align: -3px; }
.btn-sm .ic, .btn.sm .ic { width: 15px; height: 15px; }
.ic-bubble {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; position: relative; flex: none;
  background: radial-gradient(circle at 32% 26%, var(--bubble-hi), var(--azure-wash) 60%, var(--bubble-lo) 100%);
  box-shadow: 0 1px 2px rgba(10,40,60,.18), 0 0 0 1px var(--hair) inset;
}
.ic-bubble::after { content: ""; position: absolute; left: 18%; top: 12%; width: 40%; height: 26%; border-radius: 50%; background: var(--bubble-glint); pointer-events: none; }
.ic-bubble .ic { width: 16px; height: 16px; color: var(--azure-deep); position: relative; z-index: 1; vertical-align: 0; }
.ic-bubble.on { background: radial-gradient(circle at 32% 26%, var(--bubble-hi), var(--leaf-wash) 60%, var(--bubble-lo) 100%); }
.ic-bubble.on .ic { color: var(--leaf-deep); }

/* --------------------------------------------------------- glass mechanics */
.glass { background: var(--glass-panel); position: relative; }
@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .side, .topbar, .status, .tabs, .more-panel, .palette-box, .toast {
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
  }
}

/* ----------------------------------------------------------------- shell */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; position: relative; z-index: 1; padding-bottom: var(--status-h); }
.side {
  position: sticky; top: 0; height: calc(100vh - var(--status-h)); overflow-y: auto;
  background: var(--glass-chrome); border-right: 1px solid var(--hair);
  display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-4) var(--sp-3) var(--sp-3);
}
.wordmark { display: flex; align-items: center; gap: 10px; padding: 0 var(--sp-2); font-size: 20px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.wordmark svg { width: 30px; height: 30px; color: var(--ink); flex: none; }
.wordmark:hover { text-decoration: none; }
.find { display: flex; align-items: center; gap: 8px; margin: 0 var(--sp-2); padding: 7px 10px; background: var(--wash-field); border: 1px solid var(--hair); border-radius: var(--r-2); color: var(--ink-3); font: inherit; font-size: var(--fs-sm); cursor: pointer; text-align: left; width: calc(100% - 2 * var(--sp-2)); }
.find:hover { color: var(--ink); border-color: var(--hair-strong); }
.find .ic { width: 16px; height: 16px; }
.find kbd { margin-left: auto; font: 600 11px var(--sans); color: var(--ink-3); border: 1px solid var(--hair); border-radius: 4px; padding: 0 5px; }
.treehead { font-weight: 600; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 4px var(--sp-2) 3px; }
.tree { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.tree a { display: flex; align-items: center; gap: 9px; min-height: 31px; padding: 2px 10px 2px var(--d, 8px); border-radius: var(--r-1); color: var(--ink); font-size: var(--fs-sm); transition: background var(--dur-1) var(--ease); }
.tree a:hover { background: var(--wash-hover); text-decoration: none; }
.tree a.sel { background: var(--wash-sel); font-weight: 600; box-shadow: var(--lift); }
.tree .lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .n { margin-left: auto; font-size: var(--fs-xs); color: var(--azure-deep); font-weight: 700; font-variant-numeric: tabular-nums; }
.tree .n.q { color: var(--ink-3); font-weight: 500; }
.tree .n.bad { color: var(--coral-deep); }
.tree .lvl1 { --d: 26px; font-size: var(--fs-xs); min-height: 25px; color: var(--ink-2); }
.tree .lvl1::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--hair-strong); flex: none; margin-right: 3px; }
.side-foot { margin-top: auto; padding: var(--sp-2); font-size: var(--fs-xs); color: var(--ink-3); display: flex; align-items: center; gap: 8px; border-top: 1px solid var(--hair); }
.side-foot .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.side-foot form { margin: 0; }

.main { display: flex; flex-direction: column; min-width: 0; position: relative; z-index: 1; }
.topbar {
  position: sticky; top: 0; z-index: 10; min-height: var(--topbar-h);
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-6);
  background: color-mix(in srgb, var(--bg-1) 55%, transparent); border-bottom: 1px solid var(--hair);
}
.topbar-title, h1.topbar-title { font-size: var(--fs-xl); font-weight: 600; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.topbar-spacer, .spacer { flex: 1; }
.topbar .btn-icon { flex: none; }
.content { padding: var(--sp-6); max-width: var(--max-content); width: 100%; margin: 0 auto; }
.content.wide { max-width: none; }
.m-top { display: none; }

/* status line: OE's "Working online" strip as a glass taskbar, fed by the health monitor */
.status {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: var(--status-h);
  display: flex; align-items: center; gap: var(--sp-5); padding: 0 var(--sp-6) 0 calc(var(--side-w) + var(--sp-6));
  border-top: 1px solid var(--hair); background: var(--glass-panel-held); font-size: var(--fs-xs); color: var(--ink-3); white-space: nowrap; overflow: hidden;
}
.status a { color: inherit; }
.status a:hover { color: var(--ink); }
.status b { font-weight: 600; color: var(--ink-2); }
.status .who { overflow: hidden; text-overflow: ellipsis; }

/* phone tab bar + More sheet */
.tabs { display: none; }
.more-panel { display: none; }

/* --------------------------------------------------- avatars: glossy orbs */
.av, .avatar {
  width: 34px; height: 34px; border-radius: 50%; position: relative; overflow: hidden; flex: none;
  display: inline-grid; place-items: center;
  background: radial-gradient(circle at 32% 28%, var(--orb-hi), var(--azure) 55%, var(--azure-deep) 100%);
  color: #fff; font: 700 12px/1 var(--sans); letter-spacing: .02em; text-shadow: 0 1px 1px rgba(0,0,0,.25);
  box-shadow: 0 1px 2px rgba(10,40,60,.25), 0 0 0 1px rgba(255,255,255,.4) inset;
}
.av::after, .avatar::after { content: ""; position: absolute; left: 14%; top: 9%; width: 46%; height: 32%; border-radius: 50%; background: rgba(255,255,255,.6); pointer-events: none; }
.av.s, .avatar.s { background: radial-gradient(circle at 32% 28%, #d9f5e4, var(--leaf) 55%, var(--leaf-deep) 100%); }
.av.t, .avatar.t { background: radial-gradient(circle at 32% 28%, #ffe3dd, var(--coral) 55%, var(--coral-deep) 100%); }
.av.o, .avatar.o { background: radial-gradient(circle at 32% 28%, #ffecc7, var(--sun) 55%, var(--sun-deep) 100%); }
.av.v, .avatar.v { background: radial-gradient(circle at 32% 28%, #e8e2ff, #6c5fc7 55%, #4b3fa0 100%); }
:root[data-theme="dark"] .av, :root[data-theme="dark"] .avatar { color: #06141f; text-shadow: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .av, :root:not([data-theme="light"]) .avatar { color: #06141f; text-shadow: none; } }
img.avatar { object-fit: cover; background: #fff; }
img.avatar::after { display: none; }
.avatar-sm, .av.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-md { width: 40px; height: 40px; font-size: 14px; }
.avatar-lg { width: 72px; height: 72px; font-size: 24px; }
.avatar img, .avatar svg { width: 100%; height: 100%; display: block; }

/* -------------------------------------------- status lights (bead + word) */
/* Shape carries the meaning so colour is never the only signal:
   circle ok/you, triangle warn, octagon bad, square info, hollow quiet. */
.dot, .pill { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); white-space: nowrap; line-height: 1.3; }
.dot::before, .pill > .pill-dot, .pill.bare::before {
  content: ""; width: 9px; height: 9px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, var(--ink-3) 85%);
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent);
}
.dot.ok, .pill.good { color: var(--leaf-deep); }
.dot.ok::before, .pill.good > .pill-dot { background: radial-gradient(circle at 35% 30%, #eafff1, var(--leaf) 85%); }
.dot.warn, .pill.warn { color: var(--sun-deep); }
.dot.warn::before, .pill.warn > .pill-dot { background: radial-gradient(circle at 35% 30%, #fff6e2, var(--sun) 85%); clip-path: polygon(50% 0%, 100% 100%, 0% 100%); border-radius: 2px; box-shadow: none; width: 10px; height: 9px; }
.dot.bad, .pill.bad { color: var(--coral-deep); }
.dot.bad::before, .pill.bad > .pill-dot { background: radial-gradient(circle at 35% 30%, #ffe9e6, var(--coral) 85%); clip-path: polygon(30% 0,70% 0,100% 30%,100% 70%,70% 100%,30% 100%,0 70%,0 30%); box-shadow: none; }
.dot.you, .pill.accent { color: var(--azure-deep); }
.dot.you::before, .pill.accent > .pill-dot { background: radial-gradient(circle at 35% 30%, #eaf7ff, var(--azure) 85%); }
.dot.info::before { border-radius: 2px; background: radial-gradient(circle at 35% 30%, #eaf7ff, var(--azure) 85%); }
.dot.info { color: var(--azure-deep); }
.dot.quiet, .pill.neutral { color: var(--ink-3); }
.dot.quiet::before, .pill.neutral > .pill-dot { background: transparent; box-shadow: 0 0 0 1.5px var(--ink-3) inset; }
.dot:empty { gap: 0; }
/* tags: small caps words in front of a subject (triage) */
.tag { display: inline-block; font-weight: 600; font-size: 11.5px; color: var(--leaf-deep); margin-right: 6px; text-transform: uppercase; letter-spacing: .03em; vertical-align: 1px; }
.tag.reply, .tag.bad { color: var(--coral-deep); } .tag.accent, .tag.you { color: var(--azure-deep); } .tag.warn { color: var(--sun-deep); } .tag.neutral { color: var(--ink-3); }

/* ---------------------------------------------- buttons: glossy capsules */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; padding: 0 16px;
  border: 1px solid var(--hair); border-radius: var(--r-pill); background: var(--btn-face); color: var(--ink);
  font: 600 var(--fs-sm)/1 var(--sans); cursor: pointer; white-space: nowrap; position: relative; overflow: hidden; isolation: isolate;
  box-shadow: var(--lift); text-decoration: none;
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease), background var(--dur-1) var(--ease);
}
.btn::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(115deg, transparent 20%, rgba(255,255,255,.55) 38%, transparent 56%); transform: translateX(-120%); pointer-events: none; }
.btn:hover { text-decoration: none; box-shadow: var(--lift-held); }
.btn:hover::after { transform: translateX(120%); transition: transform var(--dur-4) var(--ease); }
.btn-primary, .btn.primary { background: var(--btn-primary-face); border-color: transparent; color: var(--btn-primary-ink); }
.btn-secondary { }
.btn-ghost, .btn.quiet { background: transparent; border-color: transparent; color: var(--ink-2); box-shadow: none; }
.btn-ghost:hover, .btn.quiet:hover { background: var(--wash-hover); border-color: var(--hair); box-shadow: none; color: var(--ink); }
.btn-danger { background: transparent; color: var(--coral-deep); border-color: color-mix(in srgb, var(--coral) 40%, transparent); box-shadow: none; }
.btn-danger:hover { background: var(--coral-wash); }
.btn-sm, .btn.sm { min-height: 30px; padding: 0 12px; font-size: var(--fs-xs); }
.btn-icon { padding: 0; width: 36px; min-width: 36px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.fab { position: fixed; right: var(--sp-4); bottom: calc(var(--tabs-h) + var(--status-h) + var(--sp-4)); width: 52px; height: 52px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--btn-primary-face); color: var(--btn-primary-ink); box-shadow: var(--lift-held); z-index: 21; }
/* the send button as a glossy droplet */
.seal { width: 34px; height: 34px; border-radius: 50%; border: 0; display: inline-grid; place-items: center; position: relative; overflow: hidden; color: #fff; cursor: pointer;
  background: radial-gradient(circle at 32% 26%, #eaf7ff, var(--azure) 55%, var(--azure-deep) 100%); box-shadow: 0 1px 2px rgba(10,40,60,.3), 0 0 0 1px rgba(255,255,255,.4) inset; }
.seal::after { content: ""; position: absolute; left: 16%; top: 10%; width: 46%; height: 30%; border-radius: 50%; background: rgba(255,255,255,.7); }

/* ---------------------------------------------------------------- inputs */
label.field-label, .field-label { display: block; font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: 6px; font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; min-height: 38px; background: var(--wash-field); border: 1px solid var(--hair); border-radius: var(--r-2);
  padding: 7px 12px; font: inherit; font-size: var(--fs-sm); color: var(--ink);
}
select.input { padding-right: 28px; }
textarea.input { line-height: 1.5; }
.input:focus { outline: none; border-color: var(--azure); box-shadow: 0 0 0 3px color-mix(in srgb, var(--azure) 22%, transparent); }
.input::placeholder { color: var(--ink-3); opacity: .85; }
input[type="file"].input { padding: 6px 10px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--azure); }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-3) 0; border-bottom: 1px solid var(--hair); }
.field-row:last-child { border-bottom: 0; }
.field-row .field-label { margin-bottom: 0; }
.field-row-control { flex: none; display: flex; align-items: center; gap: var(--sp-2); }
.copy-field { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; background: var(--wash-field); border: 1px solid var(--hair); border-radius: var(--r-1); padding: 6px 6px 6px 12px; }
.copy-field .val { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.copy-btn { flex: none; width: 30px; height: 30px; border-radius: var(--r-1); border: 0; background: transparent; color: var(--ink-2); display: grid; place-items: center; cursor: pointer; }
.copy-btn:hover { background: var(--wash-hover); color: var(--azure-deep); }
.copy-btn.copied { color: var(--leaf-deep); }

/* -------------------------------------------- sheets (cards), stats, rows */
.card {
  background: var(--glass-panel); border-radius: var(--r-3); box-shadow: var(--lift); border: 1px solid color-mix(in srgb, var(--hair) 60%, transparent);
  position: relative;
}
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 64px; border-radius: inherit; background: var(--sheen); pointer-events: none; }
.card > * { position: relative; }
.card-pad { padding: var(--sp-4) var(--sp-5); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5) var(--sp-3); border-bottom: 1px solid var(--hair); }
.card-header h3 { font-size: var(--fs-lg); }
.card-header .sub { color: var(--ink-3); font-size: var(--fs-sm); margin-top: 2px; }
.card-header .flex-right { display: flex; gap: 8px; align-items: center; }
.card-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.sheet-note { padding: 0 var(--sp-5) var(--sp-4); color: var(--ink-3); font-size: var(--fs-xs); }

.grid { display: grid; gap: var(--sp-4); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2, .two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); align-items: start; }
.two > .card { margin-top: 0; }

.stat-tile, .stat {
  background: var(--glass-panel); border-radius: var(--r-3); box-shadow: var(--lift); padding: var(--sp-4) var(--sp-5); position: relative; overflow: hidden; min-width: 0;
  border: 1px solid color-mix(in srgb, var(--hair) 60%, transparent); color: inherit; display: block;
}
.stat-tile::before, .stat::before { content: ""; position: absolute; inset: 0 0 60% 0; background: var(--sheen); pointer-events: none; }
a.stat-tile:hover, a.stat:hover { text-decoration: none; box-shadow: var(--lift-held); }
.stat-tile .label, .stat .k { font-size: var(--fs-sm); color: var(--ink-2); display: flex; justify-content: space-between; align-items: center; gap: 8px; position: relative; }
.stat-tile .value, .stat .v { font-size: var(--fs-2xl); font-weight: 700; line-height: 1.1; margin-top: 6px; position: relative; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-tile .value small, .stat .v small { font-size: var(--fs-sm); font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.stat-tile .delta, .stat .d { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 4px; position: relative; }
.stat-tile .delta.good { color: var(--leaf-deep); } .stat-tile .delta.bad { color: var(--coral-deep); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-4); margin-bottom: var(--sp-4); }
.card .grid .stat-tile { padding: 12px 14px; box-shadow: none; background: var(--wash-soft); }
.card .grid .stat-tile .value { font-size: var(--fs-xl); }

.row-list { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: var(--sp-3); padding: 11px var(--sp-5); border-top: 1px solid var(--hair); color: inherit; min-width: 0; }
.row-list > .row:first-child, .card-header + .row-list > .row:first-child { border-top: 0; }
a.row:hover, .row:hover { background: var(--wash-hover); text-decoration: none; }
.row-title { font-weight: 600; font-size: var(--fs-base); color: var(--ink); }
a.row-title:hover { color: var(--azure-deep); }
.row-sub { font-size: var(--fs-sm); color: var(--ink-3); }
.row-main { flex: 1; min-width: 0; }
.row-main .row-title, .row-main .row-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { display: flex; align-items: center; gap: var(--sp-2); flex: none; }
.row-meta form { margin: 0; }
.row .chev { width: 16px; height: 16px; color: var(--ink-3); }

/* flow spacing: every block on a page sits one step below the previous one */
.content > * + *, .flow > * + * { margin-top: var(--sp-4); }
.content > .flash { margin-bottom: 0; }

/* ----------------------------------------------------------- empty states */
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: var(--sp-2); padding: var(--sp-7) var(--sp-5); color: var(--ink-2); }
.empty-state .title { font-size: var(--fs-md); color: var(--ink); font-weight: 600; }
.empty-state .desc { font-size: var(--fs-sm); max-width: 340px; color: var(--ink-2); }
.empty-state .btn { margin-top: 6px; }
.m-illo { color: var(--azure-deep); }

/* ------------------------------------------------------------ flash/toast */
.flash { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; margin-bottom: var(--sp-4); border-radius: var(--r-2); font-size: var(--fs-sm); font-weight: 500;
  background: var(--glass-panel-held); box-shadow: var(--lift); border: 1px solid var(--hair); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.flash .pill-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.flash.good { color: var(--leaf-deep); border-color: color-mix(in srgb, var(--leaf) 35%, transparent); }
.flash.good .pill-dot { background: radial-gradient(circle at 35% 30%, #eafff1, var(--leaf) 85%); }
.flash.bad { color: var(--coral-deep); border-color: color-mix(in srgb, var(--coral) 40%, transparent); }
.flash.bad .pill-dot { background: radial-gradient(circle at 35% 30%, #ffe9e6, var(--coral) 85%); clip-path: polygon(30% 0,70% 0,100% 30%,100% 70%,70% 100%,30% 100%,0 70%,0 30%); }
.flash-text { flex: 1; color: var(--ink); }
.flash-x { background: none; border: 0; color: inherit; font-size: 18px; line-height: 1; cursor: pointer; width: 32px; height: 32px; border-radius: var(--r-1); flex: none; }
.flash-x:hover { background: var(--wash-hover); }
.flash.fade { opacity: 0; transform: translateY(-4px); }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--status-h) + var(--sp-4)); z-index: 40; display: flex; align-items: center; gap: 12px;
  background: var(--glass-panel-held); color: var(--ink); border: 1px solid var(--hair); border-radius: var(--r-pill); padding: 8px 10px 8px 18px;
  box-shadow: var(--lift-held); font-size: var(--fs-sm); max-width: calc(100vw - 32px); transition: opacity var(--dur-2) var(--ease); }
.toast.gone { opacity: 0; pointer-events: none; }
.toast .toast-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast .undo { color: var(--azure-deep); font-weight: 600; cursor: pointer; }

/* ------------------------------------------------------- tabs and subnav */
.tabbar, .subnav, .views { display: flex; gap: 18px; border-bottom: 1px solid var(--hair); overflow-x: auto; scrollbar-width: none; margin-bottom: var(--sp-4); }
.tabbar::-webkit-scrollbar, .subnav::-webkit-scrollbar, .views::-webkit-scrollbar { display: none; }
.tabbar .tab, .subnav a, .views a { padding: 8px 0 10px; color: var(--ink-3); font-size: var(--fs-sm); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; cursor: pointer; }
.tabbar .tab:hover, .subnav a:hover, .views a:hover { text-decoration: none; color: var(--ink); }
.tabbar .tab.active, .subnav a.on, .views a.on { color: var(--ink); border-bottom-color: var(--azure); font-weight: 600; }
.views a .n { color: var(--ink-3); font-weight: 500; margin-left: 3px; font-variant-numeric: tabular-nums; }
.views a.on .n { color: var(--azure-deep); }

/* legacy chips kept for secondary filters (AI categories, suggestions) */
.chip-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.filter-chip { flex: none; font: inherit; font-size: var(--fs-xs); font-weight: 600; padding: 4px 11px; border-radius: var(--r-pill); background: transparent; border: 1px solid var(--hair); color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.filter-chip:hover { background: var(--wash-hover); text-decoration: none; color: var(--ink); }
.filter-chip.active { background: var(--azure-wash); color: var(--azure-deep); border-color: transparent; }
.filter-chip .ic, .filter-chip svg { width: 13px; height: 13px; vertical-align: -2px; }
.suggest-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; align-items: center; }
.suggest-chip, .hint { font: inherit; font-style: italic; font-weight: 500; font-size: var(--fs-sm); padding: 5px 12px; border-radius: var(--r-pill); border: 1px solid var(--hair); background: var(--wash-soft); color: var(--ink-2); cursor: pointer; min-height: 34px; }
.suggest-chip:hover, .hint:hover { background: var(--leaf-wash); color: var(--leaf-deep); border-color: transparent; }
.suggest-chip.active { background: var(--azure-wash); color: var(--azure-deep); border-color: transparent; }

/* --------------------------------------------------------------- helpers */
.flex { display: flex; align-items: center; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: var(--sp-1); } .gap-2 { gap: var(--sp-2); } .gap-3 { gap: var(--sp-3); } .gap-4 { gap: var(--sp-4); }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.text-dim, .dim { color: var(--ink-2); }
.text-faint, .faint { color: var(--ink-3); }
.text-sm, .sm { font-size: var(--fs-sm); }
.text-xs, .xs { font-size: var(--fs-xs); }
.num { font-variant-numeric: tabular-nums; }
.mt-1{margin-top:4px;} .mt-2{margin-top:8px;} .mt-3{margin-top:12px;} .mt-4{margin-top:16px;} .mt-5{margin-top:20px;} .mt-6{margin-top:24px;}
.mb-1{margin-bottom:4px;} .mb-2{margin-bottom:8px;} .mb-3{margin-bottom:12px;} .mb-4{margin-bottom:16px;}
.w-full { width: 100%; }
.progress-bar { height: 8px; border-radius: var(--r-pill); background: var(--wash-field); border: 1px solid var(--hair); overflow: hidden; }
.progress-bar > span { display: block; height: 100%; border-radius: var(--r-pill); background: linear-gradient(180deg, color-mix(in srgb, var(--leaf) 70%, white), var(--leaf)); }
.unread-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-top: 15px; background: radial-gradient(circle at 35% 30%, #eaf7ff, var(--azure) 85%); box-shadow: 0 0 4px color-mix(in srgb, var(--azure) 60%, transparent); }
.kbd, kbd { font: 600 11px var(--font-mono); border: 1px solid var(--hair); border-radius: 5px; padding: 1px 6px; color: var(--ink-3); background: var(--wash-soft); }
details > summary { list-style: none; cursor: pointer; } details > summary::-webkit-details-marker { display: none; }
.hand { font-style: italic; font-weight: 500; color: var(--azure-deep); font-size: 1.1em; line-height: 1.4; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 40px; }
.bars i { flex: 1; display: block; min-height: 2px; border-radius: 2px 2px 0 0; background: linear-gradient(180deg, var(--leaf), var(--leaf-deep)); }
.bars i.hi { background: linear-gradient(180deg, var(--azure), var(--azure-deep)); }

/* ------------------------------------------------------ dns / domains */
.dns-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1fr) 32px; gap: var(--sp-3); align-items: center; padding: var(--sp-3) var(--sp-5); border-top: 1px solid var(--hair); }
.row-list > .dns-row:first-child { border-top: 0; }
.dns-type { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 700; color: var(--azure-deep); background: var(--azure-wash); border-radius: 6px; padding: 3px 7px; text-align: center; width: fit-content; }
.dns-host { font-size: var(--fs-sm); color: var(--ink-2); }
.dns-host .host-name { color: var(--ink); font-family: var(--font-mono); font-size: 13px; }
.status-ic { width: 18px; height: 18px; flex: none; }
.status-ic.verified { color: var(--leaf); } .status-ic.pending { color: var(--ink-3); } .status-ic.checking { color: var(--azure); } .status-ic.mismatch { color: var(--coral); }
.domain-head, .mb-head { display: flex; align-items: center; gap: 14px; margin-bottom: var(--sp-2); }
.domain-logo { width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, var(--orb-hi), var(--azure) 55%, var(--azure-deep) 100%); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; flex: none; }
.cert-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: 14px var(--sp-5); border-top: 1px solid var(--hair); }
.cert-row:first-child { border-top: 0; }
.cert-meta .k { color: var(--ink-3); font-size: var(--fs-xs); }
.cert-meta .v { font-size: var(--fs-sm); margin-top: 2px; }
.cert-names { white-space: normal; word-break: break-all; }
.history-link { font-size: var(--fs-sm); color: var(--ink-2); cursor: pointer; }
.quota-wrap { max-width: 320px; }
.quota-label { display: flex; justify-content: space-between; font-size: var(--fs-sm); color: var(--ink-2); margin-bottom: 6px; }
.qr-box { width: 132px; height: 132px; background: #fff; border-radius: var(--r-2); display: grid; place-items: center; flex: none; box-shadow: var(--lift); }
.device-opt { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid var(--hair); border-radius: var(--r-2); cursor: pointer; background: var(--wash-soft); }
.device-opt.active { border-color: var(--azure); background: var(--azure-wash); }
.settings-block { font-family: var(--font-mono); font-size: 13px; }
.relay-select { max-width: 220px; }
.attn-row .ic { width: 16px; height: 16px; }
.biz-row .name { font-weight: 600; }
.activity-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--hair); font-size: var(--fs-sm); }
.activity-item:last-child { border-bottom: 0; }
.activity-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); margin-top: 7px; flex: none; }

/* ------------------------------------------------------------ dashboard */
.greet { display: flex; align-items: flex-end; gap: var(--sp-4); margin: 0 0 var(--sp-5); flex-wrap: wrap; }
.greet h1 { font-size: var(--fs-3xl); font-weight: 700; line-height: 1.1; display: inline-block; }
/* the greeting is the page title on Today, so the top bar steps aside (phones keep their own top bar) */
.main:has(.content > .greet:first-child) .topbar { display: none; }
.greet h1 em, .greet h1 .w.n { font-style: normal; color: var(--azure-deep); }
.greet .sub { color: var(--ink-2); font-size: var(--fs-md); margin-top: 6px; }
.greet .acts { display: flex; gap: 8px; margin-left: auto; }
.dash-top { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--sp-5); align-items: start; margin-bottom: var(--sp-4); }
.dash-top > .card { margin: 0; }
.dash-top.solo { grid-template-columns: minmax(0, 1fr); }
.note { background: linear-gradient(160deg, color-mix(in srgb, var(--glass-panel-held) 90%, transparent), var(--azure-wash)); border: 1px solid var(--hair); border-radius: var(--r-3); padding: 14px 16px 12px; box-shadow: var(--lift); position: relative; overflow: hidden; }
.note::before { content: ""; position: absolute; inset: 0 0 55% 0; background: var(--sheen); pointer-events: none; }
.note > * { position: relative; }
.note .hand { font-size: 15.5px; line-height: 1.5; display: block; }
.note .by { font-size: var(--fs-xs); color: var(--ink-3); margin-top: 8px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.note .by form { display: inline; margin: 0; }
.note .by button { font: inherit; color: var(--azure-deep); background: none; border: 0; padding: 0; cursor: pointer; }
.health-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--hair); border-top: 1px solid var(--hair); border-radius: 0 0 var(--r-3) var(--r-3); overflow: hidden; }
.health-grid > a, .health-grid > div { background: var(--glass-panel); padding: 12px var(--sp-5); color: inherit; min-width: 0; }
.health-grid > a:hover { background: var(--glass-panel-held); text-decoration: none; }
.health-grid .k { font-size: var(--fs-xs); color: var(--ink-3); }
.health-grid .v { font-size: var(--fs-sm); font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 2px; }
.health-grid .v span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.digest-head { display: flex; flex-direction: column; gap: 8px; }
.digest-headline { font-weight: 600; font-size: var(--fs-md); }
.digest-ai { color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.6; }

/* ----------------------------------------------------------------- inbox */
.inbox-body { display: flex; min-height: 0; height: calc(100vh - var(--topbar-h) - var(--status-h)); margin: calc(-1 * var(--sp-6)); }
.content:has(> .inbox-body) { max-width: none; }
.thread-col { width: var(--list-w); flex: none; border-right: 1px solid var(--hair); display: flex; flex-direction: column; overflow: hidden; }
.thread-col-head { padding: var(--sp-3) var(--sp-4) 0; }
.thread-col-head .views { margin-bottom: 0; }
.thread-col-head form[role=search] { margin-top: var(--sp-3); }
.list-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.list-meta h2 { font-size: var(--fs-xl); }
.list-meta small { font-size: var(--fs-sm); color: var(--ink-3); }
.thread-scroll { overflow-y: auto; flex: 1; padding: var(--sp-2) var(--sp-3) var(--sp-4); display: flex; flex-direction: column; gap: 3px; }
.thread-row { display: flex; gap: 10px; padding: 10px 12px 10px 8px; border-radius: var(--r-2); cursor: pointer; align-items: flex-start; color: inherit; position: relative; }
.thread-row:hover { background: var(--wash-hover); text-decoration: none; }
.thread-row.selected { background: var(--wash-sel); box-shadow: var(--lift); }
.thread-row.cursor { box-shadow: inset 3px 0 0 var(--azure); }
.thread-row.woke { background: var(--azure-wash); }
.thread-row .av { width: 38px; height: 38px; font-size: 13px; }
.thread-row .meta { flex: 1; min-width: 0; }
.thread-row .top-line { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.thread-row .sender { font-size: var(--fs-sm); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.thread-row .sender.unread { color: var(--ink); font-weight: 600; }
.thread-row .time { font-size: var(--fs-xs); color: var(--ink-3); flex: none; display: inline-flex; align-items: center; gap: 4px; }
.thread-row .time .ic, .thread-row .time svg { width: 13px; height: 13px; }
.thread-row .subject { font-size: var(--fs-base); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-row .subject.unread { font-weight: 600; }
.thread-row .snippet { font-size: var(--fs-sm); color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-row .unread-gap { width: 8px; flex: none; }
.thread-row > form { margin: 0 0 0 auto; align-self: center; }
.row-check { display: none; width: 18px; height: 18px; margin-top: 10px; flex: none; }
.thread-col.selecting .row-check { display: inline-block; }
.thread-col.selecting .unread-dot, .thread-col.selecting .unread-gap { display: none; }
.bulk-bar { display: none; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.thread-col.selecting .bulk-bar { display: flex; }
.select-toggle { font: inherit; }
.older { align-self: center; margin-top: var(--sp-3); }

.reading-pane { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--wash-reading); }
.reading-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2); padding: var(--sp-7); text-align: center; color: var(--ink-2); }
.reading-empty .lead { font-size: var(--fs-lg); color: var(--ink); font-weight: 600; }
.reading-empty .keys { display: grid; grid-template-columns: auto auto; gap: 8px 14px; margin-top: var(--sp-3); font-size: var(--fs-sm); text-align: left; }
.reading-head { padding: var(--sp-5) var(--sp-6) var(--sp-4); border-bottom: 1px solid var(--hair); }
.reading-head .rd { display: flex; align-items: flex-start; gap: var(--sp-3); flex-wrap: wrap; }
.reading-head h2 { font-size: var(--fs-xl); overflow-wrap: anywhere; }
.reading-head .meta { font-size: var(--fs-sm); color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.reading-head .meta b { color: var(--ink); font-weight: 600; }
.reading-scroll { flex: 1; overflow-y: auto; padding: var(--sp-5) var(--sp-6); }
.msg { background: var(--glass-panel); border-radius: var(--r-3); box-shadow: var(--lift); margin-bottom: var(--sp-3); position: relative; overflow: hidden; }
.msg::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 60px; background: var(--sheen); pointer-events: none; }
.msg-head { display: flex; align-items: center; gap: 12px; padding: 14px var(--sp-5) 10px; position: relative; font-size: var(--fs-sm); color: var(--ink-2); }
.msg-head .who { min-width: 0; }
.msg-head .who b { display: block; color: var(--ink); font-weight: 600; font-size: var(--fs-base); }
.msg-head time { margin-left: auto; color: var(--ink-3); font-size: var(--fs-xs); white-space: nowrap; display: inline-flex; gap: 4px; align-items: center; }
.msg-head time .ic { width: 13px; height: 13px; }
.msg-body { padding: 0 var(--sp-5) var(--sp-5); font-size: var(--fs-base); color: var(--ink); line-height: 1.6; position: relative; }
/* earlier messages fold to one line, like letters in a pile */
.msg.collapsed { background: var(--wash-soft); box-shadow: none; border: 1px solid var(--hair); border-radius: var(--r-2); margin-bottom: 8px; }
.msg.collapsed::before { display: none; }
.msg.collapsed .msg-head { padding: 8px 14px; }
.msg.collapsed .msg-head .av { width: 24px; height: 24px; font-size: 10px; }
.msg.collapsed .msg-head .who b { display: inline; font-size: var(--fs-sm); }
.msg.collapsed .msg-body { display: none; }
.mail-body-frame { width: 100%; border: 0; min-height: 40px; background: #fff; border-radius: var(--r-1); }
.mail-body-text { white-space: pre-wrap; font-family: inherit; margin: 0; }
.reply-box { border-top: 1px solid var(--hair); padding: var(--sp-3) var(--sp-6) var(--sp-5); display: flex; flex-direction: column; }
.reply-sheet { background: var(--glass-panel-held); border-radius: var(--r-3) var(--r-3) var(--r-2) var(--r-2); box-shadow: var(--lift-held); padding: var(--sp-4) var(--sp-5); display: grid; gap: 10px; position: relative; }
.reply-sheet::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 50px; border-radius: inherit; background: var(--sheen); pointer-events: none; }
.reply-sheet > * { position: relative; }
.reply-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: var(--fs-xs); color: var(--ink-3); }
.reply-meta b { color: var(--ink-2); font-weight: 600; }
.reply-area { background: var(--wash-field); border: 1px solid var(--hair); border-radius: var(--r-2); padding: 12px; min-height: 70px; font-size: var(--fs-sm); color: var(--ink); width: 100%; resize: vertical; }
.reply-toolbar, .reply-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ai-row .input { flex: 1; min-width: 200px; }
.identity-picker { font-size: var(--fs-xs); color: var(--ink-2); }
.thread-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.thread-actions form { margin: 0; }
.thread-actions-mobile { display: none; }
.crm-strip { margin: 0 var(--sp-6) var(--sp-3); padding: 10px 14px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--wash-soft); border: 1px solid var(--hair); border-radius: var(--r-2); font-size: var(--fs-sm); }
.crm-strip > summary { color: var(--azure-deep); font-weight: 600; }
.crm-strip[open] { display: block; }
#ai-summary { margin: 0 var(--sp-6) var(--sp-3); white-space: pre-wrap; }

.attach-field { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.attach-chips { display: contents; }
.attach-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.attach-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; font-size: var(--fs-xs); padding: 5px 9px 5px 10px; border: 1px solid var(--hair); border-radius: var(--r-1); background: var(--wash-soft); color: var(--ink-2); position: relative; overflow: hidden; }
.attach-chip:hover { background: var(--wash-hover); text-decoration: none; }
.attach-chip .attach-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-chip.failed { border-color: var(--coral); color: var(--coral-deep); }
.attach-chip.linked { border-color: var(--azure); }
.attach-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; }
.attach-bar i { display: block; height: 100%; width: 0; background: var(--azure); transition: width var(--dur-2) var(--ease); }
.attach-chip:not(.uploading) .attach-bar { display: none; }
.attach-remove { border: 0; background: none; color: var(--ink-3); font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px; }
.attach-remove:hover { color: var(--coral-deep); }
.rte-area.drop { outline: 2px dashed var(--azure); outline-offset: -4px; }

.when-menu { position: relative; display: inline-block; }
.when-menu > summary { list-style: none; display: inline-flex; }
.when-pop { position: absolute; z-index: 30; left: 0; bottom: auto; top: calc(100% + 6px); min-width: 250px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--lift-held); background: var(--glass-panel-held); }
.compose-actions .when-pop, .reply-actions .when-pop { top: auto; bottom: calc(100% + 6px); }
.thread-actions .when-pop { left: auto; right: 0; }
.when-opt { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: var(--fs-sm); cursor: pointer; text-align: left; }
.when-opt input[type=radio] { margin: 0; }
.when-opt.btn { justify-content: flex-start; width: 100%; }
.when-custom { width: 100%; }

.help-overlay { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: flex; align-items: center; justify-content: center; padding: 16px; }
.help-overlay[hidden] { display: none; }
.help-card { width: 100%; max-width: 460px; }
.help-grid { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 10px 12px; align-items: center; margin-top: 12px; font-size: var(--fs-sm); }
.help-grid .kbd { justify-self: start; min-width: 22px; text-align: center; }

/* --------------------------------------------------------------- compose */
.compose-sheet { display: flex; flex-direction: column; gap: var(--sp-3); }
.compose-grid { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 10px 12px; align-items: center; }
.compose-grid > span { color: var(--ink-3); font-size: var(--fs-sm); text-align: right; }
.compose-actions {
  position: sticky; bottom: var(--status-h); z-index: 5; display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  margin: var(--sp-2) calc(-1 * var(--sp-5)) calc(-1 * var(--sp-4)); padding: var(--sp-3) var(--sp-5);
  background: var(--glass-panel-held); border-top: 1px solid var(--hair); border-radius: 0 0 var(--r-3) var(--r-3);
}
.compose-actions .draft-status { margin-left: auto; }
.track-opt { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 2px 8px; align-items: start; font-size: var(--fs-sm); }
.track-opt input { width: 18px; height: 18px; margin: 2px 0 0; }
.track-opt .text-xs { grid-column: 2; }
.rte { border: 1px solid var(--hair); border-radius: var(--r-2); background: var(--wash-field); overflow: hidden; }
.rte-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px; border-bottom: 1px solid var(--hair); background: var(--wash-soft); }
.rte-bar button { background: none; border: 0; color: var(--ink-2); min-width: 32px; height: 32px; border-radius: var(--r-1); cursor: pointer; font: inherit; font-size: 13px; display: inline-grid; place-items: center; }
.rte-bar button:hover { background: var(--wash-hover); color: var(--ink); }
.rte-bar button .ic { width: 16px; height: 16px; }
.rte-area { min-height: 200px; padding: 12px 14px; outline: none; color: var(--ink); line-height: 1.6; overflow-wrap: anywhere; font-size: var(--fs-base); }
.rte-area.small { min-height: 96px; }
.rte-area:empty::before { content: attr(data-placeholder); color: var(--ink-3); }
.rte-area blockquote { border-left: 3px solid var(--hair-strong); margin: 6px 0; padding-left: 10px; color: var(--ink-2); }
.rte-area a { color: var(--azure-deep); }
.gm-signature { color: var(--ink-2); }

/* -------------------------------------------------- CRM: pipeline trays */
.board-wrap { position: relative; }
.board-wrap::after { content: ""; position: absolute; top: 0; right: 0; bottom: 8px; width: 36px; pointer-events: none; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--bg-2) 85%, transparent)); border-radius: 0 var(--r-3) var(--r-3) 0; }
.crm-board, .board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: var(--sp-4); overflow-x: auto; padding: 4px 2px var(--sp-3); align-items: start; scroll-snap-type: x proximity; }
.crm-col, .tray { background: var(--wash-soft); border: 1px solid var(--hair); border-radius: var(--r-3); padding: 8px; min-height: 120px; scroll-snap-align: start; }
.crm-col-head, .tray > header { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px 10px; }
.crm-col-head h3, .tray > header h3 { font-size: var(--fs-md); }
.crm-col-head .sum { font-size: var(--fs-xs); color: var(--ink-3); }
.crm-col-head .n { margin-left: auto; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); background: var(--glass-panel-held); border-radius: var(--r-pill); padding: 1px 9px; box-shadow: var(--lift); }
.crm-col.won .crm-col-head h3 { color: var(--leaf-deep); } .crm-col.lost .crm-col-head h3 { color: var(--ink-3); }
.cards { display: grid; gap: 8px; min-height: 40px; }
.deal { background: var(--glass-panel); border-radius: var(--r-2); box-shadow: var(--lift); padding: 12px 14px; display: grid; gap: 3px; color: inherit; position: relative;
  transition: transform var(--dur-2) var(--ease-float), box-shadow var(--dur-2) var(--ease); }
.deal::before { content: ""; position: absolute; inset: 0 0 55% 0; border-radius: inherit; background: var(--sheen); pointer-events: none; }
.deal > * { position: relative; }
.deal:hover { transform: translateY(-2px); box-shadow: var(--lift-held); }
.deal .t { font-weight: 600; font-size: var(--fs-base); line-height: 1.3; color: var(--ink); }
.deal .t:hover { color: var(--azure-deep); }
.deal .who { font-size: var(--fs-sm); color: var(--ink-3); }
.deal .foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; font-size: var(--fs-xs); }
.deal .val { font-weight: 600; font-size: var(--fs-md); color: var(--ink); font-variant-numeric: tabular-nums; }
.deal .move { margin-left: auto; position: relative; }
.deal .move > summary { font-size: var(--fs-xs); color: var(--ink-3); padding: 2px 8px; border-radius: var(--r-pill); border: 1px solid transparent; }
.deal .move > summary:hover, .deal .move[open] > summary { border-color: var(--hair); color: var(--ink); background: var(--wash-hover); }
.deal .move-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 20; min-width: 170px; display: flex; flex-direction: column; padding: 4px; background: var(--glass-panel-held); border: 1px solid var(--hair); border-radius: var(--r-2); box-shadow: var(--lift-held); }
.deal .move-pop button { font: inherit; font-size: var(--fs-sm); text-align: left; padding: 7px 10px; border: 0; border-radius: var(--r-1); background: none; color: var(--ink); cursor: pointer; }
.deal .move-pop button:hover { background: var(--azure-wash); }
.deal .move-pop button[aria-current] { color: var(--ink-3); cursor: default; background: none; }
.deal form[data-stage] { display: none; }
.drop { border: 1.5px dashed var(--hair-strong); border-radius: var(--r-2); padding: 10px; text-align: center; color: var(--ink-3); font-style: italic; font-size: var(--fs-sm); }
.new-deal > summary { display: inline-flex; }
.new-deal[open] { display: block; }

/* ---------------------------------------------------------- palette (⌘K) */
.palette { position: fixed; inset: 0; z-index: 60; display: none; }
.palette.open { display: block; }
.palette-backdrop { position: absolute; inset: 0; background: var(--scrim); }
.palette-box { position: relative; margin: 10vh auto 0; width: min(640px, calc(100% - 32px)); background: var(--glass-panel-held); border: 1px solid var(--hair);
  border-radius: var(--r-3); box-shadow: var(--lift-held); overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.palette-input { width: 100%; border: 0; border-bottom: 1px solid var(--hair); background: transparent; color: var(--ink); font: inherit; font-size: var(--fs-md); padding: 14px 16px; outline: none; }
.palette-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
.palette-group { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); padding: 8px 10px 4px; }
.palette-item { display: flex; align-items: baseline; gap: 10px; padding: 9px 10px; border-radius: var(--r-1); cursor: pointer; min-height: 40px; }
.palette-item.selected { background: var(--azure-wash); }
.palette-label { font-weight: 500; flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-sub { color: var(--ink-2); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-empty { padding: 18px 10px; text-align: center; }
.palette-foot { display: flex; gap: 16px; padding: 8px 14px; border-top: 1px solid var(--hair); }
body.palette-open, body.sheet-open { overflow: hidden; }

/* ------------------------------------------------------ template builder */
.builder-top { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--hair); background: var(--glass-chrome); position: relative; z-index: 2; }
.builder-top .grow { flex: 1; }

/* ------------------------------------------------------- bare (sign-in) */
.bare { max-width: 420px; margin: 0 auto; padding: 64px 16px; position: relative; z-index: 1; }
.bare .wordmark { justify-content: center; margin-bottom: var(--sp-5); font-size: 24px; }
.bare .wordmark svg { width: 38px; height: 38px; }

/* =================================================================== phone */
@media (max-width: 899px) {
  :root { --topbar-h: 52px; }
  /* blur is costly on phone GPUs; the high-opacity fill already carries contrast */
  .side, .topbar, .status, .tabs, .more-panel, .palette-box, .toast { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .shell { grid-template-columns: minmax(0, 1fr); padding-bottom: calc(var(--tabs-h) + var(--status-h) + env(safe-area-inset-bottom)); }
  .side { display: none; }
  .m-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px 4px; }
  .m-top .wordmark { font-size: 18px; padding: 0; }
  .m-top .wordmark svg { width: 26px; height: 26px; }
  .topbar { padding: 6px 14px; gap: var(--sp-2); background: var(--glass-panel); }
  .topbar-title, h1.topbar-title { font-size: var(--fs-lg); }
  .topbar .find-btn { display: none; }
  .content { padding: var(--sp-4) 14px var(--sp-5); }

  .status { left: 0; padding: 0 14px calc(env(safe-area-inset-bottom)); height: calc(var(--status-h) + env(safe-area-inset-bottom)); gap: 12px; background: var(--glass-panel-held); }
  .status .m-hide { display: none; }
  .tabs {
    display: flex; position: fixed; left: 0; right: 0; bottom: calc(var(--status-h) + env(safe-area-inset-bottom)); z-index: 31; height: var(--tabs-h);
    justify-content: space-around; align-items: stretch; padding: 4px 6px; border-top: 1px solid var(--hair); background: var(--glass-panel-held);
  }
  .tabs > a, .tabs > details > summary { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 4px 2px; border-radius: var(--r-2); color: var(--ink-3); font-size: 11.5px; font-weight: 600; min-height: 44px; }
  .tabs > a, .tabs > details { flex: 1; min-width: 0; }
  .tabs > a:hover { text-decoration: none; }
  .tabs .ic { width: 24px; height: 24px; }
  .tabs > a.on, .tabs > details > summary.on, .tabs > details[open] > summary { color: var(--azure-deep); }
  /* More: a sheet that slides up over the page and lists every section */
  .more-panel { display: block; position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + var(--status-h) + env(safe-area-inset-bottom)); z-index: 32;
    max-height: calc(100dvh - var(--tabs-h) - var(--status-h) - 48px); overflow-y: auto; overscroll-behavior: contain;
    background: var(--glass-panel-held); border-top: 1px solid var(--hair); border-radius: var(--r-3) var(--r-3) 0 0; box-shadow: 0 -18px 40px -20px rgba(10,40,60,.45);
    padding: 6px var(--sp-4) var(--sp-4); }
  .more-scrim { position: fixed; inset: 0; z-index: 30; background: var(--scrim); }
  .more-panel .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--hair-strong); margin: 4px auto 10px; }
  .more-panel .treehead { padding-top: 10px; }
  .more-panel .tree a { min-height: 44px; font-size: var(--fs-base); }
  .more-panel .side-foot { margin-top: var(--sp-3); padding-top: var(--sp-3); }
  .more-panel .theme-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 10px var(--sp-2) 0; font-size: var(--fs-sm); color: var(--ink-2); }

  h1 { font-size: var(--fs-xl); }
  .grid-4, .grid-3, .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .grid-2, .two { grid-template-columns: minmax(0, 1fr); }
  .stat-tile, .stat { padding: 12px 14px; }
  .stat-tile .value, .stat .v { font-size: var(--fs-xl); }
  .card-pad, .card-header, .row, .cert-row { padding-left: 14px; padding-right: 14px; }
  .card-header { flex-wrap: wrap; }
  .field-row { flex-direction: column; align-items: flex-start; gap: 6px; }
  .field-row-control { width: 100%; }
  .row { flex-wrap: wrap; }
  .row-main { flex-basis: 60%; }
  .row-main .row-title, .row-main .row-sub { white-space: normal; overflow: visible; word-break: break-word; }
  .row-meta { flex-wrap: wrap; }
  .relay-select { max-width: none; width: 100%; }
  .input, .btn { min-height: 44px; }
  .btn-sm, .btn.sm { min-height: 38px; }
  table { display: block; overflow-x: auto; }
  .dns-row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: var(--sp-3) 14px; }
  .dns-row .dns-status-mobile { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
  .domain-head, .mb-head { flex-wrap: wrap; align-items: flex-start; }
  .domain-head .topbar-spacer { flex-basis: 100%; height: 0; }
  .domain-head > a.btn, .domain-head > button { width: 100%; }
  .mb-head h2 { font-size: var(--fs-lg) !important; overflow-wrap: anywhere; }
  .toast { bottom: calc(var(--tabs-h) + var(--status-h) + var(--sp-3) + env(safe-area-inset-bottom)); left: 14px; right: 14px; transform: none; }
  .palette-box { margin-top: 12px; max-height: calc(100vh - 24px); }
  .palette-foot { display: none; }
  .palette-label { max-width: none; white-space: normal; }
  .palette-item { flex-direction: column; gap: 2px; }
  .help-grid { grid-template-columns: auto 1fr; }

  .greet h1 { font-size: var(--fs-2xl); }
  .greet .acts { margin-left: 0; }
  .dash-top { grid-template-columns: minmax(0, 1fr); }
  .health-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .health-grid > a, .health-grid > div { padding: 10px 14px; }

  /* inbox: list and reading pane are two screens; the page scrolls as a whole */
  .inbox-body { display: block; height: auto; margin: calc(-1 * var(--sp-4)) -14px 0; }
  .thread-col { width: 100%; border-right: 0; overflow: visible; }
  .thread-col-head { padding: var(--sp-2) 14px 0; }
  .thread-scroll { overflow: visible; padding: var(--sp-2) 8px var(--sp-4); }
  .reading-pane { display: none; background: none; }
  .inbox-body.has-thread .thread-col { display: none; }
  .inbox-body.has-thread .reading-pane { display: flex; }
  .reading-head { padding: 12px 14px; }
  .reading-head .thread-actions { display: none; }
  .reading-scroll { padding: 12px 10px; overflow: visible; flex: none; }
  .msg-head, .msg-body { padding-left: 14px; padding-right: 14px; }
  .reply-box { padding: 8px 10px 14px; }
  .crm-strip, #ai-summary { margin-left: 10px; margin-right: 10px; }
  .thread-actions-mobile { display: block; position: sticky; bottom: calc(var(--tabs-h) + var(--status-h) + env(safe-area-inset-bottom)); z-index: 5; background: var(--glass-panel-held); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
  .thread-actions-mobile .thread-actions { justify-content: space-around; padding: 4px var(--sp-2); flex-wrap: nowrap; overflow-x: auto; }
  .thread-actions .btn, .thread-actions summary.btn { min-height: 44px; padding: 0 10px; }
  .thread-actions .when-pop { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabs-h) + var(--status-h) + 64px); top: auto; }
  .attach-chip .attach-name { max-width: 140px; }

  /* compose: the action bar stays in thumb reach above the tab bar */
  .compose-grid { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .compose-grid > span { text-align: left; margin-top: 6px; }
  .compose-actions { bottom: calc(var(--tabs-h) + var(--status-h) + env(safe-area-inset-bottom)); margin-left: -14px; margin-right: -14px; padding: 8px 14px; border-radius: 0; }
  .compose-actions .btn { min-height: 44px; }
  .compose-actions .when-pop { position: fixed; left: 12px; right: 12px; bottom: calc(var(--tabs-h) + var(--status-h) + 70px); top: auto; }
  .compose-actions .extra { display: none; }

  /* pipeline: a list grouped by stage; empty stages fold away */
  .board-wrap::after { display: none; }
  .crm-board { grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; scroll-snap-type: none; }
  .crm-col { min-height: 0; }
  .crm-col.empty { padding: 0 8px; }
  .crm-col.empty .crm-col-head { padding: 8px; }
  .crm-col.empty .cards, .crm-col.empty .drop { display: none; }
}
@media (min-width: 900px) { .more-panel, .more-scrim, .tabs { display: none !important; } }
/* phone chrome is opaque: without backdrop blur, translucent bars let rows show through */
@media (max-width: 899px) {
  .tabs, .status, .more-panel, .thread-actions-mobile, .compose-actions, .topbar { background: linear-gradient(var(--glass-panel-held), var(--glass-panel-held)), var(--bg-3); }
}


/* ============================================================== reduced */
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) .btn:hover::after { transition: none; transform: translateX(-120%); }
  :root:not([data-motion="full"]) .deal:hover { transform: none; }
}
:root[data-motion="reduce"] .btn:hover::after { transition: none; transform: translateX(-120%); }
:root[data-motion="reduce"] .deal:hover { transform: none; }

/* ---- page-level additions (inbox account picker, compose attach) ---- */
.m-account { display: none; }
.compose-sheet .attach-field .attach-btn { display: none; }
.compose-grid > label { color: var(--ink-3); font-size: var(--fs-sm); text-align: right; }
.track-opt > span:first-of-type { font-weight: 500; }
@media (max-width: 899px) {
  .m-account { display: block; margin-bottom: var(--sp-2); }
  .compose-grid > label { text-align: left; margin-top: 6px; }
}
.grow { flex: 1; min-width: 0; }
.sidebar-section-label { font-weight: 600; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-top: var(--sp-2); }

/* Password fields: show/hide eye (password.js) and messages under a field. */
.pw-wrap { position: relative; display: block; }
.pw-wrap > .input { width: 100%; padding-right: 46px; }
.pw-eye { position: absolute; top: 0; right: 0; bottom: 0; width: 44px; display: grid; place-items: center;
  background: none; border: 0; color: var(--ink-3); cursor: pointer; border-radius: 0 10px 10px 0; touch-action: manipulation; }
.pw-eye:hover, .pw-eye.on { color: var(--ink); }
.pw-eye:focus-visible { outline: 2px solid var(--azure); outline-offset: -2px; }
.pw-eye .pw-slash { display: none; }
.pw-eye.on .pw-slash { display: inline; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field-error { color: var(--bad); font-size: 13px; line-height: 1.4; }
.field-error:empty { display: none; }
.input[aria-invalid="true"] { border-color: var(--bad); }
