/* Rob's crypto site: one stylesheet for every page. Redesigned 2026-10-12 as a portfolio app (sidebar, dashboard,
   charts) in place of the first version, which followed the workbook's tabs.
   Rules: one accent color, grays carry the page, light and dark follow the device, a system font, base 18 px, pill
   buttons, no horizontal scroll on the phone. Chart colors are the dataviz reference palette, validated for both modes
   on the card surface (#ffffff light, #181c22 dark). Style guide: Cosmos reference/frontend-style.md. */
:root{
  color-scheme:light dark;
  --plane:#f3f4f6; --bg:#ffffff; --surface:#f5f6f8; --surface-2:#eaecf0; --line:#e2e5ea; --line-2:#d3d7de;
  --ink:#14171a; --ink-2:#3d434b; --muted:#68707a;
  --accent:#2160c4; --accent-ink:#ffffff; --accent-soft:#e8f0fc;
  --up:#13803a; --up-soft:#e4f4ea; --down:#c4321f; --down-soft:#fcebe8;
  --flag:#8a5a00; --flag-soft:#fdf3d8;
  --focus:#2160c4;
  --shadow:0 1px 2px rgba(16,24,40,.05),0 2px 6px rgba(16,24,40,.04);
  --radius:16px; --radius-s:10px; --pill:999px;
  --font:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  /* Chart series: slots 1 to 7 follow a coin (by money put in), 0 is "Other". */
  --s1:#2a78d6; --s2:#eb6834; --s3:#1baf7a; --s4:#eda100; --s5:#e87ba4; --s6:#008300; --s7:#4a3aa7; --s0:#9aa1ab;
  --grid:#eceef1; --axis:#c9ced6;
  /* The workbook's color key (kept for the admin screens' legend). */
  --key-green:#2e9e4f; --key-red:#d63c3c; --key-purple:#8a5cf0; --key-orange:#ee8a00; --key-blue:#2f7de1; --key-gray:#8a929c;
  --side-w:248px;
}
/* Dark: follows the device unless the account menu picks Light or Dark (data-theme on <html>). */
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --plane:#0e1115; --bg:#181c22; --surface:#1e232a; --surface-2:#262c35; --line:#2a3039; --line-2:#363d48;
    --ink:#eceff3; --ink-2:#c5cbd3; --muted:#98a1ac;
    --accent:#7eaaf5; --accent-ink:#0c1a30; --accent-soft:#1c2a40;
    --up:#4cc26b; --up-soft:#15301f; --down:#f47067; --down-soft:#3a1d1b;
    --flag:#e3b341; --flag-soft:#3a2f12;
    --focus:#7eaaf5;
    --shadow:0 1px 2px rgba(0,0,0,.3);
    --s1:#3987e5; --s2:#d95926; --s3:#199e70; --s4:#c98500; --s5:#d55181; --s6:#008300; --s7:#9085e9; --s0:#6b7380;
    --grid:#242a32; --axis:#3a414c;
    --key-green:#4cc26b; --key-red:#f26b6b; --key-purple:#a98bfa; --key-orange:#ffa94d; --key-blue:#6aa8ff; --key-gray:#9aa3ae;
  }
}
:root[data-theme="dark"]{
    --plane:#0e1115; --bg:#181c22; --surface:#1e232a; --surface-2:#262c35; --line:#2a3039; --line-2:#363d48;
    --ink:#eceff3; --ink-2:#c5cbd3; --muted:#98a1ac;
    --accent:#7eaaf5; --accent-ink:#0c1a30; --accent-soft:#1c2a40;
    --up:#4cc26b; --up-soft:#15301f; --down:#f47067; --down-soft:#3a1d1b;
    --flag:#e3b341; --flag-soft:#3a2f12;
    --focus:#7eaaf5;
    --shadow:0 1px 2px rgba(0,0,0,.3);
    --s1:#3987e5; --s2:#d95926; --s3:#199e70; --s4:#c98500; --s5:#d55181; --s6:#008300; --s7:#9085e9; --s0:#6b7380;
    --grid:#242a32; --axis:#3a414c;
    --key-green:#4cc26b; --key-red:#f26b6b; --key-purple:#a98bfa; --key-orange:#ffa94d; --key-blue:#6aa8ff; --key-gray:#9aa3ae;
}
:root[data-theme="light"]{color-scheme:light} :root[data-theme="dark"]{color-scheme:dark}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--plane);color:var(--ink);font-family:var(--font);font-size:18px;line-height:1.5}
a{color:var(--accent)}
h1,h2,h3{line-height:1.25;margin:0 0 .5em}
h1{font-size:1.55rem;letter-spacing:-.01em} h2{font-size:1.1rem} h3{font-size:1rem}
p{margin:0 0 1em}
[hidden]{display:none!important}
:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.num{font-variant-numeric:tabular-nums}
.muted,.note{color:var(--muted)} .note{font-size:.9rem}
.up{color:var(--up)} .down{color:var(--down)}
.loading{color:var(--muted);padding:24px 0}

