  :root{
    --bg:#0b0e14; --panel:#141a24; --panel2:#1b2330; --line:#27303f;
    --text:#e6edf3; --muted:#8b98a9; --accent:#f7931a; --accent2:#3fb950;
    --blue:#58a6ff; --red:#f85149; --radius:14px;
    /* Shared control height (Suite roadmap item 2, 2026-07-30) -- one standard
       across all four projects so a dialog row never mixes heights. */
    --control-h:32px;
    --banner-grad:linear-gradient(120deg,#0c1322 0%,#13233c 52%,#3a2a14 100%);
  }
  [data-theme="dark"]{
    --bg:#0b0e14; --panel:#141a24; --panel2:#1b2330; --line:#27303f;
    --text:#e6edf3; --muted:#8b98a9; --accent:#f7931a; --accent2:#3fb950;
    --blue:#58a6ff; --red:#f85149;
    --banner-grad:linear-gradient(120deg,#0c1322 0%,#13233c 52%,#3a2a14 100%);
  }
  [data-theme="light"]{
    --bg:#f4f6fb; --panel:#ffffff; --panel2:#eef1f7; --line:#d8dee9;
    --text:#1b2330; --muted:#5b6675; --accent:#e8820e; --accent2:#1a9e4b;
    --blue:#2563eb; --red:#dc2626;
    --banner-grad:linear-gradient(120deg,#172033 0%,#243349 52%,#5b4420 100%);
  }
  [data-theme="ocean"]{
    --bg:#071726; --panel:#0d2233; --panel2:#123048; --line:#1d4257;
    --text:#e3f1fb; --muted:#8fb0c4; --accent:#38bdf8; --accent2:#22d3ee;
    --blue:#60a5fa; --red:#fb7185;
    --banner-grad:linear-gradient(120deg,#041320 0%,#072c44 55%,#0a4a5c 100%);
  }
  [data-theme="forest"]{
    --bg:#0a140f; --panel:#10211a; --panel2:#163024; --line:#244536;
    --text:#e6f3ea; --muted:#94b3a2; --accent:#4ade80; --accent2:#a3e635;
    --blue:#34d399; --red:#f87171;
    --banner-grad:linear-gradient(120deg,#06130d 0%,#0c2a1c 55%,#1a3a24 100%);
  }
  [data-theme="grape"]{
    --bg:#140c1f; --panel:#1e1330; --panel2:#291a40; --line:#3a2a52;
    --text:#f1e9fb; --muted:#a996c0; --accent:#c084fc; --accent2:#f0abfc;
    --blue:#a78bfa; --red:#fb7185;
    --banner-grad:linear-gradient(120deg,#0f0820 0%,#241140 55%,#3a1a3f 100%);
  }
  body{transition:background .3s,color .3s}
  *{box-sizing:border-box}
  body{margin:0;background:var(--bg);color:var(--text);
    font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
    line-height:1.6;font-size:16px}
  a{color:var(--blue)}
  /* ---- Suite-consistent slim header/footer (replaces the old hero banner —
     same bar height/padding/font convention as CryptoPro Trader and Charts,
     see Suite CLAUDE.md rule 17) ---- */
  .site-header{background:var(--panel);border-bottom:1px solid var(--line);
    padding:16px 24px;display:flex;justify-content:space-between;align-items:center;
    gap:16px;flex-wrap:wrap;position:sticky;top:0;z-index:100}
  .brand{display:flex;align-items:center;gap:6px;font-size:26px;font-weight:700;color:var(--text)}
  .brand-cp{color:var(--accent)}
  /* 36px header / 18px footer is the suite-wide logo standard (Suite roadmap
     item 1, 2026-07-30) -- see Charts' style.css for why 36 is the ceiling. */
  .brand img{width:36px;height:36px;border-radius:8px;vertical-align:middle}
  .header-right{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
  .themes{display:flex;align-items:center;gap:7px}
  .themes .tname{font-size:.74rem;color:var(--muted);min-width:52px;text-align:right}
  .swatch{width:20px;height:20px;border-radius:50%;cursor:pointer;border:2px solid var(--line);
    padding:0;transition:transform .15s,border-color .15s;position:relative}
  .swatch:hover{transform:scale(1.15)}
  .swatch.active{border-color:var(--text);box-shadow:0 0 0 2px rgba(127,127,127,.25)}
  .swatch.active::after{content:"✓";position:absolute;inset:0;display:grid;place-items:center;
    font-size:.6rem;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.9)}
  /* Fixed vertical rail on the right edge of the viewport (Suite roadmap
     item 1, 2026-08-06) -- detached from .header-right's flex flow so it
     stays reachable while scrolling. */
  .levelpick{position:fixed;top:50%;right:14px;transform:translateY(-50%);
    display:flex;flex-direction:column;align-items:flex-end;gap:6px;z-index:90}
  .levelpick .lvl-title{font-size:.68rem;text-transform:uppercase;letter-spacing:.7px;color:var(--muted);font-weight:700}
  .levelpick .lvl-desc{display:none}
  .levelpick .levels{display:flex;flex-direction:column;gap:6px}
  .levelpick .levels button{display:inline-flex;min-height:var(--control-h);box-sizing:border-box;align-items:center;justify-content:center;gap:5px;border:1px solid var(--accent);background:var(--panel);color:var(--accent);padding:5px 12px;border-radius:8px;cursor:pointer;font-size:.78rem;font-weight:700;white-space:nowrap;box-shadow:0 2px 8px rgba(0,0,0,.18);transition:.15s}
  .levelpick .levels button:hover{background:rgba(127,127,127,.12)}
  .levelpick .levels button.active{background:var(--accent);color:#0b0e14;border-color:var(--accent)}
  .levelpick .levels button.locked{border-style:dashed;opacity:.85}
  .levelpick .levels button .pro-lock{font-size:.72rem;line-height:1}
  @media (max-width:720px){
    .levelpick{position:static;transform:none;flex-direction:row;align-items:center;
      justify-content:flex-start;gap:8px;padding:6px 12px;border-top:1px solid var(--line);
      /* Four level buttons plus a heading wrapped onto three rows here. One
         non-wrapping scrollable line keeps the whole filter reachable while
         costing a single row of vertical space. */
      flex-wrap:nowrap;overflow-x:auto;-webkit-overflow-scrolling:touch;
      scrollbar-width:none}
    .levelpick::-webkit-scrollbar{display:none}
    /* The "Niveau" heading duplicates what the active button already shows. */
    .levelpick .lvl-title{display:none}
    .levelpick .levels{flex-direction:row;flex-wrap:nowrap;justify-content:flex-start;
      gap:6px}
    .levelpick .levels button{flex:0 0 auto}
  }
  .lang-switcher{min-height:var(--control-h);box-sizing:border-box;align-items:center;justify-content:center;border:1px solid var(--accent);background:transparent;color:var(--accent);
    padding:5px 8px;border-radius:8px;cursor:pointer;font-size:.78rem;font-weight:700}
  .lang-switcher:hover{background:rgba(127,127,127,.12)}
  .page-intro{max-width:1120px;margin:0 auto;padding:20px 18px 4px}
  .page-intro p{margin:0;color:var(--muted);font-size:.92rem;line-height:1.45;max-width:760px}
  .banner-stats{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}
  .banner-stats span{background:var(--panel2);border:1px solid var(--line);
    border-radius:99px;padding:3px 9px;font-size:.72rem;color:var(--muted)}
  /* Lives in .header-right now (Suite roadmap, 2026-08-07), same row as the
     Theme selector — no margin-top, .header-right's own gap spaces it. */
  .quizbar{display:flex;flex-wrap:wrap;gap:4px 14px;align-items:center;
    font-size:.78rem;color:var(--muted)}
  .quizbar .qb-label{font-weight:700;text-transform:uppercase;letter-spacing:.6px;font-size:.68rem;color:var(--muted)}
  .quizbar b{color:var(--text)}
  .quizbar .qb-acc{color:var(--accent2)}
  .quizbar .qb-muted{color:var(--muted)}
  @media (max-width:720px){
    .site-header{padding:10px 14px;gap:8px}

    /* The header carries five separate control groups (quiz stats, theme
       swatches, glossary, language, account). At desktop's gap:16px each
       wraps onto its own line, which grew the bar to ~307px — over a third
       of a 844px screen before any course content. Tighten the gaps and let
       the groups share lines. */
    .header-right{gap:6px 10px;width:100%;justify-content:flex-start}

    /* Brand drops a size so it stops claiming a full line of its own. */
    .brand{font-size:20px}
    .brand img{width:28px;height:28px}

    /* Quiz counters are a status readout, not controls: let them run as one
       compact line instead of a wrapped 5-item grid. */
    .quizbar{gap:2px 8px;font-size:.72rem;width:100%;order:3}
    .quizbar .qb-label{display:none}

    /* Theme swatches sit next to the buttons rather than on their own row. */
    .themes{gap:4px}
    .themes .tname{display:none}
  }
  .wrap{max-width:1120px;margin:0 auto;padding:14px 18px 60px}
  .site-footer{color:var(--muted);font-size:12px;padding:16px 24px;border-top:1px solid var(--line);
    display:flex;flex-wrap:wrap;align-items:center;gap:4px 14px;text-align:left}
  .site-footer .footer-name{display:inline-flex;align-items:center;gap:6px;font-weight:700;color:var(--text);font-size:13px}
  .site-footer .footer-logo-icon{width:18px;height:18px;border-radius:4px;vertical-align:middle}
  .site-footer .footer-studio{display:inline-flex;align-items:center;gap:6px}
  /* Suite rule 16: the studio credit is a link, matching Suite's own footer. */
  .site-footer .footer-studio a{color:inherit;text-decoration:underline}
  .site-footer .footer-studio a:hover{color:var(--text)}
  .site-footer .footer-sep{color:var(--line)}
  .footer-donate{color:#e0b45c;text-decoration:none}
  .footer-donate:hover{color:#f0c876}
  .progress-box{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);
    padding:11px 14px;margin:12px 0;display:flex;align-items:center;gap:16px;flex-wrap:wrap}
  .bar{flex:1;min-width:180px;height:12px;background:var(--panel2);border-radius:99px;overflow:hidden}
  .bar > i{display:block;height:100%;width:0;background:linear-gradient(90deg,var(--accent),var(--accent2));
    transition:width .4s ease}
  .progress-box b{font-size:1.05rem}
  .reset{background:none;border:1px solid var(--line);color:var(--muted);padding:6px 12px;
    border-radius:8px;cursor:pointer;font-size:.8rem}
  .reset:hover{color:var(--text);border-color:var(--muted)}
  .track{margin:20px 0 0}
  .track > h2{display:flex;align-items:center;gap:10px;font-size:1.25rem;margin:0 0 4px;
    padding-bottom:8px;border-bottom:2px solid var(--line);cursor:pointer;user-select:none}
  .track > h2{border-bottom:none;position:relative}
  .track > h2::after{content:"";position:absolute;left:0;right:0;bottom:0;height:2px;
    background:linear-gradient(90deg,var(--accent),transparent)}
  .track .tnum{background:var(--accent);color:#000;font-weight:700;border-radius:8px;
    width:30px;height:30px;display:grid;place-items:center;font-size:.95rem}
  .track .ticon{font-size:1.3rem;line-height:1}
  .track .tchev{margin-left:auto;color:var(--muted);transition:transform .25s;font-size:1rem}
  .track:not(.collapsed) .tchev{transform:rotate(90deg)}
  .track.collapsed .track-body{display:none}
  .track .tsub{color:var(--muted);font-size:.9rem;margin:2px 0 10px}
  .module{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);
    margin:10px 0;overflow:hidden}
  .mhead{display:flex;align-items:center;gap:12px;padding:11px 14px;cursor:pointer;user-select:none}
  .mhead:hover{background:var(--panel2)}
  .check{width:22px;height:22px;border-radius:50%;border:2px solid var(--line);flex:none;
    display:grid;place-items:center;font-size:.8rem;color:transparent;transition:.2s}
  .module.done .check{background:var(--accent2);border-color:var(--accent2);color:#04210f}
  .mhead .mt{flex:1}
  .mhead .mt .mtitle{font-weight:600}
  .mhead .mt .mdur{color:var(--muted);font-size:.8rem}
  .chev{color:var(--muted);transition:transform .25s}
  .module.open .chev{transform:rotate(90deg)}
  .mbody{display:none;padding:2px 16px 16px;border-top:1px solid var(--line)}
  .module.open .mbody{display:block;animation:fade .3s ease}
  @keyframes fade{from{opacity:0;transform:translateY(-4px)}to{opacity:1}}
  .mbody h4{margin:18px 0 4px;font-size:.78rem;letter-spacing:1px;text-transform:uppercase;color:var(--accent)}
  .mbody h4.ex{color:var(--blue)}
  .mbody h4.do{color:var(--accent2)}
  .mbody p{margin:6px 0}
  .mbody ul{margin:6px 0;padding-left:20px}
  .mbody code{background:var(--panel2);padding:2px 6px;border-radius:5px;font-size:.9em}
  .callout{background:var(--panel2);border-left:3px solid var(--blue);border-radius:8px;
    padding:10px 14px;margin:8px 0}
  .callout.warn{border-left-color:var(--red)}
  .viz{background:var(--panel2);border:1px solid var(--line);border-radius:10px;padding:10px;margin:8px 0}
  .viz svg{display:block;width:100%;height:auto}
  .viz figcaption{color:var(--muted);font-size:.8rem;margin-top:6px;text-align:center}
  .calc{background:var(--panel2);border:1px solid var(--line);border-radius:10px;padding:14px 16px;margin:10px 0}
  .calc-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:7px 0}
  .calc-row label{font-size:.9rem;color:var(--text)}
  .calc-row select,.calc-row input{width:140px;background:var(--panel);color:var(--text);border:1px solid var(--line);
    border-radius:8px;padding:7px 10px;font-size:.92rem}
  .calc-out{margin-top:12px;padding:11px 13px;border-radius:8px;background:rgba(247,147,26,.10);
    border:1px solid var(--accent);font-size:.92rem;line-height:1.5}
  .calc-out b{color:var(--accent)}
  .calc .muted{color:var(--muted)}
  .lesson-link{display:inline-flex;align-items:center;gap:8px;margin:10px 0 2px;color:var(--blue);text-decoration:none;
 border:1px solid var(--line);background:var(--panel2);border-radius:9px;padding:7px 10px;font-size:.9rem;font-weight:600}
 .lesson-link:hover{border-color:var(--accent);color:var(--accent)}
 .lesson-link small{color:var(--muted);font-weight:500}
 .quiz{background:var(--panel2);border:1px solid var(--line);border-radius:10px;padding:14px 16px;margin:16px 0 4px}
  .quiz .q{font-weight:600;margin-bottom:8px}
  .quiz button{display:block;width:100%;text-align:left;background:var(--panel);color:var(--text);
    border:1px solid var(--line);border-radius:8px;padding:9px 12px;margin:6px 0;cursor:pointer;font-size:.95rem}
  .quiz button:hover{border-color:var(--muted)}
  .quiz button.correct{background:rgba(63,185,80,.15);border-color:var(--accent2)}
  .quiz button.wrong{background:rgba(248,81,73,.12);border-color:var(--red)}
  .quiz .fb{margin-top:8px;font-size:.9rem;color:var(--muted);display:none}
  .lvlbadge{display:inline-block;font-size:.66rem;font-weight:700;letter-spacing:.4px;
    text-transform:uppercase;color:var(--bc);border:1px solid var(--bc);border-radius:5px;
    padding:1px 6px;margin-left:8px;vertical-align:middle}
  .disclaimer{background:rgba(248,81,73,.08);border:1px solid rgba(248,81,73,.3);border-radius:var(--radius);
    padding:10px 14px;margin:12px 0;font-size:.86rem;color:var(--muted)}
  .glossary summary{cursor:pointer;font-weight:600;font-size:1.05rem}
  .glossary{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px;margin:12px 0}
  .glossary dt{font-weight:600;color:var(--accent);margin-top:10px}

  /* ---------- Account / sign-in modal (Suite SSO) ---------- */
  .small{font-size:.82rem;color:var(--muted)}
  .acct-btn{display:inline-flex;min-height:var(--control-h);box-sizing:border-box;align-items:center;justify-content:center;align-items:center;gap:6px;max-width:160px;border:1px solid var(--accent);
    background:transparent;color:var(--accent);padding:5px 10px;border-radius:8px;cursor:pointer;
    font-size:.78rem;font-weight:700;white-space:nowrap}
  .acct-btn:hover{background:rgba(127,127,127,.12)}
  .acct-name{max-width:90px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .acct-avatar-fallback{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;
    border-radius:50%;flex-shrink:0;background:var(--accent);color:#0b0e14;font-size:11px;font-weight:700}
  .acct-avatar-lg{width:48px;height:48px;font-size:20px}
  .acct-card{display:flex;align-items:center;gap:12px;margin-bottom:12px}
  .acct-card-name{font-weight:700;font-size:15px;color:var(--text)}

  .modal-backdrop{position:fixed;inset:0;background:rgba(0,0,0,.6);z-index:9990;display:none;
    align-items:center;justify-content:center;padding:18px}
  .modal{background:var(--panel);border:1px solid var(--line);border-radius:var(--radius);
    box-shadow:0 24px 80px rgba(0,0,0,.55);overflow:hidden}
  .modal-header{padding:16px 18px;border-bottom:1px solid var(--line);display:flex;
    justify-content:space-between;align-items:center;gap:12px}
  .modal-title{font-size:16px;font-weight:700;color:var(--text)}
  .modal-body{padding:18px}
  .modal-footer{padding:16px 18px;border-top:1px solid var(--line);display:flex;
    justify-content:flex-end;gap:10px;flex-wrap:wrap}
  .modal button{display:inline-flex;min-height:var(--control-h);box-sizing:border-box;align-items:center;justify-content:center;border:1px solid var(--line);background:var(--panel2);color:var(--text);
    padding:7px 12px;border-radius:8px;cursor:pointer;font-size:13px;font-weight:600;font-family:inherit}
  .modal button:hover{background:var(--line)}
  .modal button:disabled{opacity:.6;cursor:default}
  .modal button.primary{background:var(--accent);border-color:var(--accent);color:#0b0e14}
  .modal button.danger{background:rgba(248,81,73,.12);border-color:rgba(248,81,73,.35);color:var(--red)}
  /* Account deletion (Suite roadmap 2026-07-29): its own frame and tint so the
     one irreversible action isn't mistaken for the routine ones above it. */
  .danger-zone{margin-top:16px;padding:12px;border:1px solid rgba(248,81,73,.35);
    border-radius:8px;background:rgba(248,81,73,.06)}
  .danger-zone-title{color:var(--red);font-size:11px;font-weight:700;letter-spacing:.05em;
    text-transform:uppercase;margin-bottom:6px}
  .danger-zone .small{margin-bottom:8px}
  .auth-field{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--muted);margin-bottom:10px}
  .auth-field input{color:var(--text);background:var(--panel2);border:1px solid var(--line);
    border-radius:6px;padding:7px 9px;font-size:13px;font-family:inherit}
  .auth-err{color:var(--red);font-size:11px;min-height:14px;margin-bottom:10px}
  .totp-secret{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:15px;letter-spacing:.08em;
    background:var(--panel2);border:1px solid var(--line);border-radius:6px;padding:10px;
    text-align:center;margin:10px 0;word-break:break-all}
  .totp-qr{display:flex;justify-content:center;background:#fff;border-radius:8px;padding:12px;margin:10px 0}
  .totp-qr img{display:block;width:176px;height:176px}
  .glossary dd{margin:2px 0 0;color:var(--muted)}

  /* ---------- Privacy policy modal (client/src/components/PrivacyModal.jsx) ---------- */
  .privacy-h{margin:14px 0 4px;font-size:13px;font-weight:600;color:var(--text)}
  .privacy-p{margin:0;font-size:12px;line-height:1.6;color:var(--muted,var(--text))}
  .privacy-updated{margin-top:16px;font-size:11px;opacity:.7}
  .footer-privacy-link{background:none;border:none;padding:0;margin:0;color:inherit;
    font:inherit;cursor:pointer;opacity:.85;min-height:0}
  .footer-privacy-link:hover{opacity:1;text-decoration:underline}

  /* ---------- Plans modal (client/src/components/PlansModal.jsx) ---------- */
  .plan-current-badge{display:inline-block;margin:4px 0 10px;padding:6px 14px;border-radius:999px;
    background:color-mix(in srgb, var(--accent2) 14%, transparent);
    border:1px solid color-mix(in srgb, var(--accent2) 40%, transparent);color:var(--accent2);
    font-size:12px;font-weight:700}

  /* ---------- Role badge (Header.jsx, Suite roadmap item 2) ---------- */
  .role-badge{display:inline-flex;align-items:center;padding:2px 9px;border-radius:999px;
    font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.3px}
  .role-badge.role-free{color:var(--muted);background:color-mix(in srgb, var(--muted) 12%, transparent);
    border:1px solid color-mix(in srgb, var(--muted) 30%, transparent)}
  .role-badge.role-pro{color:var(--accent2);background:color-mix(in srgb, var(--accent2) 14%, transparent);
    border:1px solid color-mix(in srgb, var(--accent2) 40%, transparent)}
  .role-badge.role-admin{color:var(--accent);background:color-mix(in srgb, var(--accent) 14%, transparent);
    border:1px solid color-mix(in srgb, var(--accent) 40%, transparent)}
  .plans-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:14px;margin-top:6px}
  .plan-card{background:var(--panel2);border:1px solid var(--line);border-radius:10px;padding:16px;
    display:flex;flex-direction:column;gap:10px}
  .plan-card-pro{border-color:var(--accent)}
  .plan-card-head h4{margin:0;font-size:14px}
  .plan-price{font-size:20px;font-weight:800}
  .plan-price-period{font-size:11px;font-weight:400;color:var(--muted);margin-left:2px}
  .plan-price-vat-note{font-size:10px;color:var(--muted);margin-top:-4px}
  .plan-features{margin:0;padding-left:18px;color:var(--muted);line-height:1.6;font-size:12px}
  .plan-cta{display:flex;flex-direction:column;gap:8px;margin-top:auto}
  .plan-cta button{width:100%}
  .plans-steps-note{margin:0;font-size:11px;line-height:1.5;color:var(--muted)}
  .plans-matrix-title{margin:18px 0 8px;font-size:13px;font-weight:700}
  .plans-matrix{width:100%;table-layout:fixed;border-collapse:collapse;font-size:12px}
  .plans-matrix th,.plans-matrix td{padding:7px 8px;border-bottom:1px solid var(--line);text-align:left;overflow-wrap:break-word}
  .plans-matrix th{color:var(--muted);font-weight:700;font-size:11px;text-transform:uppercase;letter-spacing:.02em}
  .plans-matrix th:first-child,.plans-matrix td:first-child{width:64%}
  .plans-matrix th:nth-child(2),.plans-matrix th:nth-child(3),
  .plans-matrix td:nth-child(2),.plans-matrix td:nth-child(3){width:18%;text-align:center}
  .plans-matrix td:first-child{color:var(--text)}
  .plans-matrix .pm-yes{color:var(--accent);font-weight:700}
  .plans-matrix .pm-no{color:var(--muted)}

  /* Header "Upgrade to Pro" (2026-08-05) — filled with the accent rather
     than the outline .acct-btn uses; the footer link alone wasn't visible
     enough to attract an upgrade, this is deliberately the one loud control. */
  #upgradeBtn{display:inline-flex;min-height:var(--control-h);box-sizing:border-box;align-items:center;
    justify-content:center;gap:6px;border:1px solid var(--accent);background:var(--accent);color:#0b0e14;
    padding:5px 10px;border-radius:8px;cursor:pointer;font-size:.78rem;font-weight:700;white-space:nowrap}
  #upgradeBtn:hover{filter:brightness(1.1)}

  /* ── Mobile hardening (desktop course UI on a phone) ──
     The 720px blocks above already move the level rail inline and tighten
     the header. This covers the rest: touch targets, iOS focus-zoom, modal
     sizing, and keeping wide rows inside their own scroll box. Every rule
     is inside a media query, so desktop rendering is unchanged. */
  .modal{max-width:min(580px,100%);max-height:88dvh;overflow-y:auto}

  @media (max-width:720px){
    /* iOS Safari zooms the page when a focused input is under 16px. The
       header select and calculator inputs set their own font-size, so name
       them explicitly rather than relying on the bare element selector. */
    input,select,textarea,
    .site-header .lang-switcher,
    .calc-row input,.calc-row select,
    .modal input,.modal select{font-size:16px}
    /* Inputs also need real height, not just legible text. */
    .modal input,.modal select,.calc-row input,.calc-row select{min-height:44px}

    /* Coarse pointers need ~44px; --control-h is 32px, tuned for a mouse.
       These need the same specificity as the desktop rules they override
       (e.g. `.levelpick .levels button`), otherwise min-height loses. */
    .levelpick .levels button,
    .site-header .acct-btn,
    .site-header .lang-switcher,
    .modal button,
    .modal .primary,
    .quiz .opt,
    button.reset,
    /* #upgradeBtn sets min-height:var(--control-h) from an ID selector, which
       outranks the bare `button` rule below — it stayed 32px on touch until
       it was named here at matching specificity. */
    #upgradeBtn,
    button{min-height:44px}
    .themes .swatch{width:30px;height:30px;min-width:30px}

    /* The calculator rows put a 140px control next to a label; on a narrow
       screen stack them so neither is squeezed to unreadable width. */
    .calc-row{flex-direction:column;align-items:stretch;gap:6px}
    .calc-row select,.calc-row input{width:100%}

    /* Header is sticky and can grow tall once it wraps; releasing it keeps
       the viewport usable for actual content. */
    .site-header{position:static}

    /* Wide comparison tables scroll in their own box. */
    .plans-matrix{display:block;overflow-x:auto}

    /* body only -- overflow-x on `html` forces overflow-y to `auto`, which
       makes the root a scroll container and breaks `position:sticky`. */
    body{max-width:100%;overflow-x:clip}
  }

/* Cookie notice (Suite TODO item 5) — informational bar, not a consent gate.
   One strictly-necessary cookie needs telling, not asking, so this never
   blocks the page or traps focus. Uses the theme tokens so it follows the
   dark/light/ocean switch like everything else. */
.cookie-notice {
  position: fixed;
  left: 12px; right: 12px; bottom: 12px;
  /* Below .modal-backdrop's 9990 on purpose: opening the privacy policy from
     this bar should cover it, not sit behind it. */
  z-index: 900;
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.45);
}
.cookie-notice-text { margin: 0; font-size: 12.5px; line-height: 1.5; flex: 1 1 320px; color: var(--text); }
.cookie-notice-actions { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.cookie-notice-link {
  background: none; border: none; padding: 0; cursor: pointer;
  font-size: 12.5px; color: var(--muted); text-decoration: underline;
}
.cookie-notice-link:hover { color: var(--text); }
.cookie-notice-ok {
  white-space: nowrap; cursor: pointer;
  padding: 7px 15px; border-radius: 7px; font-size: 12.5px; font-weight: 600;
  background: var(--accent); color: #0b0e14; border: 1px solid var(--accent);
}
.cookie-notice-ok:hover { filter: brightness(1.08); }
@media (max-width: 560px) {
  .cookie-notice { left: 8px; right: 8px; bottom: 8px; padding: 11px 13px; }
  .cookie-notice-actions { width: 100%; justify-content: flex-end; }
}
