
  /* Nile Academy look: cream + navy + gold, blue status accents, system sans. */
  :root{
    --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bg:#efe8d9; --spot:rgba(201,154,30,.12); --grid:rgba(15,23,42,.05); --hud:rgba(201,154,30,.7);
    --surface:rgba(255,255,255,.9); --surface-solid:#ffffff; --surface-soft:rgba(255,255,255,.5); --surface-strong:rgba(255,255,255,.98);
    --ink:#0f172a; --ink-2:#475569; --ink-soft:#566377;
    --line:rgba(11,19,36,.12); --line-strong:rgba(11,19,36,.2);
    --gold:#c99a1e; --gold-text:#7a5c05; --gold-line:rgba(201,154,30,.35); --gold-line-strong:rgba(201,154,30,.55);
    --gold-tint:rgba(201,154,30,.1); --gold-tint-strong:rgba(201,154,30,.28);
    --gold-grad:linear-gradient(135deg,#d4af37 0%,#faeea8 50%,#d4af37 100%); --on-gold:#010208;
    --blue:#2148c4; --blue-glow:rgba(33,72,196,.22); --blue-line:rgba(33,72,196,.35);
    --correct:#1a6c44; --on-correct:#ffffff; --incorrect:#b4233f; --on-incorrect:#ffffff;
    --neutral-badge:#9a8e70; --on-neutral:#ffffff;
    --shadow:0 1px 0 rgba(255,255,255,.85) inset, 0 1px 3px rgba(15,23,42,.07);
    --shadow-lift:0 8px 24px rgba(201,154,30,.14), 0 2px 6px rgba(15,23,42,.06);
    --shadow-card:0 1px 0 rgba(255,255,255,.9) inset, 0 12px 36px rgba(15,23,42,.08), 0 3px 8px rgba(15,23,42,.05);
    --shadow-gold:0 3px 10px rgba(201,154,30,.3), 0 1px 3px rgba(15,23,42,.1);
    --shadow-gold-hover:0 10px 28px rgba(201,154,30,.4), 0 3px 8px rgba(15,23,42,.12);
    --top-1:#3F6F63; --top-2:#8B5E3C; --top-3:#2148c4; --top-4:#8a6909; --top-5:#5B6472;
    --top-6:#7A4E7E; --top-7:#2F6F7C; --top-8:#9C5B4A; --top-9:#5E7A3E;
    --mod-1:#c99a1e; --mod-2:#9B4560; --mod-3:#B8863B; --mod-4:#2148c4; --mod-5:#6B4C7C; --mod-6:#6B7D4F;
    color-scheme:light;
  }
  @media (prefers-color-scheme: dark){
    :root:not([data-theme="light"]){
      --bg:#010208; --spot:rgba(212,175,55,.09); --grid:rgba(255,255,255,.035); --hud:rgba(212,175,55,.6);
      --surface:rgba(15,23,42,.72); --surface-solid:#0b1324; --surface-soft:rgba(15,23,42,.45); --surface-strong:rgba(11,19,36,.96);
      --ink:#f8fafc; --ink-2:#cbd5e1; --ink-soft:#94a3b8;
      --line:rgba(148,163,184,.16); --line-strong:rgba(148,163,184,.3);
      --gold:#d4af37; --gold-text:#e8c84a; --gold-line:rgba(212,175,55,.3); --gold-line-strong:rgba(212,175,55,.55);
      --gold-tint:rgba(212,175,55,.08); --gold-tint-strong:rgba(212,175,55,.22);
      --blue:#4ff0ff; --blue-glow:rgba(0,224,255,.25); --blue-line:rgba(79,240,255,.35);
      --correct:#5fcf8f; --on-correct:#04140b; --incorrect:#f27a94; --on-incorrect:#1c060b;
      --neutral-badge:#475569; --on-neutral:#e2e8f0;
      --shadow:0 1px 0 rgba(255,255,255,.04) inset, 0 1px 3px rgba(0,0,0,.45);
      --shadow-lift:0 8px 28px rgba(212,175,55,.12), 0 2px 8px rgba(0,0,0,.45);
      --shadow-card:0 1px 0 rgba(255,255,255,.05) inset, 0 18px 40px rgba(0,0,0,.5);
      --shadow-gold:0 4px 18px rgba(212,175,55,.25);
      --shadow-gold-hover:0 10px 30px rgba(212,175,55,.38);
      --top-1:#7FB8AA; --top-2:#C99A72; --top-3:#8FB0D6; --top-4:#e8c84a; --top-5:#A3ACB8;
      --top-6:#C39AC6; --top-7:#86C3CE; --top-8:#D69A88; --top-9:#A7C27F;
      --mod-1:#d4af37; --mod-2:#D18AA0; --mod-3:#D9A85C; --mod-4:#4ff0ff; --mod-5:#B291C4; --mod-6:#A3B87E;
      color-scheme:dark;
    }
  }
  :root[data-theme="dark"]{
    --bg:#010208; --spot:rgba(212,175,55,.09); --grid:rgba(255,255,255,.035); --hud:rgba(212,175,55,.6);
    --surface:rgba(15,23,42,.72); --surface-solid:#0b1324; --surface-soft:rgba(15,23,42,.45); --surface-strong:rgba(11,19,36,.96);
    --ink:#f8fafc; --ink-2:#cbd5e1; --ink-soft:#94a3b8;
    --line:rgba(148,163,184,.16); --line-strong:rgba(148,163,184,.3);
    --gold:#d4af37; --gold-text:#e8c84a; --gold-line:rgba(212,175,55,.3); --gold-line-strong:rgba(212,175,55,.55);
    --gold-tint:rgba(212,175,55,.08); --gold-tint-strong:rgba(212,175,55,.22);
    --blue:#4ff0ff; --blue-glow:rgba(0,224,255,.25); --blue-line:rgba(79,240,255,.35);
    --correct:#5fcf8f; --on-correct:#04140b; --incorrect:#f27a94; --on-incorrect:#1c060b;
    --neutral-badge:#475569; --on-neutral:#e2e8f0;
    --shadow:0 1px 0 rgba(255,255,255,.04) inset, 0 1px 3px rgba(0,0,0,.45);
    --shadow-lift:0 8px 28px rgba(212,175,55,.12), 0 2px 8px rgba(0,0,0,.45);
    --shadow-card:0 1px 0 rgba(255,255,255,.05) inset, 0 18px 40px rgba(0,0,0,.5);
    --shadow-gold:0 4px 18px rgba(212,175,55,.25);
    --shadow-gold-hover:0 10px 30px rgba(212,175,55,.38);
    --top-1:#7FB8AA; --top-2:#C99A72; --top-3:#8FB0D6; --top-4:#e8c84a; --top-5:#A3ACB8;
    --top-6:#C39AC6; --top-7:#86C3CE; --top-8:#D69A88; --top-9:#A7C27F;
    --mod-1:#d4af37; --mod-2:#D18AA0; --mod-3:#D9A85C; --mod-4:#4ff0ff; --mod-5:#B291C4; --mod-6:#A3B87E;
    color-scheme:dark;
  }

  *{ box-sizing:border-box; }
  html{ -webkit-text-size-adjust:100%; }
  body{
    margin:0; position:relative; min-height:100vh;
    background-color:var(--bg); color:var(--ink);
    background-image:
      radial-gradient(ellipse 80% 45% at 50% -8%, var(--spot) 0%, transparent 70%),
      linear-gradient(var(--grid) 1px, transparent 1px),
      linear-gradient(90deg, var(--grid) 1px, transparent 1px);
    background-size:100% 100%, 48px 48px, 48px 48px;
    font-family:var(--sans); font-size:16px; line-height:1.6; -webkit-font-smoothing:antialiased;
  }
  ::selection{ background:var(--gold-tint-strong); color:var(--ink); }
  :focus-visible{ outline:2px solid var(--gold); outline-offset:2px; border-radius:4px; }
  button{ font-family:inherit; }
  [hidden]{ display:none !important; }

  .hud{ position:absolute; top:18px; width:22px; height:22px; border:0 solid var(--hud); pointer-events:none; }
  .hud-tl{ left:18px; border-top-width:1.5px; border-left-width:1.5px; }
  .hud-tr{ right:18px; border-top-width:1.5px; border-right-width:1.5px; }

  .wrap{ max-width:820px; margin:0 auto; padding:2.4rem 1.25rem 4rem; }

  /* ---- brand + hero ---- */
  .brand-bar{ display:flex; align-items:center; justify-content:space-between; gap:1rem; }
  .brand{ display:inline-flex; align-items:center; gap:.75rem; color:var(--ink); text-decoration:none; }
  .brand-mark{ width:42px; height:42px; border-radius:10px; display:grid; place-items:center; font-weight:900; font-size:1.35rem; color:var(--gold); background:var(--surface-soft); border:1.5px solid var(--blue-line); }
  .brand-word{ font-weight:900; font-size:1.55rem; line-height:1; letter-spacing:-.05em; }
  .brand-word b{ font-style:italic; font-weight:900; color:var(--ink); }
  .brand-word span{ color:var(--gold); }
  .icon-btn{ width:46px; height:46px; border-radius:12px; display:grid; place-items:center; cursor:pointer; color:var(--ink); background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow); }
  .icon-btn svg{ width:20px; height:20px; }
  .icon-sun{ display:none; } .icon-moon{ display:block; }
  :root[data-theme="dark"] .icon-sun{ display:block; } :root[data-theme="dark"] .icon-moon{ display:none; }
  @media (prefers-color-scheme: dark){
    :root:not([data-theme="light"]) .icon-sun{ display:block; }
    :root:not([data-theme="light"]) .icon-moon{ display:none; }
  }

  .eyebrow{ display:flex; align-items:center; gap:.6rem; margin-top:1.4rem; font-size:.8rem; font-weight:700; letter-spacing:0; color:var(--blue); }
  .status-dot{ width:8px; height:8px; border-radius:50%; flex:none; background:var(--blue); box-shadow:0 0 0 3px var(--blue-glow), 0 0 10px var(--blue-glow); }
  .gold-badge{ display:inline-flex; align-items:center; gap:.7rem; margin-top:1rem; padding:.8rem 1.1rem; border-radius:10px; border:1px solid var(--gold-line); background:linear-gradient(100deg, var(--gold-tint) 0%, var(--gold-tint) 55%, var(--gold-tint-strong) 100%); color:var(--gold-text); font-size:.8rem; font-weight:900; letter-spacing:0; }
  .gold-badge svg{ width:14px; height:14px; color:var(--blue); flex:none; }
  h1{ margin:1.5rem 0 0; font-weight:900; font-size:clamp(2.4rem, 7.2vw, 3.8rem); line-height:1.02; letter-spacing:-.045em; text-wrap:balance; color:var(--ink); }
  h1 em{ font-style:italic; color:var(--gold); }
  .dek{ margin:1.1rem 0 0; max-width:40em; font-size:1.12rem; font-weight:500; line-height:1.6; color:var(--ink-2); }
  .dek strong{ color:var(--gold-text); font-weight:600; }
  .meta-line{ margin:1.2rem 0 0; display:flex; flex-wrap:wrap; align-items:center; gap:.5rem 1.2rem; font-size:.8rem; font-weight:700; letter-spacing:0; color:var(--ink-soft); }
  .meta-line .stat{ display:inline-flex; align-items:center; gap:.5rem; }
  .meta-line .stat b{ color:var(--gold-text); font-weight:900; font-variant-numeric:tabular-nums; }
  .meta-line .stat:first-child{ color:var(--blue); }
  .meta-line .stat:first-child::before{ content:""; width:7px; height:7px; border-radius:50%; background:var(--blue); box-shadow:0 0 0 3px var(--blue-glow); }

  /* ---- accounts ---- */
  .account{ margin-top:1.3rem; display:flex; flex-wrap:wrap; align-items:center; gap:.6rem .9rem; padding:.8rem .95rem; border-radius:12px; background:var(--surface-soft); border:1px solid var(--line); font-size:.9rem; color:var(--ink-2); }
  .account strong{ color:var(--ink); font-weight:800; }
  .sync{ font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink-soft); }
  .sync.is-saved{ color:var(--correct); } .sync.is-error{ color:var(--incorrect); }
  .acct-btn{ appearance:none; cursor:pointer; border-radius:10px; padding:.6rem 1.05rem; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink); background:var(--surface-solid); border:1px solid var(--line-strong); box-shadow:var(--shadow); }
  .acct-btn.primary{ background:var(--gold-grad); color:var(--on-gold); border-color:transparent; box-shadow:var(--shadow-gold); }
  .acct-btn:disabled{ opacity:.55; cursor:default; }
  .account > .acct-btn:first-of-type{ margin-left:auto; }
  .auth-form{ flex-basis:100%; max-width:440px; display:flex; flex-direction:column; gap:.85rem; padding:.3rem 0 .2rem; }
  .auth-form label{ display:flex; flex-direction:column; gap:.35rem; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink-soft); }
  .auth-form input{ font:inherit; font-size:1rem; font-weight:500; letter-spacing:0; text-transform:none; padding:.7rem .85rem; border-radius:10px; border:1px solid var(--line-strong); background:var(--surface-solid); color:var(--ink); }
  .auth-form input:focus{ outline:none; border-color:var(--blue-line); box-shadow:0 0 0 3px var(--blue-glow); }
  .auth-msg{ margin:0; font-size:.9rem; color:var(--incorrect); }
  .auth-msg.is-info{ color:var(--ink-2); }
  .auth-actions{ display:flex; gap:.6rem; flex-wrap:wrap; }
  .auth-actions .acct-btn{ margin-left:0; }

  /* ---- tabs + breadcrumb ---- */
  .tabs{ display:inline-flex; gap:.3rem; margin-top:1.6rem; padding:.3rem; border-radius:12px; background:var(--surface-soft); border:1px solid var(--line); }
  .tab{ appearance:none; border:0; background:transparent; cursor:pointer; padding:.6rem 1.1rem; border-radius:9px; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink-soft); }
  .tab.is-active{ background:var(--surface-solid); color:var(--ink); box-shadow:var(--shadow); }
  .crumb{ display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; margin-top:1.6rem; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink-soft); }
  .crumb button{ background:none; border:0; padding:0; cursor:pointer; color:var(--blue); font:inherit; letter-spacing:inherit; text-transform:inherit; }
  .crumb .current{ color:var(--ink); }
  .crumb .sep{ color:var(--line-strong); }

  /* ---- home actions ---- */
  .global-actions{ display:grid; gap:.7rem; margin-top:1.4rem; }
  .mix-btn{ cursor:pointer; text-align:left; border:0; border-radius:12px; padding:1.1rem 1.3rem; background:var(--gold-grad); color:var(--on-gold); font-size:.78rem; font-weight:800; letter-spacing:0; box-shadow:var(--shadow-gold); transition:transform .15s ease, box-shadow .15s ease; }
  @media (hover:hover){ .mix-btn:hover{ transform:translateY(-1px); box-shadow:var(--shadow-gold-hover); } }
  .weak-btn{ display:flex; align-items:center; justify-content:space-between; gap:1rem; cursor:pointer; border-radius:12px; padding:1rem 1.3rem; background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow); color:var(--ink); font-size:.78rem; font-weight:800; letter-spacing:0; }
  .weak-btn strong{ min-width:2rem; text-align:center; padding:.15rem .6rem; border-radius:999px; background:var(--incorrect); color:var(--on-incorrect); font-size:.8rem; letter-spacing:0; font-variant-numeric:tabular-nums; }
  .weak-btn:disabled{ cursor:default; opacity:.6; }
  .weak-btn:disabled strong{ background:var(--neutral-badge); color:var(--on-neutral); }

  /* ---- module / section / lecture rows ---- */
  .list{ margin-top:1.4rem; display:grid; gap:.7rem; }
  .row-card{ display:flex; align-items:center; gap:1rem; width:100%; text-align:left; cursor:pointer; color:var(--ink); font-size:1rem; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:1.05rem 1.2rem; box-shadow:var(--shadow); transition:border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
  @media (hover:hover){ .row-card:hover:not(.is-empty){ border-color:var(--gold-line-strong); box-shadow:var(--shadow-lift); transform:translateY(-1px); } }
  .row-card.is-empty{ cursor:default; opacity:.6; background:var(--surface-soft); box-shadow:none; }
  .row-main{ flex:1; min-width:0; }
  .row-name{ display:flex; align-items:center; gap:.65rem; font-size:1.03rem; font-weight:800; letter-spacing:-.01em; }
  .row-name::before{ content:""; flex:none; width:10px; height:10px; border-radius:3px; background:var(--rc, var(--gold)); }
  .row-sub{ margin-top:.3rem; padding-left:calc(10px + .65rem); font-size:.8rem; font-weight:700; letter-spacing:0; color:var(--ink-soft); }
  .row-count{ flex:none; text-align:right; white-space:nowrap; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink-soft); font-variant-numeric:tabular-nums; }
  .row-count strong{ display:block; font-size:1.45rem; font-weight:900; letter-spacing:-.03em; line-height:1.1; color:var(--gold-text); }
  .section-note{ margin-top:1rem; max-width:40em; font-size:.95rem; color:var(--ink-2); }

  /* ---- question bank ---- */
  .filter-row{ display:flex; flex-wrap:wrap; gap:.45rem; margin-top:1.2rem; }
  .chip{ cursor:pointer; border-radius:999px; padding:.45rem .9rem; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink-2); background:var(--surface); border:1px solid var(--line-strong); }
  .chip.is-active{ background:var(--ink); color:var(--bg); border-color:var(--ink); }
  .bank-list{ margin-top:1.2rem; display:grid; gap:.55rem; }
  .bank-row{ display:flex; align-items:flex-start; gap:.85rem; padding:.9rem 1rem; border-radius:12px; background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow); }
  .bank-check{ appearance:none; -webkit-appearance:none; flex:none; margin:.1rem 0 0; width:1.25rem; height:1.25rem; border-radius:6px; cursor:pointer; display:inline-grid; place-content:center; background:var(--surface-solid); border:1.5px solid var(--line-strong); }
  .bank-check::before{ content:""; width:.65rem; height:.65rem; transform:scale(0); background:var(--on-gold); clip-path:polygon(14% 44%, 0 65%, 36% 100%, 100% 16%, 82% 0%, 36% 66%); }
  .bank-check:checked{ background:var(--gold-grad); border-color:var(--gold); }
  .bank-check:checked::before{ transform:scale(1); }
  .bank-main{ flex:1; min-width:0; }
  .bank-stem{ font-size:.95rem; line-height:1.5; }
  .bank-row.is-excluded .bank-stem{ opacity:.45; text-decoration:line-through; text-decoration-color:var(--line-strong); }
  .bank-meta{ display:flex; flex-wrap:wrap; align-items:center; gap:.5rem; margin-top:.45rem; }
  .bank-topic-tag{ font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--tc, var(--ink-soft)); }
  .badge{ font-size:.8rem; font-weight:800; letter-spacing:0; padding:.15rem .55rem; border-radius:999px; }
  .badge-correct{ background:var(--correct); color:var(--on-correct); }
  .badge-incorrect{ background:var(--incorrect); color:var(--on-incorrect); }
  .badge-unused{ background:var(--neutral-badge); color:var(--on-neutral); }
  .bank-footer{ position:sticky; bottom:12px; margin-top:1.4rem; display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; padding:.85rem 1rem; border-radius:14px; background:var(--surface-strong); border:1px solid var(--line); box-shadow:var(--shadow-card); }
  .bank-footer-count{ font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink-soft); }
  .bank-footer-count strong{ color:var(--gold-text); font-size:.9rem; }
  .bank-start-btn{ cursor:pointer; border:0; border-radius:12px; padding:.85rem 1.3rem; background:var(--gold-grad); color:var(--on-gold); font-size:.8rem; font-weight:800; letter-spacing:0; box-shadow:var(--shadow-gold); }
  .bank-start-btn:disabled{ opacity:.4; cursor:default; box-shadow:none; }

  /* ---- quiz ---- */
  .quiz-head{ display:flex; justify-content:space-between; align-items:flex-end; gap:1rem; margin:1.6rem 0 .8rem; }
  .quiz-topic-tag{ display:flex; align-items:center; gap:.5rem; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--tc, var(--gold-text)); }
  .quiz-topic-tag::before{ content:""; width:8px; height:8px; border-radius:2px; background:currentColor; }
  .quiz-progress{ margin-top:.3rem; font-size:.8rem; font-weight:700; letter-spacing:0; color:var(--ink-soft); font-variant-numeric:tabular-nums; }
  .quit-btn{ flex:none; background:none; border:0; padding:0; cursor:pointer; color:var(--blue); font-size:.8rem; font-weight:800; letter-spacing:0; }
  .quiz-bar{ height:4px; border-radius:999px; background:var(--line); overflow:hidden; margin-bottom:1rem; }
  .quiz-bar-fill{ height:100%; border-radius:inherit; background:linear-gradient(90deg, var(--gold), var(--blue)); }
  .stem-card{ padding:1.5rem; border-radius:16px; background:var(--surface-strong); border:1px solid var(--line); box-shadow:var(--shadow-card); }
  .stem-card .eyebrow{ margin-top:0; }
  .stem-text{ font-size:1.12rem; font-weight:500; line-height:1.6; }
  .options{ margin-top:1.3rem; display:grid; gap:.6rem; }
  .option{ display:flex; align-items:flex-start; gap:.85rem; width:100%; text-align:left; cursor:pointer; padding:.9rem 1rem; border-radius:12px; font-size:1rem; line-height:1.5; color:var(--ink); background:var(--surface-solid); border:1px solid var(--line-strong); transition:border-color .12s ease, box-shadow .12s ease, background .12s ease; }
  @media (hover:hover){ .option:hover:not(:disabled){ border-color:var(--gold); box-shadow:var(--shadow-lift); } }
  .option:disabled{ cursor:default; }
  .option .letter{ flex:none; width:1.75rem; height:1.75rem; margin-top:-.05rem; border-radius:8px; display:grid; place-items:center; font-size:.78rem; font-weight:900; color:var(--ink-2); background:var(--surface-soft); border:1px solid var(--line-strong); }
  .option.is-correct{ border-color:var(--correct); background:color-mix(in srgb, var(--correct) 12%, var(--surface-solid)); }
  .option.is-correct .letter{ background:var(--correct); border-color:var(--correct); color:var(--on-correct); }
  .option.is-wrong{ border-color:var(--incorrect); background:color-mix(in srgb, var(--incorrect) 10%, var(--surface-solid)); }
  .option.is-wrong .letter{ background:var(--incorrect); border-color:var(--incorrect); color:var(--on-incorrect); }
  .option.is-muted{ opacity:.5; }
  .explain-card{ margin-top:1.2rem; padding:1.1rem 1.2rem; border-radius:12px; background:var(--gold-tint); border:1px solid var(--gold-line); font-size:.98rem; line-height:1.65; color:var(--ink); }
  .explain-card .label{ display:block; margin-bottom:.45rem; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--blue); }
  .next-row{ margin-top:1.3rem; display:flex; justify-content:flex-end; }
  .next-btn{ cursor:pointer; border:0; border-radius:12px; padding:.95rem 1.5rem; background:var(--gold-grad); color:var(--on-gold); font-size:.8rem; font-weight:800; letter-spacing:0; box-shadow:var(--shadow-gold); }
  .next-btn:disabled{ cursor:default; opacity:.4; box-shadow:none; }

  /* ---- results ---- */
  .score-big{ margin-top:.6rem; font-weight:900; font-size:clamp(3.4rem, 13vw, 5.2rem); line-height:1; letter-spacing:-.05em; color:var(--gold-text); font-variant-numeric:tabular-nums; }
  .score-sub{ margin-top:.5rem; font-size:1.05rem; color:var(--ink-2); }
  .end-actions{ display:flex; flex-wrap:wrap; gap:.7rem; margin-top:1.6rem; }
  .end-actions button{ cursor:pointer; border-radius:12px; padding:.95rem 1.4rem; font-size:.8rem; font-weight:800; letter-spacing:0; }
  .btn-primary{ border:0; background:var(--gold-grad); color:var(--on-gold); box-shadow:var(--shadow-gold); }
  .btn-secondary{ background:var(--surface-solid); color:var(--ink); border:1px solid var(--line-strong); box-shadow:var(--shadow); }

  .site-foot{ margin-top:3.5rem; padding-top:1.2rem; border-top:1px solid var(--gold-line); display:flex; flex-wrap:wrap; justify-content:space-between; gap:.5rem 1rem; font-size:.8rem; font-weight:700; letter-spacing:0; color:var(--ink-soft); }
  .site-foot a{ color:var(--gold-text); text-decoration:none; }

  @media (prefers-reduced-motion: reduce){ *{ transition:none !important; } }
  @media (max-width:520px){
    .wrap{ padding-top:2rem; }
    .brand-word{ font-size:1.3rem; }
    .brand-mark{ width:38px; height:38px; font-size:1.2rem; }
    .gold-badge{ letter-spacing:.14em; }
    .stem-card{ padding:1.15rem; }
    .bank-footer{ flex-direction:column; align-items:stretch; }
    .account > .acct-btn:first-of-type{ margin-left:0; }
  }

