
/* C3: default link color — dark theme needs light links everywhere (was browser blue) */
a{ color:var(--muted-3); }
a:hover{ color:var(--gold-text,var(--gold)); }


    @font-face{ font-family:'Vazirmatn'; src:url('/static/fonts/Vazirmatn-Regular.woff2') format('woff2'), url('/static/fonts/Vazirmatn-Regular.ttf') format('truetype'); font-weight:400; font-display:swap; }
    @font-face{ font-family:'Vazirmatn'; src:url('/static/fonts/Vazirmatn-Medium.woff2') format('woff2'), url('/static/fonts/Vazirmatn-Medium.ttf') format('truetype'); font-weight:500; font-display:swap; }
    @font-face{ font-family:'Vazirmatn'; src:url('/static/fonts/Vazirmatn-Bold.woff2') format('woff2'), url('/static/fonts/Vazirmatn-Bold.ttf') format('truetype'); font-weight:700; font-display:swap; }
    @font-face{ font-family:'Vazirmatn'; src:url('/static/fonts/Vazirmatn-ExtraBold.woff2') format('woff2'), url('/static/fonts/Vazirmatn-ExtraBold.ttf') format('truetype'); font-weight:800; font-display:swap; }
    /* Display face - Sahel Black (OFL, 36KB). Chosen by measurement:
       ink density at 44px vs Vazirmatn800=8651 -> Sahel900=10526 (+22%),
       Estedad800=9621 (+11%), Gandom700=5171 (-40%, too light on dark). */
    @font-face{ font-family:'SahelDisplay';
      src:url('/static/fonts/Sahel-Black.woff2') format('woff2');
      font-weight:900; font-display:swap; }
    /* Liquid Glass v3 - app-like navigation + clean cosmic palette */
    * { margin:0; padding:0; box-sizing:border-box; }
    
    html,body{ background:var(--bg); color:var(--txt); font-family:Vazirmatn, Tahoma, sans-serif; min-height:100vh; overflow-x:hidden; }
    body{ padding-bottom:32px; }
    /* W2.1: aurora blobs are STATIC now — three 19–22s infinite animations of
       72px-blurred full-screen layers were a constant GPU/compositor tax on
       every device for zero information. The deep-sky look stays; motion goes. */
    .aurora{ position:fixed; inset:0; overflow:hidden; pointer-events:none; z-index:0; }
    .aurora i{ position:absolute; border-radius:50%; filter:blur(110px); }
    .a1{ width:520px; height:520px; background:var(--bg-glow); top:-220px; right:-160px; opacity:.55; }
    .a2{ display:none; }
    .a3{ display:none; }
    .starfield{ position:fixed; inset:0; pointer-events:none; opacity:.28; z-index:0;
      background-image:radial-gradient(1.5px 1.5px at 20% 30%, var(--star-1), transparent), radial-gradient(1px 1px at 80% 20%, var(--star-2), transparent),
      radial-gradient(1.2px 1.2px at 40% 70%, var(--star-3), transparent), radial-gradient(1px 1px at 60% 85%, var(--star-4), transparent),
      radial-gradient(1.8px 1.8px at 90% 55%, var(--star-5), transparent); }
    .wrap{ position:relative; z-index:1; max-width:960px; margin:0 auto; padding:0 16px; }
    /* ── Top App Bar (glass, sticky) — brand + primary actions ── */
    .appbar{ position:sticky; top:10px; z-index:60; margin:12px 0 22px; animation:appbarIn .55s var(--ease) both; }
    .appbar-inner{ position:relative; display:flex; align-items:center; justify-content:space-between; gap:10px;
      padding:8px 8px 8px 14px; border-radius:20px; overflow:hidden;
      background:var(--chrome-bg); border:1px solid var(--chrome-border);
      /* W3 perf: appbar is sticky+always-visible → flat surface, no per-scroll re-raster.
         The glass look comes from the translucent bg + border + shadow. */
      box-shadow:0 12px 44px rgba(0,0,0,.5), inset 0 1px 0 var(--nav-ink-a22, var(--w-d22, rgba(255,255,255,.22))); }
    .appbar-inner::after{ content:''; position:absolute; inset:-40%; pointer-events:none;
      background:linear-gradient(115deg, transparent 42%, var(--nav-ink-a16, var(--w-d16, rgba(255,255,255,.16))) 50%, transparent 58%);
      transform:translateX(-130%) skewX(-14deg); }
    /* W2.3: the infinite shine sweep is gone — decorative motion with zero
       information, running forever on every page (R14 §5.3). */
    @keyframes appbarIn{ from{ opacity:0; transform:translateY(-16px); } to{ opacity:1; transform:none; } }
    .brand{ display:inline-flex; align-items:center; gap:8px; min-height:44px; padding:0 10px; white-space:nowrap;
      font-weight:800; font-size:1.05rem; color:var(--txt); text-decoration:none; }
    .brand svg{ width:22px; height:22px; color:var(--gold-text,var(--gold)); flex:none; }
    .appnav{ display:flex; align-items:center; gap:4px; overflow-x:auto; -webkit-overflow-scrolling:touch; scrollbar-width:none; }
    .appnav::-webkit-scrollbar{ display:none; }
    .nav-item{ display:inline-flex; align-items:center; gap:6px; min-height:46px; padding:0 13px; border-radius:14px;
      color:var(--nav-ink-a82, var(--w-d82, rgba(255,255,255,.82))); text-decoration:none; font-size:.88rem; font-weight:600; white-space:nowrap;
      transition:background-color .2s var(--ease), color .2s var(--ease), box-shadow .2s var(--ease), transform .16s ease-out;
      animation:itemIn .45s var(--ease) both; }
    .nav-item:nth-child(1){ animation-delay:.08s } .nav-item:nth-child(2){ animation-delay:.14s }
    .nav-item:nth-child(3){ animation-delay:.20s } .nav-item:nth-child(4){ animation-delay:.26s }
    .nav-item:nth-child(5){ animation-delay:.32s }
    @keyframes itemIn{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:none; } }
    .nav-item svg{ width:18px; height:18px; flex:none; opacity:.9; }
    .nav-item:hover{ background:var(--nav-ink-a10, var(--w-d10, rgba(255,255,255,.10))); color:var(--pure); }
    .nav-item:active{ transform:scale(.95); }
    .nav-item.active{ color:var(--gold-text,var(--gold));
      background:linear-gradient(135deg, rgba(245,197,24,.18), rgba(232,142,11,.08));
      box-shadow:inset 0 0 0 1px rgba(245,197,24,.4), 0 4px 20px rgba(245,197,24,.18); }
    /* ── Bottom app nav (mobile) + central action ── */
    .bottomnav{ display:none; }
    @media (max-width:768px){
      .appnav{ display:none; }
      body{ padding-bottom:calc(140px + env(safe-area-inset-bottom, 0px)); }
      .bottomnav{ position:fixed; bottom:calc(10px + env(safe-area-inset-bottom, 0px)); left:50%; transform:translateX(-50%); z-index:80;
        display:flex; align-items:center; justify-content:space-between; gap:0; padding:7px 6px 9px; border-radius:22px;
        width:calc(100% - 20px); max-width:420px;
        background:var(--chrome-bg); border:1px solid var(--chrome-border);
        /* W3 perf: fixed bottom bar — flat surface (no backdrop re-raster) */
        box-shadow:0 12px 40px rgba(0,0,0,.55), inset 0 1px 0 var(--nav-ink-a14, var(--w-d14, rgba(255,255,255,.14)));
        animation:bnIn .5s var(--ease) both; }
      @keyframes bnIn{ from{ opacity:0; transform:translate(-50%,14px); } to{ opacity:1; transform:translate(-50%,0); } }
      .bn-item{ flex:1 1 0; min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
        min-height:52px; padding:4px 2px; border-radius:13px; color:var(--chrome-ink); text-decoration:none;
        font-size:.62rem; font-weight:600; white-space:nowrap; line-height:1.1; transition:color .2s var(--ease); }
    /* R15-fix: in LIGHT theme the bottom nav keeps a dark navy surface, but
       --w-d64 flips to dark ink → 1.04:1 contrast (invisible labels). Force
       light ink on the dark nav surface for both themes. */
    .bn-item[aria-current="page"]{ color:var(--chrome-ink-active); }
      .bn-item svg{ width:21px; height:21px; flex:none; }
      .bn-item:active{ transform:scale(.94); }
      .bn-item.active{ color:var(--chrome-ink-active); }
      /* R13: the FAB must sit EXACTLY in the middle — every slot (including
         the fab) gets identical flex so 5 items = perfect symmetry. */
      .bn-fab{ flex:1 1 0; min-width:0; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
        min-height:52px; padding:4px 2px; border-radius:13px; text-decoration:none; }
      .bn-fab .fab-circle{ width:44px; height:44px; border-radius:50%; display:flex; align-items:center; justify-content:center;
        background:linear-gradient(135deg,var(--gold),var(--gold-deep)); color:var(--gold-ink);
        box-shadow:0 6px 18px rgba(245,197,24,.45); transition:transform .16s ease-out;
        margin-top:-14px; }  /* raised center button */
      .bn-fab:active .fab-circle{ transform:scale(.93); }
      .bn-fab .fab-circle svg{ width:21px; height:21px; }
      .bn-fab span{ font-size:.62rem; font-weight:800; color:var(--chrome-ink-active); white-space:nowrap; line-height:1.1; }
    }
    /* ── Mobile hamburger + slide-in drawer ── */
    .hamburger{ display:none; }
    .drawer-backdrop{ position:fixed; inset:0; background:rgba(0,0,0,.5); backdrop-filter:blur(2px); -webkit-backdrop-filter:blur(2px);
      z-index:89; opacity:0; pointer-events:none; transition:opacity .25s var(--ease); }
    .drawer-backdrop.show{ opacity:1; pointer-events:auto; }
    /* R14 gate: the closed drawer must be fully hidden — off-canvas transform
       alone leaves children with live rects. display:none when shut, flex
       when open (restored by .drawer.open below). */
    .drawer{ display:none; }
    .drawer.open{ display:flex; position:fixed; top:0; bottom:0; inset-inline-start:auto; inset-inline-end:0; width:min(82vw,320px); z-index:90;
      background:rgba(17,22,49,.97); border-inline-start:1px solid var(--nav-ink-a12, var(--w-d12, rgba(255,255,255,.12)));
      transform:translateX(-105%); transition:transform .32s var(--ease), visibility 0s linear .32s;
      padding:18px 14px; overflow-y:auto; display:flex; flex-direction:column; gap:4px; box-shadow:-20px 0 60px rgba(0,0,0,.5); }
    .drawer.open{ transform:translateX(0); }
    .drawer-head{ display:flex; align-items:center; justify-content:space-between; padding:4px 6px 14px;
      border-bottom:1px solid var(--nav-ink-a1, var(--w-d1, rgba(255,255,255,.1))); margin-bottom:10px; }
    .drawer-head span{ font-weight:800; font-size:1.05rem; color:var(--txt); }
    .drawer-close{ width:42px; height:42px; border-radius:13px; background:var(--nav-ink-a08, var(--w-d08, rgba(255,255,255,.08))); border:1px solid var(--stroke);
      color:var(--txt); display:flex; align-items:center; justify-content:center; cursor:pointer; }
    .drawer-close svg{ width:20px; height:20px; }
    .drawer-item{ display:flex; align-items:center; gap:13px; min-height:52px; padding:0 14px; border-radius:14px;
      color:var(--txt); text-decoration:none; font-size:.93rem; font-weight:600; transition:background-color .18s var(--ease); }
    .drawer-item svg{ width:21px; height:21px; color:var(--gold-text,var(--gold)); flex:none; opacity:.95; }
    .drawer-item:active{ background:var(--nav-ink-a08, var(--w-d08, rgba(255,255,255,.08))); }
    .drawer-item.active{ background:linear-gradient(135deg, rgba(245,197,24,.16), rgba(232,142,11,.06)); color:var(--gold-text,var(--gold)); }
    @media (max-width:768px){
      .hamburger{ display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; border-radius:14px;
        background:var(--nav-ink-a08, var(--w-d08, rgba(255,255,255,.08))); border:1px solid var(--nav-ink-a16, var(--w-d16, rgba(255,255,255,.16))); color:var(--txt); cursor:pointer; flex:none; }
      .hamburger svg{ width:22px; height:22px; }
    }
    /* glass card (brighter) — W3 perf: backdrop-filter removed here too; this
       mobile-scoped rule re-introduced it after the desktop fix (18 layers on
       /plans). Glass look = translucent bg + border + shadow. */
    .glass{ background:var(--glass); border:1px solid var(--stroke); border-radius:var(--r-lg);
      box-shadow:0 8px 32px rgba(0,0,0,.35), inset 0 1px 0 var(--nav-ink-a12, var(--w-d12, rgba(255,255,255,.12))); }
    .glow{ box-shadow:0 0 40px rgba(124,108,240,.3), 0 8px 32px rgba(0,0,0,.4); }
    .btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:48px;
      padding:0 22px; border:none; border-radius:14px; cursor:pointer; font-family:inherit; font-size:1rem; font-weight:700;
      background:linear-gradient(135deg,var(--gold),var(--gold-deep)); color:var(--gold-ink); transition:transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base) var(--ease-out); text-decoration:none; }
    /* F10: spring lift - the button answers the cursor with weight,
       not a flat fade. Overshoot curve makes it feel physical. */
    .btn:hover{ transform:translateY(-2px); box-shadow:0 10px 30px rgba(245,197,24,.38); }
    .btn:active{ transform:scale(.97); }
    .btn-ghost{ background:var(--nav-ink-a08, var(--w-d08, rgba(255,255,255,.08))); color:var(--txt); border:1px solid var(--stroke); }
    .chip{ display:inline-flex; align-items:center; min-height:44px; padding:0 16px; margin:4px;
      border:1px solid var(--stroke); border-radius:999px; background:var(--nav-ink-a06, var(--w-d06, rgba(255,255,255,.06))); color:var(--txt); cursor:pointer; font-family:inherit; font-size:.95rem; transition:all .18s var(--ease); }
    .chip:hover{ background:var(--nav-ink-a12, var(--w-d12, rgba(255,255,255,.12))); }
    .chip:active{ transform:scale(.96); }
    .chip.sel{ background:linear-gradient(135deg,var(--accent-3),var(--accent-2)); border-color:var(--accent-soft); box-shadow:0 0 14px rgba(124,108,240,.5); }
    .input{ width:100%; min-height:50px; padding:0 14px; border-radius:14px; border:1px solid var(--stroke);
      background:var(--nav-ink-a07, var(--w-d07, rgba(255,255,255,.07))); color:var(--txt); font-family:inherit; font-size:1rem; outline:none; transition:border-color .2s, box-shadow .2s; }
    .input:focus{ border-color:var(--accent); box-shadow:0 0 0 3px rgba(124,108,240,.28); }
    .input::placeholder{ color:var(--muted-2); }
    label{ font-size:.85rem; color:var(--muted); display:block; margin:14px 0 6px; }
    /* Type scale. Measured before this: h1 at 30px, body copy at 16.8px with a
       33.6px line box, and a landing page 6.9 screens tall on a 390px phone.
       An app's first screen has to say what it is and offer one action; this
       scale is tuned so it can. Persian keeps generous leading (1.75-1.8),
       just not the 2.0+ it had. */
    h1{ font-family:var(--font-display); font-weight:900; font-size:clamp(1.5rem,5.2vw,2.1rem); line-height:1.3; letter-spacing:-.02em; color:var(--txt); }
    h2{ font-family:var(--font-display); font-weight:900; font-size:clamp(1.12rem,3.6vw,1.4rem); line-height:1.35; letter-spacing:-.015em; color:var(--txt); }
    h3{ font-family:var(--font-display); font-weight:900; font-size:clamp(1rem,3vw,1.15rem); line-height:1.4; color:var(--txt); }
    /* F2: prices, credits, dates and stats align in columns */
    .num, .price, .credits, .stat, .bt3-chip, table td, table th { font-variant-numeric:tabular-nums; }
    p{ line-height:1.8; }
    .muted{ color:var(--muted); }
    .gold{ color:var(--gold-text,var(--gold)); }
    .hidden{ display:none !important; }
    /* progress bar (glass step-by-step) — unified design */
    .form-progress{ margin:16px 0 24px; }
    .form-progress-head{ display:flex; justify-content:space-between; align-items:center; margin-bottom:10px; font-size:.84rem; }
    .form-progress-label{ color:var(--txt); font-weight:700; }
    .form-progress-label b{ color:var(--gold-text,var(--gold)); }
    .form-progress-pct{ color:var(--muted); font-weight:800; font-variant-numeric:tabular-nums; }
    .steps{ display:flex; gap:8px; margin:0 0 10px; }
    .step-dot{ flex:1; height:8px; border-radius:99px; background:var(--nav-ink-a12, var(--w-d12, rgba(255,255,255,.12))); overflow:hidden; border:none; padding:0; cursor:pointer; transition:background .2s; }
    .step-dot > i{ display:block; height:100%; width:0; background:linear-gradient(90deg,var(--gold),var(--gold-deep)); border-radius:99px; transition:width .4s var(--ease); }
    .step-dot.on > i{ width:100%; }
    .step-dot.active{ box-shadow:0 0 0 2px var(--gold-dim, rgba(212,175,55,.35)); }
    .step-dot:disabled{ cursor:default; }
    .form-progress-titles{ display:flex; gap:6px; font-size:.68rem; line-height:1.5; }
    .form-progress-titles span{ flex:1; text-align:center; color:var(--muted-2); padding:2px 0; border-radius:6px; transition:color .2s, background .2s; }
    .form-progress-titles span.active{ color:var(--gold-text,var(--gold)); font-weight:800; background:var(--gold-soft, rgba(212,175,55,.12)); }
    .form-progress-titles span.done{ color:var(--gold-text,var(--gold)); }
    /* funnel progress (chart → explore → deep) */
    .funnel-progress{ margin:14px 0 18px; }
    .funnel-bar{ height:6px; border-radius:99px; background:var(--nav-ink-a12, var(--w-d12, rgba(255,255,255,.12))); overflow:hidden; margin-bottom:10px; }
    .funnel-bar i{ display:block; height:100%; background:linear-gradient(90deg,var(--gold),var(--gold-deep)); border-radius:99px; transition:width .6s var(--ease); }
    .funnel-steps{ display:flex; gap:8px; list-style:none; margin:0; padding:0; }
    .funnel-steps li{ flex:1; display:flex; align-items:center; gap:6px; font-size:.8rem; color:var(--muted); }
    .funnel-steps li.done{ color:var(--gold-text,var(--gold)); font-weight:700; }
    .funnel-dot{ width:22px; height:22px; border-radius:50%; display:grid; place-items:center; font-size:.72rem; font-weight:800; background:var(--nav-ink-a12, var(--w-d12, rgba(255,255,255,.12))); color:var(--muted); flex:none; }
    .funnel-steps li.done .funnel-dot{ background:var(--gold); color:var(--bg); }
    .funnel-link{ display:flex; align-items:center; gap:6px; color:var(--txt); text-decoration:none; min-height:44px; }
    .funnel-link .funnel-dot{ background:var(--gold-soft, rgba(212,175,55,.18)); color:var(--gold-text,var(--gold)); }
    .funnel-link:hover .funnel-dot{ background:var(--gold); color:var(--bg); }
    .funnel-hint{ margin:6px 0 0; font-size:.74rem; }
    /* sign cards */
    .sign-card{ background:var(--nav-ink-a06, var(--w-d06, rgba(255,255,255,.06))); border:1px solid var(--stroke); border-radius:18px; padding:16px; text-align:center; transition:transform .18s var(--ease), background-color .2s; }
    .sign-card:hover{ background:var(--nav-ink-a1, var(--w-d1, rgba(255,255,255,.1))); transform:translateY(-2px); }
    .sign-card b{ display:block; font-size:1.05rem; margin-top:6px; }
    .sign-card span{ font-size:.8rem; color:var(--muted); }
    /* result boxes */
    .kpi{ background:var(--nav-ink-a06, var(--w-d06, rgba(255,255,255,.06))); border:1px solid var(--stroke); border-radius:18px; padding:18px; transition:transform .18s var(--ease); }
    .kpi:hover{ transform:translateY(-2px); }
    .kpi b{ font-size:1.15rem; display:block; }
    .kpi span{ font-size:.85rem; color:var(--muted); display:block; margin-top:4px; }
    [x-cloak]{ display:none !important; }
    /* footer — 4-column glass (dark-mode readable) */
    .footer{ margin-top:60px; padding:34px 4px 40px; border-top:1px solid var(--nav-ink-a1, var(--w-d1, rgba(255,255,255,.1))); }
    .footer-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:26px; }
    .footer-col h4, .footer-col .ft-h{ font-size:.85rem; font-weight:800; color:var(--gold-text,var(--gold)); margin-bottom:14px; letter-spacing:.2px; }
    .footer-col a{ display:flex; align-items:center; min-height:44px; color:var(--muted); text-decoration:none; font-size:.84rem; transition:color .2s; }
    .footer-col a:hover{ color:var(--pure); }
    .footer-bar{ margin-top:30px; padding-top:18px; border-top:1px solid var(--nav-ink-a08, var(--w-d08, rgba(255,255,255,.08)));
      display:flex; flex-wrap:wrap; gap:12px; justify-content:space-between; align-items:center; font-size:.76rem; color:var(--muted); }
    .footer-bar .disc{ max-width:560px; line-height:1.8; opacity:.9; }
    @media (max-width:640px){ .wrap{ padding:0 12px; } .btn-lg{ width:100%; }
      .appbar{ top:8px; margin:8px 0 16px; }
      .brand{ font-size:.98rem; padding:0 6px; } }
    @media (max-width:400px){ .brand span{ font-size:.95rem; } .brand{ padding:0 4px; } }
    @media (prefers-reduced-motion:reduce){
      .appbar-inner::after, .aurora i, .nav-item, .appbar, .bottomnav{ animation:none !important; }
    }
    .help-tip { position: relative; display: inline-flex; vertical-align: middle; margin-inline-start: 5px; min-height:44px; align-items:center; }
    .help-tip-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--accent); color: var(--txt); background: transparent; font-size: .7rem; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; font-family: inherit; }
    .help-tip-btn:hover { background: var(--accent); color: var(--surface-3); }
    .help-tip-box { position: absolute; z-index: 50; top: 24px; inset-inline-start: 0; width: 240px; max-width: 72vw; background: var(--surface); border: 1px solid rgba(212,175,55,.35); border-radius: 10px; padding: 10px 12px; font-size: .8rem; line-height: 1.7; color: var(--lav); box-shadow: 0 8px 24px rgba(0,0,0,.45); text-align: start; font-weight: 400; }
    .help-tip-box::before { content: ''; position: absolute; top: -5px; inset-inline-start: 10px; width: 8px; height: 8px; background: var(--surface); border-inline-start: 1px solid rgba(212,175,55,.35); border-top: 1px solid rgba(212,175,55,.35); transform: rotate(45deg); }
    .article-banner svg { width: 100%; height: auto; display: block; }
    .degraded-bar{position:fixed;top:0;left:0;right:0;z-index:200;display:flex;align-items:center;gap:8px;
      background:linear-gradient(90deg,var(--warn-bg-a),var(--warn-bg-b));color:var(--warn-txt);padding:10px 14px;font-size:.85rem;
      box-shadow:0 2px 12px rgba(0,0,0,.35)}
    .degraded-bar.hidden{display:none}
  

  #toastStack{position:fixed;top:14px;left:50%;transform:translateX(-50%);display:flex;flex-direction:column;gap:8px;z-index:10000;width:min(92vw,380px);pointer-events:none;}
  .toast{pointer-events:auto;display:flex;align-items:center;gap:10px;padding:12px 14px;border-radius:14px;background:rgba(22,29,44,.97);color:var(--txt);border:1px solid var(--nav-ink-a12, var(--w-d12, rgba(255,255,255,.12)));box-shadow:0 12px 32px rgba(0,0,0,.4);font-size:.9rem;line-height:1.5;border-right:3px solid var(--gold);}
  .toast.err{border-right-color:var(--red-err);}
  .toast .t-ic{flex:none;font-weight:800;font-size:1rem;color:var(--gold-text,var(--gold));}
  .toast.err .t-ic{color:var(--red-err);}
  #dialogBackdrop{position:fixed;inset:0;background:rgba(6,9,16,.68);backdrop-filter:blur(9px);-webkit-backdrop-filter:blur(9px);z-index:10001;display:none;align-items:center;justify-content:center;padding:20px;}
  #dialogBackdrop.show{display:flex;}
  .dialog-box{pointer-events:auto;width:min(92vw,380px);background:rgba(22,28,42,.98);border:1px solid var(--nav-ink-a14, var(--w-d14, rgba(255,255,255,.14)));border-radius:20px;padding:22px 18px;color:var(--txt);box-shadow:0 24px 64px rgba(0,0,0,.55);}
  .dialog-box .d-title{font-size:1.1rem;font-weight:800;color:var(--gold-text,var(--gold));margin-bottom:8px;}
  .dialog-box .d-msg{font-size:.92rem;line-height:1.75;color:var(--muted-3);margin-bottom:16px;white-space:pre-line;}
  .dialog-box input{width:100%;padding:13px 14px;border-radius:12px;border:1px solid var(--nav-ink-a16, var(--w-d16, rgba(255,255,255,.16)));background:var(--nav-ink-a06, var(--w-d06, rgba(255,255,255,.06)));color:var(--pure);font-size:1rem;margin-bottom:16px;}
  .dialog-box input:focus{outline:none;border-color:var(--gold-text,var(--gold));}
  .dialog-btns{display:flex;gap:10px;}
  .dialog-btns button{flex:1;padding:13px;border-radius:12px;border:none;font-size:.95rem;font-weight:800;cursor:pointer;}
  .dialog-btns .d-ok{background:var(--gold);color:var(--gold-ink);}
  .dialog-btns .d-ok.danger{background:var(--danger-soft);color:var(--pure);}
  .dialog-btns .d-cancel{background:var(--nav-ink-a08, var(--w-d08, rgba(255,255,255,.08)));color:var(--muted-3);border:1px solid var(--nav-ink-a12, var(--w-d12, rgba(255,255,255,.12)));}
  
