/* SmartLeadz Command Center - design system
   Tokens and component styles taken verbatim from marketing_tracker_mockup_v2.html,
   extended only where new views required it. */
:root{
  --bg:#f4f5f7;--panel:#ffffff;--ink:#141518;--muted:#8b8f99;--muted-2:#b3b7c0;
  --line:#ececf0;--line-2:#e2e3e8;--accent:#5b5bd6;
  --green:#16a34a;--yellow:#d99e17;--orange:#e8720c;--red:#dc2626;
}
*{box-sizing:border-box;margin:0;padding:0}
body{background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,system-ui,sans-serif;-webkit-font-smoothing:antialiased;font-size:14px;line-height:1.5}
.app{display:flex;min-height:100vh}

/* ---------- sidebar ---------- */
.side{width:212px;flex:none;padding:26px 18px;border-right:1px solid var(--line);display:flex;flex-direction:column;gap:2px;position:sticky;top:0;height:100vh}
.brand{font-weight:700;font-size:17px;letter-spacing:-.01em}
.brand small{display:block;font-weight:500;font-size:11.5px;color:var(--muted);margin-top:2px}
/* Sidebar. Each tracker is a row with a small bullet; its screens nest beneath
   it and only while that tracker is open. Type is deliberately small: this is a
   map, not content. */