/* ---- app layer on top of base.css (Nile Academy tokens) ---- */
.wrap{ max-width:860px; }
header .account{ margin-top:1rem; }
.acct-note{ font-size:.88rem; color:var(--ink-2); }
.muted{ color:var(--ink-soft); font-weight:600; }

/* hero (home only) */
.hero{ margin-top:.4rem; }
.hero h1{ margin-top:1.1rem; }
.page-title{ margin:1.2rem 0 0; font-weight:900; font-size:clamp(1.8rem, 5vw, 2.4rem); line-height:1.1; letter-spacing:-.035em; text-wrap:balance; }
.page-sub{ margin:.5rem 0 0; color:var(--ink-2); max-width:44em; }
.list-title{ margin:2.2rem 0 .2rem; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink-soft); }
.eyebrow.plain{ margin-top:0; color:var(--blue); }

/* buttons */
.btn{ cursor:pointer; border-radius:12px; padding:.85rem 1.25rem; font-size:.8rem; font-weight:800; letter-spacing:0; line-height:1.2; }
.btn.small{ padding:.6rem .95rem; font-size:.66rem; }
.btn-primary{ border:0; background:var(--gold-grad); color:var(--on-gold); box-shadow:var(--shadow-gold); }
.btn-secondary{ background:var(--surface-solid); color:var(--ink); border:1px solid var(--line-strong); box-shadow:var(--shadow); }
.btn:disabled{ opacity:.45; cursor:default; box-shadow:none; }
.btn.is-flagged{ border-color:var(--gold); color:var(--gold-text); background:var(--gold-tint); }
.btn-row{ display:flex; flex-wrap:wrap; gap:.6rem; margin-top:1.2rem; }
.btn-row.tight{ margin-top:.7rem; }

