@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:400;font-display:swap;src:url(/assets/fonts/ibm-plex-sans-400.f543dd7f3d.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+20B9,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:500;font-display:swap;src:url(/assets/fonts/ibm-plex-sans-500.8d3c490d79.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+20B9,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"IBM Plex Sans";font-style:normal;font-weight:600;font-display:swap;src:url(/assets/fonts/ibm-plex-sans-600.7b697ff952.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+20B9,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:400;font-display:swap;src:url(/assets/fonts/ibm-plex-mono-400.c1dd3fcb62.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+20B9,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:500;font-display:swap;src:url(/assets/fonts/ibm-plex-mono-500.77edd8de92.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+20B9,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Bricolage Grotesque";font-style:normal;font-weight:500;font-display:swap;src:url(/assets/fonts/bricolage-grotesque-500.236f33c307.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+20B9,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Bricolage Grotesque";font-style:normal;font-weight:700;font-display:swap;src:url(/assets/fonts/bricolage-grotesque-700.45915ebfa7.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+20B9,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
/* Layout: deep navy sidebar + light working canvas; dense data tables, a few cards with real hierarchy.
   "Navy & Gold": gold is reserved for "you are here" (active nav, active scope). Primary actions are navy. */
:root{
  --bg:#F2F4F8; --surface:#FFFFFF; --surface-2:#F7F8FB; --surface-3:#EAEDF3;
  --line:#DEE2EA; --line-2:#C7CEDA;
  --ink:#15223A; --ink-2:#48546B; --ink-3:#6C778C;
  --nav:#17305C; --nav-2:#22407A; --nav-ink:#AFBEDC; --nav-ink-strong:#FFFFFF;
  --primary:#1E3F7A; --primary-h:#163063; --on-primary:#FFFFFF;
  --accent:#D29A2C; --accent-soft:#FBEFD3; --on-accent:#2C1F03;
  --gain:#13804A; --gain-soft:#E0F2E8; --loss:#C5342F; --loss-soft:#FBE5E4;
  --warn:#8F5400; --warn-soft:#FFF1D6; --info:#2A5FA8; --info-soft:#E5EDF8;
  --grid:#E7EAF0; --axis:#C5CCD8; --chart-surface:#FFFFFF;
  --s1:#1E3F7A; --s2:#D29A2C; --s3:#2F9AA6; --s4:#C75E3F; --s5:#7B6BC2; --s6:#1F8A52; --s7:#C2478A; --s8:#5A7F9E; --s-other:#9AA3AF;
  --shadow-1:0 1px 2px rgba(21,34,58,.06),0 1px 1px rgba(21,34,58,.04);
  --shadow-2:0 10px 28px rgba(21,34,58,.12),0 2px 6px rgba(21,34,58,.06);
  --shadow-3:0 28px 72px rgba(21,34,58,.28);
  --scrim:rgba(11,20,38,.48);
  --r-sm:6px; --r-md:10px; --r-lg:14px;
  --f-ui:"IBM Plex Sans",system-ui,-apple-system,"Segoe UI",sans-serif;
  --f-display:"Bricolage Grotesque","IBM Plex Sans",system-ui,sans-serif;
  --f-mono:"IBM Plex Mono",ui-monospace,Consolas,monospace;
}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){
  --bg:#0F1A2F; --surface:#17243D; --surface-2:#1C2B47; --surface-3:#243556;
  --line:#2E4164; --line-2:#3C5280;
  --ink:#E8EDF6; --ink-2:#AEBAD2; --ink-3:#8896B2;
  --nav:#0B1426; --nav-2:#1B2D4F; --nav-ink:#9DADCC; --nav-ink-strong:#FFFFFF;
  --primary:#5B86D6; --primary-h:#6D97E4; --on-primary:#FFFFFF;
  --accent:#E8B44C; --accent-soft:#3C2F12; --on-accent:#231800;
  --gain:#44C283; --gain-soft:#123222; --loss:#F07A74; --loss-soft:#3D1D1E;
  --warn:#F2B84B; --warn-soft:#382A10; --info:#8DB4F0; --info-soft:#182C4C;
  --grid:#22345A; --axis:#3A4F78; --chart-surface:#17243D;
  --s1:#6F97E0; --s2:#E8B44C; --s3:#45BFCC; --s4:#E3826A; --s5:#A79AE6; --s6:#4CC48A; --s7:#E07AB5; --s8:#8FB0CC; --s-other:#6B7586;
  --shadow-1:0 1px 2px rgba(0,0,0,.4); --shadow-2:0 10px 28px rgba(0,0,0,.45); --shadow-3:0 28px 72px rgba(0,0,0,.6);
  --scrim:rgba(0,0,0,.6); color-scheme:dark;
}}
:root[data-theme="dark"]{
  --bg:#0F1A2F; --surface:#17243D; --surface-2:#1C2B47; --surface-3:#243556;
  --line:#2E4164; --line-2:#3C5280;
  --ink:#E8EDF6; --ink-2:#AEBAD2; --ink-3:#8896B2;
  --nav:#0B1426; --nav-2:#1B2D4F; --nav-ink:#9DADCC; --nav-ink-strong:#FFFFFF;
  --primary:#5B86D6; --primary-h:#6D97E4; --on-primary:#FFFFFF;
  --accent:#E8B44C; --accent-soft:#3C2F12; --on-accent:#231800;
  --gain:#44C283; --gain-soft:#123222; --loss:#F07A74; --loss-soft:#3D1D1E;
  --warn:#F2B84B; --warn-soft:#382A10; --info:#8DB4F0; --info-soft:#182C4C;
  --grid:#22345A; --axis:#3A4F78; --chart-surface:#17243D;
  --s1:#6F97E0; --s2:#E8B44C; --s3:#45BFCC; --s4:#E3826A; --s5:#A79AE6; --s6:#4CC48A; --s7:#E07AB5; --s8:#8FB0CC; --s-other:#6B7586;
  --shadow-1:0 1px 2px rgba(0,0,0,.4); --shadow-2:0 10px 28px rgba(0,0,0,.45); --shadow-3:0 28px 72px rgba(0,0,0,.6);
  --scrim:rgba(0,0,0,.6); color-scheme:dark;
}

*{box-sizing:border-box}
html,body{height:100%}
html{scrollbar-gutter:stable}
body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.45 var(--f-ui);-webkit-font-smoothing:antialiased}
body::before{content:"";position:fixed;inset:0 0 auto;height:env(safe-area-inset-top,0px);z-index:10;background:var(--bg)}
button,input,select,textarea{font:inherit;color:inherit}
a{color:var(--info)}
.num,.tnum,td.n,th.n{font-variant-numeric:tabular-nums}
:focus-visible{outline:2px solid var(--s1);outline-offset:2px;border-radius:4px}
@media (prefers-reduced-motion: reduce){*{transition:none!important;animation:none!important}}

/* ---------- shell ---------- */
.app{display:grid;grid-template-columns:248px minmax(0,1fr);min-height:100%}
.side{background:var(--nav);color:var(--nav-ink);display:flex;flex-direction:column;position:sticky;top:0;height:100vh;overflow-y:auto;padding:14px 12px 12px;padding-left:max(12px,env(safe-area-inset-left,0px));gap:10px}
.brand{display:flex;align-items:center;gap:10px;padding:4px 6px 8px;color:var(--nav-ink-strong)}
.brand-mark{width:32px;height:32px;flex:none;display:inline-block;background:url(/favicon.svg) center/contain no-repeat}
.brand-name{font:700 17px/1 var(--f-display);letter-spacing:-.01em}
/* Wordmark: lowercase, with "my" in gold italic as on the logo sheet. */
/* Wordmark in the logo's own colours: blue + gold on light surfaces, periwinkle + bright gold on navy. */
:root{--wm-ink:#1F5EFF;--wm-my:#D4A017}
:root[data-theme="dark"]{--wm-ink:#9DB8FF;--wm-my:#FFC53D}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){--wm-ink:#9DB8FF;--wm-my:#FFC53D}}
.wordmark{font:700 17px/1 var(--f-display);letter-spacing:-.02em;white-space:nowrap;color:var(--wm-ink)}
.wordmark em{font:italic 600 1.12em/1 Georgia,"Times New Roman",serif;letter-spacing:0;color:var(--wm-my);padding-right:.05em}
.side .wordmark{--wm-ink:#9DB8FF;--wm-my:#FFC53D}
/* The dot on the "i" of investment is the logo's mint: paint the glyph with a two-stop fill, mint above the x-height. */
.wordmark .wm-i{background:linear-gradient(180deg,#2BE0B4 0 var(--wm-i-split,48%),var(--wm-ink) var(--wm-i-split,48%));-webkit-background-clip:text;background-clip:text;color:transparent}
.scope-btn{display:flex;align-items:center;gap:10px;width:100%;text-align:left;background:var(--nav-2);border:1px solid rgba(255,255,255,.06);border-radius:10px;padding:9px 10px;color:var(--nav-ink-strong);cursor:pointer}
.scope-btn:hover{border-color:rgba(255,255,255,.18)}
.scope-ico{width:28px;height:28px;border-radius:7px;background:rgba(227,162,26,.16);color:var(--accent);display:grid;place-items:center;flex:none}
.scope-btn .t1{font-weight:600;font-size:13.5px;line-height:1.2}
.scope-btn .t2{font-size:11.5px;color:var(--nav-ink)}
.nav-group{display:flex;flex-direction:column;gap:1px}
.nav-label{font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:#6E7C91;padding:10px 10px 4px}
.nav-item{display:flex;align-items:center;gap:10px;padding:7px 10px;border-radius:8px;color:var(--nav-ink);cursor:pointer;background:none;border:0;width:100%;text-align:left;font-size:13.5px;position:relative}
.nav-item:hover{background:rgba(255,255,255,.05);color:var(--nav-ink-strong)}
.nav-item.on{background:var(--nav-2);color:var(--nav-ink-strong)}
.nav-item.on::before{content:"";position:absolute;left:-12px;top:7px;bottom:7px;width:3px;border-radius:0 3px 3px 0;background:var(--accent)}
.nav-item svg{width:17px;height:17px;flex:none;opacity:.9}
.nav-badge{margin-left:auto;background:var(--accent);color:var(--on-accent);font-size:10.5px;font-weight:600;border-radius:9px;padding:0 6px;line-height:17px}
.ticker{margin-top:auto;background:var(--nav-2);border-radius:10px;padding:10px 12px;display:grid;gap:6px;font-size:12px}
.ticker-row{display:flex;justify-content:space-between;gap:8px;color:var(--nav-ink-strong)}
.ticker-row span:first-child{color:var(--nav-ink)}
.ticker .up{color:#55D18F}.ticker .dn{color:#FF8A8A}
.ticker-note{font-size:10.5px;color:#6E7C91}

.main{min-width:0;display:flex;flex-direction:column}
.top{position:sticky;top:env(safe-area-inset-top,0px);z-index:20;background:color-mix(in srgb,var(--bg) 88%,transparent);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:10px;padding-block:10px;padding-left:max(20px,env(safe-area-inset-left,0px));padding-right:max(20px,env(safe-area-inset-right,0px))}
.search{flex:1;max-width:460px;display:flex;align-items:center;gap:8px;background:var(--surface);border:1px solid var(--line);border-radius:9px;padding:0 10px;height:36px;color:var(--ink-3);cursor:text}
.search:hover{border-color:var(--line-2)}
.search span{flex:1;font-size:13.5px}
kbd{font:500 11px var(--f-mono);border:1px solid var(--line-2);border-bottom-width:2px;border-radius:4px;padding:0 5px;color:var(--ink-3);background:var(--surface-2)}
.top-actions{margin-left:auto;display:flex;gap:6px;align-items:center}
.icon-btn{width:36px;height:36px;border-radius:9px;border:1px solid var(--line);background:var(--surface);display:grid;place-items:center;cursor:pointer;color:var(--ink-2);position:relative}
.icon-btn:hover{border-color:var(--line-2);color:var(--ink)}
.icon-btn svg{width:18px;height:18px}
.icon-btn.on{background:var(--ink);color:var(--surface);border-color:var(--ink)}
.dot{position:absolute;top:6px;right:7px;width:8px;height:8px;border-radius:50%;background:var(--loss);border:2px solid var(--surface)}
.avatar{width:36px;height:36px;border-radius:50%;background:var(--primary);color:var(--on-primary);display:grid;place-items:center;font-weight:600;cursor:pointer;border:0}
.content{padding-block:20px 40px;padding-left:max(20px,env(safe-area-inset-left,0px));padding-right:max(20px,env(safe-area-inset-right,0px));display:flex;flex-direction:column;gap:16px;min-width:0}
/* Desktop: content and top bar share one centred column capped at 1440px, so a 1366px laptop and a 2560px monitor
   show the same layout instead of stretching cards across the whole screen. */
@media (min-width:901px){
  .content,.top{padding-left:max(24px,calc((100% - 1440px) / 2));padding-right:max(24px,calc((100% - 1440px) / 2))}
}
.privacy-banner{background:var(--ink);color:var(--surface);font-size:12.5px;display:flex;align-items:center;justify-content:center;gap:10px;padding-block:6px;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
.privacy-banner button{background:none;border:1px solid currentColor;color:inherit;border-radius:6px;padding:1px 8px;cursor:pointer;font-size:12px}
.sample-banner{background:var(--info-soft);color:var(--info);border:1px solid color-mix(in srgb,var(--info) 25%,transparent);border-radius:10px;padding:8px 12px;font-size:12.5px;display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.sample-banner b{color:var(--ink)}
.sample-banner .sp{margin-left:auto;display:flex;gap:8px}

/* ---------- page header ---------- */
.ph{display:flex;align-items:flex-end;gap:12px;flex-wrap:wrap}
.ph h1{font:700 26px/1.1 var(--f-display);letter-spacing:-.02em;margin:0;text-wrap:balance}
.ph .sub{color:var(--ink-3);font-size:13px;margin-top:4px}
.ph .acts{margin-left:auto;display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.crumbs{display:flex;gap:6px;align-items:center;color:var(--ink-3);font-size:12.5px}

/* ---------- primitives ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:34px;padding:0 13px;border-radius:8px;border:1px solid var(--line-2);background:var(--surface);color:var(--ink);font-weight:500;font-size:13.5px;cursor:pointer;white-space:nowrap;transition:background .15s,border-color .15s}
.btn:hover{border-color:var(--ink-3)}
.btn svg{width:16px;height:16px}
.btn-primary{background:var(--primary);border-color:var(--primary);color:var(--on-primary)}
.btn-primary:hover{background:var(--primary-h);border-color:var(--primary-h)}
.btn-danger{background:var(--loss);border-color:var(--loss);color:#fff}
.btn-ghost{border-color:transparent;background:transparent;color:var(--ink-2)}
.btn-ghost:hover{background:var(--surface-3);border-color:transparent;color:var(--ink)}
.btn-sm{height:28px;padding:0 10px;font-size:12.5px;border-radius:7px}
.btn[disabled]{opacity:.45;cursor:not-allowed}
.link{background:none;border:0;padding:0;color:var(--info);cursor:pointer;font-weight:500}
.link:hover{text-decoration:underline}

.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--shadow-1);min-width:0}
.card-h{display:flex;align-items:center;gap:10px;padding:14px 16px 0;flex-wrap:wrap}
.card-h h2,.card-h h3{font:600 15px/1.3 var(--f-ui);margin:0}
.card-h .hint{color:var(--ink-3);font-size:12.5px}
.card-h .r{margin-left:auto;display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.card-b{padding:14px 16px 16px}
.card-b.flush{padding:10px 0 0}

.grid{display:grid;gap:16px}
.g-hero{grid-template-columns:minmax(0,1.35fr) repeat(4,minmax(0,1fr))}
.g-2-1{grid-template-columns:minmax(0,2fr) minmax(0,1fr)}
.g-1-1{grid-template-columns:repeat(2,minmax(0,1fr))}
.g-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.g-4{grid-template-columns:repeat(4,minmax(0,1fr))}
/* Page grids respond to the width of the content column, not the screen, so every PC from a 1280px laptop to a
   2560px monitor gets the same arrangement (the column is capped at 1440px). Drawers and dialogs keep screen queries. */
.content{container-type:inline-size}
@container (max-width:899px){.g-hero{grid-template-columns:repeat(2,minmax(0,1fr))}.g-hero>.hero{grid-column:1/-1}}
@container (max-width:819px){.g-2-1,.g-3{grid-template-columns:minmax(0,1fr)}.g-4{grid-template-columns:repeat(2,minmax(0,1fr))}}
@container (max-width:599px){.g-1-1,.g-4{grid-template-columns:minmax(0,1fr)}}
@media (max-width:1280px){:is(.drawer,.modal) .g-hero{grid-template-columns:repeat(2,minmax(0,1fr))}:is(.drawer,.modal) .g-hero>.hero{grid-column:1/-1}}
@media (max-width:1100px){:is(.drawer,.modal) :is(.g-2-1,.g-3){grid-template-columns:minmax(0,1fr)}:is(.drawer,.modal) .g-4{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:640px){:is(.drawer,.modal) :is(.g-1-1,.g-4){grid-template-columns:minmax(0,1fr)}}
.g-rep{grid-template-columns:minmax(0,220px) minmax(0,1fr)}
@media (max-width:760px){.g-rep{grid-template-columns:minmax(0,1fr)}.rp-cats{flex-direction:row;flex-wrap:wrap}}

.hero{background:var(--nav);color:#fff;border-color:transparent;position:relative;overflow:hidden}
.hero::after{content:"";position:absolute;right:-60px;top:-60px;width:220px;height:220px;border-radius:50%;border:34px solid rgba(227,162,26,.13)}
.hero .card-b{position:relative;z-index:1;display:flex;flex-direction:column;gap:6px;padding:18px}
.hero .lbl{color:var(--nav-ink);font-size:12px;letter-spacing:.06em;text-transform:uppercase}
.hero .big{font:700 38px/1 var(--f-display);letter-spacing:-.025em}
.hero .eq{color:var(--nav-ink);font-size:12.5px;display:flex;gap:6px;flex-wrap:wrap;align-items:center}
.hero .eq b{color:#fff;font-weight:600}
.kpi .card-b{display:flex;flex-direction:column;gap:4px;padding:16px}
.kpi .lbl{color:var(--ink-3);font-size:12.5px;display:flex;align-items:center;gap:6px}
.kpi .val{font:600 22px/1.15 var(--f-display);letter-spacing:-.015em}
.kpi .foot{font-size:12px;color:var(--ink-3)}
.def{border-bottom:1px dotted var(--ink-3);cursor:help}

.pill{display:inline-flex;align-items:center;gap:3px;border-radius:20px;padding:1px 8px;font-size:12px;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
.pill.up{background:var(--gain-soft);color:var(--gain)}
.pill.dn{background:var(--loss-soft);color:var(--loss)}
.pill.flat{background:var(--surface-3);color:var(--ink-2)}
.up-t{color:var(--gain)}.dn-t{color:var(--loss)}
.badge{display:inline-grid;place-items:center;min-width:34px;height:20px;padding:0 5px;border-radius:5px;border:1px solid var(--line-2);font:600 10px var(--f-mono);color:var(--ink-2);letter-spacing:.02em;background:var(--surface)}
.tag{display:inline-flex;align-items:center;gap:4px;font-size:11.5px;font-weight:500;color:var(--ink-2);background:var(--surface-3);border-radius:5px;padding:1px 7px;white-space:nowrap}
.tag.warn{background:var(--warn-soft);color:var(--warn)}
.tag.info{background:var(--info-soft);color:var(--info)}
.tag.good{background:var(--gain-soft);color:var(--gain)}
.tag.bad{background:var(--loss-soft);color:var(--loss)}
.tag.accent{background:var(--accent-soft);color:var(--warn)}

.seg{display:inline-flex;background:var(--surface-3);border-radius:8px;padding:2px;gap:2px}
.seg button{border:0;background:none;padding:4px 10px;border-radius:6px;font-size:12.5px;font-weight:500;color:var(--ink-2);cursor:pointer;white-space:nowrap}
.seg button:hover{color:var(--ink)}
.seg button.on{background:var(--surface);color:var(--ink);box-shadow:var(--shadow-1)}
.chips{display:flex;gap:6px;flex-wrap:wrap}
.chip{border:1px solid var(--line-2);background:var(--surface);border-radius:20px;padding:3px 11px;font-size:12.5px;cursor:pointer;color:var(--ink-2);display:inline-flex;gap:6px;align-items:center;white-space:nowrap}
.chip:hover{border-color:var(--ink-3);color:var(--ink)}
.chip.on{background:var(--ink);border-color:var(--ink);color:var(--surface)}
.chip .badge{height:17px;min-width:28px;font-size:9.5px}
.chip.on .badge{background:transparent;color:inherit;border-color:rgba(255,255,255,.4)}

/* fields */
.field{display:flex;flex-direction:column;gap:5px;min-width:0}
.field>label,.flabel{font-size:12.5px;font-weight:500;color:var(--ink-2)}
.field .help{font-size:12px;color:var(--ink-3)}
.field .err{font-size:12px;color:var(--loss);font-weight:500}
.input,.select,textarea.input{height:36px;border:1px solid var(--line-2);background:var(--surface);border-radius:8px;padding:0 10px;width:100%;min-width:0;font-size:13.5px}
textarea.input{height:auto;padding:8px 10px;font:12.5px/1.5 var(--f-mono);resize:vertical}
.input:hover,.select:hover{border-color:var(--ink-3)}
.input:focus,.select:focus{outline:none;border-color:var(--s1);box-shadow:0 0 0 3px color-mix(in srgb,var(--s1) 20%,transparent)}
.input.bad{border-color:var(--loss)}
.input.r{text-align:right;font-variant-numeric:tabular-nums}
.input[readonly]{background:var(--surface-2);color:var(--ink-2)}
.input-sm{height:30px;font-size:12.5px}
.frow{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.frow.c3{grid-template-columns:repeat(3,minmax(0,1fr))}
.frow.c4{grid-template-columns:repeat(4,minmax(0,1fr))}
@media (max-width:640px){.frow,.frow.c3,.frow.c4{grid-template-columns:minmax(0,1fr)}}
.check{display:flex;gap:8px;align-items:center;font-size:13.5px;cursor:pointer}
.check input{width:16px;height:16px;accent-color:var(--primary)}
.switch{position:relative;width:36px;height:20px;flex:none}
.switch input{opacity:0;width:100%;height:100%;position:absolute;margin:0;cursor:pointer;z-index:1}
.switch span{position:absolute;inset:0;border-radius:20px;background:var(--line-2);transition:background .15s}
.switch span::after{content:"";position:absolute;left:2px;top:2px;width:16px;height:16px;border-radius:50%;background:#fff;transition:transform .15s;box-shadow:0 1px 2px rgba(0,0,0,.2)}
.switch input:checked+span{background:var(--primary)}
.switch input:checked+span::after{transform:translateX(16px)}
.switch input:focus-visible+span{outline:2px solid var(--s1);outline-offset:2px}
.set-row{display:flex;align-items:center;gap:16px;padding:12px 0;border-bottom:1px solid var(--line)}
.set-row:last-child{border-bottom:0}
.set-row .t{flex:1;min-width:0}
.set-row .t b{display:block;font-weight:500}
.set-row .t span{color:var(--ink-3);font-size:12.5px}

/* tables */
.tbl-wrap{overflow-x:auto;min-width:0}
table.t{width:100%;border-collapse:separate;border-spacing:0;font-size:13px}
table.t th{position:sticky;top:0;background:var(--surface-2);text-align:left;font-weight:600;font-size:11.5px;letter-spacing:.04em;text-transform:uppercase;color:var(--ink-3);padding:9px 12px;border-bottom:1px solid var(--line);white-space:nowrap;z-index:1}
table.t th.n,table.t td.n{text-align:right}
table.t th.sort{cursor:pointer;user-select:none}
table.t th.sort:hover{color:var(--ink)}
table.t td{padding:9px 12px;border-bottom:1px solid var(--line);vertical-align:middle}
table.t tr.click{cursor:pointer}
table.t tr.click:hover td{background:var(--surface-2)}
table.t tr.grp td{background:var(--surface-3);font-weight:600;cursor:pointer}
table.t tr.grp:hover td{background:color-mix(in srgb,var(--surface-3) 70%,var(--line-2))}
table.t tr.sub td{background:var(--surface-2);font-size:12.5px;color:var(--ink-2)}
table.t tr.total td{background:var(--info-soft);font-weight:700;border-bottom:0}
table.t tfoot td{position:sticky;bottom:0;background:var(--info-soft);font-weight:700;border-top:1px solid var(--line-2);border-bottom:0}
table.t .stack{display:flex;flex-direction:column;line-height:1.25}
table.t .stack small{font-size:11.5px;color:var(--ink-3);font-weight:400}
table.t .stack small.up-t{color:var(--gain)}table.t .stack small.dn-t{color:var(--loss)}
table.t td.first{position:sticky;left:0;background:var(--surface);z-index:0}
table.t tr.grp td.first{background:var(--surface-3)}
table.t tr.click:hover td.first{background:var(--surface-2)}
.aname{display:flex;align-items:center;gap:9px;min-width:220px}
.aname .nm{font-weight:500;color:var(--ink);max-width:300px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.aname .ms{font-size:11.5px;color:var(--ink-3)}
.caret{display:inline-block;transition:transform .15s;color:var(--ink-3)}
.caret.closed{transform:rotate(-90deg)}
.wbar{height:4px;background:var(--surface-3);border-radius:2px;width:60px;display:inline-block;vertical-align:middle;margin-left:6px;overflow:hidden}
.wbar i{display:block;height:100%;background:var(--ink-3);border-radius:2px}
.empty{padding:40px 20px;text-align:center;color:var(--ink-3);display:flex;flex-direction:column;align-items:center;gap:10px}
.empty b{color:var(--ink);font-size:15px}
.toolbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:12px 16px;border-bottom:1px solid var(--line)}
.toolbar .sp{flex:1}
.tsearch{position:relative;min-width:200px;flex:0 1 260px}
.tsearch svg{position:absolute;left:9px;top:9px;width:16px;height:16px;color:var(--ink-3)}
.tsearch .input{padding-left:32px;height:34px}
.bulkbar{position:sticky;bottom:16px;z-index:5;margin:0 auto;background:var(--ink);color:var(--surface);border-radius:12px;padding:8px 10px 8px 16px;display:flex;align-items:center;gap:12px;box-shadow:var(--shadow-2);width:max-content;max-width:100%}
.bulkbar .btn{height:30px}
.pager{display:flex;align-items:center;gap:8px;justify-content:flex-end;padding:10px 16px;color:var(--ink-3);font-size:12.5px}

/* lists */
.list{display:flex;flex-direction:column}
.li{display:flex;align-items:center;gap:12px;padding:10px 16px;border-top:1px solid var(--line)}
.li:first-child{border-top:0}
.li .grow{flex:1;min-width:0}
.li .t1{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.li .t2{font-size:12px;color:var(--ink-3)}
.li .r{text-align:right;font-variant-numeric:tabular-nums}
.li.click{cursor:pointer}.li.click:hover{background:var(--surface-2)}
.ico{width:32px;height:32px;border-radius:8px;display:grid;place-items:center;flex:none;background:var(--surface-3);color:var(--ink-2)}
.ico svg{width:17px;height:17px}
.ico.bad{background:var(--loss-soft);color:var(--loss)}.ico.warn{background:var(--warn-soft);color:var(--warn)}.ico.good{background:var(--gain-soft);color:var(--gain)}.ico.info{background:var(--info-soft);color:var(--info)}
.legend{display:flex;flex-direction:column;gap:2px}
.lg{display:flex;align-items:center;gap:8px;padding:5px 6px;border-radius:6px;font-size:13px;cursor:default}
.lg:hover,.lg.hl{background:var(--surface-2)}
.lg i{width:10px;height:10px;border-radius:3px;flex:none}
.lg .v{margin-left:auto;font-variant-numeric:tabular-nums;color:var(--ink-2)}
.lg .p{width:48px;text-align:right;font-weight:600;font-variant-numeric:tabular-nums}
.legend-inline{display:flex;gap:14px;flex-wrap:wrap;font-size:12.5px;color:var(--ink-2)}
.legend-inline span{display:inline-flex;align-items:center;gap:6px}
.legend-inline i{width:12px;height:3px;border-radius:2px;display:inline-block}
.legend-inline i.dash{background:repeating-linear-gradient(90deg,currentColor 0 4px,transparent 4px 7px)!important;height:2px}
.progress{height:8px;background:var(--surface-3);border-radius:5px;overflow:hidden}
.progress i{display:block;height:100%;border-radius:5px;background:var(--primary)}
.progress i.good{background:var(--gain)}.progress i.warn{background:var(--accent)}

/* charts */
.chart{position:relative;width:100%;min-width:0}
.chart svg{display:block;width:100%;height:auto;overflow:visible}
.chart text{fill:var(--ink-3);font:11px var(--f-ui);font-variant-numeric:tabular-nums}
.tip{position:fixed;z-index:200;pointer-events:none;background:var(--ink);color:var(--surface);border-radius:8px;padding:8px 10px;font-size:12px;box-shadow:var(--shadow-2);min-width:140px;max-width:280px;opacity:0;transition:opacity .1s}
.tip.on{opacity:1}
.tip .th{font-weight:600;margin-bottom:4px;opacity:.85}
.tip .tr{display:flex;align-items:center;gap:8px;justify-content:space-between;font-variant-numeric:tabular-nums}
.tip .tr span:first-child{display:flex;align-items:center;gap:6px;opacity:.85}
.tip i{width:8px;height:8px;border-radius:2px;display:inline-block}

/* drawer & modal */
.scrim{position:fixed;inset:0;background:var(--scrim);z-index:90;animation:fade .15s ease-out}
@keyframes fade{from{opacity:0}}
@keyframes slide{from{transform:translateX(24px);opacity:0}}
@keyframes pop{from{transform:translateY(8px) scale(.98);opacity:0}}
.drawer{position:fixed;top:0;right:0;bottom:0;width:min(760px,100%);background:var(--bg);z-index:100;box-shadow:var(--shadow-3);display:flex;flex-direction:column;animation:slide .2s ease-out;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px);padding-right:env(safe-area-inset-right,0px)}
.drawer-h{display:flex;align-items:flex-start;gap:12px;padding:16px 20px;border-bottom:1px solid var(--line);background:var(--surface)}
.drawer-h h2{font:700 20px/1.2 var(--f-display);margin:0;letter-spacing:-.015em}
.drawer-b{overflow-y:auto;padding:16px 20px 30px;display:flex;flex-direction:column;gap:14px}
.modal-wrap{position:fixed;inset:0;z-index:110;display:grid;grid-template-columns:minmax(0,1fr);place-items:center;padding:16px;overflow-y:auto}
.modal{background:var(--surface);border-radius:16px;box-shadow:var(--shadow-3);width:min(560px,100%);max-height:calc(100vh - 32px);display:flex;flex-direction:column;align-items:stretch;justify-self:center;text-align:left;animation:pop .18s ease-out;position:relative;z-index:1}
.modal-h>div:first-child{flex:1;min-width:0}
.modal-wrap>.scrim{z-index:0}
.modal-h{flex-wrap:wrap}
.modal-b,.modal-b>*{min-width:0;max-width:100%}
.paper{max-width:100%}
@media (max-width:760px){.toolbar .chips{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px;width:100%}.paper{padding:14px}.modal-wrap{padding:8px}}
/* Phones: dialogs rise from the bottom as sheets; big forms take the whole screen. */
@media (max-width:640px){
  .modal-wrap{padding:0;place-items:end stretch}
  .modal,.modal.lg,.modal.xl{width:100%;max-height:calc(100dvh - 24px);border-radius:18px 18px 0 0;animation:sheet .22s ease-out}
  .modal.lg,.modal.xl{max-height:100dvh;height:100dvh;border-radius:0}
  .modal-h{padding:14px 16px;padding-top:calc(14px + env(safe-area-inset-top,0px))}
  .modal-b{padding:14px 16px}
  .modal-f{padding:10px 16px calc(10px + env(safe-area-inset-bottom,0px));border-radius:0}
  .modal-f .btn{flex:1 1 auto;height:44px}
  .modal-f .l{flex:0 0 100%;justify-content:center;order:2}
  .modal.cmd{align-self:start;border-radius:0 0 18px 18px;max-height:80dvh}
  .modal{min-width:0;max-width:100vw}
  .chg-f .btn{max-width:100%;overflow:hidden;text-overflow:ellipsis;justify-content:flex-start}
  .tiles{grid-template-columns:repeat(2,minmax(0,1fr))}
  .tile{padding:10px 8px;gap:8px;min-height:56px}
  .tile>span{min-width:0}
  .tile .tt,.tile .ts{display:block;overflow-wrap:anywhere}
  .frow,.frow.c3,.frow.c4{gap:10px}
  .chg-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .chg-net{flex:1 1 100%;display:flex;align-items:center;justify-content:space-between;gap:8px}
  .set-row{flex-wrap:wrap;gap:8px 12px}
  .set-row .t{flex:1 1 60%}
  .drawer-h{padding:12px 16px}
  .drawer-b{padding:12px 16px 24px}
}
@keyframes sheet{from{transform:translateY(24px);opacity:0}}
.modal.lg{width:min(880px,100%)}
.modal.xl{width:min(1120px,100%)}
.modal-h{display:flex;align-items:center;gap:10px;padding:16px 20px;border-bottom:1px solid var(--line)}
.modal-h h2{font:600 17px/1.3 var(--f-ui);margin:0}
.modal-h .x{margin-left:auto}
.modal-b{padding:18px 20px;overflow-y:auto;display:flex;flex-direction:column;gap:14px}
.modal-f{display:flex;gap:8px;justify-content:flex-end;align-items:center;padding:12px 20px;border-top:1px solid var(--line);background:var(--surface-2);border-radius:0 0 16px 16px;flex-wrap:wrap}
.modal-f .l{margin-right:auto;display:flex;gap:8px;align-items:center}
.strip{display:flex;gap:6px;align-items:center;flex-wrap:wrap;background:var(--surface-2);border:1px solid var(--line);border-radius:10px;padding:10px 12px;font-size:13px}
.strip .op{color:var(--ink-3)}
.strip b{font-variant-numeric:tabular-nums}
.alert{display:flex;gap:10px;align-items:flex-start;border-radius:10px;padding:10px 12px;font-size:13px}
.alert.bad{background:var(--loss-soft);color:var(--loss)}
.alert.warn{background:var(--warn-soft);color:var(--warn)}
.alert.info{background:var(--info-soft);color:var(--info)}
.alert.good{background:var(--gain-soft);color:var(--gain)}
.alert svg{width:17px;height:17px;flex:none;margin-top:1px}
.tiles{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px}
.tile{border:1px solid var(--line);background:var(--surface);border-radius:10px;padding:10px;display:flex;gap:10px;align-items:center;cursor:pointer;text-align:left}
.tile:hover{border-color:var(--primary);background:var(--surface-2)}
.tile .tt{font-weight:500;font-size:13px;line-height:1.25}
.tile .ts{font-size:11px;color:var(--ink-3)}
.chg{border:1px solid var(--line);border-radius:12px;padding:12px;background:var(--surface-2);display:flex;flex-direction:column;gap:10px;min-width:0}
.chg-h{display:flex;gap:12px;align-items:center;flex-wrap:wrap}
.chg-tot{margin-left:auto;font-size:13px;color:var(--ink-2)}
.chg-tot b{color:var(--ink);font-variant-numeric:tabular-nums}
.chg-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.chg-grid .field>label{font-size:12px}
.chg-f{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.chg-net{margin-left:auto;display:flex;gap:8px;align-items:center}
.chg-x{border:0;background:none;padding:0;width:16px;height:16px;display:inline-grid;place-items:center;color:var(--ink-3);cursor:pointer;border-radius:4px}
.chg-x:hover{color:var(--loss);background:var(--loss-soft)}
.chg-x svg{width:12px;height:12px}
.btn.on-filter{border-color:var(--primary);color:var(--primary);background:var(--info-soft)}
.cat-h{font-size:11px;letter-spacing:.07em;text-transform:uppercase;color:var(--ink-3);font-weight:600;margin:6px 0 -2px}
.ta{position:relative}
.ta-list{position:absolute;left:0;right:0;top:calc(100% + 4px);background:var(--surface);border:1px solid var(--line-2);border-radius:10px;box-shadow:var(--shadow-2);z-index:5;max-height:260px;overflow-y:auto;padding:4px}
.ta-opt{display:flex;gap:8px;align-items:center;padding:7px 9px;border-radius:7px;cursor:pointer;font-size:13px}
.ta-opt:hover,.ta-opt.hl{background:var(--surface-3)}
.ta-opt .ms{margin-left:auto;color:var(--ink-3);font-size:12px;font-variant-numeric:tabular-nums}
.cn-grid{display:grid;gap:6px}
.cn-row{display:grid;grid-template-columns:90px minmax(0,2.2fr) repeat(3,minmax(0,1fr)) minmax(0,1.1fr) 30px;gap:6px;align-items:center}
.cn-row.h{font-size:11.5px;color:var(--ink-3);font-weight:600;text-transform:uppercase;letter-spacing:.04em}
@media (max-width:760px){.cn-row{grid-template-columns:1fr 1fr}.cn-row.h{display:none}}

/* toast */
.toasts{position:fixed;bottom:calc(20px + env(safe-area-inset-bottom,0px));left:50%;transform:translateX(-50%);z-index:300;display:flex;flex-direction:column;gap:8px;align-items:center;width:max-content;max-width:calc(100% - 32px)}
body:has(.modal-wrap) .toasts{bottom:auto;top:calc(16px + env(safe-area-inset-top,0px))}
.toast{background:var(--ink);color:var(--surface);border-radius:10px;padding:9px 10px 9px 14px;display:flex;align-items:center;gap:12px;box-shadow:var(--shadow-2);font-size:13.5px;animation:pop .2s ease-out}
.toast button{background:none;border:0;color:var(--accent);font-weight:600;cursor:pointer;padding:3px 6px;border-radius:5px}
.toast button:hover{background:rgba(255,255,255,.1)}
.toast svg{width:17px;height:17px;color:#55D18F}

/* popover */
.pop{position:fixed;z-index:120;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow-2);min-width:260px;max-width:min(380px,calc(100vw - 24px));max-height:70vh;overflow-y:auto;animation:pop .15s ease-out}
.pop-h{padding:10px 14px;font-size:11px;letter-spacing:.07em;text-transform:uppercase;color:var(--ink-3);font-weight:600}
.pop-i{display:flex;align-items:center;gap:10px;padding:8px 14px;cursor:pointer;font-size:13.5px;border:0;background:none;width:100%;text-align:left}
.pop-i:hover{background:var(--surface-2)}
.pop-i.on{font-weight:600}
.pop-i .ck{margin-left:auto;color:var(--primary)}
.pop-sep{height:1px;background:var(--line);margin:4px 0}

/* command palette */
.cmd{width:min(620px,100%);align-self:start;margin-top:10vh}
.cmd .input{height:48px;border:0;border-bottom:1px solid var(--line);border-radius:16px 16px 0 0;font-size:15px;padding:0 18px}
.cmd .input:focus{box-shadow:none}
.cmd-list{max-height:52vh;overflow-y:auto;padding:6px}
.cmd-g{font-size:11px;letter-spacing:.07em;text-transform:uppercase;color:var(--ink-3);font-weight:600;padding:8px 10px 4px}
.cmd-i{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:8px;cursor:pointer}
.cmd-i.hl{background:var(--surface-3)}
.cmd-i .ms{margin-left:auto;color:var(--ink-3);font-size:12px}

/* report viewer */
.paper{background:#fff;color:#1A2433;border-radius:6px;box-shadow:var(--shadow-1);padding:24px;min-width:0;border:1px solid var(--line)}
.paper h3{margin:0;text-align:center;font:700 16px var(--f-ui);color:#0B2A55}
.paper .rp-sub{text-align:center;font-size:12.5px;color:#4A5668;margin:4px 0 14px}
.paper table{width:100%;border-collapse:collapse;font-size:12px;font-variant-numeric:tabular-nums}
.paper th{background:#0B2A55;color:#fff;padding:7px 8px;text-align:left;font-weight:600;white-space:nowrap}
.paper th.n,.paper td.n{text-align:right}
.paper td{padding:6px 8px;border-bottom:1px solid #E6EAF0;color:#1A2433}
.paper tr.band td{background:#DCEAF5;font-weight:700;border-top:1px solid #B8CDE2}
.paper tr.band2 td{background:#EEF1F5;font-weight:600}
.paper tr.tot td{background:#DCEAF5;font-weight:700}
.paper tr:nth-child(even):not(.band):not(.band2):not(.tot) td{background:#FAFBFC}
.paper .up-t{color:#0E7A43}.paper .dn-t{color:#C2312F}
.paper .rp-foot{display:flex;justify-content:space-between;font-size:11px;color:#6B7788;margin-top:14px;border-top:1px solid #E6EAF0;padding-top:8px}
.rp-cats{display:flex;flex-direction:column;gap:4px}
.rp-cat{border:0;background:none;text-align:left;padding:8px 10px;border-radius:8px;cursor:pointer;font-weight:500;color:var(--ink-2);display:flex;gap:8px;align-items:center}
.rp-cat:hover{background:var(--surface-3);color:var(--ink)}
.rp-cat.on{background:var(--info-soft);color:var(--info)}
.rp-card{border:1px solid var(--line);border-radius:12px;padding:14px;display:flex;flex-direction:column;gap:8px;background:var(--surface)}
.rp-card h4{margin:0;font-size:14px;font-weight:600}
.rp-card p{margin:0;color:var(--ink-3);font-size:12.5px;flex:1}

.drop{border:2px dashed var(--line-2);border-radius:14px;padding:26px;text-align:center;display:flex;flex-direction:column;gap:8px;align-items:center;color:var(--ink-3);background:var(--surface-2)}
.drop.over{border-color:var(--primary);background:var(--info-soft)}
.conn{display:flex;gap:10px;align-items:center;border:1px solid var(--line);border-radius:12px;padding:12px;background:var(--surface);cursor:pointer;text-align:left}
.conn:hover{border-color:var(--ink-3)}
.conn .lg-ico{width:36px;height:36px;border-radius:9px;display:grid;place-items:center;font:700 13px var(--f-display);color:#fff;flex:none}

.goal{display:flex;flex-direction:column;gap:10px;padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--surface)}
.goal h3{margin:0;font-size:15px}
.goal .row{display:flex;justify-content:space-between;gap:8px;font-size:12.5px;color:var(--ink-3)}
.goal .row b{color:var(--ink);font-variant-numeric:tabular-nums}

.insight{display:flex;gap:12px;padding:12px 16px;border-top:1px solid var(--line);align-items:flex-start}
.insight:first-child{border-top:0}
.insight .t1{font-weight:500}
.insight .t2{font-size:12.5px;color:var(--ink-3);margin-top:2px}
.insight .grow{flex:1;min-width:0}

.mobile-nav{display:none}
.side-close{display:none}
.top-m,.side-user,.hlist{display:none}
.nw{white-space:nowrap}
@media (max-width:900px){
  .app{grid-template-columns:minmax(0,1fr)}
  /* Phone shell: switcher + search + alerts on top; account, privacy and theme in the drawer. */
  .top{gap:8px;padding-block:8px;padding-left:max(10px,env(safe-area-inset-left,0px));padding-right:max(12px,env(safe-area-inset-right,0px))}
  .top-m{display:flex;align-items:center;gap:8px;width:100%;min-width:0}
  .scope-m{display:flex;align-items:center;gap:6px;min-width:0;flex:0 1 auto;height:40px;padding:0 8px 0 6px;border:0;border-radius:10px;background:none;color:var(--ink);font:600 15.5px/1 var(--f-display);letter-spacing:-.01em;cursor:pointer;text-align:left}
  .scope-m svg{width:18px;height:18px;flex:none;color:var(--ink-3)}
  .scope-m .chev{width:16px;height:16px}
  .scope-m span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .top-m-acts{display:flex;gap:6px;margin-left:auto;flex:none}
  .top-m .icon-btn{width:40px;height:40px;border-radius:10px}
  .side-user{display:flex;align-items:center;gap:8px;padding:8px 6px;border-top:1px solid rgba(255,255,255,.08);margin-top:4px}
  .side-user .avatar{width:30px;height:30px;font-size:12px;flex:none}
  .side-user .su-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;color:var(--nav-ink-strong)}
  .side-user .icon-btn{width:34px;height:34px;background:transparent;border-color:rgba(255,255,255,.14);color:var(--nav-ink)}
  .side-user .icon-btn.on{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
  .content{padding-top:12px;gap:12px;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
  .ph{gap:8px}
  .ph .acts{width:100%;margin-left:0}
  .ph .acts .btn-primary[data-act="addTx"]{display:none}
  .grid{gap:12px}
  .kpi .card-b{padding:14px;gap:3px}
  .kpi .val{font-size:20px}
  .card-h{padding:12px 14px 0}
  .card-b{padding:12px 14px 14px}
  .sample-banner{padding:7px 12px;font-size:12px;border-radius:8px;flex-wrap:nowrap;align-items:flex-start}
  .sample-banner>svg{flex:none;margin-top:1px}
  .sample-banner>span{flex:1;min-width:0}
  /* Holdings as a list */
  .hlist{display:block}
  .hl-head{display:flex;align-items:center;gap:8px;padding:8px 14px;border-bottom:1px solid var(--line);font-size:12.5px;color:var(--ink-3)}
  .hl-head .seg{margin-left:auto}
  .hl-grp,.hl-row,.hl-foot{display:flex;align-items:center;gap:10px;padding:10px 14px;border-top:1px solid var(--line)}
  .hl-grp{background:var(--surface-3);font-weight:600;font-size:13px;cursor:pointer;min-height:44px}
  .hl-grp .ms{font-weight:400;color:var(--ink-3);font-size:12px}
  .hl-row{min-height:56px;cursor:pointer;padding-left:28px}
  .hl-row:active{background:var(--surface-2)}
  .hl-row .t1{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .hl-grp .grow,.hl-row .grow,.hl-foot .grow{flex:1;min-width:0}
  .hl-row .t2,.hl-grp .t2,.hl-foot .t2{font-size:12px;color:var(--ink-3);margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .hl-grp .r,.hl-row .r,.hl-foot .r{text-align:right;font-variant-numeric:tabular-nums;flex:none}
  .hl-grp .r b,.hl-row .r b,.hl-foot .r b{display:block;font-weight:600}
  .hl-foot{background:var(--info-soft);font-weight:700;position:sticky;bottom:0}
  /* Any remaining data table becomes one card per row: first cell as the title, the rest as label/value pairs
     (labels are copied from the header by labelTables()). Tables with a hand-made phone list are hidden instead. */
  .tbl-wrap{overflow-x:visible;max-height:none!important}
  table.t thead{display:none}
  table.t,table.t tbody,table.t tfoot{display:block;width:100%}
  table.t tr{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 12px;padding:10px 14px;border-bottom:1px solid var(--line)}
  table.t tr:last-child{border-bottom:0}
  table.t td,table.t td.n{display:block;border:0;padding:0;text-align:left;min-width:0;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
  table.t td.first,table.t td:first-child{grid-column:1/-1;font-weight:500;position:static}
  table.t td[data-l]::before{content:attr(data-l);display:block;font-size:10.5px;letter-spacing:.04em;text-transform:uppercase;color:var(--ink-3);margin-bottom:1px}
  table.t td:first-child::before,table.t td:empty{display:none}
  /* A row whose first cell is just a checkbox shows that column's label beside it (e.g. "Include"). */
  table.t td:first-child:has(> input[type=checkbox]:only-child){display:flex;flex-direction:row-reverse;justify-content:flex-end;align-items:center;gap:8px}
  table.t td[data-l]:first-child:has(> input[type=checkbox]:only-child)::before{display:block;margin:0;font-size:13px;letter-spacing:0;text-transform:none;color:var(--ink-2)}
  table.t tr.grp td{background:transparent}
  table.t tr.grp{background:var(--surface-3)}
  table.t tfoot td{position:static;background:transparent;border:0}
  table.t tfoot tr{background:var(--info-soft)}
  table.t .aname{min-width:0}
  table.t .aname .nm{max-width:none;white-space:normal}
  .toolbar{padding:10px 12px;gap:8px}
  .toolbar .tsearch{flex:1 1 100%;min-width:0}
  .seg{max-width:100%;min-width:0;flex:0 1 auto;overflow-x:auto;scrollbar-width:none;align-self:flex-start}
  .toolbar .select{flex:1 1 40%;min-width:0;width:auto!important}
  .toolbar .flabel{display:none}
  .toolbar .sp{flex:1 1 100%;display:none}
  .side{position:fixed;inset:0 auto 0 0;width:min(300px,86vw);z-index:150;transform:translateX(-102%);transition:transform .2s;height:100%;padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}
  .side.open{transform:none;box-shadow:var(--shadow-3)}
  .side-close{display:grid}
  .top .search span.long{display:none}
  .content{padding-bottom:calc(90px + env(safe-area-inset-bottom,0px))}
  .mobile-nav{display:grid;grid-template-columns:repeat(5,1fr);position:fixed;left:0;right:0;bottom:0;z-index:40;background:var(--surface);border-top:1px solid var(--line);padding-top:6px;padding-bottom:calc(6px + env(safe-area-inset-bottom,0px));padding-left:max(8px,env(safe-area-inset-left,0px));padding-right:max(8px,env(safe-area-inset-right,0px))}
  .mobile-nav button{border:0;background:none;display:flex;flex-direction:column;align-items:center;gap:2px;font-size:10.5px;color:var(--ink-3);padding:4px 0;cursor:pointer;min-height:44px}
  .mobile-nav button svg{width:21px;height:21px}
  .mobile-nav button.on{color:var(--ink)}
  .mobile-nav .fab{width:46px;height:46px;border-radius:14px;background:var(--primary);color:#fff;display:grid;place-items:center;margin-top:-16px;box-shadow:var(--shadow-2)}
  .ph h1{font-size:22px}
  .hero .big{font-size:32px}
  .toasts{bottom:calc(84px + env(safe-area-inset-bottom,0px))}
  .hide-m{display:none!important}
}
@media (min-width:901px){.show-m{display:none!important}}
/* Phones: small controls get a comfortable tap height. */
@media (max-width:900px){.seg button{min-height:36px;padding-inline:12px}.btn-sm{height:36px}.input-sm{height:40px}}
.privacy .money{filter:blur(0)}

/* ---------- Phone pages (mobile.js) ---------- */
@media (max-width:900px){
  .content.m-view{display:flex;flex-direction:column;gap:0;padding-top:4px}
  .m-view > .card,.m-view > .m-list,.m-view > .m-kpis,.m-view > .m-stack,.m-view > .alert,.m-view > .sample-banner{margin-bottom:16px}
  .m-view .card{border-radius:16px}
  .m-ph{display:flex;align-items:center;gap:8px;min-height:44px;margin:8px 0 16px}
  .m-ph h1{margin:0 auto 0 0;font:700 26px/1.15 var(--f-display);letter-spacing:-.01em;min-width:0;text-wrap:balance}
  .m-back h1{font-size:22px}
  .m-ib{width:44px;height:44px;display:grid;place-items:center;border:0;background:none;border-radius:12px;color:var(--ink-2);cursor:pointer;flex:none;position:relative}
  .m-ib svg{width:21px;height:21px}
  .m-ib:active,.m-ib[aria-pressed="true"]{background:var(--surface-3)}
  .m-pill{display:inline-flex;align-items:center;gap:6px;height:36px;padding:0 12px;border-radius:18px;border:1px solid var(--line-2);background:var(--surface);font-size:14px;font-weight:500;white-space:nowrap;cursor:pointer;flex:none;color:var(--ink)}
  .m-pill svg{width:16px;height:16px}
  .m-pill-sq{height:44px;min-width:44px;border-radius:12px;justify-content:center}
  .m-badge{min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:var(--primary);color:var(--on-primary);font-size:12px;font-weight:600;display:grid;place-items:center}
  .m-hero{background:var(--nav);color:#fff;border-radius:20px;padding:20px;display:flex;flex-direction:column;margin-bottom:16px;position:relative;overflow:hidden}
  .m-hero::after{content:"";position:absolute;right:-60px;top:-60px;width:180px;height:180px;border-radius:50%;border:28px solid rgba(255,255,255,.05);pointer-events:none}
  .m-hero .lbl{font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--nav-ink)}
  .m-hero .big{font:700 34px/1.1 var(--f-display);margin:4px 0 12px;letter-spacing:-.01em}
  .m-hero .kv{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;border-top:1px solid rgba(255,255,255,.12);padding-top:12px}
  .m-hero .kv span{display:block;font-size:12px;color:var(--nav-ink)}
  .m-hero .kv b{font-size:14px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
  .m-hero .up-t{color:#7FE0AE} .m-hero .dn-t{color:#FF9C96}
  .m-sec{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:8px 0;min-height:36px}
  .m-sec h2{margin:0;font-size:16px;font-weight:600}
  .m-sec .link{font-size:14px;padding:8px 0}
  .m-grp{font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3);margin:8px 4px;min-height:4px}
  .m-count{font-size:13px;color:var(--ink-3)}
  .m-note{font-size:12.5px;color:var(--ink-3);margin-top:8px}
  .m-meta{font-size:13px;color:var(--ink-3);margin-bottom:8px;display:flex;gap:12px;flex-wrap:wrap;align-items:center}
  .m-key{display:inline-flex;align-items:center;gap:6px}
  .m-key i{width:14px;border-top:2px dashed var(--ink-3)}
  .m-key-s1 i{border-top:2px solid var(--s1)} .m-key-s2 i{border-top:2px dashed var(--s2)}
  .m-list{background:var(--surface);border:1px solid var(--line);border-radius:16px;overflow:hidden;margin-bottom:16px}
  .m-row{display:flex;align-items:center;gap:12px;padding:12px 16px;min-height:64px;width:100%;border:0;background:none;text-align:left;font:inherit;color:inherit}
  .m-row + .m-row,.m-gh + .m-row,.m-row + .m-gh{border-top:1px solid var(--line)}
  .m-row.click{cursor:pointer} .m-row.click:active{background:var(--surface-2)}
  .m-row .grow{flex:1;min-width:0}
  .m-row .t1{font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .m-row .t2{font-size:13px;color:var(--ink-3);margin-top:2px;overflow:hidden;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
  .m-row .r{text-align:right;flex:none;max-width:48%;font-variant-numeric:tabular-nums}
  .m-row .r .t1{font-weight:600}
  .m-row .r .t2{display:block;white-space:nowrap}
  .m-row .chev{width:18px;height:18px;color:var(--ink-3);flex:none}
  .m-row .ico,.m-goal-h .ico{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;flex:none;background:var(--surface-3);color:var(--ink-2)}
  .m-row .ico svg,.m-goal-h .ico svg{width:20px;height:20px}
  .m-row .ico.good,.m-goal-h .ico.good{background:var(--gain-soft);color:var(--gain)}
  .m-row .ico.warn,.m-goal-h .ico.warn{background:var(--warn-soft);color:var(--warn)}
  .m-row .ico.info{background:var(--info-soft);color:var(--info)}
  .m-row .badge,.m-ca .badge{width:40px;height:40px;border-radius:12px;flex:none;display:grid;place-items:center}
  .m-row .lg-ico{width:40px;height:40px;border-radius:12px;flex:none}
  .m-signout{justify-content:center;color:var(--loss);font-weight:600;cursor:pointer;min-height:56px}
  .m-strip{display:flex;gap:8px;overflow-x:auto;margin:0 -16px 8px;padding:0 16px 4px;scroll-snap-type:x mandatory;scroll-padding-inline:16px;scrollbar-width:none}
  .m-strip::-webkit-scrollbar{display:none}
  .m-cc{flex:none;width:140px;scroll-snap-align:start;text-align:left;border:1px solid var(--line);background:var(--surface);border-radius:14px;padding:12px;display:flex;flex-direction:column;gap:2px;cursor:pointer;font:inherit;color:inherit}
  .m-cc .nm{font-size:13px;color:var(--ink-2);display:flex;align-items:center;gap:6px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .m-cc .nm i{width:8px;height:8px;border-radius:2px;flex:none}
  .m-cc .vv{font-weight:600;font-size:16px;font-variant-numeric:tabular-nums}
  .m-cc .pp{font-size:12px;color:var(--ink-3);font-variant-numeric:tabular-nums}
  .m-cc.on{border-color:var(--primary);box-shadow:inset 0 0 0 1px var(--primary);background:var(--info-soft)}
  .m-tools{display:flex;align-items:center;gap:4px;margin:8px 0}
  .m-tools .lbl{margin-right:auto;font-weight:600;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .m-tools .lbl span{font-weight:400;color:var(--ink-3)}
  .m-search,.m-searchrow .tsearch{max-width:none;flex:1;margin-bottom:8px}
  .m-search svg,.m-searchrow .tsearch svg{top:14px;left:12px}
  .m-search .input,.m-searchrow .tsearch .input{padding-left:36px;font-size:16px}
  .m-sheet .modal-h h2{margin-right:auto}
  .m-ins .t1{white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
  .m-searchrow{display:flex;gap:8px;align-items:flex-start}
  .m-searchrow .tsearch .input,.m-search .input{height:44px}
  .m-chips{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:8px}
  .m-chips .chip{height:32px;cursor:pointer}
  .m-chips .chip svg{width:14px;height:14px}
  .m-gh{display:flex;align-items:center;gap:8px;width:100%;padding:12px 16px;min-height:48px;border:0;background:var(--surface-2);font:inherit;color:inherit;text-align:left;cursor:pointer}
  .m-gh i{width:10px;height:10px;border-radius:3px;flex:none}
  .m-gh .ms{color:var(--ink-3);font-size:13px;margin-right:auto}
  .m-gh .v{font-weight:600;font-size:14px;font-variant-numeric:tabular-nums}
  .m-gh .chev{width:16px;height:16px;color:var(--ink-3);transition:transform .2s}
  .m-gh.closed .chev{transform:rotate(-90deg)}
  .m-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .m-kpis .card{padding:14px;display:flex;flex-direction:column;gap:2px;min-width:0}
  .m-kpis span{font-size:13px;color:var(--ink-3)}
  .m-kpis b{font-size:20px;font-weight:600;font-variant-numeric:tabular-nums}
  .m-kpis small{font-size:12px;color:var(--ink-3)}
  .m-donut{display:flex;flex-direction:column;gap:12px}
  .m-tgt{flex-direction:column;align-items:stretch;gap:8px;min-height:0}
  .m-tgt-h{display:flex;justify-content:space-between;align-items:center;gap:8px;flex-wrap:wrap;font-size:14px}
  .m-tgt-h i{display:inline-block;width:10px;height:10px;border-radius:3px;margin-right:8px}
  .m-bar{position:relative;height:8px;border-radius:4px;background:var(--surface-3)}
  .m-bar i{position:absolute;inset:0 auto 0 0;border-radius:4px}
  .m-bar b{position:absolute;top:-3px;bottom:-3px;width:2px;margin-left:-1px;background:var(--ink);border-radius:1px}
  .m-num{width:76px;text-align:right;height:40px}
  .m-stack{display:flex;flex-direction:column;gap:12px}
  .m-goal{display:flex;flex-direction:column;gap:10px;padding:16px;text-align:left;font:inherit;color:inherit;width:100%;cursor:pointer}
  .m-goal-h{display:flex;align-items:center;gap:12px}
  .m-goal-h .grow{flex:1;min-width:0}
  .m-goal-h .t1{font-weight:600}
  .m-goal .t2,.m-ca .t2,.m-goal-h .t2{font-size:13px;color:var(--ink-3)}
  .m-ca{padding:16px;display:flex;flex-direction:column;gap:12px}
  .m-btns{display:flex;gap:8px;margin-top:4px} .m-btns .btn{flex:1;height:44px;justify-content:center}
  .m-sticky{position:sticky;bottom:calc(76px + env(safe-area-inset-bottom,0px));padding-top:16px;background:linear-gradient(transparent,var(--bg) 30%);z-index:2}
  .btn-block{width:100%;height:48px;justify-content:center}
  .m-more{margin-bottom:16px}
  .m-alert{display:flex;align-items:center;gap:12px;background:var(--warn-soft);color:var(--ink);border-radius:14px;padding:12px 12px 12px 16px;margin-bottom:16px}
  .m-alert > svg{width:20px;height:20px;color:var(--warn);flex:none}
  .m-alert .grow{flex:1;min-width:0;font-size:14px} .m-alert b{display:block} .m-alert span{color:var(--ink-2)}
  .m-user{display:flex;align-items:center;gap:12px;margin:8px 0;min-height:56px}
  .m-user .grow{flex:1;min-width:0} .m-user .t1{font-weight:600} .m-user .t2{font-size:13px;color:var(--ink-3)}
  .m-view .avatar{width:44px;height:44px;flex:none}
  .m-wm{display:flex;justify-content:center;margin:8px 0 16px}
  .m-wm .wordmark{font-size:18px}
  .m-drop{display:flex;flex-direction:column;align-items:center;gap:8px;padding:24px;border:2px dashed var(--line-2);text-align:center;cursor:pointer}
  .m-drop .ico{width:52px;height:52px;border-radius:14px;display:grid;place-items:center;background:var(--info-soft);color:var(--primary)}
  .m-drop .t2{font-size:13px;color:var(--ink-3)}
  .m-paste summary{padding:14px 16px;cursor:pointer;font-weight:500;min-height:48px}
  .m-paste .card-b{display:flex;flex-direction:column;gap:12px;padding-top:0}
  .m-setsub > .ph,.m-setsub > .seg{display:none}
  .m-fg h4{margin:0 0 8px;font-size:12px;font-weight:600;color:var(--ink-3);letter-spacing:.05em;text-transform:uppercase}
  .m-fg .seg{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;max-width:none;width:100%}
  .m-fg .seg button{min-height:40px}
  .m-opts{display:flex;flex-wrap:wrap;gap:8px}
  .m-opt{height:40px;padding:0 14px;border-radius:20px;border:1px solid var(--line-2);background:var(--surface);font:inherit;font-size:14px;color:inherit;display:inline-flex;align-items:center;gap:6px;cursor:pointer}
  .m-opt.on{border-color:var(--primary);background:var(--info-soft);font-weight:600}
  .m-opt.on::before{content:"";width:11px;height:6px;border-left:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(-45deg) translateY(-2px)}
  .m-swrow{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px;cursor:pointer}
  .m-sheet .m-sheet-b{display:flex;flex-direction:column;gap:20px}
  .m-sheet .m-list{margin-bottom:0}
  .mobile-nav button{font-size:11px}
  .mobile-nav button.on{font-weight:600}
  .mobile-nav button.on svg{color:var(--primary)}
  .mobile-nav button.on::after{content:"";width:18px;height:3px;border-radius:2px;background:var(--accent);margin-top:1px}
}
@media (max-width:900px) and (prefers-reduced-motion: reduce){.m-gh .chev{transition:none}}

/* Additions for the production app: sign-in screens, sync status, recovery codes. Uses the tokens in styles.css. */
body.auth-mode { background: var(--bg); }
/* Sign-in (design B): the logo stands on the page above a plain card that holds only the form. One column at every size. */
.auth-wrap { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 32px; padding-block: 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.auth-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-2); padding: 32px; display: flex; flex-direction: column; gap: 16px; }
.auth-card h1 { margin: 0 0 4px; font: 700 20px/1.2 var(--f-display); letter-spacing: -.015em; }
.auth-sub { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.auth-card h1 + .auth-sub { margin-top: -8px; margin-bottom: 4px; }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: 12px; }
.auth-brand .brand-mark { width: 48px; height: 48px; }
.auth-brand b.wordmark { display: block; font: 700 32px/1 var(--f-display); letter-spacing: -.025em; }
@media (max-width: 480px) {
  .auth-wrap { gap: 24px; padding-block: 32px; }
  .auth-card { padding: 24px; }
  .auth-brand .brand-mark { width: 40px; height: 40px; }
  .auth-brand b.wordmark { font-size: 28px; }
}
/* Floating labels: the field's name sits inside it, then moves to the top edge once the field has focus or a value. */
.fl { position: relative; }
.auth-card .fl .input { height: 56px; padding: 22px 14px 6px; }
.fl > label { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); font-size: 15px; color: var(--ink-3); pointer-events: none; transform-origin: left top; transition: top .15s ease, font-size .15s ease, color .15s ease, transform .15s ease; white-space: nowrap; max-width: calc(100% - 64px); overflow: hidden; text-overflow: ellipsis; }
.fl .input:focus ~ label, .fl .input:not(:placeholder-shown) ~ label, .fl .input:-webkit-autofill ~ label { top: 9px; transform: none; font-size: 12px; font-weight: 500; color: var(--ink-2); }
.fl .input:focus ~ label { color: var(--primary); }
.fl .input::placeholder { color: transparent; }
.auth-card .fl .input.otp { height: 56px; padding-top: 20px; }
.auth-forgot { display: flex; justify-content: flex-end; margin-top: -8px; font-size: 13.5px; }
.auth-alt { margin: 8px 0 0; text-align: center; font-size: 14px; color: var(--ink-3); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
/* 8pt rhythm: fields sit 16px apart; the action that submits them stands 32px clear of the last field. */
.auth-form > .btn[type="submit"] { margin-top: 16px; }
.auth-wide { width: 100%; height: auto; min-height: 48px; padding: 8px 16px; white-space: normal; text-align: center; line-height: 1.3; border-radius: 12px; font-size: 15px; font-weight: 600; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 12px; margin-block: 8px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--ink-3); }
.auth-foot { font-size: 12.5px; color: var(--ink-3); text-align: center; margin-top: -8px; }
.auth-foot a { color: var(--ink-2); }

/* Fields: taller, soft fill at rest, primary ring on focus; the label follows the focus. */
.auth-card .input { height: 48px; border-radius: 12px; padding: 0 14px; font-size: 15px; background: var(--surface-2); transition: border-color .2s ease, box-shadow .25s ease, background-color .2s ease; }
.auth-card .input:hover { border-color: var(--ink-3); }
.auth-card .input:focus { background: var(--surface); border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 16%, transparent); }
.auth-card .field > label { transition: color .2s ease; }
.auth-card .field:focus-within > label, .auth-card .field.filled > label { color: var(--ink); }
.auth-card .input.otp { height: 52px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 48px; }
.pw-eye { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--ink-3); cursor: pointer; transition: background-color .15s, color .15s; }
.pw-eye:hover { background: var(--surface-3); color: var(--ink); }
.pw-eye:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.pw-eye svg { width: 18px; height: 18px; }
.caps { font-size: 12px; font-weight: 500; color: var(--warn); animation: authFade .2s ease both; }

/* Buttons: a little lift on hover; a spinner replaces the label while signing in. */
.auth-card .btn { transition: background-color .15s, border-color .15s, box-shadow .2s, transform .15s; }
.auth-card .btn-primary { box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--primary) 70%, transparent); }
.auth-card .btn:not([disabled]):hover { transform: translateY(-1px); }
.auth-card .btn-primary:not([disabled]):hover { box-shadow: 0 10px 22px -8px color-mix(in srgb, var(--primary) 80%, transparent); }
.auth-card .btn:not([disabled]):active { transform: translateY(0) scale(.98); transition-duration: .08s; }
/* Working: a light sweep crosses the primary button under the spinner. Done: it turns green and draws a tick. */
.auth-card .btn-primary.is-loading { overflow: hidden; }
.auth-card .btn-primary.is-loading::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.22) 50%, transparent 80%); transform: translateX(-100%); animation: authSweep 1.1s cubic-bezier(.4, 0, .2, 1) infinite; }
.auth-card .btn.is-done { background: var(--gain); border-color: var(--gain); color: #fff; box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--gain) 70%, transparent); animation: authPop .38s cubic-bezier(.16, 1, .3, 1); }
.done-check { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.done-check path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: authDraw .42s .08s cubic-bezier(.16, 1, .3, 1) forwards; }
.btn.is-loading { position: relative; color: transparent !important; opacity: 1; cursor: progress; --spin: var(--ink); }
.btn-primary.is-loading { --spin: var(--on-primary); }
.btn.is-loading > * { visibility: hidden; }
.btn.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--spin) 25%, transparent); border-top-color: var(--spin); animation: authSpin .7s linear infinite; }

/* Screen changes: the card's contents rise in one after another; a failed attempt shakes the card. */
.auth-card.enter > * { animation: authRise .45s cubic-bezier(.2, .7, .2, 1) both; }
.auth-card.enter > :nth-child(2) { animation-delay: .04s; }
.auth-card.enter > :nth-child(3) { animation-delay: .08s; }
.auth-card.enter > :nth-child(4) { animation-delay: .12s; }
.auth-card.enter > :nth-child(5) { animation-delay: .16s; }
.auth-card.enter > :nth-child(6) { animation-delay: .2s; }
.auth-card.enter > :nth-child(n+7) { animation-delay: .24s; }
.auth-card.shake { animation: authShake .42s cubic-bezier(.36, .07, .19, .97) both; }
@keyframes authRise { from { opacity: 0; transform: translateY(10px); } }
@keyframes authFade { from { opacity: 0; } }
@keyframes authSpin { to { transform: rotate(360deg); } }
@keyframes authShake { 15%, 85% { transform: translateX(-2px); } 30%, 70% { transform: translateX(5px); } 45%, 55% { transform: translateX(-6px); } }
@keyframes authSweep { to { transform: translateX(100%); } }
@keyframes authPop { 40% { transform: scale(1.03); } }
@keyframes authDraw { to { stroke-dashoffset: 0; } }

/* First paint (the one authored moment): the diamond turns 45° into place and sends out a mint ring, the wordmark wipes
   in left to right, then the card rises. Everything is visible by default; only the .intro class animates. */
.auth-brand .brand-mark { position: relative; }
.auth-shell.intro .auth-brand .brand-mark { animation: markIn .75s cubic-bezier(.16, 1, .3, 1) both; }
.auth-shell.intro .auth-brand .brand-mark::after,
.auth-loading .auth-brand .brand-mark::after { content: ""; position: absolute; inset: -4px; border-radius: 30%; border: 2px solid #2BE0B4; opacity: 0; pointer-events: none; }
.auth-shell.intro .auth-brand .brand-mark::after { animation: markPing .9s .5s cubic-bezier(.16, 1, .3, 1) both; }
.auth-shell.intro .auth-brand .wordmark { animation: wordIn .7s .2s cubic-bezier(.16, 1, .3, 1) both; }
.auth-shell.intro .auth-card { animation: cardIn .65s .32s cubic-bezier(.16, 1, .3, 1) both; }
.auth-shell.intro .auth-foot { animation: authFade .5s .6s ease both; }
@keyframes markIn { from { opacity: 0; transform: translateY(10px) rotate(-45deg) scale(.55); } }
@keyframes markPing { 0% { opacity: .9; transform: scale(.85); } 100% { opacity: 0; transform: scale(1.7); } }
@keyframes wordIn { from { opacity: .001; clip-path: inset(-20% 100% -40% 0); transform: translateX(-6px); } to { opacity: 1; clip-path: inset(-20% 0 -40% 0); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(.985); } }
/* Loading the family after sign-in: the mark breathes and keeps pinging until the app appears. */
.auth-loading .auth-brand .brand-mark { animation: markBreath 1.6s ease-in-out infinite; }
.auth-loading .auth-brand .brand-mark::after { animation: markPing 1.6s cubic-bezier(.16, 1, .3, 1) infinite; }
@keyframes markBreath { 50% { transform: scale(.92); } }

/* Screen changes and the keyboard opening are View Transitions: the logo and card morph between layouts. */
.auth-shell .auth-brand { view-transition-name: auth-brand; }
.auth-shell .auth-card { view-transition-name: auth-card; }
.auth-shell .auth-foot { view-transition-name: auth-foot; }
::view-transition-group(auth-brand), ::view-transition-group(auth-card), ::view-transition-group(auth-foot) { animation-duration: .42s; animation-timing-function: cubic-bezier(.16, 1, .3, 1); }
::view-transition-old(auth-card) { animation: .16s ease-in both authFadeOut; }
::view-transition-new(auth-card) { animation: .34s .06s cubic-bezier(.16, 1, .3, 1) both authFade; }
@keyframes authFadeOut { to { opacity: 0; } }

/* Keyboard open on a phone: smaller logo, card pulled to the top, footer hidden, so the fields stay above the keys. */
body.auth-mode.kb-open .auth-wrap { justify-content: flex-start; gap: 12px; padding-block: max(12px, env(safe-area-inset-top, 0px)) 16px; min-height: 0; }
body.auth-mode.kb-open .auth-brand .brand-mark { width: 28px; height: 28px; }
body.auth-mode.kb-open .auth-brand b.wordmark { font-size: 20px; }
body.auth-mode.kb-open .auth-card { padding-block: 20px; }
body.auth-mode.kb-open .auth-foot { display: none; }
.auth-card .fl .input { scroll-margin-block: 24px; }

@media (prefers-reduced-motion: reduce) {
  .auth-card.enter > *, .auth-card.shake, .caps, .btn.is-loading::after { animation: none; }
  .auth-card .btn:not([disabled]):hover { transform: none; }
  .auth-shell.intro .auth-brand .brand-mark, .auth-shell.intro .auth-brand .wordmark, .auth-shell.intro .auth-card, .auth-loading .auth-brand .brand-mark { animation: authFade .3s ease both; }
  .auth-shell.intro .auth-brand .brand-mark::after, .auth-loading .auth-brand .brand-mark::after, .auth-card .btn-primary.is-loading::before { animation: none; display: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
.input.otp { font: 600 20px var(--f-mono); letter-spacing: .3em; text-align: center; height: 46px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.pw-meter { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; background: var(--loss); transition: width .2s; }
.pw-meter i.warn { background: var(--accent); }
.pw-meter i.good { background: var(--gain); }
.qr { display: grid; place-items: center; background: #fff; border-radius: 12px; padding: 10px; border: 1px solid var(--line); width: 200px; height: 200px; margin: 0 auto; }
.qr svg { width: 100%; height: 100%; }
code.key { font: 500 13px var(--f-mono); background: var(--surface-3); padding: 2px 6px; border-radius: 5px; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.codes code { font: 500 14px var(--f-mono); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px; text-align: center; }
.sync-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gain); flex: none; margin-inline: 4px; transition: background .2s; }
.sync-dot[data-s="saving"] { background: var(--accent); animation: syncpulse 1s ease-in-out infinite; }
.sync-dot[data-s="error"] { background: var(--loss); }
@keyframes syncpulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .sync-dot[data-s="saving"] { animation: none; } }