/* ---------- The app shell: a sidebar on a wide screen, a top bar and bottom tabs on a phone ---------- */
.wrap{max-width:1180px;margin:0 auto;padding:16px 16px 96px}
.wrap.narrow{max-width:520px}
@media (min-width:640px){.wrap{padding:24px 24px 96px}}
body.app .wrap{padding-top:20px}
@media (min-width:1000px){body.app .wrap{margin-left:calc(var(--side-w) + max(0px,(100vw - var(--side-w) - 1180px)/2));padding:32px 32px 64px}}

.side{display:none}
@media (min-width:1000px){
  .side{display:flex;flex-direction:column;position:fixed;inset:0 auto 0 0;width:var(--side-w);background:var(--bg);border-right:1px solid var(--line);padding:20px 14px;z-index:20}
}
.brand{display:flex;align-items:center;gap:10px;font-weight:700;font-size:1.05rem;color:var(--ink);text-decoration:none;padding:4px 10px 18px}
.brand .logo{width:30px;height:30px;border-radius:9px;background:var(--accent);display:grid;place-items:center;color:var(--accent-ink)}
.side nav{display:flex;flex-direction:column;gap:2px}
.side nav a{display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:var(--radius-s);color:var(--ink-2);text-decoration:none;font-size:.95rem;font-weight:500}
.side nav a:hover{background:var(--surface)}
.side nav a[aria-current="page"]{background:var(--accent-soft);color:var(--accent);font-weight:600}
.side nav .navsep{font-size:.75rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);padding:18px 12px 6px}
.ico{width:20px;height:20px;flex:none;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:10px;padding:10px 16px;background:color-mix(in srgb,var(--bg) 92%,transparent);border-bottom:1px solid var(--line);backdrop-filter:saturate(1.2)}
.topbar .brand{padding:0;margin-right:auto}
@media (min-width:1000px){.topbar{display:none}}
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:20;display:grid;grid-auto-flow:column;grid-auto-columns:1fr;background:var(--bg);border-top:1px solid var(--line);padding:6px 4px calc(6px + env(safe-area-inset-bottom))}
.tabs a{display:flex;flex-direction:column;align-items:center;gap:2px;padding:4px 2px;color:var(--muted);text-decoration:none;font-size:.7rem;font-weight:600}
.tabs a[aria-current="page"]{color:var(--accent)}
@media (min-width:1000px){.tabs{display:none}}

.avatar{display:inline-grid;place-items:center;width:34px;height:34px;border-radius:50%;background:var(--surface-2);color:var(--ink-2);font-size:.8rem;font-weight:700;flex:none}