/* home actions */
.resume{ margin-top:1.4rem; width:100%; display:flex; align-items:center; justify-content:space-between; gap:1rem; text-align:left; cursor:pointer; padding:1rem 1.2rem; border-radius:12px; border:1.5px solid var(--gold-line-strong); background:var(--gold-tint); color:var(--ink); font-size:.95rem; }
.resume .arrow{ font-size:1.2rem; color:var(--gold-text); }
.resume-wrap{ margin-top:1.4rem; display:flex; align-items:stretch; gap:.5rem; }
.resume-wrap .resume{ margin-top:0; flex:1; min-width:0; background:var(--surface); border:1px solid var(--line); }
.resume-sub{ display:block; margin-top:.15rem; font-size:.88rem; }
.resume-dismiss{ flex:none; min-height:44px; padding:0 .75rem; border-radius:12px; border:1px solid var(--line); background:transparent; color:var(--ink-soft); font:inherit; font-size:.88rem; cursor:pointer; }
@media (hover:hover){ .resume-dismiss:hover{ color:var(--ink); border-color:var(--gold-line-strong); } }
.actions{ margin-top:1.4rem; display:grid; grid-template-columns:repeat(3, 1fr); gap:.7rem; }
.action{ display:flex; flex-direction:column; gap:.45rem; text-align:left; cursor:pointer; padding:1.05rem 1.15rem; border-radius:14px; background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow); color:var(--ink); transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
@media (hover:hover){ .action:hover:not(:disabled){ transform:translateY(-1px); box-shadow:var(--shadow-lift); border-color:var(--gold-line-strong); } }
.action:disabled{ cursor:default; opacity:.7; }
.action.primary{ background:var(--gold-grad); border-color:transparent; color:var(--on-gold); box-shadow:var(--shadow-gold); }
.action-title{ display:flex; align-items:center; gap:.5rem; font-size:.78rem; font-weight:900; letter-spacing:0; }
.action-sub{ font-size:.86rem; line-height:1.45; color:inherit; opacity:.8; }
.pill{ display:inline-block; min-width:1.6rem; text-align:center; padding:.05rem .5rem; border-radius:999px; background:var(--incorrect); color:var(--on-incorrect); font-size:.72rem; letter-spacing:0; }

/* progress bars */
.bar{ display:flex; height:6px; margin-top:.6rem; border-radius:999px; overflow:hidden; background:var(--line); }
.bar span{ display:block; height:100%; }
.bar-correct{ background:var(--correct); }
.bar-wrong{ background:var(--incorrect); opacity:.75; }
.row-card .bar{ max-width:360px; }
.row-card:disabled{ cursor:default; opacity:.55; }
.row-sub{ padding-left:calc(10px + .65rem); }
.row-main .bar{ margin-left:calc(10px + .65rem); }

/* practice */
.quiz-head{ margin-top:1.4rem; }
.option-text{ padding-top:.1rem; }
.explain-card.is-right .label{ color:var(--correct); }
.explain-card.is-wrong .label{ color:var(--incorrect); }
.explain-card p{ margin:0; }
.next-row{ align-items:center; justify-content:space-between; gap:1rem; }
.kbd-hint{ font-size:.8rem; font-weight:700; letter-spacing:0; color:var(--ink-soft); }
.result-card{ margin-top:1.4rem; }

/* exam */
.exam-bar{ position:sticky; top:0; z-index:5; display:flex; justify-content:space-between; align-items:center; gap:1rem; margin:1.2rem 0 1rem; padding:.75rem 1rem; border-radius:14px; background:var(--surface-strong); border:1px solid var(--line); box-shadow:var(--shadow-card); }
.exam-bar-right{ display:flex; align-items:center; gap:.7rem; }
.timer{ font-weight:900; font-size:1.05rem; letter-spacing:-.01em; font-variant-numeric:tabular-nums; padding:.35rem .7rem; border-radius:10px; background:var(--surface-soft); border:1px solid var(--line); }
.timer.is-low{ color:var(--incorrect); border-color:var(--incorrect); }
.option.is-selected{ border-color:var(--blue); background:color-mix(in srgb, var(--blue) 9%, var(--surface-solid)); box-shadow:0 0 0 2px var(--blue-glow); }
.option.is-selected .letter{ background:var(--blue); border-color:var(--blue); color:var(--surface-solid); }
.exam-nav{ display:flex; justify-content:space-between; gap:.6rem; margin-top:1.3rem; flex-wrap:wrap; }
.nav-card{ margin-top:1rem; padding:1rem 1.1rem; border-radius:14px; background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow); }
.nav-legend{ display:flex; flex-wrap:wrap; gap:1rem; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink-soft); }
.lg::before{ content:""; display:inline-block; width:.8rem; height:.8rem; margin-right:.4rem; vertical-align:-2px; border-radius:3px; border:1px solid var(--line-strong); background:var(--surface-solid); }
.lg.done::before{ background:var(--blue); border-color:var(--blue); }
.lg.flag::before{ background:var(--gold); border-color:var(--gold); }
.nav-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(2.4rem, 1fr)); gap:.35rem; margin:.8rem 0 .9rem; }
.nav-grid button{ cursor:pointer; height:2.4rem; border-radius:8px; font-size:.78rem; font-weight:800; font-variant-numeric:tabular-nums; color:var(--ink-2); background:var(--surface-solid); border:1px solid var(--line-strong); }
.nav-grid button.done{ background:var(--blue); border-color:var(--blue); color:var(--surface-solid); }
.nav-grid button.flag{ box-shadow:inset 0 -4px 0 var(--gold); }
.nav-grid button.current{ outline:2px solid var(--ink); outline-offset:1px; }

/* exam setup */
.setup{ margin-top:1.2rem; }
.setup-h{ margin:1.2rem 0 .6rem; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink-soft); }
.setup-h:first-child{ margin-top:0; }
.setup-sections{ display:grid; grid-template-columns:repeat(2, 1fr); gap:.45rem; }
.check{ display:flex; align-items:center; gap:.6rem; cursor:pointer; padding:.6rem .75rem; border-radius:10px; border:1px solid var(--line); background:var(--surface-solid); font-size:.92rem; }
.check .muted{ margin-left:auto; font-size:.8rem; font-variant-numeric:tabular-nums; }
.check input{ width:1.05rem; height:1.05rem; accent-color:var(--gold); flex:none; }
.check.solo{ margin-top:1.2rem; border:0; padding:0; background:none; }
.setup-foot{ display:flex; justify-content:space-between; align-items:center; gap:1rem; flex-wrap:wrap; margin-top:1.4rem; padding-top:1rem; border-top:1px solid var(--line); }
.setup-summary{ margin:0; font-weight:800; }
.setup-spread{ display:flex; flex-wrap:wrap; gap:.4rem; }
.spread-item{ display:inline-flex; align-items:baseline; gap:.45rem; padding:.3rem .65rem; border-radius:999px; border:1px solid var(--line); background:var(--surface-solid); font-size:.82rem; }
.spread-item strong{ font-variant-numeric:tabular-nums; }

/* results */
.breakdown{ display:grid; gap:.55rem; padding:1rem 1.1rem; border-radius:14px; background:var(--surface); border:1px solid var(--line); }
.bd-row{ display:grid; grid-template-columns:minmax(0, 1.3fr) minmax(0, 1fr) 3.5rem; align-items:center; gap:.8rem; font-size:.9rem; }
.bd-row .bar{ margin:0; }
.bd-more{ margin-top:1rem; }
.bd-more > summary{ cursor:pointer; min-height:44px; display:flex; align-items:center; color:var(--ink-soft); font-size:.92rem; }
.bd-more > .breakdown{ margin-top:.4rem; }
.bd-score{ text-align:right; font-weight:800; font-variant-numeric:tabular-nums; }
.review-list{ display:grid; gap:.55rem; margin-top:.8rem; }
.review{ border-radius:12px; background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow); }
.review summary{ cursor:pointer; list-style:none; display:grid; grid-template-columns:auto minmax(0, 1fr) auto; gap:.75rem; align-items:start; padding:.85rem 1rem; }
.review summary::-webkit-details-marker{ display:none; }
.review-num{ font-weight:900; color:var(--ink-soft); font-variant-numeric:tabular-nums; min-width:1.6rem; }
.review-stem{ font-size:.94rem; line-height:1.5; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.review[open] .review-stem{ -webkit-line-clamp:unset; display:block; }
.review-body{ padding:0 1rem 1rem; }
.review-opts{ list-style:none; margin:.7rem 0 0; padding:0; display:grid; gap:.4rem; }
.review-opts li{ display:flex; gap:.6rem; align-items:flex-start; padding:.55rem .7rem; border-radius:9px; border:1px solid var(--line); background:var(--surface-solid); font-size:.92rem; line-height:1.45; }
.review-opts li .letter{ flex:none; width:1.45rem; height:1.45rem; border-radius:6px; display:grid; place-items:center; font-size:.7rem; font-weight:900; background:var(--surface-soft); border:1px solid var(--line-strong); color:var(--ink-2); }
.review-opts li.is-correct{ border-color:var(--correct); background:color-mix(in srgb, var(--correct) 10%, var(--surface-solid)); }
.review-opts li.is-correct .letter{ background:var(--correct); border-color:var(--correct); color:var(--on-correct); }
.review-opts li.is-wrong{ border-color:var(--incorrect); background:color-mix(in srgb, var(--incorrect) 9%, var(--surface-solid)); }
.review-opts li.is-wrong .letter{ background:var(--incorrect); border-color:var(--incorrect); color:var(--on-incorrect); }
.review-opts .tag{ margin-left:auto; flex:none; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink-soft); padding-top:.2rem; }
.review-explain{ margin:.8rem 0 0; padding:.85rem 1rem; border-radius:10px; background:var(--gold-tint); border:1px solid var(--gold-line); font-size:.94rem; line-height:1.6; }
.review .quiz-topic-tag{ margin-top:.2rem; }