/* C3: back links must meet the 44px touch target */
.back-link{ display:inline-block; min-height:44px; line-height:24px; padding:10px 0; }

    /* C4: light/dark toggle.
       R15-fix: appbar/bottomnav/drawer keep the DARK navy surface in light
       theme too (the old override made them near-white while their ink
       variables stayed dark → invisible labels/icons). Dark chrome + light
       page is also the design: gold brand reads best on navy. */
    [data-theme="light"] .appbar, [data-theme="light"] .bottomnav, [data-theme="light"] .drawer{
      background:var(--chrome-bg); border-color:var(--chrome-border); }
    [data-theme="light"] .appbar-inner{ background:var(--chrome-bg); border-color:var(--chrome-border); }
    .brand, .nav-item{ color:var(--chrome-ink-active); }
    .hamburger{ color:var(--chrome-ink); }
    [data-theme="light"] .drawer-item{ color:var(--chrome-ink); }
    .credits-chip{ color:var(--chrome-ink-active); }

    /* D2: grouped drawer */
    .drawer-group{ padding:10px 0; border-bottom:1px solid var(--border); }
    .drawer-group:last-child{ border-bottom:none; }
    .drawer-group-title{ font-size:.72rem; font-weight:800; color:var(--gold-text,var(--gold)); padding:6px 18px 2px; letter-spacing:.3px; }