/* ---------- Page header ---------- */
.page-head{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px 16px;margin:0 0 18px}
.page-head h1{margin:0}
.page-head .sub{color:var(--muted);font-size:.95rem;margin:2px 0 0}
.page-head .actions{margin-left:auto;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.back{display:inline-flex;align-items:center;gap:6px;color:var(--muted);text-decoration:none;font-size:.9rem;margin-bottom:10px}

/* ---------- Cards and grids ---------- */
.card{background:var(--bg);border:1px solid var(--line);border-radius:var(--radius);padding:18px;box-shadow:var(--shadow);min-width:0}
.card + .card{margin-top:16px}
.grid .card + .card{margin-top:0}
.card-head{display:flex;align-items:center;gap:8px 12px;flex-wrap:wrap;margin:0 0 14px}
.card-head h2{margin:0;font-size:1rem}
.card-head .more{margin-left:auto;font-size:.9rem;text-decoration:none;font-weight:600}
.grid{display:grid;gap:16px}
.grid + .grid,.grid + .card,.card + .grid{margin-top:16px}
@media (min-width:900px){.g-2{grid-template-columns:1fr 1fr}.g-3-2{grid-template-columns:3fr 2fr}.g-2-1{grid-template-columns:2fr 1fr}}
.tiles{display:grid;gap:12px;grid-template-columns:1fr 1fr}
@media (min-width:900px){.tiles{grid-template-columns:repeat(4,1fr)}}
.tile{background:var(--bg);border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px;box-shadow:var(--shadow);min-width:0}
.tile .label{font-size:.82rem;color:var(--muted);margin:0 0 4px}
.tile .value{font-size:1.3rem;font-weight:650;line-height:1.2;overflow-wrap:anywhere}
.tile .delta{font-size:.85rem;margin-top:4px}

/* ---------- Buttons, pills, forms ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:8px 18px;border-radius:var(--pill);
  border:1px solid var(--line-2);background:var(--bg);color:var(--ink);font:inherit;font-size:.95rem;font-weight:600;text-decoration:none;cursor:pointer}
.btn:hover{background:var(--surface)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.btn.primary:hover{filter:brightness(1.05)}
.btn.danger{color:var(--down);border-color:color-mix(in srgb,var(--down) 40%,var(--line))}
.btn.small{min-height:34px;padding:4px 12px;font-size:.85rem}
.btn.ghost{border-color:transparent;background:transparent}
.btn:disabled{opacity:.6;cursor:default}
.iconbtn{display:inline-grid;place-items:center;width:40px;height:40px;border-radius:50%;border:1px solid transparent;background:transparent;color:var(--ink-2);cursor:pointer}
.iconbtn:hover{background:var(--surface)}
.pillrow,.seg{display:flex;flex-wrap:wrap;gap:6px}
.pill{border:1px solid var(--line-2);background:var(--bg);color:var(--ink-2);border-radius:var(--pill);padding:5px 12px;font:inherit;font-size:.85rem;font-weight:600;cursor:pointer;min-height:34px}
.pill[aria-pressed="true"]{background:var(--ink);border-color:var(--ink);color:var(--bg)}
.seg{background:var(--surface);border-radius:var(--pill);padding:3px;gap:2px;flex-wrap:nowrap}
.seg .pill{border:0;background:transparent;min-height:30px;padding:3px 10px;font-size:.8rem;color:var(--muted)}
.seg .pill[aria-pressed="true"]{background:var(--bg);color:var(--ink);box-shadow:var(--shadow)}
.field{display:block;margin-bottom:14px}
.field span{display:block;font-size:.85rem;font-weight:600;color:var(--ink-2);margin-bottom:4px}
.field input,.field select,.field textarea,.input{width:100%;font:inherit;font-size:1rem;padding:10px 12px;border:1px solid var(--line-2);border-radius:var(--radius-s);background:var(--bg);color:var(--ink)}
textarea.input{min-height:96px;resize:vertical;line-height:1.45}
.check{display:flex;align-items:center;gap:8px;font-size:.9rem;color:var(--ink-2);margin:4px 0 18px}
.check input{width:20px;height:20px}
.search{position:relative;flex:1 1 260px}
.search input{width:100%;font:inherit;font-size:1rem;padding:10px 14px 10px 40px;border:1px solid var(--line-2);border-radius:var(--pill);background:var(--bg);color:var(--ink)}
.search .ico{position:absolute;left:14px;top:50%;transform:translateY(-50%);color:var(--muted)}
select.pill{appearance:auto;padding-right:8px}

/* ---------- Messages and chips ---------- */
.msg{border-radius:var(--radius-s);padding:10px 12px;font-size:.95rem;margin:0 0 14px}
.msg.err{background:var(--down-soft);color:var(--down)}
.msg.ok{background:var(--up-soft);color:var(--up)}
.msg.warn{background:var(--flag-soft);color:var(--flag)}
.flag{display:inline-block;background:var(--flag-soft);color:var(--flag);border-radius:var(--pill);padding:1px 8px;font-size:.75rem;font-weight:700;vertical-align:middle}
.chip{display:inline-flex;align-items:center;gap:6px;border-radius:var(--pill);padding:2px 10px;font-size:.78rem;font-weight:650;background:var(--surface-2);color:var(--ink-2);white-space:nowrap}
.chip.tax-yes{background:var(--down-soft);color:var(--down)}
.chip.tax-no{background:var(--surface-2);color:var(--muted)}
.chip.tax-check{background:var(--flag-soft);color:var(--flag)}
.badge-up,.badge-down{display:inline-flex;align-items:center;gap:4px;border-radius:var(--pill);padding:2px 10px;font-size:.85rem;font-weight:650}
.badge-up{background:var(--up-soft);color:var(--up)} .badge-down{background:var(--down-soft);color:var(--down)}

/* ---------- Dashboard ---------- */
.hero{display:flex;flex-wrap:wrap;align-items:flex-end;gap:10px 24px}
.hero .label{font-size:.9rem;color:var(--muted);margin:0 0 2px;font-weight:600}
.hero .big{font-size:2.6rem;font-weight:700;letter-spacing:-.02em;line-height:1.05}
@media (min-width:640px){.hero .big{font-size:3.4rem}}
.hero .deltas{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:8px}
.hero .deltas .muted{font-size:.85rem}
.asof{display:flex;flex-wrap:wrap;align-items:center;gap:8px;color:var(--muted);font-size:.85rem;margin-left:auto}
.chart{position:relative;width:100%;touch-action:pan-y}
.chart svg{display:block;width:100%;overflow:visible}
.chart .tip{position:absolute;pointer-events:none;background:var(--bg);border:1px solid var(--line-2);border-radius:var(--radius-s);box-shadow:0 4px 14px rgba(0,0,0,.12);padding:8px 10px;font-size:.82rem;line-height:1.35;white-space:nowrap;z-index:5}
.chart .tip b{display:block;font-size:.8rem;color:var(--muted);font-weight:600;margin-bottom:2px}
.chart .tip .row{display:flex;align-items:center;gap:8px;justify-content:space-between}
.chart .tip .k{display:inline-flex;align-items:center;gap:6px;color:var(--ink-2)}
.chart .empty{display:grid;place-items:center;color:var(--muted);font-size:.9rem;background:var(--surface);border-radius:var(--radius-s)}
.chart text{fill:var(--muted);font-size:12px;font-family:var(--font)}
.key{display:flex;flex-wrap:wrap;gap:6px 16px;font-size:.85rem;color:var(--ink-2);margin:10px 0 0}
.key span{display:inline-flex;align-items:center;gap:6px}
.key i{display:inline-block;width:14px;height:3px;border-radius:2px}
.key i.dot{width:10px;height:10px;border-radius:50%}
.key i.bar{width:10px;height:10px;border-radius:3px}

/* Lists: holdings, activity, insights. One row is a link or a button. */
.list{list-style:none;margin:0;padding:0}
.list > li + li{border-top:1px solid var(--line)}
.li{display:flex;align-items:center;gap:12px;padding:12px 4px;color:var(--ink);text-decoration:none;width:100%;background:none;border:0;font:inherit;text-align:left;cursor:pointer;border-radius:var(--radius-s)}
a.li:hover,button.li:hover{background:var(--surface)}
.li .main{min-width:0;flex:1}
.li .t{font-weight:600;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.li .s{font-size:.84rem;color:var(--muted);line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.li .end{text-align:right;flex:none}
.li .end .t{font-variant-numeric:tabular-nums}
.li .end .s{font-variant-numeric:tabular-nums}
.coinav{display:inline-grid;place-items:center;width:38px;height:38px;border-radius:50%;font-size:.7rem;font-weight:800;letter-spacing:.02em;flex:none;color:#fff}
.coinav.lg{width:52px;height:52px;font-size:.85rem}
.alloc{height:6px;border-radius:3px;background:var(--surface-2);overflow:hidden;margin-top:6px}
.alloc i{display:block;height:100%;border-radius:3px}
.typeicon{display:inline-grid;place-items:center;width:38px;height:38px;border-radius:50%;flex:none}
.typeicon .ico{width:18px;height:18px}
.notemark{color:var(--muted);vertical-align:-3px;margin-left:4px}
.notemark .ico{width:15px;height:15px}

.donutwrap{display:grid;gap:16px;align-items:center}
.card{container-type:inline-size}
@container (min-width:480px){.donutwrap{grid-template-columns:190px minmax(0,1fr)}}
.donutwrap .chart{max-width:220px;margin:0 auto}
.legendlist{list-style:none;margin:0;padding:0;font-size:.9rem}
.legendlist li{display:flex;align-items:center;gap:8px;padding:5px 0}
.legendlist li + li{border-top:1px solid var(--line)}
.legendlist .sw{width:10px;height:10px;border-radius:50%;flex:none}
.legendlist .nm{flex:1;min-width:0;color:var(--ink-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.legendlist .v{font-variant-numeric:tabular-nums;font-weight:600}
.legendlist .p{font-variant-numeric:tabular-nums;color:var(--muted);width:3.6em;text-align:right}

.insight{display:flex;gap:12px;align-items:flex-start;padding:12px 4px;text-decoration:none;color:var(--ink)}
.insight + .insight{border-top:1px solid var(--line)}
.insight .ic{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;flex:none;background:var(--accent-soft);color:var(--accent)}
.insight .ic.warn{background:var(--flag-soft);color:var(--flag)}
.insight .t{font-weight:600;line-height:1.3}
.insight .s{font-size:.85rem;color:var(--muted)}

/* ---------- Transactions feed ---------- */
.toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:0 0 12px}
.filterbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.dayhead{position:sticky;top:57px;z-index:2;background:var(--bg);font-size:.8rem;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;padding:10px 4px 6px;border-bottom:1px solid var(--line)}
@media (min-width:1000px){.dayhead{top:0}}
.feed{list-style:none;margin:0;padding:0}
.feed li + li{border-top:1px solid var(--line)}
.count{margin:6px 0 10px;color:var(--muted);font-size:.9rem}
.morebox{display:flex;justify-content:center;margin:16px 0 0}

/* The detail sheet: a dialog that rises from the bottom on a phone and sits centered on a wide screen. */
dialog.sheet{border:0;padding:0;background:var(--bg);color:var(--ink);width:min(560px,100vw);max-width:100vw;max-height:88vh;border-radius:20px;box-shadow:0 20px 60px rgba(0,0,0,.3)}
dialog.sheet::backdrop{background:rgba(10,14,20,.45)}
@media (max-width:639px){dialog.sheet{margin:auto 0 0;border-radius:20px 20px 0 0;width:100vw}}
.sheet .sh-head{display:flex;align-items:center;gap:12px;padding:18px 18px 8px}
.sheet .sh-head h2{margin:0;font-size:1.1rem}
.sheet .sh-head .iconbtn{margin-left:auto}
.sheet .sh-body{padding:4px 18px 22px;overflow:auto;max-height:calc(88vh - 70px)}
.sheet .amount{font-size:1.9rem;font-weight:700;letter-spacing:-.01em;margin:4px 0 2px}
.kv{display:grid;grid-template-columns:auto 1fr;gap:8px 16px;margin:14px 0;font-size:.92rem}
.kv dt{color:var(--muted)} .kv dd{margin:0;text-align:right;overflow-wrap:anywhere}
.notebox{background:var(--surface);border-radius:var(--radius-s);padding:12px 14px;margin-top:8px;white-space:pre-wrap;font-size:.95rem}
.notebox.empty{color:var(--muted)}
.noteedit .actions{display:flex;gap:8px;justify-content:flex-end;margin-top:8px}

/* ---------- Tables (admin screens and the tax lots). Cards under 640 px. ---------- */
.table{width:100%;border-collapse:collapse;font-size:.92rem}
.table th,.table td{padding:10px 8px;border-bottom:1px solid var(--line);text-align:left;vertical-align:top}
.table th{font-size:.78rem;color:var(--muted);font-weight:600}
.table td.r,.table th.r{text-align:right}
@media (min-width:640px){.table td.r{white-space:nowrap}}
@media (max-width:639px){
  .table thead{display:none}
  .table,.table tbody,.table tr,.table td{display:block;width:100%}
  .table tr{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius-s);padding:8px 12px;margin-bottom:10px}
  .table td{border:0;padding:4px 0;display:flex;justify-content:space-between;gap:12px;text-align:right}
  .table td::before{content:attr(data-label);color:var(--muted);font-size:.85rem;text-align:left}
  .table td.title{display:block;text-align:left;font-weight:700}
  .table td.title::before{content:none}
}

/* ---------- Coin page ---------- */
.coinhead{display:flex;align-items:center;gap:14px;margin:0 0 18px}
.coinhead h1{margin:0}
.coinhead .price{font-size:1.05rem;color:var(--ink-2);font-variant-numeric:tabular-nums}
.facts{display:grid;gap:12px;grid-template-columns:1fr 1fr}
@media (min-width:900px){.facts{grid-template-columns:repeat(4,1fr)}}
.fact{background:var(--surface);border-radius:var(--radius-s);padding:12px 14px}
.fact .label{font-size:.8rem;color:var(--muted);margin:0}
.fact .value{font-size:1.15rem;font-weight:650;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.fact .value .note{display:block;font-weight:400;font-size:.8rem;line-height:1.35}
.fact.wide{grid-column:1 / -1}
/* The yellow "Cost Rob says" box. Admin can type in it. The viewer sees the value only. */
.override{background:var(--flag-soft);border:1px solid color-mix(in srgb,var(--flag) 40%,transparent);border-radius:var(--radius-s);padding:12px 14px;grid-column:1 / -1}
.override .label{font-weight:600;color:var(--flag);margin:0 0 6px}
.override form{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.override input{font:inherit;font-size:1.05rem;padding:8px 12px;border:1px solid var(--flag);border-radius:8px;background:var(--bg);color:var(--ink);width:14em;max-width:100%}
.override .value{font-size:1.15rem;font-weight:700}
details.fold{border-top:1px solid var(--line);margin-top:6px}
details.fold > summary{cursor:pointer;list-style:none;padding:12px 4px;font-weight:600;display:flex;align-items:center;gap:8px}
details.fold > summary::-webkit-details-marker{display:none}
details.fold > summary::after{content:"";margin-left:auto;width:8px;height:8px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:rotate(45deg);transition:transform .15s}
details.fold[open] > summary::after{transform:rotate(-135deg)}

/* ---------- Taxes ---------- */
.answer{font-size:1.02rem;line-height:1.55}
.yearcards{display:grid;gap:12px}
@media (min-width:700px){.yearcards{grid-template-columns:repeat(2,1fr)}}
@media (min-width:1100px){.yearcards{grid-template-columns:repeat(3,1fr)}}
.yearcard{border:1px solid var(--line);border-radius:var(--radius-s);padding:14px}
.yearcard .yr{display:flex;align-items:center;gap:8px;font-weight:700;font-size:1.1rem;margin-bottom:8px}
.yearcard .yr .chip{margin-left:auto}
.yearcard dl{display:grid;grid-template-columns:1fr auto;gap:4px 12px;margin:0;font-size:.9rem}
.yearcard dt{color:var(--muted)} .yearcard dd{margin:0;text-align:right;font-variant-numeric:tabular-nums}

/* ---------- Legend for the workbook color key (admin screens) ---------- */
.legend{display:flex;flex-wrap:wrap;gap:6px 18px;margin:0;padding:0;list-style:none;font-size:.9rem}
.legend li{display:flex;align-items:center;gap:8px}
.legend .sw{display:inline-block;width:22px;height:14px;border-radius:4px;flex:none}

/* ---------- Sign-in page ---------- */
body.auth{min-height:100dvh;display:grid;place-items:center;padding:24px 16px}
.auth-card{width:100%;max-width:420px}
.auth-card .btn.primary{width:100%}
.auth-brand{display:flex;align-items:center;gap:10px;font-weight:700;margin-bottom:18px;color:var(--ink)}
a.yearcard{display:block;color:inherit;text-decoration:none} a.yearcard:hover{border-color:var(--line-2);background:var(--surface)}
.flag{white-space:nowrap} .yearcard .yr{flex-wrap:wrap}
.page-head .actions .muted{font-size:.85rem}

/* Page rhythm (2026-10-12 fix): one rule spaces every top-level block, so a new block never touches its neighbor.
   The old pair rules (.card + .card, .grid + .grid) missed tiles, so cards and tiles touched on the Dashboard. */
#content > *{margin-top:0;margin-bottom:0}
#content > * + *{margin-top:16px}
#content > .page-head + *{margin-top:20px}
#content > .back + *{margin-top:0}
@media (min-width:900px){#content > * + *{margin-top:20px} #content > .page-head + *{margin-top:24px}}
.tiles{gap:16px}
.hero + *{margin-top:18px}
.card > .note:last-child,.card > p:last-child{margin-bottom:0}
.card > .chart + .note,.card > div + .note{margin-top:10px}

/* ---------- Notes and "Ask Steve" threads (2026-10-12) ---------- */
.navbadge{display:inline-grid;place-items:center;min-width:20px;height:20px;padding:0 6px;border-radius:var(--pill);background:var(--down);color:#fff;font-size:.72rem;font-weight:700;line-height:1}
.side nav a .navbadge{margin-left:auto}
.tabs a{position:relative}
.tabs a .navbadge{position:absolute;top:0;left:calc(50% + 6px);min-width:18px;height:18px;font-size:.66rem}
.thread{display:flex;flex-direction:column;gap:12px}
.entries,.replies{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.replies{margin:10px 0 0 18px;padding-left:12px;border-left:2px solid var(--line)}
.entry{background:var(--surface);border-radius:var(--radius-s);padding:10px 12px}
.entry.is-request{background:color-mix(in srgb,var(--flag-soft) 60%,var(--surface));border:1px solid color-mix(in srgb,var(--flag) 25%,transparent)}
.replies .entry{background:var(--bg);border:1px solid var(--line)}
.entry-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;font-size:.85rem}
.entry-head .muted{font-size:.8rem}
.avatar.sm{width:24px;height:24px;font-size:.62rem}
.entry-body{margin-top:6px;white-space:pre-wrap;font-size:.95rem;overflow-wrap:anywhere}
.kindline{font-size:.8rem;font-weight:700;color:var(--flag);margin-bottom:2px;white-space:normal}
.suggest{display:flex;align-items:center;gap:6px;margin-top:8px;font-size:.88rem;color:var(--ink-2);white-space:normal}
.suggest .ico{width:16px;height:16px;color:var(--accent)}
.entry-actions{display:flex;flex-wrap:wrap;gap:6px 12px;align-items:center;justify-content:flex-end;margin-top:8px}
.linkbtn{background:none;border:0;padding:4px 2px;font:inherit;font-size:.85rem;font-weight:600;color:var(--accent);cursor:pointer}
.linkbtn:hover{text-decoration:underline}
.chip.ask{background:var(--accent-soft);color:var(--accent)}
.chip.st-answered{background:var(--up-soft);color:var(--up)}
.composer{display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--line);padding-top:12px}
.composer textarea.input{min-height:64px}
.replyform{margin-top:10px}
.pinned{border:1px dashed var(--line-2);border-radius:var(--radius-s);padding:10px 12px}
.pinned-title{display:flex;align-items:center;gap:6px;font-size:.82rem;font-weight:700;color:var(--muted);margin-bottom:6px}
.pinned-title .ico{width:15px;height:15px}
.pinned .notebox{margin-top:0;background:transparent;padding:0}
.askbtn .ico{width:17px;height:17px}
.ask-ic{color:var(--accent);background:var(--accent-soft)}
.fieldlabel{font-size:.85rem;font-weight:600;color:var(--ink-2);margin:14px 0 6px}
.suggestrow{display:grid;gap:8px}
@media (min-width:480px){.suggestrow{grid-template-columns:1fr 1fr}}
.sheet .sent{text-align:center;padding-top:24px}
.ic-ok{width:48px;height:48px;border-radius:50%;margin:0 auto 10px;display:grid;place-items:center;background:var(--up-soft);color:var(--up)}
/* Request cards on the Requests page */
.reqlist{display:flex;flex-direction:column;gap:12px}
.reqcard{border:1px solid var(--line);border-radius:var(--radius-s);padding:12px 14px;background:var(--bg)}
.reqcard .about{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin-bottom:8px;font-weight:600}
.reqcard .about a{text-decoration:none}
.reqcard .ctx{font-size:.82rem;color:var(--muted);margin:-2px 0 8px}
.yearcard .yfoot{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:space-between;margin-top:10px;padding-top:10px;border-top:1px solid var(--line)}
.yearcard .yfoot a{font-size:.85rem;font-weight:600;text-decoration:none}
.coinhead .headask{margin-left:auto}
.li .t .chip{margin-left:6px;vertical-align:1px}
/* The note composer and the Ask Steve row are two separate blocks, so a note is never mistaken for a request. */
.composer-title{display:flex;align-items:center;gap:6px;font-size:.88rem;font-weight:700;color:var(--ink-2);margin:0}
.composer-title .ico{width:16px;height:16px;color:var(--muted)}
.composer-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 12px}
.hint{margin:0;font-size:.82rem;color:var(--muted)}
.askrow{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 16px;background:var(--accent-soft);border-radius:var(--radius-s);padding:12px 14px}
.askrow .composer-title .ico{color:var(--accent)}
.askrow .askbtn{flex:none}
/* Bottom tabs on a narrow phone: tighter labels so none wraps or spills. */
@media (max-width:420px){.tabs a{font-size:.62rem;letter-spacing:-.01em}.tabs a .ico{width:20px;height:20px}}
/* Requests kept apart from notes inside a thread panel (2026-10-12). */
.reqgroup{display:flex;flex-direction:column;gap:10px;border-top:1px solid var(--line);padding-top:12px}
.reqgroup-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
.reqgroup-head h3{margin:0;font-size:.95rem}
.reqgroup-head .more{font-size:.85rem;font-weight:600;text-decoration:none}
.side .brand{line-height:1.15;align-items:center} .side .brand .logo{flex:none}
/* Requests and the account at the top right (2026-10-12). Desktop: a bar above the page. Phone: in the top bar. */
.userbar{display:none}
@media (min-width:1000px){.userbar{display:flex;justify-content:flex-end;align-items:center;gap:10px;margin:-14px 0 6px}}
.reqpill{position:relative;display:inline-flex;align-items:center;gap:8px;height:38px;padding:0 14px;border:1px solid var(--line);border-radius:var(--pill);background:var(--bg);color:var(--ink-2);text-decoration:none;font-weight:600;font-size:.9rem}
.reqpill:hover{background:var(--surface)}
.reqpill[aria-current="page"]{background:var(--accent-soft);color:var(--accent);border-color:transparent}
.reqpill .ico{width:18px;height:18px}
.reqbtn{position:relative}
.reqbtn[aria-current="page"]{color:var(--accent)}
.reqbtn .navbadge{position:absolute;top:0;right:-2px;min-width:18px;height:18px;padding:0 5px;font-size:.66rem}
.profile{position:relative}
.profile summary{list-style:none;cursor:pointer;width:38px;height:38px}
.profile summary::-webkit-details-marker{display:none}
.profile summary:hover,.profile[open] summary{box-shadow:0 0 0 2px var(--line-2)}
.profile .menu{position:absolute;right:0;top:calc(100% + 8px);min-width:210px;background:var(--bg);border:1px solid var(--line);border-radius:var(--radius-s);box-shadow:0 10px 28px rgba(0,0,0,.14);padding:6px;z-index:40}
.profile .menu .who{padding:8px 10px 10px;border-bottom:1px solid var(--line);margin-bottom:4px}
.profile .menu .name{font-weight:600;font-size:.92rem}
.profile .menu .role{font-size:.8rem;color:var(--muted)}
.menuitem{display:flex;align-items:center;gap:10px;width:100%;padding:9px 10px;border:0;border-radius:var(--radius-s);background:transparent;color:var(--ink-2);font:inherit;font-size:.92rem;text-align:left;cursor:pointer}
.menuitem:hover{background:var(--surface)}
.menuitem .ico{width:18px;height:18px}
/* Theme picker in the account menu (2026-10-12). */
.profile .menu .themerow{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 10px;font-size:.88rem;color:var(--ink-2)}
.profile .menu .themerow .seg .pill{padding:3px 9px}