/* question bank */
.bank-controls{ display:grid; grid-template-columns:1fr 1fr 1.2fr; gap:.55rem; margin-top:1.3rem; }
.bank-controls select, .bank-controls input{ width:100%; min-width:0; font:inherit; font-size:.92rem; padding:.65rem .75rem; border-radius:10px; border:1px solid var(--line-strong); background:var(--surface-solid); color:var(--ink); }
.bank-controls select:focus, .bank-controls input:focus{ outline:none; border-color:var(--blue-line); box-shadow:0 0 0 3px var(--blue-glow); }
.bank-main summary{ cursor:pointer; list-style:none; display:block; }
.bank-main summary::-webkit-details-marker{ display:none; }
.bank-main .bank-stem{ display:block; }
.bank-main .bank-meta{ display:flex; }
.bank-main .review-body{ padding:0; }
.bank-row.is-excluded .bank-main .bank-stem{ opacity:.45; text-decoration:line-through; text-decoration-color:var(--line-strong); }

/* modal */
.modal-back{ position:fixed; inset:0; z-index:50; display:grid; place-items:center; padding:1.25rem; background:rgba(1,2,8,.45); }
.modal{ width:min(440px, 100%); padding:1.4rem; border-radius:16px; background:var(--surface-strong); border:1px solid var(--line); box-shadow:var(--shadow-card); }
.modal h3{ margin:0; font-size:1.2rem; font-weight:900; letter-spacing:-.02em; }
.modal p{ margin:.6rem 0 0; color:var(--ink-2); }

@media (max-width:640px){
  .actions{ grid-template-columns:1fr; }
  .setup-sections{ grid-template-columns:1fr; }
  .bank-controls{ grid-template-columns:1fr; }
  .exam-bar{ padding:.6rem .75rem; }
  .next-row .kbd-hint{ display:none; }
  .row-card{ flex-direction:row; align-items:center; }
  .row-count{ text-align:right; }
  .row-card .bar{ max-width:none; }
}
@media (hover:none){ .kbd-hint{ display:none; } }

/* bullet-point explanations */
.points{ margin:.2rem 0 0; padding-left:1.15rem; display:grid; gap:.45rem; }
.points li{ line-height:1.55; padding-left:.15rem; }
.points li::marker{ color:var(--gold); }
.explain-card .points{ margin-top:.3rem; }
.more-btn{ justify-self:center; margin-top:.4rem; }
/* focus mode: hide account + tabs while answering */
body.focus header .account, body.focus header .tabs{ display:none; }
body.focus .quiz-head, body.focus .exam-bar{ margin-top:1rem; }
.tabs{ max-width:100%; }
@media (max-width:480px){
  .tabs{ display:flex; width:100%; }
  .tab{ flex:1; padding:.6rem .4rem; font-size:.6rem; letter-spacing:.08em; white-space:nowrap; }
  .wrap{ padding-left:1rem; padding-right:1rem; }
  .hud{ display:none; }
}
/* per-option reasons, shown under each wrong option once answered */
.option-text, .ro-text{ display:flex; flex-direction:column; gap:.3rem; min-width:0; }
.option-why{ font-size:.86rem; line-height:1.45; font-weight:500; color:var(--ink-2); }
.option.is-wrong .option-why, .review-opts li.is-wrong .option-why{ color:var(--ink); font-weight:650; }
.option.is-muted{ opacity:1; }
.option.is-muted .option-main, .option.is-muted .letter{ opacity:.55; }
.review-opts .option-why{ font-size:.84rem; }
.quiz-topic-tag{ align-items:flex-start; }
.quiz-topic-tag::before{ margin-top:.28em; flex:none; }

/* question pictures (served to signed-in users only) */
.q-img{ margin:1rem 0 .25rem; display:flex; align-items:center; justify-content:center; min-height:7.5rem; padding:.5rem; border-radius:12px; border:1px solid var(--line); background:var(--surface-soft); overflow:hidden; }
.q-img img{ display:block; max-width:100%; max-height:min(58vh, 480px); width:auto; height:auto; border-radius:6px; }
.q-img-note{ font-size:.9rem; color:var(--ink-2); text-align:center; padding:1rem; }
.review-body .q-img{ margin:.4rem 0 .8rem; }

/* module tabs (FunMed, Cardioresp, ...) */
.mod-switch{ display:flex; flex-wrap:wrap; gap:.4rem; margin:.2rem 0 .4rem; }
.mod-tab{ display:inline-flex; align-items:center; gap:.55rem; cursor:pointer; border-radius:999px; padding:.5rem .95rem; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink-2); background:var(--surface); border:1px solid var(--line-strong); }
.mod-tab .mod-count{ font-size:.62rem; letter-spacing:.04em; font-variant-numeric:tabular-nums; padding:.1rem .45rem; border-radius:999px; background:var(--gold-tint); color:var(--gold-text); }
.mod-tab.is-active{ background:var(--ink); color:var(--bg); border-color:var(--ink); }
.mod-tab.is-active .mod-count{ background:var(--gold-tint-strong); color:var(--bg); }
.mod-tab:focus-visible{ outline:2px solid var(--blue); outline-offset:2px; }

/* ---------- app guide ---------- */
.foot-link{ font:inherit; letter-spacing:inherit; text-transform:inherit; color:var(--gold-text); background:none; border:0; padding:0; cursor:pointer; }
@media (hover:hover){ .foot-link:hover{ text-decoration:underline; } }
.guide-lock{ margin-top:1.2rem; max-width:30rem; display:flex; flex-direction:column; gap:.9rem; }
.guide-lock .page-sub{ margin:0; }
.guide-lock-row{ display:flex; gap:.6rem; }
.guide-code{ flex:1; min-width:0; font:inherit; font-size:1.3rem; letter-spacing:.4em; padding:.6rem .9rem; border-radius:12px; border:1px solid var(--line-strong); background:var(--surface-solid); color:var(--ink); }
.guide-code:focus{ outline:2px solid var(--gold); outline-offset:1px; }
.guide{ margin-top:.4rem; }
.guide-intro .page-sub{ margin-top:.4rem; }
.guide-toc{ display:flex; flex-wrap:wrap; gap:.35rem .5rem; margin:1rem 0 .4rem; }
.guide-toc a{ font-size:.82rem; font-weight:700; color:var(--gold-text); text-decoration:none; padding:.25rem .6rem; border:1px solid var(--gold-line); border-radius:99px; background:var(--gold-tint); }
@media (hover:hover){ .guide-toc a:hover{ border-color:var(--gold-line-strong); } }
.guide section{ margin-top:1.4rem; padding:1.3rem 1.4rem; border-radius:16px; background:var(--surface-strong); border:1px solid var(--line); box-shadow:var(--shadow); scroll-margin-top:1rem; }
.guide h3{ margin:0 0 .7rem; font-size:1.25rem; font-weight:900; letter-spacing:-.02em; }
.guide h4{ margin:1.1rem 0 .35rem; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--gold-text); }
.guide p{ margin:.4rem 0; color:var(--ink-2); }
.guide ul,.guide ol{ margin:.3rem 0 .6rem; padding-left:1.3rem; color:var(--ink-2); }
.guide li{ margin:.25rem 0; }
.guide b{ color:var(--ink); }
.guide code{ font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:.86em; padding:.05rem .35rem; border-radius:5px; background:var(--gold-tint); border:1px solid var(--line); color:var(--ink); overflow-wrap:anywhere; }
.guide pre{ margin:.5rem 0; padding:.8rem 1rem; border-radius:10px; background:var(--surface-soft); border:1px solid var(--line); overflow-x:auto; }
.guide pre code{ padding:0; border:0; background:none; font-size:.82rem; overflow-wrap:normal; white-space:pre; }
.guide kbd{ font-family:ui-monospace,Menlo,monospace; font-size:.8em; padding:.05rem .4rem; border-radius:5px; border:1px solid var(--line-strong); border-bottom-width:2px; background:var(--surface-solid); }
.guide-scroll{ overflow-x:auto; margin:.5rem 0; border:1px solid var(--line); border-radius:10px; }
.guide table{ border-collapse:collapse; width:100%; min-width:520px; font-size:.88rem; }
.guide th,.guide td{ text-align:left; vertical-align:top; padding:.5rem .7rem; border-bottom:1px solid var(--line); }
.guide th{ font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink-soft); background:var(--surface-soft); }
.guide tr:last-child td{ border-bottom:0; }
.guide td.num{ font-variant-numeric:tabular-nums; font-weight:800; color:var(--ink); }
.guide-stats{ display:grid; grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:.6rem; margin:.2rem 0 .8rem; }
.guide-stat{ padding:.8rem .9rem; border-radius:12px; border:1px solid var(--gold-line); background:var(--gold-tint); display:flex; flex-direction:column; }
.guide-stat b{ font-size:1.6rem; font-weight:900; line-height:1.1; font-variant-numeric:tabular-nums; color:var(--ink); }
.guide-stat span{ font-size:.8rem; color:var(--ink-2); }
@media (max-width:560px){ .guide section{ padding:1.05rem 1rem; } }

/* ---------- sign-in and sign-up forms ---------- */
.auth-title{ margin:0; font-size:1.05rem; font-weight:900; letter-spacing:-.015em; color:var(--ink); }
.auth-field{ display:flex; flex-direction:column; gap:.35rem; }
.auth-field label{ font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink-soft); }
.auth-hint{ margin:0; font-size:.8rem; line-height:1.4; color:var(--ink-soft); }
.auth-form input[aria-invalid="true"]{ border-color:var(--incorrect); box-shadow:0 0 0 3px color-mix(in srgb, var(--incorrect) 20%, transparent); }
.pw-wrap{ position:relative; display:flex; }
.pw-wrap input{ flex:1; min-width:0; padding-right:4.6rem; }
.pw-toggle{ position:absolute; top:.25rem; bottom:.25rem; right:.25rem; display:flex; align-items:center; cursor:pointer; padding:0 .75rem; border:0; border-radius:8px; background:none; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--gold-text); }
@media (hover:hover){ .pw-toggle:hover{ background:var(--gold-tint); } }
.auth-switch{ margin:0; font-size:.88rem; color:var(--ink-2); }
.link-btn{ font:inherit; font-weight:700; color:var(--gold-text); background:none; border:0; padding:0; cursor:pointer; text-decoration:underline; text-underline-offset:2px; }
.pw-toggle:focus-visible, .link-btn:focus-visible{ outline:2px solid var(--blue); outline-offset:2px; }

/* ---------- installable app ---------- */
/* Safe areas: the installed app runs edge to edge on phones with a notch or home bar. */
@supports (padding: max(0px)) {
  .wrap{ padding-top:calc(2.4rem + env(safe-area-inset-top)); padding-left:max(1.25rem, env(safe-area-inset-left)); padding-right:max(1.25rem, env(safe-area-inset-right)); padding-bottom:calc(4rem + env(safe-area-inset-bottom)); }
  .hud{ top:calc(18px + env(safe-area-inset-top)); }
  @media (max-width:520px){ .wrap{ padding-top:calc(2rem + env(safe-area-inset-top)); } }
  @media (max-width:480px){ .wrap{ padding-left:max(1rem, env(safe-area-inset-left)); padding-right:max(1rem, env(safe-area-inset-right)); } }
}
/* Until the app has drawn the page, keep the footer below the fold so it doesn't jump. */
.booting main{ min-height:100vh; }
.install-bar, .toast{ position:fixed; z-index:40; left:50%; transform:translateX(-50%); width:min(780px, calc(100% - 2rem)); margin:0;
  display:flex; flex-wrap:wrap; align-items:center; gap:.6rem .9rem; padding:.8rem .95rem; border-radius:14px;
  background:var(--surface-strong); border:1px solid var(--gold-line); box-shadow:var(--shadow-card); font-size:.9rem; color:var(--ink-2); }
.install-bar{ bottom:calc(.9rem + env(safe-area-inset-bottom)); }
.toast{ top:calc(.9rem + env(safe-area-inset-top)); z-index:45; }
.toast-text{ flex:1 1 14rem; }
.toast > .acct-btn{ margin-left:auto; }
.toast-x{ appearance:none; cursor:pointer; width:2rem; height:2rem; border-radius:8px; border:1px solid var(--line); background:var(--surface-solid); color:var(--ink); font-size:1.1rem; line-height:1; }
body.focus .install-bar{ display:none; }

.backup-msg{ min-height:1.2em; font-weight:700; color:var(--ink) !important; }
.brand-word{ display:inline-flex; align-items:baseline; }
/* Floating panels sit over busy content, so they are fully opaque (the gold cards showed through at 96%). */
.install-bar, .toast, .modal{ background:var(--surface-solid); }
.modal-back{ -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px); }

