/* Layout: a highway-sign green rail on the left (the name sits on a white-bordered sign plate),
   a plain work sheet on the right built from rows, not cards. Km-stone yellow marks what is due. */
:root {
  --bg: #EEF1ED;
  --sheet: #FFFFFF;
  --sheet-2: #F6F8F5;
  --line: #D2D9D0;
  --line-strong: #A9B4A7;
  --ink: #121813;
  --ink-2: #333D35;
  --ink-3: #56625A;
  --sign: #0A5636;
  --sign-hi: #0E6B44;
  --sign-ink: #FFFFFF;
  --accent: #0A6B42;
  --accent-hi: #08583A;
  --accent-ink: #FFFFFF;
  --accent-soft: #E0F0E6;
  --stone: #F3C300;
  --stone-ink: #211A00;
  --bad: #B42318;
  --bad-bg: #FCEAE8;
  --warn: #7A5000;
  --warn-bg: #FFF3C9;
  --ok: #11683F;
  --ok-bg: #DFF1E6;
  --info: #1B4F91;
  --info-bg: #E4ECF8;
  --keep: #0B5F63;
  --keep-bg: #DCEFEF;
  --revive: #7A4A26;
  --revive-bg: #F4E9DF;
  --mute-bg: #E9EDE8;
  --scrim: rgba(12, 24, 16, .42);
  --shadow: 0 16px 40px rgba(10, 30, 20, .22);
  --font: "DM Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 8px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1310; --sheet: #161C18; --sheet-2: #1B221D; --line: #2C362F; --line-strong: #46534A;
    --ink: #EDF2EE; --ink-2: #C9D2CA; --ink-3: #9EAAA1;
    --sign: #0A3B26; --sign-hi: #0F5034; --accent: #3DB177; --accent-hi: #52C48A; --accent-ink: #04130B; --accent-soft: #15301F;
    --bad: #FF8F80; --bad-bg: #3A1915; --warn: #F2C75A; --warn-bg: #332810; --ok: #6DD49D; --ok-bg: #142E1E;
    --info: #93BBF3; --info-bg: #16263C; --keep: #73CFD2; --keep-bg: #12302F; --revive: #E2AC80; --revive-bg: #33251A;
    --mute-bg: #222A24; --scrim: rgba(0, 0, 0, .6); --shadow: 0 16px 40px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1310; --sheet: #161C18; --sheet-2: #1B221D; --line: #2C362F; --line-strong: #46534A;
  --ink: #EDF2EE; --ink-2: #C9D2CA; --ink-3: #9EAAA1;
  --sign: #0A3B26; --sign-hi: #0F5034; --accent: #3DB177; --accent-hi: #52C48A; --accent-ink: #04130B; --accent-soft: #15301F;
  --bad: #FF8F80; --bad-bg: #3A1915; --warn: #F2C75A; --warn-bg: #332810; --ok: #6DD49D; --ok-bg: #142E1E;
  --info: #93BBF3; --info-bg: #16263C; --keep: #73CFD2; --keep-bg: #12302F; --revive: #E2AC80; --revive-bg: #33251A;
  --mute-bg: #222A24; --scrim: rgba(0, 0, 0, .6); --shadow: 0 16px 40px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.2; }
h1 { font-size: 28px; font-weight: 700; }
h2 { font-size: 21px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
.num, table, .phone { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--stone); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- frame ---------- */
.app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100%; }
.rail { background: var(--sign); color: var(--sign-ink); display: flex; flex-direction: column; gap: 18px; padding: 18px 14px; position: sticky; top: 0; height: 100vh; }
.plate { display: flex; flex-direction: column; border: 2.5px solid var(--sign-ink); border-radius: 9px; padding: 10px 12px; color: var(--sign-ink); text-decoration: none; }
.plate-name { font-size: 22px; font-weight: 700; letter-spacing: .01em; }
.plate-sub { font-size: 14px; opacity: .85; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--sign-ink); text-decoration: none; font-weight: 700; font-size: 16.5px; padding: 9px 12px; border-radius: 7px; border: 2px solid transparent; }
.nav a:hover { background: var(--sign-hi); }
.nav a.on { border-color: var(--sign-ink); background: var(--sign-hi); }
.count { font-size: 14px; font-weight: 700; min-width: 26px; text-align: center; padding: 1px 7px; border-radius: 6px; background: rgba(255, 255, 255, .16); }
.count.due { background: var(--stone); color: var(--stone-ink); }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.saved { font-size: 14px; opacity: .85; text-align: center; }
.saved.bad { opacity: 1; color: var(--stone); font-weight: 700; }
.main { min-width: 0; padding-inline: 28px; padding-block: 0 48px; }
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding-block: 16px 12px; display: flex; gap: 12px; align-items: center; }
.search { position: relative; flex: 1; max-width: 620px; }
.search input { width: 100%; padding: 11px 14px; border: 1.5px solid var(--line-strong); border-radius: var(--r); background: var(--sheet); font-size: 16px; }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); background: var(--sheet); border: 1.5px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--shadow); max-height: 60vh; overflow: auto; z-index: 20; }
.results button { display: flex; width: 100%; text-align: left; gap: 10px; justify-content: space-between; padding: 10px 14px; border: 0; background: none; cursor: pointer; border-bottom: 1px solid var(--line); }
.results button:hover, .results button.on { background: var(--accent-soft); }
.view { display: flex; flex-direction: column; gap: 22px; }