.nav{margin-top:26px;display:flex;flex-direction:column;gap:1px}
.nav a,.side .foot a{
  display:flex;align-items:center;gap:9px;padding:6px 10px;border-radius:7px;
  color:#4b4f59;text-decoration:none;font-weight:500;font-size:13px;line-height:1.3}
.nav a span,.side .foot a span{flex:1;min-width:0}
.nav a:hover,.side .foot a:hover{background:#f4f4f8}
.nav a.on,.side .foot a.on{background:none;color:var(--ink);font-weight:600}
.nav a.off{color:var(--muted-2);cursor:default}
.nav a.off:hover{background:none}
.nav a .soon{font-size:9.5px;color:var(--muted-2);font-weight:600;font-style:normal;letter-spacing:.04em}

/* Bullets carry the selection. Everything is grey; the row you are on turns its
   bullet accent blue. Filling the whole row read as heavy next to a nested tree,
   and made an open group look like two selected rows at once. */
.bul{width:6px;height:6px;border-radius:50%;background:#c7c9d1;flex:none;
  transition:background .14s ease}
.bul.grey{background:#c7c9d1}
.nav a.off .bul{background:#e0e2e8}
.sbul{width:5px;height:5px;border-radius:50%;background:#c7c9d1;flex:none;
  transition:background .14s ease}

.nav a.on .bul,.side .foot a.on .bul,.subnav a.on .sbul{background:var(--accent)}
.nav a:hover .bul,.subnav a:hover .sbul{background:var(--muted-2)}
.nav a.on:hover .bul,.subnav a.on:hover .sbul{background:var(--accent)}

.subnav{display:flex;flex-direction:column;gap:1px;margin:1px 0 3px 0}
.subnav a{
  display:flex;align-items:center;gap:9px;padding:5px 10px 5px 21px;border-radius:7px;
  color:var(--muted);text-decoration:none;font-size:12.5px;font-weight:500;line-height:1.3}
.subnav a:hover{background:#f4f4f8;color:#4b4f59}
.subnav a.on{background:none;color:var(--ink);font-weight:600}

.side .foot{margin-top:auto;display:flex;flex-direction:column;gap:1px}

/* ---------- main ---------- */
.main{flex:1;padding:26px 34px;min-width:0}
.statrow{display:flex;gap:44px;margin-bottom:30px;flex-wrap:wrap}
.stat .lbl{font-size:12px;color:var(--muted);margin-bottom:3px}
.stat .val{font-size:26px;font-weight:700;letter-spacing:-.02em;display:flex;align-items:baseline;gap:8px}
.stat .tgt{font-size:11.5px;font-weight:600}
.up{color:var(--green)}.down{color:var(--red)}

.head{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;gap:16px;flex-wrap:wrap}
.h1{font-size:30px;font-weight:700;letter-spacing:-.02em}
.h1 .dot{color:var(--accent)}
.controls{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.toggle{display:inline-flex;background:#ececf1;border-radius:9px;padding:3px}
.toggle button{border:none;background:none;font:inherit;font-size:13px;font-weight:600;color:var(--muted);padding:6px 14px;border-radius:7px;cursor:pointer}
.toggle button.on{background:#fff;color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.06)}
.navbtns{display:flex;gap:6px;align-items:center}
.navbtns button{height:30px;min-width:30px;border:1px solid var(--line-2);background:#fff;border-radius:8px;cursor:pointer;color:var(--muted);font-size:14px;padding:0 10px}
.navbtns button:hover{color:var(--ink);border-color:var(--muted-2)}
.navbtns button:disabled{opacity:.45;cursor:default}
.sub{color:var(--muted);font-size:14px;margin-bottom:28px}

.slabel{font-size:11px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);margin:0 0 12px;display:flex;justify-content:space-between;align-items:baseline;gap:14px}
.slabel .hint{font-size:10.5px;letter-spacing:.02em;text-transform:none;color:var(--muted-2);font-weight:500}

/* ---------- hard metric hero tiles ---------- */
.hard{display:grid;grid-template-columns:repeat(5,1fr);gap:12px;margin-bottom:30px}
.htile{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:18px;position:relative}
.htile .k{font-size:12px;color:var(--muted);font-weight:600;margin-bottom:9px}
.htile .v{font-size:27px;font-weight:700;letter-spacing:-.02em}
.htile .t{font-size:11.5px;color:var(--muted);margin-top:7px}
.htile .t b{color:#5a5f6a}
.htile .grade{position:absolute;top:17px;right:17px;width:9px;height:9px;border-radius:50%}
.g-green{background:var(--green)}.g-yellow{background:var(--yellow)}.g-orange{background:var(--orange)}.g-red{background:var(--red)}
.g-none{background:var(--muted-2)}
.htile.tmode .actual{display:none}.htile .target{display:none}.htile.tmode .target{display:inline}

/* ---------- funnel volumes ---------- */
.vols{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:32px}
.vol{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:16px 18px;display:flex;align-items:baseline;justify-content:space-between}
.vol .vk{font-size:12.5px;color:var(--muted);font-weight:600}
.vol .vv{font-size:22px;font-weight:700}
.vol .vr{font-size:12px;color:var(--muted-2);margin-left:8px}

/* ---------- tables ---------- */
.card{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:6px 6px 4px;margin-bottom:30px;overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:13px;min-width:720px}
th{text-align:right;font-weight:600;color:var(--muted);font-size:11.5px;padding:12px 14px;border-bottom:1px solid var(--line)}
th:first-child,td:first-child{text-align:left}
td{text-align:right;padding:12px 14px;border-bottom:1px solid var(--line);font-variant-numeric:tabular-nums}
tr:last-child td{border-bottom:none}
.cell{display:inline-block;padding:2px 8px;border-radius:6px;font-weight:600}
.c-green{background:#e7f6ec;color:#15803d}.c-yellow{background:#fbf3dd;color:#a97a0b}.c-orange{background:#fde9d7;color:#c25708}.c-red{background:#fbe4e4;color:#c11d1d}
.c-none{color:var(--muted-2)}
.wk{font-weight:600}

/* ---------- campaign rows ---------- */
.camp{background:var(--panel);border:1px solid var(--line);border-radius:14px;overflow:hidden;margin-bottom:30px}
.crow{display:grid;grid-template-columns:14px 1fr 84px 84px 96px 100px 26px;align-items:center;padding:15px 18px;border-bottom:1px solid var(--line);cursor:pointer;text-align:left;width:100%;background:none;border-left:none;border-right:none;border-top:none;font:inherit;color:inherit}
.crow:last-child{border-bottom:none}
.crow:hover{background:#fafafc}
.crow .bar{width:4px;height:34px;border-radius:3px}
.crow .cname{font-weight:600;padding-left:14px;min-width:0}
.crow .cname small{display:block;font-weight:500;color:var(--muted);font-size:12px;margin-top:1px}
.crow .m{text-align:right}
.crow .m .ml{display:block;font-size:10.5px;color:var(--muted-2);text-transform:uppercase;margin-bottom:2px}
.crow .m .mv{font-weight:600;font-size:13.5px}
.crow .chev{text-align:right;color:var(--muted-2)}
.b-green{background:var(--green)}.b-yellow{background:var(--yellow)}.b-orange{background:var(--orange)}.b-red{background:var(--red)}
.b-none{background:var(--muted-2)}

/* drill-in */
.drill{border-bottom:1px solid var(--line);background:#fafafc;padding:0 18px 18px 32px}
.drill:last-child{border-bottom:none}
.guide{display:flex;gap:10px;align-items:flex-start;padding:14px 16px;border-radius:10px;margin:14px 0;font-size:12.5px;line-height:1.55}
.guide b{display:block;margin-bottom:2px}
.guide.green{background:#e7f6ec;color:#15803d}.guide.yellow{background:#fbf3dd;color:#a97a0b}
.guide.orange{background:#fde9d7;color:#c25708}.guide.red{background:#fbe4e4;color:#c11d1d}
.guide.none{background:#f0f0f4;color:#5a5f6a}
.drill table{min-width:640px;font-size:12.5px}
.drill h4{font-size:11px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);margin:16px 0 8px}
.note{width:100%;border:1px solid var(--line-2);border-radius:10px;padding:10px 12px;font:inherit;font-size:12.5px;resize:vertical;min-height:62px;background:#fff;color:var(--ink)}
.note:focus{outline:none;border-color:var(--accent)}
.notemeta{font-size:11px;color:var(--muted-2);margin-top:6px;display:flex;justify-content:space-between;align-items:center}

/* ---------- soft metrics ---------- */
.soft{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:6px 6px 4px;overflow-x:auto}
.soft table{min-width:820px}
.soft td,.soft th{font-size:12.5px}
.soft .wk{color:#5a5f6a}
.soft td{color:#5a5f6a}
.soft tr.total td{font-weight:600;color:var(--ink)}
.soft tr.total td:first-child{font-weight:700}

.legend{display:flex;gap:16px;margin:14px 2px 0;font-size:11.5px;color:var(--muted);flex-wrap:wrap}
.legend span{display:inline-flex;align-items:center;gap:6px}
.legend i{width:8px;height:8px;border-radius:50%;display:inline-block}
.src{margin-top:16px;font-size:12px;color:var(--muted-2)}

/* ---------- shared UI ---------- */
.btn{height:30px;border:1px solid var(--line-2);background:#fff;border-radius:8px;cursor:pointer;color:#4b4f59;font:inherit;font-size:13px;font-weight:500;padding:0 12px;display:inline-flex;align-items:center;gap:6px}
.btn:hover{border-color:var(--muted-2);color:var(--ink)}
.btn.primary{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:600}
.btn.primary:hover{background:#4a4ac4;color:#fff}
.btn:disabled{opacity:.5;cursor:default}
.pill{display:inline-flex;align-items:center;gap:6px;font-size:11px;font-weight:600;padding:4px 10px;border-radius:999px;background:#f0f0f4;color:var(--muted)}
.pill.demo{background:#fbf3dd;color:#a97a0b}
.pill.live{background:#e7f6ec;color:#15803d}

.empty{background:var(--panel);border:1px dashed var(--line-2);border-radius:14px;padding:34px 24px;text-align:center;color:var(--muted);margin-bottom:30px}
.empty b{display:block;color:var(--ink);font-size:15px;margin-bottom:5px;font-weight:600}
.empty p{font-size:13px;max-width:520px;margin:0 auto;line-height:1.6}

.banner{border-radius:12px;padding:13px 16px;margin-bottom:22px;font-size:13px;display:flex;gap:12px;align-items:flex-start;line-height:1.55}
.banner.warn{background:#fbf3dd;color:#8a6410;border:1px solid #f0e2bc}
.banner.err{background:#fbe4e4;color:#a91c1c;border:1px solid #f2cccc}
.banner b{font-weight:700}
.banner .x{margin-left:auto;cursor:pointer;opacity:.6;font-size:16px;line-height:1;background:none;border:none;color:inherit;padding:0}

.skel{background:linear-gradient(90deg,#eeeef2 25%,#f6f6f9 50%,#eeeef2 75%);background-size:200% 100%;animation:sk 1.4s infinite;border-radius:6px;color:transparent!important}
@keyframes sk{0%{background-position:200% 0}100%{background-position:-200% 0}}

/* ---------- projections ---------- */
.projgrid{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:6px 6px 4px;margin-bottom:24px;overflow-x:auto}
.projgrid table{min-width:860px}
.projgrid td{padding:9px 14px}
.projgrid input{width:88px;border:1px solid var(--line-2);border-radius:7px;padding:6px 9px;font:inherit;font-size:12.5px;text-align:right;font-variant-numeric:tabular-nums;background:#fff;color:var(--ink)}
.projgrid input:focus{outline:none;border-color:var(--accent)}
.projgrid input.dirty{border-color:var(--accent);background:#f7f7fe}
.projgrid .mname{font-weight:600}
.projgrid .mname small{display:block;font-weight:500;color:var(--muted);font-size:11.5px;margin-top:1px}
.bandhead{display:inline-flex;align-items:center;gap:6px;justify-content:flex-end}
.bandhead i{width:8px;height:8px;border-radius:50%;display:inline-block}
.savebar{position:sticky;bottom:0;background:rgba(244,245,247,.94);backdrop-filter:blur(6px);border-top:1px solid var(--line-2);padding:14px 0;display:flex;gap:12px;align-items:center;margin-top:8px}
.savebar .msg{font-size:12.5px;color:var(--muted)}
select.sel{border:1px solid var(--line-2);border-radius:8px;padding:7px 10px;font:inherit;font-size:13px;background:#fff;color:var(--ink);max-width:100%}
select.sel:focus{outline:none;border-color:var(--accent)}
.fieldrow{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:18px;margin-bottom:24px}
.fieldrow label{display:block;font-size:12.5px;font-weight:600;margin-bottom:7px}
.fieldrow p{font-size:12px;color:var(--muted);margin-top:8px;line-height:1.55}

/* ---------- login ---------- */
.login{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px}
.login form{background:var(--panel);border:1px solid var(--line);border-radius:16px;padding:32px;width:100%;max-width:352px}
.login .brand{margin-bottom:22px}
.login input{width:100%;border:1px solid var(--line-2);border-radius:9px;padding:11px 13px;font:inherit;margin-bottom:12px;background:#fff;color:var(--ink)}
.login input:focus{outline:none;border-color:var(--accent)}
.login .btn{width:100%;justify-content:center;height:40px}
.login .err{color:var(--red);font-size:12.5px;margin-bottom:12px}

/* ---------- stub modules ---------- */
.stub{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:56px 30px;text-align:center}
.stub b{display:block;font-size:17px;margin-bottom:6px;font-weight:600}
.stub p{color:var(--muted);font-size:13.5px;max-width:460px;margin:0 auto;line-height:1.6}

@media(max-width:1080px){
  .hard{grid-template-columns:repeat(2,1fr)}
  .vols{grid-template-columns:repeat(2,1fr)}
  .statrow{gap:28px}
}
@media(max-width:720px){
  .app{flex-direction:column}
  .side{width:100%;height:auto;position:static;flex-direction:row;align-items:center;gap:16px;padding:16px;overflow-x:auto}
  .nav{margin-top:0;flex-direction:row}
  .side .foot{margin-top:0;flex-direction:row}
  .main{padding:20px 16px}
  .hard,.vols{grid-template-columns:1fr}
}

/* date range picker */
.daterange{display:inline-flex;align-items:center;gap:6px}
.daterange input[type="date"]{border:1px solid var(--line-2);border-radius:8px;padding:6px 9px;font:inherit;font-size:12.5px;background:#fff;color:var(--ink)}
.daterange input[type="date"]:focus{outline:none;border-color:var(--accent)}
.daterange .to{font-size:12px;color:var(--muted)}
.slabel .toggle button{padding:3px 10px;font-size:11.5px}

/* EOD form. Reuses .fieldrow/.btn/.sel from above; these are the field
   primitives the read-mostly screens never needed. */
.eodlabel{display:block;font-size:12px;color:var(--muted);font-weight:600;margin-bottom:5px}
.eodhint{font-size:10.5px;color:var(--muted-2);margin-top:4px;line-height:1.45}
.eodinput{width:100%;border:1px solid var(--line-2);border-radius:7px;padding:7px 9px;font:inherit;font-size:13px;background:#fff}
.eodinput.narrow{max-width:90px}
.eodinput:focus{outline:2px solid #d8dbf5;outline-offset:-1px}
.eodgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:14px}
.eodgradefield{display:grid;grid-template-columns:130px 90px 1fr;gap:10px;align-items:end;margin-bottom:12px}
.eodgradefield .eodlabel{margin-bottom:0;align-self:center}
.eodchecks{display:grid;gap:9px}
.eodcheck{display:flex;gap:9px;align-items:flex-start;font-size:13px;color:#4b4f59;cursor:pointer}
.eodcheck input{margin-top:2px}
.eodrow{display:grid;grid-template-columns:1fr 200px 90px 90px;gap:10px;align-items:center;margin-bottom:9px}
.eodrollrow{display:grid;grid-template-columns:1fr 150px 1.4fr 1fr 1fr 90px;gap:8px;align-items:center;margin-bottom:9px}
@media (max-width:1100px){.eodrow,.eodrollrow{grid-template-columns:1fr}}

/* Scorecard grid: label and hint on the left, the 1-10 input on the right. */
.scgrid{display:grid;gap:11px}
.scrow{display:grid;grid-template-columns:1fr 90px;gap:14px;align-items:center;padding-bottom:10px;border-bottom:1px solid var(--line)}
.scrow:last-child{border-bottom:0;padding-bottom:0}
.sclabel{font-size:13px;font-weight:600;color:var(--ink)}

/* Funnel cards. Four equal columns with the number and its conversion on their
   own lines, so every card shares a baseline no matter which have a percentage. */
.funnel{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:14px}
.fcard{background:var(--panel);border:1px solid var(--line);border-radius:14px;padding:16px 18px}
.fcard .fk{font-size:12px;color:var(--muted);font-weight:600;letter-spacing:.01em}
.fcard .fv{font-size:28px;font-weight:700;letter-spacing:-.02em;margin-top:8px;font-variant-numeric:tabular-nums}
.fcard .fr{font-size:11.5px;color:var(--muted-2);margin-top:6px;min-height:16px}
.fcard .fr span{color:var(--muted-2);opacity:.75}
@media (max-width:900px){.funnel{grid-template-columns:repeat(2,1fr)}}

/* Projection fields. Labels of different lengths wrap to different heights,
   which is what makes a row of inputs look skewed. Reserving two label lines
   puts every input on the same baseline regardless of label length. */
.projgrid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px}
.projfield{display:flex;flex-direction:column}
.projfield .eodlabel{min-height:32px;display:flex;align-items:flex-end;margin-bottom:6px;line-height:1.35}
.projfield .eodinput{text-align:right;font-variant-numeric:tabular-nums}
.projfield .eodhint{min-height:28px}

/* Six outcome cards where Marketing shows five. Kept for any tracker that needs
   it; the Sales row is five, so energy does not orphan on the end. */
.hard.six{grid-template-columns:repeat(6,1fr)}
@media (max-width:1180px){.hard.six{grid-template-columns:repeat(3,1fr)}}

/* Condition: the self-reported energy / focus / biology read. Quieter than an
   outcome card because it is a self-report, and ungraded by design. */
.conds{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:30px}
.cond{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:14px 16px}
.cond .ck{font-size:11.5px;color:var(--muted);font-weight:600}
.cond .cv{font-size:22px;font-weight:700;letter-spacing:-.02em;margin-top:6px;font-variant-numeric:tabular-nums}
.cond .cv span{font-size:12px;font-weight:500;color:var(--muted-2);margin-left:3px}
.cond .ch{font-size:10.5px;color:var(--muted-2);margin-top:4px;line-height:1.4}
@media (max-width:820px){.conds{grid-template-columns:repeat(2,1fr)}}

/* Signed-in identity under the brand. */
.whoami{display:none}
.whoami span{display:block;font-size:9.5px;font-weight:500;color:var(--muted-2);margin-top:1px;
  text-transform:uppercase;letter-spacing:.06em}

/* Login now takes two fields. */
.login input + input{margin-top:9px}

/* Call review archive. */
.callrow{cursor:pointer}
.callrow:hover{background:#fafafc}
.drillcell{background:#fafafc;padding:0!important}
.callbreak{padding:16px 18px}
.dimgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:7px 18px;margin-bottom:14px}
.dimrow{display:flex;justify-content:space-between;align-items:center;gap:12px;font-size:12.5px;
  padding:5px 0;border-bottom:1px solid var(--line)}
.dimrow .dn{color:#4b4f59}
.dimrow .dv{font-weight:700;min-width:34px;text-align:center;border-radius:5px;padding:1px 6px;font-size:12px}
.callnote{font-size:13px;line-height:1.6;color:#4b4f59;margin-top:10px}
.callnote b{display:block;color:var(--ink);font-size:12px;margin-bottom:3px}
.callnote p{margin:0}

/* Anchors used as buttons: .btn was written for <button>, so links styled with
   it inherited the underline. */
a.btn{text-decoration:none;display:inline-flex;align-items:center}


/* --- Sidebar: brand row, collapse toggle, group carets --- */
.brandrow{display:flex;align-items:flex-start;justify-content:space-between;gap:8px}
.sidetoggle,.sideopen{
  border:1px solid var(--line-2);background:#fff;color:var(--muted);border-radius:7px;
  width:24px;height:24px;line-height:1;cursor:pointer;font-size:15px;flex:none;
  display:flex;align-items:center;justify-content:center;padding:0}
.sidetoggle:hover,.sideopen:hover{color:var(--ink);border-color:var(--muted-2)}

/* The reopen button only exists while the sidebar is hidden, and sits clear of
   the content rather than on top of it. */
.sideopen{display:none;position:fixed;top:22px;left:12px;z-index:20}
.app.collapsed .side{display:none}
.app.collapsed .sideopen{display:flex}
.app.collapsed .main{padding-left:52px}

/* Caret marks a group that opens. Rotating it is the whole dropdown cue. */
.caret{margin-left:auto;font-size:14px;font-weight:400;color:var(--muted-2);
  transition:transform .16s ease;display:inline-block;transform:rotate(0deg)}
.caret.open{transform:rotate(90deg)}
.nav a .soon + .caret{margin-left:6px}

/* Settings is a group, not a destination, so it never takes the selected state. */
.settings-row{cursor:pointer}

/* Dropdown. Animating max-height keeps it cheap and needs no measurement. */
.subnav{overflow:hidden;animation:subnav-open .18s ease}
@keyframes subnav-open{
  from{max-height:0;opacity:0;transform:translateY(-2px)}
  to{max-height:220px;opacity:1;transform:none}
}
@media (prefers-reduced-motion:reduce){
  .subnav{animation:none}
  .caret{transition:none}
}

/* Collapsing a group runs the open animation backwards, so a dropdown does not
   simply vanish when you click the tracker again. */
.subnav.closing{animation:subnav-close .15s ease forwards}
@keyframes subnav-close{
  from{max-height:220px;opacity:1}
  to{max-height:0;opacity:0;transform:translateY(-2px)}
}
@media (prefers-reduced-motion:reduce){ .subnav.closing{animation:none} }

/* The panel fades in rather than snapping, so switching screens does not flash.
   Short enough that it never feels like waiting. */
.main > *{animation:panel-in .16s ease}
@keyframes panel-in{ from{opacity:0} to{opacity:1} }
@media (prefers-reduced-motion:reduce){ .main > *{animation:none} }