/* ---------- login gate ---------- */
/* Until someone signs in, only the gate shows: no tabs, account bar or footer links (they need the app). */
.locked header .account, .locked header .tabs, .locked .site-foot .foot-link, .locked .install-bar{ display:none !important; }
.gate{ max-width:560px; margin-top:1.6rem; display:flex; flex-direction:column; gap:1.1rem; }
.gate .eyebrow{ margin-top:0; }
.gate h1{ margin:0; }
.gate .dek{ margin:0; }
.gate-form{ max-width:420px; padding:1.25rem; border-radius:16px; background:var(--surface-solid); border:1px solid var(--line); box-shadow:var(--shadow-card); }
.gate-form .acct-btn.primary{ margin-left:0; }
.gate.is-loading .gate-form{ opacity:.6; }
.gate-note{ margin:0; font-size:.9rem; color:var(--ink-soft); }

/* ---------- study tools ---------- */
/* ---------- home dashboard ---------- */
.home-head{ margin-top:.2rem; }
.home-title{ margin:1.1rem 0 .2rem; font-size:clamp(1.6rem, 5.5vw, 2.3rem); line-height:1.1; letter-spacing:-.02em; text-wrap:balance; }
.home-sub{ margin:0; font-size:.9rem; color:var(--ink-soft); font-variant-numeric:tabular-nums; }
.switch-wrap{ display:grid; gap:.6rem; }
.year-switch{ display:inline-flex; width:max-content; padding:3px; border-radius:999px; background:var(--surface-soft); border:1px solid var(--line-strong); }
.year-tab{ cursor:pointer; border:0; border-radius:999px; padding:.42rem 1.15rem; font:inherit; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink-2); background:transparent; }
.year-tab.is-active{ background:var(--ink); color:var(--bg); }
.year-tab:focus-visible{ outline:2px solid var(--blue); outline-offset:2px; }
.today-card{ margin-top:1.1rem; display:grid; gap:.8rem; padding:1.1rem 1.15rem 1.15rem; border-radius:16px; background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow); }
.tc-top{ display:flex; align-items:center; justify-content:space-between; gap:.6rem .9rem; flex-wrap:wrap; }
.tc-count{ font-size:.92rem; color:var(--ink-2); }
.tc-count strong{ margin-right:.1rem; font-size:1.6rem; font-weight:900; letter-spacing:-.02em; color:var(--ink); font-variant-numeric:tabular-nums; }
.today-card .today-bar{ margin:0; max-width:none; }
.today-card .action.primary{ padding:1.1rem 1.25rem; border-radius:12px; }
.today-card .action-title{ font-size:.92rem; }
.tc-note{ margin:0; font-size:.86rem; line-height:1.5; color:var(--ink-2); }
.tc-note strong{ color:var(--ink); }
.actions.tiles{ margin-top:.75rem; grid-template-columns:repeat(3, 1fr); gap:.6rem; }
.action.tile{ padding:.85rem .95rem; gap:.3rem; border-radius:12px; box-shadow:none; }
.action.tile .action-title{ justify-content:space-between; font-size:.66rem; }
.action.tile .action-sub{ font-size:.8rem; line-height:1.4; }
.home-links{ margin-top:1.5rem; display:flex; flex-wrap:wrap; gap:.6rem 1.5rem; }
.sec-list{ display:grid; grid-template-columns:1fr; gap:.6rem; }
@media (min-width:900px){ .sec-list{ grid-template-columns:1fr 1fr; } }
@media (max-width:520px){
  .sec-list .row-card{ padding:.8rem .95rem; gap:.7rem; }
  .sec-list .row-count strong{ font-size:1.35rem; }
  .sec-list .row-main .bar{ margin-top:.45rem; }
  .actions.tiles{ grid-template-columns:1fr 1fr; }
  .actions.tiles .action.tile:last-child{ grid-column:1 / -1; }
}

.today-chip{ display:inline-flex; align-items:baseline; gap:.3rem; padding:.3rem .7rem; border-radius:999px; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink-soft); background:var(--surface-soft); border:1px solid var(--line); }
.today-chip strong{ font-size:.86rem; letter-spacing:0; color:var(--ink-2); font-variant-numeric:tabular-nums; }
.today-chip.is-on, .today-chip.is-on strong{ color:var(--gold-text); }
.today-chip.is-on{ background:var(--gold-tint); border-color:var(--gold-line); }
.today-link{ font:inherit; font-size:.86rem; font-weight:700; text-align:left; color:var(--gold-text); background:none; border:0; padding:0; cursor:pointer; }
@media (hover:hover){ .today-link:hover{ text-decoration:underline; text-underline-offset:2px; } }

/* Save / note / report, under an answered question. */
.qtools{ margin-top:1rem; }
.qtools-row{ display:flex; flex-wrap:wrap; gap:.4rem; }
.qtool{ display:inline-flex; align-items:center; cursor:pointer; padding:.45rem .8rem; border-radius:999px; font:inherit; font-size:.8rem; font-weight:800; letter-spacing:0; line-height:1.2; color:var(--ink-2); background:var(--surface-solid); border:1px solid var(--line-strong); }
@media (hover:hover){ .qtool:hover{ color:var(--ink); border-color:var(--gold-line-strong); } }
.qtool.is-on{ color:var(--gold-text); background:var(--gold-tint); border-color:var(--gold-line-strong); }
.note-holder{ margin-top:.7rem; }
.note-holder:empty{ display:none; }
.note-box{ padding:.75rem .9rem; border-radius:10px; border:1px dashed var(--gold-line-strong); background:var(--surface-soft); }
.note-label, .field-label{ display:block; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink-soft); }
.note-text{ margin:.3rem 0 0; font-size:.94rem; line-height:1.55; white-space:pre-wrap; overflow-wrap:anywhere; }
.note-input, .modal select, .date-input{ width:100%; font:inherit; font-size:.95rem; padding:.65rem .75rem; border-radius:10px; border:1px solid var(--line-strong); background:var(--surface-solid); color:var(--ink); }
.note-input{ display:block; min-height:4.5rem; line-height:1.5; resize:vertical; }
.note-input:focus, .modal select:focus, .date-input:focus{ outline:none; border-color:var(--blue-line); box-shadow:0 0 0 3px var(--blue-glow); }
.modal .field-label{ margin:1rem 0 .4rem; }
.qtool:focus-visible, .today-link:focus-visible, .ptile.is-link:focus-visible, .heat-tile:focus-visible, mark.hl:focus-visible{ outline:2px solid var(--blue); outline-offset:2px; }

/* Crossed-out options (right-click, or press and hold on a phone). */
.option.is-struck .option-text{ text-decoration:line-through; text-decoration-thickness:2px; text-decoration-color:var(--ink-soft); opacity:.5; }
.option.is-struck .letter{ opacity:.5; }
.touch-hint{ display:none; font-size:.8rem; color:var(--ink-soft); }
@media (hover:none){ .touch-hint:not(:empty){ display:block; } .kb-link{ display:none; } }

/* After answering: time taken, what other students picked, "I guessed this". */
.peer:empty{ display:none; }
.peer{ margin-top:.85rem; padding-top:.75rem; border-top:1px solid var(--gold-line); }
.explain-card .peer-line{ font-size:.88rem; color:var(--ink-2); }
.peer-line strong{ color:var(--ink); font-variant-numeric:tabular-nums; }
.peer-pct{ font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink-soft); font-variant-numeric:tabular-nums; }
.guess-btn{ margin-top:.85rem; }
.explain-card .guess-note{ margin-top:.85rem; font-size:.86rem; font-weight:700; color:var(--ink-2); }
.score-time{ margin:.5rem 0 0; font-size:.92rem; font-weight:700; color:var(--ink-2); }

/* Highlighter: select words in a question, then press Highlight. */
mark.hl{ color:inherit; cursor:pointer; padding:0 .06em; border-radius:3px; background:color-mix(in srgb, var(--gold) 40%, transparent); -webkit-box-decoration-break:clone; box-decoration-break:clone; }
.hl-btn{ position:absolute; z-index:60; cursor:pointer; padding:.5rem .85rem; border:0; border-radius:9px; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--bg); background:var(--ink); box-shadow:var(--shadow-card); }

/* Keyboard shortcuts list. */
.kb-list{ display:grid; grid-template-columns:auto minmax(0, 1fr); gap:.55rem .9rem; align-items:center; margin-top:1rem; font-size:.9rem; color:var(--ink-2); }
.kb-list kbd{ justify-self:start; font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:.74rem; padding:.15rem .45rem; border-radius:6px; border:1px solid var(--line-strong); border-bottom-width:2px; background:var(--surface-soft); color:var(--ink); }

/* Larger text (Progress > Display). */
body.text-large .stem-text{ font-size:1.32rem; }
body.text-large .option{ font-size:1.13rem; }
body.text-large .option-why{ font-size:.98rem; }
body.text-large .explain-card, body.text-large .review-explain, body.text-large .review-stem, body.text-large .review-opts li{ font-size:1.08rem; }

/* ---------- progress page ---------- */
.ptiles{ margin-top:1.2rem; display:grid; grid-template-columns:repeat(4, 1fr); gap:.6rem; }
.ptile{ display:flex; flex-direction:column; gap:.3rem; text-align:left; padding:.95rem 1rem; border-radius:14px; font:inherit; color:var(--ink); background:var(--surface); border:1px solid var(--line); box-shadow:var(--shadow); }
.ptile strong{ font-size:1.5rem; font-weight:900; line-height:1.1; letter-spacing:-.03em; font-variant-numeric:tabular-nums; }
.ptile span{ font-size:.8rem; line-height:1.35; color:var(--ink-2); }
.ptile.is-link{ cursor:pointer; background:var(--gold-tint); border-color:var(--gold-line-strong); }
@media (hover:hover){ .ptile.is-link:hover{ box-shadow:var(--shadow-lift); } }
.plan{ margin-top:.8rem; display:grid; justify-items:start; gap:.45rem; }
.plan .section-note{ margin:0 0 .7rem; }
.plan .filter-row{ margin-top:0; }
.date-input{ max-width:15rem; }

/* Activity calendar: one column per week, Monday at the top. */
.cal-wrap{ margin-top:.8rem; padding:1rem 1.1rem; border-radius:14px; background:var(--surface); border:1px solid var(--line); overflow-x:auto; }
.cal-months, .cal{ display:grid; grid-template-columns:repeat(18, minmax(11px, 22px)); gap:3px; }
.cal{ margin-top:.35rem; grid-template-rows:repeat(7, auto); grid-auto-flow:column; }
.cal-months span{ font-size:.8rem; font-weight:800; letter-spacing:0; white-space:nowrap; color:var(--ink-soft); }
.cal-cell{ display:block; aspect-ratio:1; border-radius:3px; }
.cal-0{ background:var(--line); }
.cal-1{ background:color-mix(in srgb, var(--gold) 30%, var(--surface-solid)); }
.cal-2{ background:color-mix(in srgb, var(--gold) 55%, var(--surface-solid)); }
.cal-3{ background:color-mix(in srgb, var(--gold) 80%, var(--surface-solid)); }
.cal-4{ background:var(--gold); }
.cal-future{ background:transparent; box-shadow:inset 0 0 0 1px var(--line); }
.cal-legend{ display:flex; align-items:center; gap:4px; margin-top:.7rem; font-size:.8rem; font-weight:700; letter-spacing:0; color:var(--ink-soft); }
.cal-legend .cal-cell{ width:11px; height:11px; }

/* Lecture heat map: red (under 50%) to green (85%+). */
.heat-legend{ display:flex; flex-wrap:wrap; gap:.45rem 1rem; margin-top:.9rem; font-size:.78rem; color:var(--ink-2); }
.heat-key{ display:inline-flex; align-items:center; gap:.4rem; }
.heat-swatch{ width:.85rem; height:.85rem; border-radius:3px; border:1px solid var(--line-strong); }
.heat-section{ margin:1.4rem 0 .55rem; font-size:.95rem; font-weight:800; letter-spacing:-.01em; }
.heat-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(150px, 1fr)); gap:.45rem; }
.heat-tile{ display:flex; flex-direction:column; align-items:flex-start; gap:.3rem; min-height:4.8rem; text-align:left; cursor:pointer; padding:.65rem .75rem; border-radius:10px; font:inherit; color:var(--ink); border:1px solid var(--line-strong); transition:transform .12s ease, box-shadow .12s ease; }
@media (hover:hover){ .heat-tile:hover:not(:disabled){ transform:translateY(-1px); box-shadow:var(--shadow-lift); } }
.heat-tile:disabled{ cursor:default; opacity:.5; }
.heat-name{ font-size:.84rem; font-weight:700; line-height:1.3; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.heat-score{ margin-top:auto; font-size:.72rem; font-weight:700; color:var(--ink-2); font-variant-numeric:tabular-nums; }
.heat-due{ padding:.05rem .45rem; border-radius:999px; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--gold-text); background:var(--gold-tint-strong); }
.heat-0{ background:var(--surface-solid); }
.heat-1{ background:color-mix(in srgb, var(--incorrect) 22%, var(--surface-solid)); border-color:color-mix(in srgb, var(--incorrect) 50%, transparent); }
.heat-2{ background:color-mix(in srgb, var(--gold) 28%, var(--surface-solid)); border-color:var(--gold-line-strong); }
.heat-3{ background:color-mix(in srgb, var(--correct) 16%, var(--surface-solid)); border-color:color-mix(in srgb, var(--correct) 40%, transparent); }
.heat-4{ background:color-mix(in srgb, var(--correct) 34%, var(--surface-solid)); border-color:color-mix(in srgb, var(--correct) 60%, transparent); }