/* ---------- common ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: 7px; border: 1.5px solid var(--line-strong); background: var(--sheet); font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--ink-3); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn-onsign { background: var(--sign-ink); color: var(--sign); border-color: var(--sign-ink); font-size: 16px; padding: 10px 14px; }
.btn-danger { color: var(--bad); }
.btn-sm { padding: 5px 10px; font-size: 14px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--ink-3); }
.small { font-size: 14px; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; font-weight: 700; padding: 2px 9px; border-radius: 6px; white-space: nowrap; background: var(--mute-bg); color: var(--ink-2); }
.t-money { background: var(--ok-bg); color: var(--ok); }
.t-grow, .t-info { background: var(--info-bg); color: var(--info); }
.t-keep { background: var(--keep-bg); color: var(--keep); }
.t-revive, .t-warn { background: var(--warn-bg); color: var(--warn); }
.t-ok, .t-won { background: var(--ok-bg); color: var(--ok); }
.t-bad { background: var(--bad-bg); color: var(--bad); }
.t-mute { background: var(--mute-bg); color: var(--ink-3); }
.t-stone { background: var(--stone); color: var(--stone-ink); }
.sheet { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.head p { margin: 4px 0 0; color: var(--ink-2); font-size: 17px; }
.empty { padding: 28px; text-align: center; color: var(--ink-2); }
.empty h2 { margin-bottom: 6px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------- Today ---------- */
.summary { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 17px; color: var(--ink-2); }
.summary b { color: var(--ink); }
.progress { display: flex; align-items: center; gap: 12px; }
.bar { height: 10px; flex: 1; min-width: 120px; max-width: 320px; background: var(--mute-bg); border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.block { display: flex; flex-direction: column; gap: 8px; }
.block-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.block-head .muted { font-size: 15px; }
.rows { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.item { display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; gap: 0 14px; align-items: center; padding: 12px 14px 12px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item .stripe { align-self: stretch; border-radius: 0 3px 3px 0; background: var(--line); }
.item.g-money .stripe { background: var(--ok); }
.item.g-grow .stripe { background: var(--info); }
.item.g-keep .stripe { background: var(--keep); }
.item.g-revive .stripe { background: var(--revive); }
.item-main { min-width: 0; display: flex; flex-direction: column; gap: 3px; cursor: pointer; }
.item-line { display: flex; align-items: baseline; gap: 6px 10px; flex-wrap: wrap; }
.item-name { font-size: 17.5px; font-weight: 700; color: var(--ink); }
.item-main:hover .item-name { text-decoration: underline; text-underline-offset: 3px; }
.item-sub { color: var(--ink-2); font-size: 15px; }
.item-note { color: var(--ink-2); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-side { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.item .phone { font-weight: 700; font-size: 16px; }
.late { color: var(--bad); font-weight: 700; }
.timechip { font-weight: 700; font-size: 15px; padding: 2px 9px; border-radius: 6px; background: var(--stone); color: var(--stone-ink); }
.overload { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; border-radius: var(--r); background: var(--warn-bg); color: var(--ink); border: 1px solid var(--line); }
.done-list { padding: 4px 16px 10px; color: var(--ink-2); }
.done-list li { padding: 3px 0; }

/* ---------- Contacts table ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters select, .filters input { padding: 7px 10px; border: 1.5px solid var(--line-strong); border-radius: 7px; background: var(--sheet); font-size: 15px; }
.table-wrap { overflow-x: auto; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); }
table.grid { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.grid th { text-align: left; font-size: 14px; font-weight: 700; color: var(--ink-2); padding: 10px 12px; border-bottom: 1.5px solid var(--line-strong); white-space: nowrap; background: var(--sheet-2); position: sticky; top: 0; }
.grid th[data-sort] { cursor: pointer; }
.grid th[data-sort]:hover { color: var(--ink); }
.grid td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid td.phone, .grid td.num { white-space: nowrap; }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover { background: var(--sheet-2); }
.grid tr.sel { background: var(--accent-soft); }
.grid td.chk, .grid th.chk { width: 36px; padding-right: 0; }
.grid input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.bulk { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-radius: var(--r); background: var(--accent-soft); }

/* ---------- Pipeline ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--sheet-2); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; min-height: 200px; }
.col.over { outline: 3px dashed var(--accent); outline-offset: -3px; }
.col-head { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.col-head b { font-size: 16px; }
.col-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; max-height: 70vh; }
.card { background: var(--sheet); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; cursor: grab; display: flex; flex-direction: column; gap: 2px; }
.card:hover { border-color: var(--line-strong); }
.card b { font-size: 15.5px; overflow-wrap: anywhere; }
.card .small { color: var(--ink-2); }

/* ---------- Drawer ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 30; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--sheet); z-index: 31; box-shadow: var(--shadow); overflow-y: auto; padding: 0 24px 40px; display: flex; flex-direction: column; gap: 18px; }
.d-top { position: sticky; top: 0; background: var(--sheet); padding: 18px 0 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; z-index: 2; }
.d-title { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.d-title h2 { font-size: 25px; }
.d-tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.d-phone { display: flex; gap: 10px 16px; align-items: center; flex-wrap: wrap; font-size: 20px; font-weight: 700; }
.nextbox { border: 1.5px solid var(--line-strong); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.nextbox.due { border-color: var(--stone); background: var(--warn-bg); }
.nextbox.late { border-color: var(--bad); background: var(--bad-bg); }
.nextbox .big { font-size: 19px; font-weight: 700; }
.playbook { border-left: 4px solid var(--accent); padding: 4px 0 4px 14px; display: flex; flex-direction: column; gap: 8px; }
.playbook p { margin: 0; }
.playbook .lbl { font-weight: 700; }
.script { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.script li { padding: 8px 12px; background: var(--sheet-2); border-radius: 7px; border: 1px solid var(--line); }
.script b { display: block; font-size: 14px; color: var(--ink-3); }
details > summary { cursor: pointer; font-weight: 700; color: var(--accent); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 14px; color: var(--ink-3); font-weight: 700; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { padding: 12px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.timeline .when { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14.5px; color: var(--ink-3); }
.timeline .text { white-space: pre-wrap; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: 12px; padding: 0; width: min(760px, calc(100% - 24px)); max-height: calc(100% - 32px); background: var(--sheet); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: var(--scrim); }
dialog form { display: flex; flex-direction: column; gap: 16px; padding: 22px 24px; }
.dlg-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; position: sticky; bottom: -22px; background: var(--sheet); padding-block: 12px; margin-bottom: -10px; border-top: 1px solid var(--line); }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 14.5px; font-weight: 700; color: var(--ink-2); }
.field input, .field select, .field textarea { padding: 9px 11px; border: 1.5px solid var(--line-strong); border-radius: 7px; background: var(--sheet); font-size: 16px; width: 100%; }
.field textarea { min-height: 96px; resize: vertical; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 14px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { cursor: pointer; position: relative; }
.seg input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 7px 13px; border-radius: 7px; border: 1.5px solid var(--line-strong); font-weight: 700; font-size: 15px; background: var(--sheet); }
.seg input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.seg input:focus-visible + span { outline: 3px solid var(--stone); outline-offset: 2px; }
.seg.small span { padding: 4px 10px; font-size: 14px; }
.callnum { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; padding: 12px 16px; background: var(--sheet-2); border: 1px solid var(--line); border-radius: var(--r); }
.callnum .phone { font-size: 30px; font-weight: 700; letter-spacing: .02em; }
.say { padding: 10px 14px; border-radius: 7px; background: var(--info-bg); color: var(--ink); font-size: 15.5px; }
.say b { color: var(--info); }
.hint { padding: 10px 14px; border-radius: 7px; background: var(--accent-soft); font-size: 15.5px; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px 12px; }
.checks label { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.checks input { width: 17px; height: 17px; accent-color: var(--accent); }
.tpl { width: 100%; min-height: 220px; padding: 12px; border: 1.5px solid var(--line-strong); border-radius: 7px; background: var(--sheet); font-size: 16px; line-height: 1.5; }

/* ---------- Playbook / Insights / Import ---------- */
.tactics { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.tactic { padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.tactic p { margin: 0; color: var(--ink-2); }
.tactic .app-use { color: var(--ink); font-size: 15px; padding-top: 6px; border-top: 1px dashed var(--line); }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.panel { background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.tplcard { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.tplcard pre { margin: 0; white-space: pre-wrap; font: inherit; font-size: 15px; color: var(--ink-2); }
.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.stat { padding: 14px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: -1px; display: flex; flex-direction: column; gap: 2px; }
.stat .v { font-size: 30px; font-weight: 700; line-height: 1.1; }
.stat .k { font-size: 14.5px; color: var(--ink-2); font-weight: 500; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(120px, 210px) minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 15px; }
.hbar .track { height: 12px; background: var(--mute-bg); border-radius: 4px; }
.hbar .track i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 3px; }
.hbar .n { text-align: right; font-weight: 700; }
.drop { border: 2px dashed var(--line-strong); border-radius: var(--r); padding: 36px 20px; text-align: center; background: var(--sheet); display: flex; flex-direction: column; gap: 10px; align-items: center; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.mapgrid select { padding: 6px 8px; border: 1.5px solid var(--line-strong); border-radius: 6px; background: var(--sheet); font-size: 15px; }
.sample { color: var(--ink-3); font-size: 14px; max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- toasts & alarm ---------- */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px; font-weight: 500; box-shadow: var(--shadow); max-width: min(560px, calc(100vw - 32px)); }
.toast.bad { background: var(--bad); color: #fff; }
.alarm { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; border-radius: var(--r); background: var(--stone); color: var(--stone-ink); font-weight: 700; font-size: 17px; }
.alarm .btn { border-color: var(--stone-ink); }

@media (max-width: 1100px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { min-width: 0; position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 16px; }
  .plate { padding: 4px 10px; }
  .plate-name { font-size: 18px; }
  .plate-sub { display: none; }
  .nav { flex-direction: row; overflow-x: auto; flex: 1 1 100%; min-width: 0; order: 3; }
  .nav a { padding: 6px 10px; font-size: 15px; white-space: nowrap; }
  .rail-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; }
  .saved { display: none; }
  .main { padding-inline: 16px; }
  .item { grid-template-columns: 6px minmax(0, 1fr); }
  .item-side { grid-column: 2; justify-content: flex-start; padding-top: 8px; }
  .facts { grid-template-columns: 1fr; }
  .drawer { padding-inline: 16px; }
  .hbar { grid-template-columns: minmax(90px, 140px) minmax(0, 1fr) 40px; }
}
@media (max-width: 520px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: no-preference) {
  .drawer:not([hidden]) { animation: slide .18s ease-out; }
  @keyframes slide { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }
}

/* ---------- sign-in, account strip ---------- */
.gate { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 32px 16px; background: var(--sign); }
.gate-card { width: min(420px, 100%); background: var(--sheet); border-radius: 12px; padding: 26px 26px 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.gate-card h1 { font-size: 24px; }
.gate-card p { margin: 0; }
.gate-card .btn-primary { padding: 11px 16px; font-size: 16px; }
.gate-plate { background: var(--sign); color: var(--sign-ink); border-color: var(--sign); outline: 2.5px solid var(--sign-ink); outline-offset: -7px; padding: 14px 16px; align-self: flex-start; }
.gate-msg { padding: 9px 12px; border-radius: 7px; background: var(--accent-soft); font-size: 15px; }
.gate-msg.bad { background: var(--bad-bg); color: var(--bad); font-weight: 700; }
.whoami { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 14.5px; padding: 4px 2px; border-top: 1px solid rgba(255, 255, 255, .25); padding-top: 10px; }
.link-onsign { background: none; border: 0; padding: 0; color: var(--sign-ink); font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.today-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.grid tr.warnrow td { background: var(--warn-bg); }
@media (max-width: 900px) {
  .whoami { border-top: 0; padding-top: 4px; gap: 10px; }
  .today-side { align-items: flex-start; }
}