/* Custom practice uses the exam setup card. */
.setup .filter-row{ margin-top:0; }
.setup .setup-summary{ margin-top:1.3rem; }

/* Four tabs on a phone: shorter labels. */
.t-short{ display:none; }
.tab.is-live .t-short::after{ content:""; display:inline-block; width:.4rem; height:.4rem; margin-left:.3rem; vertical-align:.1em; border-radius:50%; background:var(--gold); }

@media (max-width:640px){
  .actions{ grid-template-columns:1fr; }
  .ptiles{ grid-template-columns:repeat(2, 1fr); }
  .today{ grid-template-columns:1fr; grid-template-areas:"main" "pace" "side"; }
  .today-side{ justify-content:flex-start; }
}
@media (max-width:480px){
  .t-full{ display:none; }
  .t-short{ display:inline; }
  .tab{ font-size:.62rem; }
  .heat-grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
}

/* ---- TBL page: notes, flashcards, gap-fills, knowledge checks, questions ---- */
.has-notes{ display:inline-block; margin-left:.55rem; padding:.1rem .5rem; border-radius:999px; vertical-align:.12em; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--gold-text); background:var(--gold-tint); border:1px solid var(--gold-line); }
.seg{ display:flex; gap:.35rem; margin-top:1.2rem; padding:.3rem; border-radius:14px; background:var(--surface-soft); border:1px solid var(--line); overflow-x:auto; scrollbar-width:none; }
.seg::-webkit-scrollbar{ display:none; }
.seg-btn{ flex:1 0 auto; display:inline-flex; align-items:center; justify-content:center; gap:.4rem; cursor:pointer; padding:.6rem .8rem; border-radius:10px; border:1px solid transparent; background:none; color:var(--ink-2); font-size:.8rem; font-weight:800; letter-spacing:0; white-space:nowrap; }
@media (hover:hover){ .seg-btn:hover{ color:var(--ink); } }
.seg-btn.is-active{ background:var(--surface-solid); color:var(--ink); border-color:var(--line-strong); box-shadow:var(--shadow); }
.seg-btn:focus-visible{ outline:2px solid var(--blue); outline-offset:2px; }
.seg-n{ font-variant-numeric:tabular-nums; padding:.05rem .4rem; border-radius:999px; background:var(--line); color:var(--ink-2); letter-spacing:0; font-size:.66rem; }
.seg-btn.is-active .seg-n{ background:var(--gold-tint); color:var(--gold-text); }
.next-tab{ justify-content:flex-end; margin-top:1.4rem; }

/* notes */
.toc-chip{ cursor:pointer; font:inherit; font-size:.8rem; font-weight:700; color:var(--gold-text); padding:.25rem .6rem; border:1px solid var(--gold-line); border-radius:99px; background:var(--gold-tint); }
@media (hover:hover){ .toc-chip:hover{ border-color:var(--gold-line-strong); } }
.tbl-notes{ margin-top:1rem; padding:.4rem 1.4rem 1.3rem; border-radius:16px; background:var(--surface-strong); border:1px solid var(--line); box-shadow:var(--shadow); color:var(--ink-2); line-height:1.6; }
.tbl-notes h2{ margin:1.6rem 0 .6rem; padding-top:.2rem; font-size:1.2rem; font-weight:900; letter-spacing:-.02em; color:var(--ink); text-wrap:balance; scroll-margin-top:1rem; }
.tbl-notes h3{ margin:1.1rem 0 .35rem; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--gold-text); }
.tbl-notes p{ margin:.45rem 0; }
.tbl-notes ul, .tbl-notes ol{ margin:.35rem 0 .7rem; padding-left:1.3rem; }
.tbl-notes li{ margin:.3rem 0; }
.tbl-notes li::marker{ color:var(--gold); }
.tbl-notes b, .tbl-notes strong{ color:var(--ink); }
.tbl-notes ol.cols{ columns:2 14rem; column-gap:2rem; }
.tbl-notes .tablewrap{ overflow-x:auto; margin:.6rem 0; border:1px solid var(--line); border-radius:10px; }
.tbl-notes table{ border-collapse:collapse; width:100%; min-width:520px; font-size:.88rem; }
.tbl-notes th, .tbl-notes td{ text-align:left; vertical-align:top; padding:.5rem .7rem; border-bottom:1px solid var(--line); }
.tbl-notes th{ font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink-soft); background:var(--surface-soft); }
.tbl-notes tr:last-child td{ border-bottom:0; }
.tbl-notes .note{ margin:.8rem 0; padding:.8rem 1rem; border-radius:12px; background:var(--gold-tint); border:1px solid var(--gold-line); }
.tbl-notes .note ul{ margin:.2rem 0; }
.notes-source{ margin:.8rem 0 0; font-size:.8rem; color:var(--ink-soft); }

/* flashcards */
.fc-top{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:.6rem; margin-top:1.2rem; }
.fc-known{ font-size:.86rem; font-weight:700; color:var(--ink-2); font-variant-numeric:tabular-nums; }
.fc-top-btns{ display:flex; flex-wrap:wrap; gap:.4rem; }
.fc-progress{ margin-top:1rem; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--ink-soft); font-variant-numeric:tabular-nums; }
.fc-progress .bar{ margin-top:.45rem; }
.fc{ margin-top:.8rem; min-height:13rem; display:flex; flex-direction:column; gap:.6rem; padding:1.4rem 1.5rem; border-radius:16px; background:var(--surface-strong); border:1px solid var(--line); box-shadow:var(--shadow-card); }
.fc[role="button"]{ cursor:pointer; justify-content:center; text-align:center; align-items:center; transition:border-color .15s ease, transform .15s ease; }
@media (hover:hover){ .fc[role="button"]:hover{ border-color:var(--gold-line-strong); } }
.fc[role="button"]:focus-visible{ outline:2px solid var(--blue); outline-offset:3px; }
.fc.is-shown{ border-color:var(--gold-line); }
.fc-label{ font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--gold-text); }
.fc-q{ margin:0; font-size:1.18rem; font-weight:800; line-height:1.4; letter-spacing:-.01em; color:var(--ink); text-wrap:balance; }
.fc-tap{ margin:0; font-size:.86rem; color:var(--ink-soft); }
.fc-a{ margin-top:.2rem; font-size:1rem; }
.fc-a b{ color:var(--ink); }
.fc-done{ min-height:0; }
.fc-btns{ display:grid; grid-template-columns:repeat(auto-fit, minmax(140px, 1fr)); gap:.6rem; margin-top:.9rem; }
.fc-btns .btn{ padding:1rem 1.2rem; }
.fc-hint{ margin:.7rem 0 0; text-align:center; }
@media (prefers-reduced-motion: reduce){ .fc[role="button"]{ transition:none; } }

/* fill the gaps */
.gaps{ margin:1rem 0 0; padding-left:1.4rem; display:grid; gap:.9rem; }
.gaps li{ padding:.9rem 1rem; border-radius:12px; background:var(--surface-strong); border:1px solid var(--line); line-height:2.1; color:var(--ink); }
.gaps li::marker{ color:var(--ink-soft); font-weight:800; }
.gap{ display:inline; cursor:pointer; font:inherit; font-weight:800; margin:0 .1rem; padding:.05rem .45rem; border-radius:6px; border:0; border-bottom:2px solid var(--gold); background:var(--gold-tint); color:var(--gold-text); }
.gap span{ visibility:hidden; }
.gap.is-shown span{ visibility:visible; }
.gap.is-shown{ background:none; border-bottom-color:var(--correct); color:var(--ink); }
.gap:focus-visible{ outline:2px solid var(--blue); outline-offset:2px; }

/* knowledge checks */
.kc-list{ margin:1rem 0 0; padding-left:1.4rem; display:grid; gap:.8rem; }
.kc{ padding:.9rem 1rem; border-radius:12px; background:var(--surface-strong); border:1px solid var(--line); }
.kc::marker{ color:var(--ink-soft); font-weight:800; }
.kc-q{ margin:0; font-weight:800; color:var(--ink); line-height:1.45; }
.kc-ans{ margin-top:.5rem; }
.kc-ans summary{ cursor:pointer; display:inline-block; font-size:.8rem; font-weight:800; letter-spacing:0; color:var(--gold-text); padding:.3rem .6rem; border-radius:8px; border:1px solid var(--gold-line); background:var(--gold-tint); list-style:none; }
.kc-ans summary::-webkit-details-marker{ display:none; }
.kc-ans[open] summary{ margin-bottom:.4rem; }
.kc-a{ margin:.3rem 0 0; font-weight:700; color:var(--ink); }
.kc-why{ margin:.3rem 0 0; color:var(--ink-2); font-size:.94rem; }

/* questions tab */
.topic-qs{ margin-top:1.2rem; padding:1.3rem 1.4rem; border-radius:16px; background:var(--surface-strong); border:1px solid var(--line); box-shadow:var(--shadow); }
.topic-qs .page-sub{ margin-top:.3rem; }
@media (max-width:480px){
  .tbl-notes{ padding:.2rem 1rem 1rem; }
  .fc{ padding:1.2rem 1.1rem; min-height:11rem; }
  .fc-q{ font-size:1.08rem; }
}
.page-title.compact{ font-size:clamp(1.25rem, 3.6vw, 1.6rem); }
.seg-short{ display:none; }
.fc-answer{ margin-top:.4rem; padding-top:.9rem; border-top:1px dashed var(--gold-line-strong); }
@media (max-width:600px){
  /* contents: one swipeable row instead of a tall stack of chips */
  .tbl-toc{ flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; padding-bottom:.2rem; margin-left:-1rem; margin-right:-1rem; padding-left:1rem; padding-right:1rem; }
  .tbl-toc::-webkit-scrollbar{ display:none; }
  .tbl-toc .toc-chip{ flex:0 0 auto; white-space:nowrap; }
  /* all five tabs on screen at once */
  .seg{ overflow:visible; gap:.2rem; padding:.25rem; }
  .seg-btn{ flex:1 1 0; min-width:0; padding:.6rem .2rem; font-size:.62rem; letter-spacing:.06em; }
  .seg-full, .seg-n{ display:none; }
  .seg-short{ display:inline; }
}

/* ---------- mock exam builder: sections that open to show lectures ---------- */
.msec-list{ display:grid; gap:.45rem; }
.msec-mod{ margin:.9rem 0 .15rem; font-size:.8rem; font-weight:800; color:var(--ink-2); }
.msec-mod:first-child{ margin-top:0; }
.msec{ border:1px solid var(--line); border-radius:10px; background:var(--surface-solid); }
.msec.is-open{ border-color:var(--gold-line-strong); }
.msec-head{ display:flex; align-items:center; gap:.2rem; }
.msec-head .check{ flex:1; min-width:0; border:0; background:none; }
.msec-toggle{ flex:none; font:inherit; font-size:.78rem; font-weight:700; color:var(--gold-text); background:none; border:0; padding:.6rem .85rem; cursor:pointer; }
@media (hover:hover){ .msec-toggle:hover{ text-decoration:underline; text-underline-offset:2px; } }
.msec-toggle:focus-visible{ outline:2px solid var(--blue); outline-offset:-2px; border-radius:8px; }
.msec-topics{ display:grid; grid-template-columns:repeat(2, 1fr); gap:.35rem; padding:0 .6rem .65rem; }
.check.small{ font-size:.86rem; padding:.45rem .6rem; }
@media (max-width:640px){ .msec-topics{ grid-template-columns:1fr; } }

/* ---------- UX audit 2026-10-18 ---------- */
/* Verdict: plain words, time apart; first explanation point is the take-home line. */
.verdict{ display:flex; align-items:baseline; justify-content:space-between; gap:.6rem; flex-wrap:wrap; }
.explain-card .label{ text-transform:none; letter-spacing:0; font-size:.98rem; }
.verdict-time{ font-size:.8rem; color:var(--ink-soft); font-variant-numeric:tabular-nums; }
.explain-card .points li:first-child, .review-explain .points li:first-child{ font-weight:650; color:var(--ink); }
/* Action bar: verdict + Next (practice) or Prev / Flag / jump / Next (mock). Sticky at the thumb on phones. */
.actionbar{ display:flex; align-items:center; justify-content:space-between; gap:.6rem .75rem; flex-wrap:wrap; }
.actionbar-text{ font-size:.86rem; color:var(--ink-soft); font-variant-numeric:tabular-nums; }
.actionbar.is-right .actionbar-text{ color:var(--correct); font-weight:800; }
.actionbar.is-wrong .actionbar-text{ color:var(--incorrect); font-weight:800; }
.exam-nav.actionbar{ justify-content:space-between; }
@media (max-width:640px){
  .actionbar{ position:sticky; bottom:0; z-index:6; margin:1rem -1.15rem -1.15rem; padding:.65rem 1.15rem calc(.65rem + env(safe-area-inset-bottom));
    background:var(--surface-solid); border-top:1px solid var(--line); border-radius:0 0 16px 16px; flex-wrap:nowrap; }
  .actionbar .kbd-hint, .actionbar .touch-hint{ display:none; }
  .actionbar .next-btn{ min-height:48px; }
  .exam-nav.actionbar .btn{ flex:1 1 0; min-width:0; padding-inline:.4rem; }
}
.clear-ans{ margin-top:.6rem; font:inherit; font-size:.82rem; font-weight:700; color:var(--gold-text); background:none; border:0; padding:.4rem 0; cursor:pointer; }
/* Mock navigator as a drawer with filters; flagged questions get a dot. */
.nav-drawer > summary{ cursor:pointer; list-style:none; font-weight:800; font-size:.92rem; padding:.2rem 0 .6rem; }
.nav-drawer > summary::-webkit-details-marker{ display:none; }
.nav-drawer > summary::before{ content:'▸ '; color:var(--gold-text); }
.nav-drawer[open] > summary::before{ content:'▾ '; }
.nav-drawer .filter-row{ margin-bottom:.7rem; }
.nav-grid button{ position:relative; }
.nav-grid button.flag::after{ content:''; position:absolute; top:3px; right:3px; width:9px; height:9px; border-radius:50%; background:var(--gold); box-shadow:0 0 0 2px var(--surface-solid); }
/* Sentence case for controls and small labels (uppercase kept for section headings only). */
.btn, .next-btn, .acct-btn, .bank-start-btn, .chip, .qtool, .tab, .mod-tab, .year-tab, .seg-btn, .quit-btn, .crumb, .badge,
.row-sub, .row-count, .quiz-progress, .quiz-topic-tag, .kbd-hint, .peer-pct, .bank-topic-tag, .bank-footer-count, .fc-progress,
.today-chip, .sync, .site-foot, .nav-legend, .heat-due, .review-opts .tag, .action-title{ text-transform:none; letter-spacing:.01em; }
.btn, .next-btn, .bank-start-btn{ font-size:.92rem; font-weight:700; }
.chip, .qtool, .tab, .mod-tab, .year-tab, .seg-btn, .acct-btn{ font-size:.85rem; font-weight:650; }
.row-sub, .quiz-progress, .peer-pct, .bank-topic-tag, .kbd-hint, .fc-progress, .site-foot, .today-chip{ font-size:.8rem; font-weight:600; }
.action-title{ font-size:.95rem; font-weight:800; }
.action.tile .action-title{ font-size:.9rem; }
.badge{ font-size:.72rem; }
/* Visible active tab in dark mode. */
:root[data-theme="dark"] .tab.is-active{ background:var(--gold-tint-strong); color:var(--gold-text); }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .tab.is-active{ background:var(--gold-tint-strong); color:var(--gold-text); } }
.crumb .sep{ color:var(--ink-soft); }
/* 44px touch targets on touch screens (WCAG 2.5.8 / Apple HIG). */
@media (pointer:coarse){
  .quit-btn, .crumb button, .today-link, .foot-link, .site-foot a, .clear-ans{ min-height:44px; display:inline-flex; align-items:center; }
  .chip, .qtool, .btn.small, .tab, .mod-tab, .seg-btn, .acct-btn, .year-tab, .msec-toggle{ min-height:44px; }
  .bank-check{ width:28px; height:28px; }
  .nav-grid button{ height:44px; }
}
.quit-btn{ padding:.5rem .85rem; border:1px solid var(--line-strong); border-radius:10px; background:var(--surface-solid); }

/* Install prompt sits in the page above the footer (home only), never over content. */
.install-bar{ position:static; transform:none; left:auto; width:auto; margin:1.5rem 0 0; display:flex; flex-wrap:wrap; align-items:center; gap:.6rem; }
.install-bar .acct-note{ flex:1 1 220px; }
/* Header: account box behind a button on phones; year + module chips in one scrolling row. */
.brand-tools{ display:inline-flex; gap:.5rem; align-items:center; }
.acct-toggle{ display:none; }
.locked .acct-toggle{ display:none !important; }
@media (max-width:640px){
  .acct-toggle{ display:inline-flex; }
  header .account{ display:none; }
  body.acct-open header .account{ display:flex; }
  .switch-wrap{ display:flex; gap:.45rem; align-items:center; overflow-x:auto; scrollbar-width:none; margin-inline:-1rem; padding:0 1rem .2rem; }
  .switch-wrap::-webkit-scrollbar, .mod-switch::-webkit-scrollbar{ display:none; }
  .switch-wrap .mod-switch{ flex-wrap:nowrap; margin:0; }
  .mod-switch{ flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; }
  .mod-tab, .year-switch{ flex:0 0 auto; }
}
.seg-wrap{ flex-wrap:wrap; }
/* Mock setup: Start stays in reach; fresh-question line; module rows in whole-year mode. */
.setup-foot{ position:sticky; bottom:0; z-index:5; background:var(--surface-solid); padding:.8rem 0 calc(.8rem + env(safe-area-inset-bottom)); }
.setup-fresh{ margin:.2rem 0 0; font-size:.82rem; color:var(--ink-soft); }
.setup-fresh.is-warn{ color:var(--incorrect); font-weight:700; }
.msec-modname{ font-weight:800; }

/* ---------- pre-reading diagrams and spotter pins ---------- */
.q-img.has-pin img{ max-height:min(68vh, 620px); }
.pin-wrap{ position:relative; display:inline-block; max-width:100%; line-height:0; }
.pin-wrap img{ display:block; max-width:100%; height:auto; }
.pin{ position:absolute; width:22px; height:22px; margin:-11px 0 0 -11px; border-radius:50%; background:#e0245e; border:3px solid #fff; box-shadow:0 0 0 2px #e0245e, 0 2px 6px rgba(0,0,0,.45); }
.q-img .pin{ animation:pinpulse 1.6s ease-in-out infinite; }
@keyframes pinpulse{ 0%,100%{ box-shadow:0 0 0 2px #e0245e, 0 2px 6px rgba(0,0,0,.45); } 50%{ box-shadow:0 0 0 7px rgba(224,36,94,.35), 0 2px 6px rgba(0,0,0,.45); } }
@media (prefers-reduced-motion: reduce){ .q-img .pin{ animation:none; } }
.pr-fig{ margin:1.1rem 0; text-align:center; }
.pr-fig img{ max-width:100%; height:auto; border-radius:8px; background:var(--surface-soft); min-height:4rem; }
.pr-fig img:not(.is-loaded){ min-width:min(100%, 18rem); min-height:10rem; }
.pr-fig img.is-failed{ min-height:0; padding:1rem; font-size:.85rem; }
.pr-fig figcaption{ margin-top:.4rem; font-size:.85rem; color:var(--ink-2); text-wrap:balance; }
.pr-fig .pr-credit{ display:block; font-size:.72rem; opacity:.75; }
.pr-lab .pin{ cursor:pointer; padding:0; display:inline-flex; align-items:center; justify-content:center; font:800 .62rem/1 system-ui, sans-serif; color:#fff; }
.pr-lab .pin:focus-visible{ outline:2px solid var(--blue); outline-offset:2px; }
.pr-lab .pin::after{ content:attr(data-label); position:absolute; left:50%; bottom:calc(100% + 6px); transform:translateX(-50%); width:max-content; max-width:14rem; white-space:normal; background:var(--ink); color:var(--surface-solid); font:600 .78rem/1.25 system-ui, sans-serif; padding:.3rem .5rem; border-radius:6px; box-shadow:var(--shadow); display:none; z-index:3; }
.pr-lab .pin.is-open::after{ display:block; }
.pr-lab .pin.is-open{ z-index:4; }
.pr-key{ display:none; margin:.6rem auto 0; padding:0; list-style:none; text-align:left; max-width:40rem; columns:2 14rem; column-gap:1.4rem; font-size:.85rem; }
.pr-key li{ break-inside:avoid; padding:.12rem 0; }
.pr-key b{ display:inline-block; min-width:1.6rem; color:#e0245e; }
.pr-lab.show-all .pr-key{ display:block; }
.pr-all{ margin-top:.5rem; }
/* printed labels hidden under tap-to-reveal covers (like Anki image occlusion) */
.pr-occ .cover{ position:absolute; padding:0; margin:0; border:2px solid #fff; border-radius:4px; background:#f2a93b; box-shadow:0 1px 3px rgba(0,0,0,.35); cursor:pointer; transition:background-color .15s, border-color .15s; }
.pr-occ .cover::before{ content:''; position:absolute; inset:-5px; }
.pr-occ .cover:hover{ background:#e2911c; }
.pr-occ .cover:focus-visible{ outline:2px solid var(--blue); outline-offset:1px; }
.pr-occ .cover.is-open, .pr-occ.show-all .cover{ background:transparent; border-color:rgba(226,145,28,.85); box-shadow:none; }
@media (prefers-reduced-motion: reduce){ .pr-occ .cover{ transition:none; } }
.pr-pairs{ margin:.35rem 0 0; padding:0; list-style:none; font-weight:700; color:var(--ink); }
.pr-pairs li{ padding:.08rem 0; }
.pr-pairs b{ display:inline-block; min-width:1.4rem; color:#e0245e; }
.pr-spot .pr-fig{ padding-bottom:1rem; border-bottom:1px solid var(--line); }
.pr-spot .pr-fig:last-child{ border-bottom:0; }
.pr-check{ margin:-.4rem auto 1.2rem; max-width:40rem; padding:.6rem .9rem; border-radius:10px; background:var(--surface-soft); border:1px solid var(--line); font-size:.9rem; text-align:left; }
.pr-check p{ margin:0; }
.pr-check details{ margin-top:.35rem; }
.pr-check summary{ cursor:pointer; font-weight:700; color:var(--blue); }
.pr-check details p{ margin-top:.3rem; font-weight:700; color:var(--ink); }
.pr-check details img{ display:block; max-width:100%; height:auto; margin:.5rem auto 0; border-radius:8px; }
.pr-check .pr-note{ margin-top:.3rem; font-size:.82rem; color:var(--ink-2); }

/* ---------- Mock exam: question list beside the question (2026-11-16) ----------
   Green = answered, yellow = flagged, red = seen but not answered, plain = not seen yet.
   Wide screens: sticky panel to the right. Narrow screens: a sheet that slides in from the right. */
body.is-exam .wrap{ max-width:1180px; }
.exam-bar-left{ min-width:0; }
.exam-bar-left .quiz-topic-tag{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.timer.is-untimed{ font-size:.8rem; font-weight:700; color:var(--ink-soft); }
.exam-side{ padding:1rem 1.05rem; border-radius:14px; background:var(--surface-strong); border:1px solid var(--line); box-shadow:var(--shadow); display:flex; flex-direction:column; gap:.85rem; }
.side-head{ display:flex; justify-content:space-between; align-items:center; font-size:.95rem; }
.side-close{ display:none; align-items:center; justify-content:center; width:2.4rem; height:2.4rem; border-radius:10px; font:inherit; font-weight:800; cursor:pointer; color:var(--ink); background:var(--surface-soft); border:1px solid var(--line); }
.exam-side .filter-row{ margin:0; gap:.35rem; }
.exam-side .nav-grid{ grid-template-columns:repeat(6, minmax(0, 1fr)); gap:.3rem; margin:0; }
.exam-side .nav-grid button{ height:2.3rem; }
.side-finish{ width:100%; }
.exam-side .quit-btn{ align-self:center; }
@media (min-width:1000px){
  .exam-layout{ display:grid; grid-template-columns:minmax(0, 1fr) 280px; gap:1.2rem; align-items:start; }
  .exam-side{ position:sticky; top:5.6rem; max-height:calc(100vh - 6.6rem); overflow:auto; }
  .nav-open-btn{ display:none; }
}
@media (max-width:999.98px){
  .exam-side{ position:fixed; z-index:40; top:0; right:0; bottom:0; width:min(340px, 88vw); border-radius:16px 0 0 16px; overflow:auto; transform:translateX(105%); transition:transform .22s ease; padding-bottom:calc(1rem + env(safe-area-inset-bottom)); }
  .exam-side:not(.is-open){ visibility:hidden; }
  .exam-side.is-open{ transform:none; }
  .side-close{ display:inline-flex; }
  .side-back{ position:fixed; inset:0; z-index:39; background:rgba(0,0,0,.45); }
  .exam-side .nav-grid button{ height:44px; }
}
@media (prefers-reduced-motion:reduce){ .exam-side{ transition:none; } }
.nav-grid button.done{ background:var(--correct); border-color:var(--correct); color:var(--on-correct); }
.nav-grid button.flag{ background:var(--gold); border-color:var(--gold); color:#1d1600; box-shadow:none; }
.nav-grid button.miss{ background:var(--incorrect); border-color:var(--incorrect); color:var(--on-incorrect); }
.nav-grid button.flag::after{ display:none; }
.nav-grid button.has-ans::after{ display:block; content:''; position:absolute; top:3px; right:3px; width:8px; height:8px; border-radius:50%; background:var(--correct); box-shadow:0 0 0 2px var(--gold); }
.nav-grid button.current{ outline:2.5px solid var(--ink); outline-offset:2px; }
.nav-empty{ grid-column:1 / -1; margin:.3rem 0; font-size:.85rem; }
.exam-counts{ display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:.4rem; }
.exam-count{ display:flex; flex-direction:column; gap:.05rem; padding:.45rem .55rem; border-radius:10px; background:var(--surface-solid); border:1px solid var(--line); }
.exam-count strong{ font-size:1.2rem; font-weight:900; font-variant-numeric:tabular-nums; line-height:1.1; }
.exam-count span{ font-size:.72rem; color:var(--ink-soft); }
.exam-count.done strong{ color:var(--correct); }
.exam-count.flag strong{ color:var(--gold-text); }
.exam-count.miss strong{ color:var(--incorrect); }
.nav-legend{ list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:.35rem .9rem; font-size:.78rem; color:var(--ink-2); }
.nav-legend li{ display:inline-flex; align-items:center; gap:.35rem; }
.nav-legend .key{ width:.85rem; height:.85rem; border-radius:4px; background:var(--surface-solid); border:1px solid var(--line-strong); }
.nav-legend .key.done{ background:var(--correct); border-color:var(--correct); }
.nav-legend .key.flag{ background:var(--gold); border-color:var(--gold); }
.nav-legend .key.miss{ background:var(--incorrect); border-color:var(--incorrect); }
.exam-review{ display:flex; flex-direction:column; gap:1rem; }
.review-title{ margin:0; font-size:1.5rem; font-weight:900; letter-spacing:-.02em; text-wrap:balance; }
.exam-review .page-sub{ margin:0; }
.exam-review .nav-grid{ margin:0; }
.exam-review .btn-row{ flex-wrap:wrap; }
.exam-toast{ position:fixed; z-index:60; left:50%; top:1rem; transform:translateX(-50%); padding:.7rem 1.1rem; border-radius:12px; font-weight:800; background:var(--ink); color:var(--bg); box-shadow:var(--shadow-card); }
/* Practice: Skip sits beside Next before you answer */
.next-pair{ display:inline-flex; align-items:center; gap:.5rem; margin-left:auto; }
@media (max-width:480px){
  .exam-bar{ gap:.5rem; }
  .exam-bar-right{ gap:.4rem; }
  .exam-bar-right .btn.small{ padding-inline:.6rem; }
}
@media (max-width:999.98px){ .exam-side{ background:var(--surface-solid); } }
@media (max-width:640px){
  .exam-bar .quiz-topic-tag, .exam-bar .prog-counts{ display:none; }
  .exam-bar .quiz-progress{ font-weight:800; color:var(--ink); }
  .next-row.has-skip .actionbar-text{ display:none; }
  .next-row.has-skip .next-pair{ width:100%; }
  .next-row.has-skip .next-pair .next-btn{ flex:1 1 auto; }
}
.prog-short{ display:none; }
@media (max-width:640px){ .exam-bar .prog-long{ display:none; } .exam-bar .prog-short{ display:inline; white-space:nowrap; } }

/* ---------- Polish 2026-11-16: lecture finder, phone fixes ---------- */
.lec-find{ width:100%; margin:0 0 .8rem; padding:.8rem 1rem; font:inherit; font-size:1rem; color:var(--ink); background:var(--surface-solid); border:1px solid var(--line-strong); border-radius:12px; }
.lec-find::placeholder{ color:var(--ink-soft); }
.lec-find:focus-visible{ outline:2px solid var(--blue); outline-offset:2px; }
.find-none{ margin:.4rem 0 1rem; }
.spot-note{ font-size:.75rem; }
@media (max-width:640px){
  /* Mock setup "Cover": seven choices no longer squash into each other; they wrap onto rows. */
  .seg.seg-wrap{ flex-wrap:wrap; }
  .seg.seg-wrap .seg-btn{ flex:1 0 auto; min-width:0; padding:.6rem .7rem; }
  /* Lecture page: the bar pinned to the bottom is one slim row, so it stops covering the choices above it. */
  .lec-foot{ gap:.5rem; }
  .lec-foot .setup-summary{ display:none; }
  .lec-foot .btn-row{ flex-wrap:nowrap; width:100%; margin:0; }
  .lec-foot .btn{ flex:1 1 0; min-width:0; padding-inline:.5rem; font-size:.88rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
}
.lm-short{ display:none; }
@media (max-width:640px){ .lm-long{ display:none; } .lm-short{ display:inline; } }
.lec-find{ scroll-margin-top:.8rem; }
@media (max-width:640px){
  .site-foot{ align-items:center; }
  .setup-fresh:not(.is-warn){ display:none; } /* the pinned Start bar stays slim on phones unless there is a warning */
}

/* ---- 2026-11-18 plainer look (user: "un-AI-ify it"): no grid, no corner brackets, no glows,
   flat gold buttons, one accent colour (gold) instead of gold + cyan. Undo: delete this block. ---- */
:root{ --gold-grad:var(--gold); --shadow-gold:none; --shadow-gold-hover:none; --shadow-lift:0 2px 8px rgba(15,23,42,.08); }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){
  --bg:#0c111c; --surface:#131a28; --surface-solid:#131a28; --surface-soft:#10161f; --surface-strong:#131a28;
  --blue:#e8c84a; --blue-glow:rgba(232,200,74,.18); --blue-line:rgba(232,200,74,.45); --mod-4:#8FB0D6;
  --shadow-lift:0 2px 10px rgba(0,0,0,.35); } }
:root[data-theme="dark"]{
  --bg:#0c111c; --surface:#131a28; --surface-solid:#131a28; --surface-soft:#10161f; --surface-strong:#131a28;
  --blue:#e8c84a; --blue-glow:rgba(232,200,74,.18); --blue-line:rgba(232,200,74,.45); --mod-4:#8FB0D6;
  --shadow-lift:0 2px 10px rgba(0,0,0,.35); }
body{ background-image:none; }
.hud, .status-dot{ display:none; }
.brand-mark{ border-color:var(--gold-line-strong); }
.eyebrow{ letter-spacing:.04em; text-transform:none; font-size:.85rem; font-weight:600; color:var(--gold-text); }
h1{ letter-spacing:-.025em; font-weight:800; }
.meta-line .stat:first-child::before{ display:none; }
.meta-line .stat:first-child{ color:var(--ink-soft); }
.gold-badge{ background:var(--gold-tint); }
@media (hover:hover){ .mix-btn:hover, .row-card:hover:not(.is-empty){ transform:none; } .mix-btn:hover{ filter:brightness(1.05); } }
:root{ --blue:#7a5c05; --blue-glow:rgba(201,154,30,.2); --blue-line:rgba(201,154,30,.5); --mod-4:#2148c4; --grid:transparent; }
.list-title{ text-transform:none; letter-spacing:0; font-size:1.05rem; font-weight:700; color:var(--ink); }
/* Plain off-white instead of cream in light mode; small, tight shadows instead of big soft ones. */
:root{ --bg:#f3f4f6; --surface:#ffffff; --surface-soft:#f9fafb; --surface-strong:#ffffff;
  --shadow:0 1px 2px rgba(15,23,42,.06); --shadow-card:0 1px 3px rgba(15,23,42,.08); }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){ --shadow:none; --shadow-card:0 1px 3px rgba(0,0,0,.4); } }
:root[data-theme="dark"]{ --shadow:none; --shadow-card:0 1px 3px rgba(0,0,0,.4); }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){ --shadow-gold:none; --shadow-gold-hover:none; } }
:root[data-theme="dark"]{ --shadow-gold:none; --shadow-gold-hover:none; }
@media (hover:hover){ .action:hover:not(:disabled){ transform:none; } }
/* Light mode uses navy as its accent (gold looked orange on light grey); dark mode keeps gold. Logo stays gold in both. */
:root{ --gold:#1e3a6e; --gold-text:#1e3a6e; --on-gold:#ffffff;
  --gold-line:rgba(30,58,110,.28); --gold-line-strong:rgba(30,58,110,.5); --gold-tint:rgba(30,58,110,.07); --gold-tint-strong:rgba(30,58,110,.16);
  --blue:#1e3a6e; --blue-glow:rgba(30,58,110,.16); --blue-line:rgba(30,58,110,.45); --mod-1:#1e3a6e; }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){ --on-gold:#0c111c; } }
:root[data-theme="dark"]{ --on-gold:#0c111c; }
.brand-word span{ color:#c99a1e; }
.brand-mark{ color:#c99a1e; border-color:rgba(201,154,30,.5); }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .brand-word span, :root:not([data-theme="light"]) .brand-mark{ color:#d4af37; } }
:root[data-theme="dark"] .brand-word span, :root[data-theme="dark"] .brand-mark{ color:#d4af37; }

/* ---------- 20 Nov 2026: lecture notes, flag, previous, reset ---------- */
.tbl-notes .key{ margin:.8rem 0; padding:.75rem 1rem; border-radius:10px; background:var(--gold-tint); border:1px solid var(--gold-line); border-left:4px solid var(--gold); color:var(--ink); }
.tbl-notes .key ul{ margin:.2rem 0; }
.tbl-notes .flow{ margin:.6rem 0; padding:.55rem .8rem; border-radius:8px; background:var(--surface-soft); font-weight:700; color:var(--ink); overflow-wrap:anywhere; }
.quiz-head-btns{ display:flex; gap:.5rem; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.flag-btn{ gap:.35rem; white-space:nowrap; }
.flag-btn.is-flagged{ background:var(--gold-tint); border-color:var(--gold); color:var(--gold-text); font-weight:700; }
.prev-btn{ white-space:nowrap; }
.next-pair{ display:inline-flex; gap:.5rem; flex-wrap:wrap; justify-content:flex-end; }
.reset-row{ display:flex; gap:.6rem; flex-wrap:wrap; align-items:center; margin:.4rem 0 1.2rem; }
.reset-select{ flex:1 1 16rem; max-width:28rem; min-height:44px; padding:.5rem .7rem; border-radius:10px; border:1px solid var(--line-strong); background:var(--surface-solid); color:var(--ink); font:inherit; }
.reset-lec{ display:block; margin:1rem auto 0; background:none; border:0; color:var(--ink-soft); text-decoration:underline; font:inherit; font-size:.85rem; cursor:pointer; min-height:44px; }
.reset-lec:hover{ color:var(--bad, #b42318); }
.quiz-head-btns{ flex-wrap:nowrap; flex:none; }
@media (max-width:560px){
  .quiz-head-btns .quit-btn{ padding:.45rem .7rem; }
  .tbl-notes table:not(:has(th:nth-child(3))){ min-width:0; }
  .tbl-notes table:not(:has(th:nth-child(3))) td:first-child{ width:38%; }
}
