/* Rotorhead styles. Token values are copied verbatim from design/project/Handoff.dc.html (section 2) and the
   artboard theme scripts (--shadow). Component values are ported from the screen mockups. */

:root {
  --bg:#EEF2F4; --panel:#FFFFFF; --raised:#F5F8F9;
  --ink:#13202A; --muted:#4A5B67; --rule:#C9D3D9;
  --accent:#B0177A; --accent-hover:#951267;
  --accent-press:#7A0F55; --accent-soft:#F8E4F0;
  --on-accent:#FFFFFF;
  --ok:#17703D; --ok-soft:#DFF1E6;
  --warn:#8A5600; --warn-soft:#FAEACC;
  --bad:#B3261E; --bad-soft:#FBE2DF;
  --focus:#1F6FEB; --chart:#E3E9ED; --grid:#E2E9ED;
  --shadow:0 1px 2px rgba(15,23,28,.06),0 6px 16px rgba(15,23,28,.08);
  --scrim:rgba(10,16,20,.4);
  --fast:120ms; --base:200ms; --slow:360ms;
  --ease-out:cubic-bezier(.2,.7,.2,1); --ease-std:cubic-bezier(.4,0,.2,1);
  --safe-top:env(safe-area-inset-top,0px); --safe-bottom:env(safe-area-inset-bottom,0px);
  color-scheme: light;
}
:root[data-theme=dark] {
  --bg:#0F171C; --panel:#16222A; --raised:#1E2D37;
  --ink:#E5ECF0; --muted:#9AACB8; --rule:#2B3C47;
  --accent:#EC5FB4; --accent-hover:#F37EC4;
  --accent-press:#D9479F; --accent-soft:#3A1A2D;
  --on-accent:#1A0812;
  --ok:#4CC27E; --ok-soft:#143021;
  --warn:#F0B13E; --warn-soft:#3A2B0F;
  --bad:#FF7B6E; --bad-soft:#3E1A17;
  --focus:#6EA8FF; --chart:#22323D; --grid:#15212A;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 20px rgba(0,0,0,.35);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    --bg:#0F171C; --panel:#16222A; --raised:#1E2D37;
    --ink:#E5ECF0; --muted:#9AACB8; --rule:#2B3C47;
    --accent:#EC5FB4; --accent-hover:#F37EC4;
    --accent-press:#D9479F; --accent-soft:#3A1A2D;
    --on-accent:#1A0812;
    --ok:#4CC27E; --ok-soft:#143021;
    --warn:#F0B13E; --warn-soft:#3A2B0F;
    --bad:#FF7B6E; --bad-soft:#3E1A17;
    --focus:#6EA8FF; --chart:#22323D; --grid:#15212A;
    --shadow:0 1px 2px rgba(0,0,0,.4),0 8px 20px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin:0; background:var(--bg); color:var(--ink); font-family:'IBM Plex Sans',system-ui,sans-serif; font-size:16px; line-height:24px; -webkit-font-smoothing:antialiased; overflow-x:hidden; }
button,input,select { font:inherit; color:inherit; }
button { cursor:pointer; }
button:disabled { cursor:default; }
.d { font-family:'Barlow Semi Condensed',sans-serif; }
.m { font-family:'IBM Plex Mono',ui-monospace,monospace; }
.tn { font-variant-numeric:tabular-nums; }
kbd { font-family:'IBM Plex Mono',monospace; font-size:11px; line-height:16px; padding:0 5px; border:1px solid var(--rule); border-bottom-width:2px; border-radius:4px; color:var(--muted); background:var(--panel); }
kbd.on-accent { background:transparent; color:var(--on-accent); border-color:var(--on-accent); }
:focus-visible { outline:2px solid var(--focus); outline-offset:2px; }
a { color:var(--accent); }
a:hover { color:var(--ink); }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
h1,h2,h3,p { margin:0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation:none!important; transition:none!important; } }

/* ---------- buttons ---------- */
.btn-primary { border:0; border-radius:12px; background:var(--accent); color:var(--on-accent); font-weight:600; transition:background var(--fast) var(--ease-std); }
.btn-primary:hover { background:var(--accent-hover); }
.btn-primary:active { background:var(--accent-press); }
.btn-secondary { border:1px solid var(--rule); border-radius:12px; background:var(--panel); font-weight:600; }
.btn-secondary:hover { background:var(--raised); }
.btn-text { border:0; background:transparent; color:var(--accent); font-weight:600; }
.btn-text:hover { color:var(--ink); }
.btn-dimmed, .btn-primary:disabled { border:1px dashed var(--rule); background:var(--raised); color:var(--muted); }
.btn-text:disabled { color:var(--muted); }
.icon-btn { width:44px; height:44px; border:0; background:transparent; display:flex; align-items:center; justify-content:center; padding:0; flex:none; }
.round-btn { width:44px; height:44px; border:1px solid var(--rule); border-radius:50%; background:var(--panel); display:flex; align-items:center; justify-content:center; padding:0; flex:none; color:var(--ink); }
.small-btn { height:36px; padding:0 10px; border:1px solid var(--rule); border-radius:8px; background:var(--panel); font-size:13px; font-weight:600; flex:none; }
.small-btn.danger { border-color:var(--bad); color:var(--bad); }
.small-btn:disabled { border-style:dashed; color:var(--muted); border-color:var(--rule); }

/* ---------- shell ---------- */
.app { min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; }
.app-main { flex:1; min-width:0; display:flex; flex-direction:column; padding-bottom:calc(56px + var(--safe-bottom) + 24px); }
.app.focused .app-main { padding-bottom:0; }

.tabbar { position:fixed; left:0; right:0; bottom:0; z-index:20; display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); border-top:1px solid var(--rule); background:var(--panel); padding:0 4px var(--safe-bottom); }
.tab { display:flex; flex-direction:column; align-items:center; gap:2px; height:56px; justify-content:center; text-decoration:none; color:var(--muted); font-size:12px; line-height:16px; }
.tab:hover { color:var(--ink); }
.tab[aria-current=page] { color:var(--accent); font-weight:600; box-shadow:inset 0 2px 0 var(--accent); }

.sidebar { display:none; }

.page { padding:0 16px; display:flex; flex-direction:column; gap:12px; }
.ph-head { padding:max(24px, calc(var(--safe-top) + 12px)) 16px 12px; display:flex; align-items:flex-end; gap:10px; }
.ph-head h1 { font-size:36px; line-height:40px; font-weight:600; }
.ph-head .date { font-size:13px; line-height:20px; color:var(--muted); }
.ph-head .badge-unsynced { margin-bottom:8px; }
.ph-head.back { padding:max(20px, calc(var(--safe-top) + 8px)) 8px 8px; align-items:center; gap:4px; }
.ph-head.back h1 { font-size:32px; line-height:36px; }

.badge-unsynced { display:inline-flex; align-items:center; gap:6px; height:28px; padding:0 10px; border-radius:999px; border:1px solid var(--warn); color:var(--warn); font-size:12px; font-weight:600; flex:none; }
.badge-unsynced .dot { width:7px; height:7px; border-radius:50%; background:var(--warn); }

.offline-banner { display:flex; align-items:center; gap:8px; padding:8px 12px; border-radius:8px; background:var(--warn-soft); color:var(--ink); font-size:14px; line-height:20px; margin:0 16px 12px; }

.toast { position:fixed; left:16px; right:16px; bottom:calc(56px + var(--safe-bottom) + 20px); z-index:40; display:flex; align-items:center; gap:10px; padding:12px 14px; border-radius:10px; background:var(--ink); color:var(--bg); box-shadow:var(--shadow); font-size:15px; font-weight:500; animation:rise var(--base) var(--ease-out); }

@keyframes rise { from { transform:translateY(12px); opacity:0; } to { transform:none; opacity:1; } }
@keyframes sheet-up { from { transform:translateY(100%); } to { transform:none; } }
@keyframes fade { from { opacity:0; } to { opacity:1; } }

/* tablet 720-1023: same shell, 32 px margins */
@media (min-width:720px) {
  .page { padding:0 32px; gap:16px; }
  .ph-head { padding:max(40px, calc(var(--safe-top) + 16px)) 32px 16px; gap:12px; }
  .ph-head h1 { font-size:48px; line-height:52px; }
  .ph-head .date { font-size:14px; }
  .ph-head.back { padding:max(32px, calc(var(--safe-top) + 12px)) 24px 12px; }
  .tabbar { padding:0 80px max(20px, var(--safe-bottom)); }
  .app-main { padding-bottom:calc(76px + var(--safe-bottom) + 24px); }
  .offline-banner { margin:0 32px 16px; }
  .toast { left:auto; right:32px; width:auto; }
}

/* laptop >= 1024: 220 px sidebar */
@media (min-width:1024px) {
  .app { flex-direction:row; }
  .tabbar { display:none; }
  .app-main { padding-bottom:0; }
  .sidebar { width:220px; flex:none; border-right:1px solid var(--rule); background:var(--panel); padding:20px 12px; display:flex; flex-direction:column; gap:2px; position:sticky; top:0; height:100vh; height:100dvh; overflow-y:auto; }
  .toast { right:32px; bottom:32px; padding:12px 16px; }
  .offline-banner { margin:0 0 4px; }
}
.side-brand { display:flex; align-items:center; gap:10px; padding:0 8px 20px; text-decoration:none; color:var(--ink); }
.side-brand span { font-size:22px; line-height:28px; font-weight:600; }
.side-link { display:flex; align-items:center; gap:10px; height:40px; padding:0 10px; border-radius:8px; text-decoration:none; color:var(--ink); font-size:15px; }
.side-link:hover { background:var(--raised); color:var(--ink); }
.side-link kbd { margin-left:auto; }
.side-link[aria-current=page] { background:var(--accent-soft); color:var(--accent); font-weight:600; box-shadow:inset 3px 0 0 var(--accent); }
.side-foot { margin-top:auto; display:flex; flex-direction:column; gap:10px; }
.side-foot .badge-unsynced { align-self:flex-start; height:26px; margin-left:8px; }
.side-metar { padding:10px 8px 0; border-top:1px solid var(--rule); font-size:12px; line-height:18px; overflow-wrap:anywhere; }

.lap-main { flex:1; min-width:0; padding:36px 48px; display:flex; flex-direction:column; gap:24px; max-width:1296px; }
.lap-head { display:flex; align-items:baseline; gap:16px; }
.lap-head h1 { font-size:48px; line-height:52px; font-weight:600; }
.lap-head .date { font-size:15px; color:var(--muted); }

/* ---------- cards ---------- */
.card { border:1px solid var(--rule); border-radius:12px; background:var(--panel); }
.card-pad { padding:14px; display:flex; flex-direction:column; gap:4px; }
.eyebrow { font-family:'IBM Plex Mono',ui-monospace,monospace; font-size:12px; line-height:18px; color:var(--muted); }
.muted { color:var(--muted); }
.empty-card { border:1px dashed var(--rule); border-radius:12px; padding:18px; display:flex; flex-direction:column; gap:6px; }
.loading-card { display:flex; flex-direction:column; gap:8px; padding:12px; border:1px solid var(--rule); border-radius:10px; }
.loading-card span { height:12px; border-radius:4px; background:var(--chart); display:block; }
.error-card { display:flex; align-items:center; gap:10px; padding:12px; border:1px solid var(--bad); border-radius:10px; background:var(--bad-soft); }
.error-card span { flex:1; font-size:14px; }
.error-card button { height:36px; padding:0 12px; border:1px solid var(--bad); border-radius:8px; background:var(--panel); color:var(--bad); font-weight:600; }

/* METAR */
.metar-btn { text-align:left; display:flex; align-items:flex-start; gap:10px; padding:12px 14px; border:1px solid var(--rule); border-radius:10px; background:var(--panel); width:100%; }
.metar-btn:hover { background:var(--raised); }
.metar-btn .label { display:none; font-size:12px; color:var(--muted); }
.metar-btn .line { flex:1; font-size:14px; line-height:21px; font-weight:500; overflow-wrap:anywhere; }
.metar-btn .decode { font-size:12px; color:var(--accent); text-decoration:underline; padding-top:2px; }
@media (min-width:720px) {
  .metar-btn { align-items:center; gap:14px; padding:16px 18px; }
  .metar-btn .label { display:inline; }
  .metar-btn .line { font-size:17px; line-height:24px; }
  .metar-btn .decode { font-size:13px; padding-top:0; }
}
.tok-ok { color:var(--ok); font-weight:600; }
.tok-warn { color:var(--warn); font-weight:600; }
.tok-bad { color:var(--bad); font-weight:600; }
.tok-muted { color:var(--muted); }

/* sortie */
.sortie { text-align:left; border:0; border-radius:12px; background:var(--accent); color:var(--on-accent); padding:20px; display:flex; flex-direction:column; gap:6px; min-height:132px; justify-content:flex-end; position:relative; overflow:hidden; width:100%; transition:background var(--fast) var(--ease-std); }
.sortie:hover { background:var(--accent-hover); }
.sortie:active { background:var(--accent-press); }
.sortie .art { position:absolute; right:-6px; top:8px; opacity:.35; }
.sortie .art-l { display:none; }
.sortie .kick { display:none; font-size:13px; line-height:18px; opacity:.9; }
.sortie .title { font-size:32px; line-height:36px; font-weight:600; position:relative; }
.sortie .sub { font-size:13px; line-height:19px; position:relative; }
.sortie kbd { display:none; position:absolute; right:20px; bottom:20px; }
@media (min-width:720px) {
  .sortie { padding:28px; gap:8px; min-height:200px; }
  .sortie .art { display:none; }
  .sortie .art-l { display:block; position:absolute; right:10px; top:14px; opacity:.3; }
  .sortie .kick { display:block; }
  .sortie .title { font-size:48px; line-height:52px; }
  .sortie .sub { font-size:15px; line-height:22px; }
}
@media (min-width:1024px) { .sortie kbd { display:inline; } }

/* next up */
.nextup { text-decoration:none; color:var(--ink); display:flex; align-items:center; gap:14px; padding:14px; border:1px solid var(--rule); border-radius:12px; background:var(--panel); }
.nextup:hover { color:var(--ink); background:var(--raised); }
.nextup .body { flex:1; display:flex; flex-direction:column; gap:2px; min-width:0; }
.nextup .t { font-weight:600; }
.nextup .go { font-size:14px; line-height:20px; color:var(--accent); font-weight:600; }
.nextup .contents { font-size:14px; line-height:20px; color:var(--muted); }
.nextup .go-side { color:var(--accent); font-weight:600; flex:none; }
@media (min-width:720px) {
  .nextup { gap:16px; padding:18px; }
  .nextup .t { font-size:18px; line-height:24px; }
  .nextup .contents { font-size:13px; line-height:18px; }
}
@media (min-width:1024px) { .nextup .contents { font-size:14px; line-height:20px; } }

/* stats */
.stats4 { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
.stat-v { font-size:24px; line-height:30px; font-weight:600; }
.stat-l { font-size:12px; line-height:18px; color:var(--muted); display:flex; align-items:center; gap:2px; }
@media (min-width:720px) { .stat-v { font-size:28px; line-height:34px; } .stat-l { font-size:13px; gap:3px; } }

.today-grid { display:flex; flex-direction:column; gap:12px; }
.today-col { display:flex; flex-direction:column; gap:12px; }
.pair { display:flex; flex-direction:column; gap:12px; }
@media (min-width:720px) {
  .today-col { gap:16px; }
  .pair { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; align-items:stretch; }
  .section-pad { padding:18px; }
}
@media (min-width:1024px) {
  .today-grid { display:grid; grid-template-columns:7fr 5fr; gap:24px; align-items:start; }
  .today-col { gap:16px; }
}

/* first run */
.firstrun h2 { font-size:28px; line-height:32px; font-weight:600; }
.firstrun p { font-size:16px; line-height:24px; color:var(--muted); }
.firstrun .art { display:block; background:var(--raised); border-bottom:1px solid var(--rule); width:100%; height:auto; }
.firstrun .body { padding:18px; display:flex; flex-direction:column; gap:12px; }
.firstrun .go { height:52px; font-size:17px; display:flex; align-items:center; justify-content:center; gap:10px; }
@media (min-width:720px) {
  .firstrun .art { height:220px; }
  .firstrun .body { padding:28px; gap:14px; }
  .firstrun h2 { font-size:40px; line-height:44px; }
  .firstrun p { font-size:17px; line-height:26px; }
  .firstrun .go { align-self:flex-start; padding:0 24px; }
}

/* ---------- sheets / panels ---------- */
.scrim { position:fixed; inset:0; background:var(--scrim); z-index:50; animation:fade var(--base) var(--ease-std); }
.sheet { position:fixed; left:0; right:0; bottom:0; z-index:51; background:var(--panel); border-top:1px solid var(--rule); border-radius:16px 16px 0 0; box-shadow:var(--shadow); padding:8px 20px calc(var(--safe-bottom) + 34px); display:flex; flex-direction:column; gap:12px; max-height:calc(100dvh - 120px); overflow-y:auto; animation:sheet-up var(--base) var(--ease-out); }
.sheet .grab { align-self:center; width:40px; height:5px; border-radius:3px; background:var(--rule); flex:none; }
.sheet .sheet-head { display:flex; align-items:center; gap:12px; }
.sheet .sheet-head h2 { font-size:28px; line-height:32px; font-weight:600; }
.dialog { position:fixed; z-index:51; left:50%; top:50%; transform:translate(-50%,-50%); width:min(560px, calc(100vw - 48px)); max-height:calc(100dvh - 64px); overflow-y:auto; background:var(--panel); border:1px solid var(--rule); border-radius:12px; box-shadow:var(--shadow); padding:20px 24px 24px; display:flex; flex-direction:column; gap:10px; animation:fade var(--base) var(--ease-std); }

.metar-list { list-style:none; margin:0; padding:0; }
.metar-list li { display:grid; grid-template-columns:112px 1fr; gap:12px; padding:10px 0; border-top:1px solid var(--rule); }
.metar-list .code { font-size:15px; line-height:22px; font-weight:600; overflow-wrap:anywhere; }
.metar-list .meaning { font-size:15px; line-height:22px; }
.metar-raw { padding:10px 12px; border-radius:8px; background:var(--raised); font-size:14px; line-height:21px; overflow-wrap:anywhere; }

/* ---------- route ---------- */
.route-bg { background-color:var(--bg); background-image:linear-gradient(var(--grid) 1px,transparent 1px),linear-gradient(90deg,var(--grid) 1px,transparent 1px); background-size:32px 32px; }
.route-head { padding:max(24px, calc(var(--safe-top) + 12px)) 16px 4px; display:flex; align-items:flex-end; justify-content:space-between; gap:8px; }
.route-head h1 { font-size:36px; line-height:40px; font-weight:600; }
.route-head .sum { font-size:13px; color:var(--muted); padding-bottom:6px; }
.legend { margin:0 16px; padding:8px 12px; border:1px solid var(--rule); border-radius:8px; background:var(--panel); display:flex; gap:12px; flex-wrap:wrap; font-size:12px; line-height:18px; }
.legend span { display:flex; align-items:center; gap:5px; }
.dot { width:12px; height:12px; border-radius:50%; flex:none; display:inline-block; }
.dot.current { border:3px solid var(--accent); }
.dot.cleared { background:var(--ok); }
.dot.due { border:2px solid var(--warn); background:linear-gradient(to top,var(--warn) 50%,transparent 50%); }
.dot.lapsed { background:var(--bad); }
.dot.not-started { border:2px solid var(--muted); }
.dot.questions-only { border:2px dotted var(--muted); }
.map-svg { display:block; width:100%; height:auto; overflow:visible; }
.map-node { cursor:pointer; }
.map-node:focus { outline:none; }
.map-node:focus-visible .ring { stroke:var(--focus); stroke-width:3; }
.map-node:hover .hit { fill:var(--raised); }

.zoom-head { padding:max(20px, calc(var(--safe-top) + 8px)) 8px 4px; display:flex; align-items:center; gap:4px; }
.zoom-head h1 { font-size:28px; line-height:32px; font-weight:600; }
.zoom-head .sub { font-size:12px; line-height:18px; color:var(--muted); }

.wp-list { list-style:none; margin:0; padding:0 8px; display:flex; flex-direction:column; }
.wp-row { display:grid; grid-template-columns:20px 40px 1fr 50px; gap:8px; align-items:center; min-height:32px; padding:0 12px; font-size:14px; line-height:20px; width:100%; text-align:left; border:0; background:transparent; border-radius:8px; }
.wp-row:hover { background:var(--raised); }
.wp-row.is-current { min-height:36px; padding:0 10px; border:2px solid var(--accent); background:var(--accent-soft); font-weight:600; }
.wp-row.is-current .dot.current { width:14px; height:14px; }
.wp-row.is-selected:not(.is-current) { box-shadow:inset 0 0 0 1px var(--ink); }
.wp-row .q { text-align:right; color:var(--muted); }
.wp-row.is-current .q { color:var(--ink); }
.wp-list.phone .wp-row { min-height:44px; }

.tag { font-family:'IBM Plex Mono',ui-monospace,monospace; margin-left:auto; font-size:12px; line-height:18px; padding:2px 8px; border-radius:999px; font-weight:600; flex:none; }
.tag.current { background:var(--accent-soft); color:var(--accent); }
.tag.due { background:var(--warn-soft); color:var(--warn); }
.tag.lapsed { background:var(--bad-soft); color:var(--bad); }
.tag.cleared { background:var(--ok-soft); color:var(--ok); }
.tag.questions-only { border:1px dotted var(--muted); color:var(--muted); }

.wp-detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.wp-detail-grid > div { padding:10px 12px; border:1px solid var(--rule); border-radius:8px; }
.wp-actions { display:flex; gap:10px; }
.wp-actions > * { flex:1; height:52px; font-size:16px; display:flex; align-items:center; justify-content:center; text-decoration:none; gap:6px; }
a.btn-primary { color:var(--on-accent); }
a.btn-secondary { color:var(--ink); }

.route-lap { display:flex; flex:1; min-height:100vh; min-height:100dvh; }
.route-lap .map-col { flex:1; min-width:0; position:relative; display:flex; flex-direction:column; background-size:40px 40px; }
.route-lap .map-col header { padding:28px 32px 0; display:flex; align-items:baseline; gap:14px; }
.route-lap .map-col h1 { font-size:40px; line-height:44px; font-weight:600; }
.route-lap .map-col .sum { font-size:14px; color:var(--muted); }
.route-lap .map-wrap { padding:0 0 72px; max-width:740px; }
.route-lap .legend { position:absolute; left:32px; bottom:20px; margin:0; gap:16px; font-size:13px; }
.route-lap .legend span { gap:6px; }
.route-lap aside { width:420px; flex:none; border-left:1px solid var(--rule); background:var(--panel); display:flex; flex-direction:column; height:100vh; height:100dvh; position:sticky; top:0; }
.route-lap aside .a-head { padding:24px 20px 8px; display:flex; align-items:baseline; justify-content:space-between; gap:8px; }
.route-lap aside .a-head h2 { font-size:28px; line-height:32px; font-weight:600; }
.route-lap aside .a-list { flex:1; min-height:0; overflow-y:auto; padding-bottom:8px; }
.route-lap aside .detail { border-top:1px solid var(--rule); padding:18px 20px 22px; display:flex; flex-direction:column; gap:12px; background:var(--raised); }
.route-lap aside .detail h3 { font-size:26px; line-height:30px; font-weight:600; }
.route-lap aside .wp-actions > * { height:44px; font-size:16px; border-radius:10px; }
@media (min-width:1024px) and (max-width:1279px) { .route-lap aside { width:360px; } }

/* ---------- login ---------- */
.login-phone { min-height:100vh; min-height:100dvh; padding:max(48px, calc(var(--safe-top) + 40px)) 24px calc(var(--safe-bottom) + 50px); display:flex; flex-direction:column; position:relative; overflow:hidden; }
.login-phone .art { position:absolute; left:0; top:40px; pointer-events:none; }
.login-phone h1 { margin:20px 0 0; font-size:48px; line-height:52px; font-weight:600; }
.login-phone .tag-line { margin:6px 0 0; font-size:16px; line-height:24px; color:var(--muted); }
.login-actions { margin-top:auto; display:flex; flex-direction:column; gap:12px; position:relative; padding-top:32px; }
.login-actions .big { height:56px; font-size:17px; display:flex; align-items:center; justify-content:center; gap:10px; }
.login-actions .alt { height:48px; }
.login-foot { margin:8px 0 0; font-size:12px; line-height:18px; color:var(--muted); }
.pw-field { display:flex; align-items:center; height:52px; border:2px solid var(--rule); border-radius:10px; background:var(--panel); padding:0 6px 0 14px; }
.pw-field:focus-within { border-color:var(--accent); }
.pw-field input { flex:1; min-width:0; border:0; background:transparent; outline:none; font-size:17px; letter-spacing:.1em; height:100%; }
.pw-field button { color:var(--muted); }
.field-label { font-size:14px; line-height:20px; font-weight:600; }
.alert-bad { display:flex; gap:10px; padding:12px 14px; border:1px solid var(--bad); border-radius:10px; background:var(--bad-soft); font-size:15px; line-height:22px; }
.alert-warn { display:flex; align-items:center; gap:12px; padding:14px; border:1px solid var(--warn); border-radius:10px; background:var(--warn-soft); }
.alert-warn .msg { flex:1; font-size:15px; line-height:22px; }
.alert-warn .count { font-size:15px; font-weight:600; color:var(--warn); }

.login-lap { min-height:100vh; min-height:100dvh; background-color:var(--bg); background-image:linear-gradient(var(--grid) 1px,transparent 1px),linear-gradient(90deg,var(--grid) 1px,transparent 1px); background-size:48px 48px; position:relative; display:flex; align-items:center; justify-content:center; overflow:hidden; padding:24px; }
.login-lap .art { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.login-card { position:relative; width:420px; max-width:100%; padding:36px; background:var(--panel); border:1px solid var(--rule); border-radius:12px; box-shadow:var(--shadow); display:flex; flex-direction:column; gap:14px; }
.login-card .brand { display:flex; align-items:center; gap:14px; }
.login-card h1 { font-size:36px; line-height:40px; font-weight:600; }
.login-card .tag-line { font-size:15px; line-height:22px; color:var(--muted); }
.login-card .first { margin-top:10px; }
.login-card .b52 { height:52px; border-radius:10px; font-size:16px; display:flex; align-items:center; justify-content:center; gap:10px; }
.login-card .b48 { height:48px; border-radius:10px; }
.login-card .or { display:flex; align-items:center; gap:10px; color:var(--muted); font-size:13px; }
.login-card .or span { flex:1; height:1px; background:var(--rule); }
.login-card input.pw { height:48px; border:2px solid var(--rule); border-radius:10px; background:var(--panel); padding:0 14px; font-size:16px; outline:none; width:100%; }
.login-card input.pw:focus { border-color:var(--accent); }
.login-card .enter { font-size:12px; padding:1px 6px; border-radius:4px; border:1px solid var(--on-accent); opacity:.85; }
.login-card .login-foot { margin:6px 0 0; }

/* ---------- settings ---------- */
.set-h2 { margin:6px 0 0; font-size:12px; line-height:18px; color:var(--muted); font-weight:600; letter-spacing:.04em; }
.set-card { border:1px solid var(--rule); border-radius:12px; background:var(--panel); }
.set-row { padding:10px 14px; display:flex; align-items:center; gap:10px; min-height:52px; }
.set-row + .set-row, .set-card > * + * { border-top:1px solid var(--rule); }
.set-row label, .set-row .lbl { flex:1; font-size:15px; line-height:22px; }
.set-row .sub { display:block; font-size:12px; line-height:18px; color:var(--muted); font-family:'IBM Plex Mono',ui-monospace,monospace; }
.set-col { padding:10px 14px; display:flex; flex-direction:column; gap:6px; }
.set-input { height:36px; border:1px solid var(--rule); border-radius:8px; background:var(--panel); padding:0 8px; font-size:13px; }
.set-input.text { font-family:'IBM Plex Sans',system-ui,sans-serif; font-size:14px; flex:1; min-width:0; }
fieldset.set-col { margin:0; border:0; }
fieldset.set-col legend { padding:0; font-size:15px; margin-bottom:4px; }
.radio-row { display:flex; align-items:center; gap:10px; min-height:44px; font-size:14px; line-height:20px; }
.radio-row input { width:18px; height:18px; accent-color:var(--accent); margin:0; flex:none; }
input[type=range] { width:100%; accent-color:var(--accent); height:32px; margin:0; }
.switch { width:48px; height:28px; border:0; border-radius:14px; background:var(--accent); padding:3px; display:flex; justify-content:flex-end; flex:none; position:relative; transition:background var(--fast) var(--ease-std); }
.switch::after { content:""; position:absolute; inset:-8px -2px; }
.switch .knob { width:22px; height:22px; border-radius:50%; background:var(--panel); }
.switch[aria-checked=false] { border:2px solid var(--muted); background:var(--panel); padding:2px; justify-content:flex-start; }
.switch[aria-checked=false] .knob { width:20px; height:20px; background:var(--muted); }
.switch:disabled { border:2px dashed var(--rule); background:var(--raised); }
.switch:disabled .knob { background:var(--rule); }
.meter { height:10px; border-radius:5px; background:var(--chart); display:flex; overflow:hidden; }
.arrives { font-size:12px; line-height:18px; color:var(--warn); font-weight:600; font-family:'IBM Plex Mono',ui-monospace,monospace; }
.set-page { padding:0 16px 30px; display:flex; flex-direction:column; gap:10px; }
@media (min-width:720px) { .set-page { padding:0 32px 30px; max-width:760px; } }
.set-lap { display:flex; flex:1; min-height:100vh; min-height:100dvh; }
.set-lap aside { width:240px; flex:none; border-right:1px solid var(--rule); padding:32px 12px; display:flex; flex-direction:column; gap:2px; }
.set-lap aside h1 { margin:0 10px 16px; font-size:36px; line-height:40px; font-weight:600; }
.set-nav { display:flex; align-items:center; height:40px; padding:0 12px; border-radius:8px; border:0; background:transparent; color:var(--ink); font-size:15px; text-align:left; width:100%; }
.set-nav:hover { background:var(--raised); }
.set-nav[aria-current=true] { background:var(--panel); font-weight:600; box-shadow:inset 3px 0 0 var(--accent); }
.set-lap .set-main { flex:1; min-width:0; padding:32px 48px; display:flex; flex-direction:column; gap:18px; max-width:820px; }
.set-lap .set-main h2.sec { font-size:32px; line-height:36px; font-weight:600; }
.pack-table { border:1px solid var(--rule); border-radius:12px; background:var(--panel); font-size:15px; }
.pack-table .row { display:grid; grid-template-columns:2fr 1fr 1.4fr; align-items:center; }
.pack-table .row + .row { border-top:1px solid var(--rule); }
.pack-table .hdr { font-size:12px; color:var(--muted); }
.pack-table .cell { padding:10px; display:flex; align-items:center; gap:10px; }
.pack-table .cell:first-child { padding:10px 16px; display:block; }
.pack-table .switch { width:44px; height:26px; }
.pack-table .switch .knob { width:18px; height:18px; }

/* ---------- placeholders ---------- */
.chip-on { display:inline-flex; align-items:center; gap:6px; height:36px; padding:0 12px; border:1px solid var(--accent); border-radius:999px; font-size:14px; background:var(--accent-soft); color:var(--accent); font-weight:600; flex:none; }
.chip-off { display:inline-flex; align-items:center; gap:6px; height:36px; padding:0 12px; border:1px dashed var(--rule); border-radius:999px; font-size:14px; color:var(--muted); background:transparent; flex:none; }
.search-field { display:flex; align-items:center; gap:8px; height:44px; border:1px dashed var(--rule); border-radius:10px; background:var(--raised); padding:0 12px; color:var(--muted); }
.search-field input { flex:1; min-width:0; border:0; background:transparent; outline:none; font-size:15px; }
.lesson-ph { min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; }
.lesson-ph header { padding:max(20px, calc(var(--safe-top) + 8px)) 8px 8px; display:flex; align-items:center; gap:4px; border-bottom:1px solid var(--rule); background:var(--panel); }
.lesson-ph header h1 { font-size:22px; line-height:28px; font-weight:600; }

/* ======================= M3.3-M3.6 ======================= */
.ellip { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.clamp2 { display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.sq-btn { width:40px; height:40px; border:1px solid var(--rule); border-radius:8px; background:var(--panel); display:flex; align-items:center; justify-content:center; padding:0; flex:none; color:var(--ink); }
.sq-btn:hover { background:var(--raised); }
.sq-btn:disabled { border-style:dashed; color:var(--muted); background:var(--raised); }
.sq-btn.s32 { width:32px; height:32px; border-radius:6px; }
.sq-btn.s44 { width:44px; height:44px; }
.sq-btn.flagged { border:2px solid var(--warn); background:var(--warn-soft); }
mark, mark.hit { background:var(--warn-soft); color:inherit; padding:0 2px; border-radius:2px; }
.bar8 { display:block; height:8px; border-radius:4px; background:var(--chart); overflow:hidden; }
.bar8 > span, .bar10 > span { display:block; height:100%; border-radius:inherit; }
.bar10 { display:block; height:10px; border-radius:5px; background:var(--chart); overflow:hidden; }
.pill { font-size:12px; padding:2px 8px; border:1px solid var(--rule); border-radius:999px; color:var(--muted); flex:none; }
.end-actions { margin-top:auto; display:flex; flex-direction:column; gap:10px; }
.end-actions .btn-primary { height:56px; font-size:16px; display:flex; align-items:center; justify-content:center; gap:10px; }
.end-actions .btn-secondary { height:48px; }
.end-actions.row { flex-direction:row; }
.end-actions.row > * { flex:1; height:48px; border-radius:10px; }
.stat3 { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border:1px solid var(--rule); border-radius:12px; background:var(--panel); }
.stat3 > div { padding:14px; }
.stat3 > div + div { border-left:1px solid var(--rule); }
.stat3 .v { font-size:30px; line-height:36px; font-weight:600; }
.stat3 .l { font-size:13px; color:var(--muted); }

/* ---------- question card ---------- */
.q-body { display:flex; flex-direction:column; gap:10px; }
.q-stem { margin:0 0 8px; font-size:19px; line-height:28px; font-weight:600; overflow-wrap:anywhere; }
.q-opts { display:flex; flex-direction:column; gap:10px; }
.qopt { display:flex; align-items:center; gap:12px; min-height:56px; padding:8px 14px; border:1px solid var(--rule); border-radius:10px; background:var(--panel); text-align:left; width:100%; color:var(--ink); font-size:16px; line-height:24px; transition:background var(--fast) var(--ease-std),border-color var(--fast) var(--ease-std); }
button.qopt:hover { border-color:var(--muted); background:var(--raised); }
.qopt .ql { flex:none; width:26px; height:26px; border-radius:6px; border:1px solid var(--rule); display:flex; align-items:center; justify-content:center; font-size:13px; }
.qopt .qk { display:none; }
.qopt .qt { flex:1; min-width:0; overflow-wrap:anywhere; }
.qopt .qt.m { font-size:16px; }
.qopt .qtag { font-size:12px; font-weight:600; flex:none; }
.qopt.sel { border:2px solid var(--accent); padding:7px 13px; background:var(--accent-soft); }
.qopt.sel .ql { background:var(--accent); color:var(--on-accent); border-color:var(--accent); }
.qopt.sel .qtag { color:var(--accent); }
.qopt.ok, .qopt.ok-yours { border:2px solid var(--ok); padding:7px 13px; background:var(--ok-soft); animation:pulse var(--fast) var(--ease-out); }
.qopt.ok .qt, .qopt.ok-yours .qt { font-weight:600; }
.qopt.ok .qtag, .qopt.ok-yours .qtag { color:var(--ok); }
.qopt.bad { border:2px solid var(--bad); padding:7px 13px; background:var(--bad-soft); animation:pulse var(--fast) var(--ease-out); }
.qopt.bad .qtag { color:var(--bad); }
.qopt .ql.fill { border:0; color:var(--panel); }
.qopt.ok .ql.fill, .qopt.ok-yours .ql.fill { background:var(--ok); }
.qopt.bad .ql.fill { background:var(--bad); }
.qopt.dim { border:1px dashed var(--rule); color:var(--muted); background:transparent; }
.qopt.dim .ql { border-style:dashed; }
@keyframes pulse { from { transform:scale(.985); } to { transform:none; } }
.q-compact .q-stem { font-size:17px; line-height:24px; margin-bottom:4px; }
.q-compact .q-opts { gap:8px; }
.q-compact .qopt { min-height:48px; padding:6px 13px; font-size:15px; line-height:22px; }
.q-compact .qopt.idle, .q-compact .qopt.dim { padding:6px 14px; }
.q-compact.revealed .qopt.dim { min-height:40px; padding:4px 14px; }
.q-fig { margin:0; padding:6px; min-height:120px; border:1px solid var(--rule); border-radius:8px; background:#F7F9FA; display:flex; align-items:center; justify-content:center; position:relative; width:100%; }
.q-fig img { max-width:100%; max-height:260px; object-fit:contain; display:block; }
.q-fig .cap { position:absolute; right:8px; bottom:6px; font-size:11px; color:#4A5B67; background:rgba(247,249,250,.85); padding:0 4px; border-radius:3px; }
.q-fig.err { color:var(--bad); font-size:14px; }
.fig-zoom { position:fixed; inset:0; z-index:60; background:rgba(10,16,20,.92); display:flex; align-items:center; justify-content:center; padding:16px; overflow:auto; }
.fig-zoom img { max-width:none; width:min(1400px, 200vw); background:#FFFFFF; border-radius:4px; }
.fig-zoom .icon-btn { position:fixed; top:max(12px, var(--safe-top)); right:12px; color:#FFFFFF; }
.q-expl { padding:12px 14px; border:1px solid var(--rule); border-radius:10px; background:var(--panel); font-size:15px; line-height:22px; display:flex; flex-direction:column; gap:6px; overflow-wrap:anywhere; }
.q-expl .html p { margin:0 0 6px; }
.q-expl .html ul, .q-expl .html ol { margin:0 0 6px; padding-left:18px; }
.q-expl .html img { max-width:100%; height:auto; }
.q-expl .html table { border-collapse:collapse; font-size:14px; max-width:100%; display:block; overflow-x:auto; }
.q-expl .html td, .q-expl .html th { padding:6px 8px; border-bottom:1px solid var(--rule); text-align:left; vertical-align:top; }
.q-expl .doc, .q-body .doc { font-size:14px; font-weight:600; }
.q-expl.big { border:0; padding:0; background:transparent; font-size:18px; line-height:28px; gap:12px; }
.q-expl.big .doc { font-size:15px; }
.src { font-size:12px; color:var(--muted); margin-top:auto; }
.grades { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; }
.grade { min-height:56px; border:1px solid var(--rule); border-radius:10px; background:var(--panel); display:flex; flex-direction:column; align-items:center; justify-content:center; padding:4px; color:var(--ink); }
.grade:hover { background:var(--raised); }
.grade .iv { font-size:12px; color:var(--muted); }
.grade[aria-checked=true] { border:2px solid var(--accent); background:var(--accent-soft); }
.grade.again[aria-checked=true] { border-color:var(--bad); background:var(--bad-soft); }
.flag-on { height:36px; padding:0 10px; margin-right:6px; border:1px solid var(--warn); border-radius:999px; background:var(--warn-soft); color:var(--warn); display:flex; align-items:center; gap:6px; font-size:13px; font-weight:600; flex:none; }

/* ---------- question session (focused) ---------- */
.qs { min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; }
.qs-offline { padding:8px 16px; background:var(--warn-soft); display:flex; align-items:center; gap:8px; font-size:14px; line-height:20px; color:var(--ink); }
.qs-head { padding:max(12px, calc(var(--safe-top) + 6px)) 8px 10px; display:flex; align-items:center; gap:4px; border-bottom:1px solid var(--rule); }
.qs-head .badge-unsynced { margin-right:4px; }
.qs-bar { height:3px; background:var(--chart); flex:none; }
.qs-bar > div { height:100%; background:var(--accent); transition:width var(--base) var(--ease-std); }
.qs-bar.l { flex:1; height:4px; border-radius:2px; max-width:420px; overflow:hidden; }
.qs-body { flex:1; padding:20px 16px; display:flex; flex-direction:column; gap:10px; width:100%; max-width:760px; align-self:center; }
.qs-foot { position:sticky; bottom:0; padding:10px 12px calc(var(--safe-bottom) + 12px); border-top:1px solid var(--rule); background:var(--panel); }
.qs-foot .qs-next { width:100%; height:52px; font-size:16px; }
.qs-pad { padding:20px 16px; }
.qs-end { flex:1; padding:48px 24px calc(var(--safe-bottom) + 32px); display:flex; flex-direction:column; gap:18px; width:100%; max-width:560px; align-self:center; }
.qs-lhead { height:64px; flex:none; display:flex; align-items:center; gap:16px; padding:0 20px; border-bottom:1px solid var(--rule); background:var(--panel); }
.qs-hints { margin-left:auto; display:flex; align-items:center; gap:8px; font-size:13px; color:var(--muted); }
.qs-grid { flex:1; display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); min-height:0; }
.qs-qcol { padding:48px 48px 32px 64px; display:flex; flex-direction:column; gap:14px; }
.qs-ecol { border-left:1px solid var(--rule); background:var(--panel); padding:48px 64px 32px 48px; display:flex; flex-direction:column; gap:16px; }
.qs-commit { margin-top:auto; display:flex; flex-direction:column; gap:10px; }
.qs-commit .qs-next { height:52px; border-radius:10px; font-size:16px; display:flex; align-items:center; justify-content:center; gap:10px; }
@media (min-width:1024px) {
  .qs-qcol .q-stem { font-size:26px; line-height:36px; margin-bottom:10px; }
  .qs-qcol .q-opts, .cr-qcol .q-opts, .wc-lap .q-opts { gap:14px; }
  .qopt { min-height:60px; padding:8px 17px; gap:14px; font-size:18px; line-height:26px; }
  .qopt .qt.m { font-size:18px; }
  .qopt .ql:not(.fill) { display:none; }
  .qopt .qk { display:inline-block; }
  .qopt.ok .qk, .qopt.ok-yours .qk, .qopt.bad .qk { display:none; }
  .qopt.sel, .qopt.ok, .qopt.ok-yours, .qopt.bad { padding:7px 16px; }
  .qopt.sel .qk { background:var(--accent); color:var(--on-accent); border-color:var(--accent); }
  .qopt .ql.fill { width:24px; height:24px; }
  .qopt .qtag { font-size:13px; }
  .grade { min-height:64px; gap:2px; }
  .grades { gap:8px; }
  .qs-end { padding-top:96px; }
}

.pick-row { display:flex; align-items:center; gap:10px; width:100%; min-height:52px; padding:0 14px; border:0; background:transparent; font-size:15px; }
.pick-row:hover { background:var(--raised); }
.pick-list { list-style:none; margin:0; padding:0 0 6px; border-top:1px solid var(--rule); }
.pick-list a { display:flex; align-items:center; gap:10px; min-height:44px; padding:4px 14px; text-decoration:none; color:var(--ink); font-size:14px; line-height:20px; }
.pick-list a:hover { background:var(--raised); color:var(--ink); }
.pick-list a > span:first-child { width:64px; flex:none; font-size:12px; color:var(--muted); }
.pick-list a > span:nth-child(2) { flex:1; min-width:0; }
.pick-list a > span:nth-child(3) { flex:none; font-size:12px; }
.pick-list a[aria-disabled=true] { color:var(--muted); cursor:default; }

/* ---------- practice ---------- */
.pr-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.pr-list.two { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.pr-row { display:flex; align-items:center; gap:12px; min-height:60px; padding:10px 14px; border:1px solid var(--rule); border-radius:12px; background:var(--panel); text-decoration:none; color:var(--ink); height:100%; }
.pr-row:hover { color:var(--ink); background:var(--raised); }
.pr-row .b { flex:1; min-width:0; }
.pr-row .t { display:block; font-weight:600; }
.pr-row .s { display:block; font-size:13px; line-height:18px; color:var(--muted); }
.pr-row .num { font-size:26px; line-height:30px; font-weight:600; }
.pr-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.pr-tile { display:flex; flex-direction:column; gap:6px; padding:20px; border:1px solid var(--rule); border-radius:12px; background:var(--panel); text-decoration:none; color:var(--ink); }
a.pr-tile:hover { color:var(--ink); background:var(--raised); }
.pr-tile.due { min-height:150px; padding:22px; border:2px solid var(--warn); }
.pr-tile .t { font-size:26px; line-height:30px; font-weight:600; }
.pr-tile .s { font-size:14px; line-height:20px; color:var(--muted); }
.ride-chip { padding:6px 10px; border:1px solid var(--rule); border-radius:8px; font-size:13px; color:var(--muted); text-decoration:none; }
.ride-chip.on { border-color:var(--accent); color:var(--accent); font-weight:600; }
.weak-card { width:320px; flex:none; align-self:flex-start; margin-top:72px; padding:20px; border:1px solid var(--rule); border-radius:12px; background:var(--panel); display:flex; flex-direction:column; gap:14px; }
.weak-row { display:flex; flex-direction:column; gap:4px; text-decoration:none; color:var(--ink); }
.weak-row:hover { color:var(--accent); }

.auto { min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; gap:14px; padding:max(24px, calc(var(--safe-top) + 12px)) 16px calc(var(--safe-bottom) + 32px); max-width:640px; margin:0 auto; width:100%; transition:box-shadow var(--fast) var(--ease-std); }
.auto.flash-ok { box-shadow:inset 0 0 0 4px var(--ok); }
.auto.flash-bad { box-shadow:inset 0 0 0 4px var(--bad); }
.auto.end { padding-top:max(96px, calc(var(--safe-top) + 72px)); gap:18px; padding-left:24px; padding-right:24px; }
.auto-opts { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.auto-opts.long { grid-template-columns:minmax(0,1fr); }
.auto-opt { min-height:72px; border:1px solid var(--rule); border-radius:10px; background:var(--panel); font-size:22px; line-height:28px; display:flex; align-items:center; justify-content:center; gap:8px; padding:8px 12px; color:var(--ink); }
.auto-opts.long .auto-opt { font-size:16px; line-height:22px; min-height:60px; justify-content:flex-start; text-align:left; }
.auto-opt:disabled { cursor:default; color:var(--muted); }
.auto-opt.ok { border:2px solid var(--ok); background:var(--ok-soft); font-weight:600; color:var(--ink); }
.auto-opt.bad { border:2px solid var(--bad); background:var(--bad-soft); color:var(--ink); }
.auto-opt.dim { border-style:dashed; }

/* ---------- lesson ---------- */
.lesson { min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; }
.ls-head { padding:max(12px, calc(var(--safe-top) + 6px)) 8px 10px; display:flex; flex-direction:column; gap:8px; background:var(--panel); border-bottom:1px solid var(--rule); position:sticky; top:0; z-index:5; }
.ls-pad { padding:20px 16px; display:flex; flex-direction:column; gap:14px; width:100%; max-width:760px; align-self:center; }
.strip { display:flex; gap:4px; }
.strip > span { height:5px; border-radius:3px; border:1px solid var(--rule); box-sizing:border-box; }
.strip > .done { background:var(--ok); border:0; }
.strip > .cur { background:var(--accent); border:0; outline:2px solid var(--accent-soft); }
.ls-body { flex:1; padding:20px 16px; display:flex; flex-direction:column; gap:14px; width:100%; max-width:860px; align-self:center; }
.ls-body.dimmed { opacity:.35; pointer-events:none; }
.slide { margin:0; aspect-ratio:16/9; border-radius:8px; border:1px solid var(--rule); background:#FAFBFC; overflow:hidden; position:relative; user-select:none; }
.slide img { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; transition:opacity var(--fast) var(--ease-std); transform-origin:center; -webkit-user-drag:none; }
.slide .slide-skel { position:absolute; inset:0; border-radius:0; }
.slide-skel { aspect-ratio:16/9; border-radius:8px; background:var(--chart); display:flex; flex-direction:column; gap:8px; padding:16px; }
.slide-skel span { border-radius:4px; background:var(--rule); display:block; }
.slide-err { aspect-ratio:16/9; border-radius:8px; border:1px solid var(--bad); background:var(--bad-soft); display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; padding:16px; text-align:center; }
.slide-err button { height:44px; padding:0 18px; border:1px solid var(--bad); border-radius:10px; background:var(--panel); color:var(--bad); font-weight:600; }
.ls-dots { display:flex; justify-content:center; gap:6px; }
.ls-dots span { width:6px; height:6px; border-radius:50%; background:var(--rule); }
.ls-dots span.on { width:18px; border-radius:3px; background:var(--accent); }
.ls-chips { display:flex; gap:8px; flex-wrap:wrap; }
.lchip { display:inline-flex; align-items:center; gap:6px; height:40px; padding:0 14px; border:1px solid var(--rule); border-radius:999px; background:var(--panel); font-size:14px; color:var(--ink); }
.lchip:hover { background:var(--raised); }
.lchip.on { border-color:var(--accent); background:var(--accent-soft); color:var(--accent); font-weight:600; }
.ls-foot { display:flex; gap:10px; padding:12px 16px calc(var(--safe-bottom) + 16px); border-top:1px solid var(--rule); background:var(--panel); position:sticky; bottom:0; }
.ls-prev { width:52px; height:52px; border:1px solid var(--rule); border-radius:12px; background:var(--panel); display:flex; align-items:center; justify-content:center; flex:none; color:var(--ink); }
.ls-prev:disabled { border-style:dashed; color:var(--muted); background:var(--raised); }
.ls-next { flex:1; height:52px; font-size:16px; }
.ls-checksheet { position:fixed; left:0; right:0; bottom:0; z-index:30; background:var(--panel); border-top:1px solid var(--rule); border-radius:16px 16px 0 0; box-shadow:var(--shadow); padding:20px 16px calc(var(--safe-bottom) + 20px); max-height:calc(100dvh - 90px); overflow-y:auto; animation:sheet-up var(--base) var(--ease-out); }
.check-card { display:flex; flex-direction:column; gap:10px; max-width:760px; margin:0 auto; }
.check-card .q-stem { font-size:18px; line-height:26px; margin:0; }
.check-card .skip { height:36px; border:0; background:transparent; color:var(--muted); font-size:14px; text-decoration:underline; }
.check-card.lap { border:1px solid var(--rule); border-radius:12px; background:var(--panel); padding:18px 20px; margin:0; width:100%; }
.sheet.tall { top:110px; max-height:none; }
.guide-page { align-self:center; width:min(100%, 420px); background:#FFFFFF; border:1px solid var(--rule); box-shadow:var(--shadow); }
.guide-page img { display:block; width:100%; height:auto; }
.res-badge { width:52px; height:52px; border-radius:50%; display:flex; align-items:center; justify-content:center; flex:none; }
.res-badge.ok { background:var(--ok); }
.res-badge.warn { border:3px solid var(--warn); }
.ls-result { flex:1; display:flex; flex-direction:column; gap:16px; padding:max(64px, calc(var(--safe-top) + 48px)) 20px calc(var(--safe-bottom) + 32px); width:100%; max-width:640px; margin:0 auto; min-height:100vh; min-height:100dvh; }
.miss-list { margin:0; padding:0; list-style:none; border:1px solid var(--rule); border-radius:12px; background:var(--panel); }
.miss-list li { display:flex; gap:10px; padding:12px 14px; font-size:15px; line-height:22px; }
.miss-list li + li { border-top:1px solid var(--rule); }
.miss-list svg { stroke:var(--bad); flex:none; margin-top:3px; }
.wc-intro { gap:16px; padding-top:48px; min-height:calc(100dvh - 140px); }
.wc-lap { flex:1; padding:40px 64px; display:flex; flex-direction:column; gap:14px; max-width:900px; width:100%; align-self:center; }

.lesson.lap { height:100vh; height:100dvh; }
.ls-lhead { height:64px; flex:none; display:flex; align-items:center; gap:16px; padding:0 20px; border-bottom:1px solid var(--rule); background:var(--panel); }
.ls-hints { margin-left:auto; display:flex; gap:14px; font-size:13px; color:var(--muted); }
.ls-lbody { flex:1; display:flex; min-height:0; }
.ls-slidecol { flex:1; min-width:0; max-width:1100px; padding:24px; display:flex; flex-direction:column; gap:14px; overflow-y:auto; }
.ls-slidecol.narrow { flex:none; width:660px; }
.ls-slidecol .lchip { height:36px; padding:0 12px; }
.ls-thumbs { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:10px; }
.thumb { aspect-ratio:16/9; border-radius:6px; border:1px solid var(--rule); background:#FAFBFC; position:relative; padding:0; color:#4A5B67; }
.thumb .n { position:absolute; left:6px; top:3px; font-size:11px; }
.thumb .ck { position:absolute; right:4px; bottom:2px; font-size:11px; }
.thumb.on { border:2px solid var(--accent); }
.thumb:disabled { opacity:.6; cursor:default; border-style:dashed; }
.ls-guidecol { flex:1; min-width:0; border-left:1px solid var(--rule); background:var(--raised); padding:24px 20px; display:flex; flex-direction:column; gap:12px; overflow-y:auto; }
.ls-guidecol .guide-page { width:min(100%, 460px); }
.ls-clipcol { flex:none; width:380px; border-left:1px solid var(--rule); background:var(--panel); display:flex; flex-direction:column; overflow-y:auto; }
@media (min-width:1024px) and (max-width:1279px) { .ls-slidecol.narrow { width:520px; } .ls-clipcol { width:340px; } }

/* clip */
.clip { display:flex; flex-direction:column; gap:0; }
.clip-video { aspect-ratio:16/9; background:#0B1216; position:relative; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.clip.compact .clip-video { margin:0 16px; border-radius:8px; }
.clip-video video { position:absolute; inset:0; width:100%; height:100%; object-fit:contain; background:#0B1216; }
.clip-video video::cue { background:rgba(0,0,0,.72); color:#FFFFFF; font-size:14px; line-height:19px; }
.clip-play { position:relative; width:48px; height:48px; border-radius:50%; border:0; background:rgba(255,255,255,.14); display:flex; align-items:center; justify-content:center; }
.clip-prog { position:absolute; left:12px; right:12px; bottom:12px; height:4px; border-radius:2px; background:rgba(255,255,255,.25); pointer-events:none; }
.clip-prog span { display:block; height:4px; border-radius:2px; background:#EC5FB4; }
.clip-ctl { display:flex; align-items:center; gap:8px; padding:10px 16px; }
.clip-seek { flex:1; min-width:40px; height:28px; }
.tagbtn { font-size:12px; padding:3px 8px; border:1px solid var(--rule); border-radius:4px; background:var(--panel); color:var(--ink); flex:none; min-height:28px; }
.tagbtn.on { font-weight:600; }
.cap-note { margin:0 16px; font-size:13px; color:var(--muted); }
.ts-search { margin:12px 16px 6px; display:flex; align-items:center; gap:8px; height:44px; border:1px solid var(--rule); border-radius:10px; background:var(--panel); padding:0 12px; }
.ts-search input { flex:1; min-width:0; border:0; background:transparent; outline:none; font-size:15px; }
.ts-list { list-style:none; margin:0; padding:0 8px 12px; display:flex; flex-direction:column; font-size:15px; line-height:22px; }
.ts-list button { display:flex; gap:10px; padding:8px; border:0; background:transparent; text-align:left; width:100%; border-radius:8px; color:var(--ink); }
.ts-list button:hover { background:var(--raised); }
.ts-list .at { font-size:12px; color:var(--muted); width:36px; flex:none; padding-top:1px; }
.ts-list li.on button { background:var(--accent-soft); box-shadow:inset 3px 0 0 var(--accent); }
.ts-list li.on .at { color:var(--accent); font-weight:600; }
.clip-sheet { padding-left:0; padding-right:0; }
.clip-sheet > div:first-of-type { padding:0 8px 0 16px; }
@media (min-width:1024px) { .ls-clipcol .ts-list { font-size:14px; line-height:20px; } .ls-clipcol .ts-search { height:40px; border-radius:8px; margin:12px 16px 8px; } }

/* ---------- checkride ---------- */
.cr { min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; }
.cr-start { min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; gap:18px; padding:max(24px, calc(var(--safe-top) + 12px)) 20px calc(var(--safe-bottom) + 32px); max-width:640px; margin:0 auto; width:100%; }
.cr-start.lap { padding-top:64px; }
.cr-dl { margin:0; display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border:1px solid var(--rule); border-radius:12px; background:var(--panel); }
.cr-dl > div { padding:14px; }
.cr-dl > div + div { border-left:1px solid var(--rule); }
.cr-dl dt { font-size:12px; color:var(--muted); }
.cr-dl dd { margin:0; font-size:26px; line-height:32px; font-weight:600; }
.cr-rules { margin:0; padding:0; list-style:none; display:flex; flex-direction:column; gap:10px; font-size:16px; line-height:24px; }
.cr-rules li { display:flex; gap:10px; }
.cr-rules svg { flex:none; margin-top:3px; }
.cr-go { margin-top:auto; display:flex; flex-direction:column; gap:8px; }
.cr-go .btn-primary { height:56px; font-size:17px; display:flex; align-items:center; justify-content:center; gap:10px; }
.cr-head { padding:max(12px, calc(var(--safe-top) + 6px)) 12px 10px; display:flex; align-items:center; gap:8px; border-bottom:1px solid var(--rule); background:var(--panel); position:sticky; top:0; z-index:5; }
.timer { padding:6px 10px; border:1px solid var(--rule); border-radius:8px; font-size:16px; font-weight:500; white-space:nowrap; }
.timer.big { padding:6px 12px; font-size:17px; }
.timer.warn { border-color:var(--warn); color:var(--warn); background:var(--warn-soft); font-weight:600; }
.timer.bad { border:2px solid var(--bad); color:var(--bad); background:var(--bad-soft); font-weight:600; }
.flagbtn { height:40px; padding:0 14px; display:flex; align-items:center; gap:8px; font-size:15px; color:var(--ink); }
.flagbtn.on { border:2px solid var(--warn); background:var(--warn-soft); color:var(--warn); }
.cr-lbody { flex:1; display:flex; min-height:0; }
.cr-qcol { flex:1; padding:48px 64px; display:flex; flex-direction:column; gap:14px; }
.cr-qcol .q-stem { font-size:24px; line-height:34px; margin-bottom:10px; }
.cr-nav { width:340px; flex:none; border-left:1px solid var(--rule); background:var(--panel); padding:24px 20px; display:flex; flex-direction:column; gap:14px; }
.navgrid { display:grid; grid-template-columns:repeat(8,minmax(0,1fr)); gap:6px; }
.navgrid.s { gap:5px; }
.navcell { height:38px; border-radius:6px; font-size:13px; border:1px solid var(--rule); background:var(--panel); color:var(--ink); padding:0; }
.navgrid.s .navcell { height:34px; font-size:12px; }
.navcell.answered { border:0; background:var(--ink); color:var(--panel); }
.navcell.flagged { border:2px solid var(--warn); background:var(--warn-soft); }
.navcell.current { border:3px solid var(--accent); font-weight:600; }
.nav-legend { display:flex; gap:14px; flex-wrap:wrap; font-size:13px; color:var(--muted); }
.nav-legend > span { display:flex; align-items:center; gap:6px; }
.nav-legend .sw { width:14px; height:14px; border-radius:3px; }
.sw.answered { background:var(--ink); }
.sw.empty { border:1px solid var(--rule); }
.sw.flagged { border:2px solid var(--warn); background:var(--warn-soft); }
.sw.current { border:3px solid var(--accent); }
.nav-sheet { top:150px; }
.qchip { padding:4px 8px; border:1px solid var(--rule); border-radius:6px; font-size:13px; background:var(--panel); color:var(--ink); }
.qchip.flag { border:2px solid var(--warn); background:var(--warn-soft); }
.dialog.cr-confirm { width:min(440px, calc(100vw - 32px)); padding:28px; gap:14px; }
.cr-result { min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; gap:12px; padding:max(24px, calc(var(--safe-top) + 12px)) 20px calc(var(--safe-bottom) + 28px); max-width:640px; margin:0 auto; width:100%; }
.cr-status { display:flex; align-items:flex-start; gap:8px; font-weight:600; }
.cr-status.ok { color:var(--ok); }
.cr-status.bad { font-weight:400; color:var(--ink); }
.cr-bars { padding:14px; border:1px solid var(--rule); border-radius:12px; background:var(--panel); display:flex; flex-direction:column; gap:10px; }
.cr-bar { display:grid; grid-template-columns:minmax(0,1fr) 120px 36px; gap:8px; align-items:center; font-size:14px; }
.cr-bar .track { height:8px; border-radius:4px; background:var(--chart); position:relative; }
.cr-bar .track > span:first-child { display:block; height:100%; border-radius:4px; }
.cr-bar .line { position:absolute; top:-3px; width:2px; height:14px; background:var(--ink); }
.cr-bars.lap { padding:28px; gap:18px; }
.cr-bars.lap .cr-bar { grid-template-columns:220px 1fr 48px; gap:14px; font-size:16px; }
.cr-bars.lap .track { height:12px; border-radius:6px; }
.cr-bars.lap .line { top:-4px; height:20px; }
.cr-bars .note { margin-top:auto; padding:14px; border-radius:10px; background:var(--raised); font-size:15px; line-height:22px; }
.cr-res-grid { flex:1; display:grid; grid-template-columns:minmax(0,5fr) minmax(0,7fr); gap:32px; padding:48px 64px; min-height:0; }
.cr-res-main { display:flex; flex-direction:column; gap:14px; padding:28px; }
.needle { transform-origin:100px 100px; transform-box:view-box; transform:rotate(var(--deg)); animation:sweep 900ms var(--ease-out); }
@keyframes sweep { from { transform:rotate(0deg); } }
.stamp { width:52px; height:52px; border-radius:50%; border:2px dashed var(--muted); color:var(--muted); display:flex; flex-direction:column; align-items:center; justify-content:center; flex:none; }
.stamp .c { font-size:15px; font-weight:600; line-height:18px; }
.stamp .t { font-size:9px; line-height:12px; }
.stamp.earned { border:3px double var(--accent); color:var(--accent); background:var(--accent-soft); transform:rotate(-8deg); animation:stamp-in var(--slow) var(--ease-out); }
.stamp.earned .c { font-weight:700; }
.stamp.l { width:68px; height:68px; }
.stamp.l .c { font-size:19px; line-height:20px; }
.stamp.l .t { font-size:11px; }
.stamp.big { width:76px; height:76px; }
.stamp.big .c { font-size:22px; line-height:22px; }
.stamp.big .t { font-size:11px; }
@keyframes stamp-in { from { transform:rotate(-8deg) scale(1.3); opacity:0; } }

/* ---------- logbook ---------- */
.lb-card { padding:14px; border:1px solid var(--rule); border-radius:12px; background:var(--panel); display:flex; flex-direction:column; min-width:0; }
.lb-h { margin:0; font-size:22px; line-height:28px; font-weight:600; }
.lvl { width:40px; height:40px; border-radius:8px; background:var(--accent); color:var(--on-accent); display:flex; align-items:center; justify-content:center; font-size:20px; font-weight:700; flex:none; }
.stamps5 { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:10px; justify-items:center; }
.cur-row { display:grid; grid-template-columns:40px 1fr 92px; gap:8px; align-items:center; }
.cur-row > span:first-child { font-size:13px; }
.cur-row > span:last-child { font-size:12px; }
.cur-row.l { grid-template-columns:44px 1fr 100px; gap:10px; }
.cur-row.l > span:first-child { font-size:14px; }
.cur-row.l > span:last-child { font-size:13px; }
.study-bars { display:flex; align-items:flex-end; border-bottom:1px solid var(--rule); }
.study-bars span { flex:1; border-radius:3px 3px 0 0; }
.plan-pill { font-size:12px; padding:2px 8px; border-radius:999px; font-weight:600; flex:none; }
.plan9 { display:grid; grid-template-columns:repeat(9,minmax(0,1fr)); gap:8px; }
.plan9 > div { padding:10px; border-radius:8px; display:flex; flex-direction:column; gap:4px; min-width:0; }
.lb-export { display:flex; align-items:center; justify-content:center; gap:8px; height:44px; padding:0 16px; border-radius:10px; margin-left:auto; color:var(--ink); }
.lb-export.big { height:52px; border-radius:12px; margin:0; }
.lb-lap { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); grid-auto-rows:auto; gap:16px; padding:32px 40px; align-content:start; }
.lb-lap .lb-card { padding:18px 20px; }
.lb-lap .lb-h { font-size:24px; }
.lb-page { padding-bottom:16px; }
@media (min-width:720px) and (max-width:1023px) { .lb-page.two { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); } .lb-page.two > :first-child, .lb-page.two > .lb-export { grid-column:span 2; } }

/* ---------- library ---------- */
.lib-search { display:flex; align-items:center; gap:8px; height:44px; border:1px solid var(--rule); border-radius:10px; background:var(--panel); padding:0 6px 0 12px; }
.lib-search.active, .lib-search:focus-within { border:2px solid var(--accent); padding:0 5px 0 11px; }
.lib-search input { flex:1; min-width:0; border:0; background:transparent; outline:none; font-size:15px; height:100%; }
.lib-search .clear { width:36px; height:36px; border:0; background:transparent; color:var(--muted); flex:none; }
.lib-search.lap { width:340px; height:40px; margin-left:auto; padding-right:12px; }
.lib-search.lap input { font-size:14px; }
.seg { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); padding:3px; border-radius:10px; background:var(--chart); }
.seg button { height:38px; border:0; border-radius:8px; background:transparent; font-size:14px; color:var(--ink); }
.seg button[aria-selected=true] { background:var(--panel); font-weight:600; box-shadow:0 1px 2px rgba(0,0,0,.12); }
.seg.lap { display:flex; }
.seg.lap button { height:36px; padding:0 14px; }
.shelf { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; align-content:start; }
.shelf.lap { grid-template-columns:repeat(auto-fill,minmax(170px,1fr)); gap:20px; }
@media (min-width:720px) and (max-width:1023px) { .shelf { grid-template-columns:repeat(3,minmax(0,1fr)); } }
.book { text-decoration:none; color:var(--ink); display:flex; flex-direction:column; gap:6px; }
.book:hover { color:var(--ink); }
.book .cover { aspect-ratio:1/1.2; border-radius:8px; border:1px solid var(--rule); background:var(--panel); display:flex; flex-direction:column; justify-content:space-between; padding:12px; position:relative; overflow:hidden; }
.book:hover .cover { background:var(--raised); }
.book .spine { position:absolute; left:0; top:0; bottom:0; width:6px; background:var(--accent); opacity:.85; }
.book .k { font-size:12px; color:var(--muted); padding-left:6px; }
.book .c { font-size:30px; line-height:34px; font-weight:700; padding-left:6px; }
.hit-filters { display:flex; gap:6px; flex-wrap:wrap; }
.fchip { height:30px; padding:0 10px; border:1px solid var(--rule); border-radius:999px; background:transparent; font-size:13px; display:inline-flex; align-items:center; color:var(--ink); }
.fchip.on { border-color:var(--accent); background:var(--accent-soft); color:var(--accent); font-weight:600; }
.hits { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.hits.lap { max-width:900px; }
.hit-row { display:flex; flex-direction:column; gap:4px; padding:12px 14px; border:1px solid var(--rule); border-radius:10px; background:var(--panel); text-decoration:none; color:var(--ink); }
.hit-row:hover { color:var(--ink); background:var(--raised); }
.hit-row .snip { font-size:15px; line-height:22px; overflow-wrap:anywhere; }
.tbadge { font-size:11px; font-weight:600; padding:1px 6px; border-radius:4px; border:1px solid var(--rule); flex:none; }
.tbadge.acc { background:var(--accent-soft); color:var(--accent); border-color:transparent; }
.lib-lap { flex:1; display:flex; flex-direction:column; min-height:100vh; min-height:100dvh; }
.lib-lhead { padding:24px 28px 16px; display:flex; align-items:center; gap:20px; border-bottom:1px solid var(--rule); flex-wrap:wrap; }
.lib-lhead h1 { font-size:40px; line-height:44px; font-weight:600; }
.lib-lbody { padding:20px 28px; display:flex; flex-direction:column; gap:12px; }
.lib-lbody.docs { padding:0; flex:1; }
.docs3 { flex:1; display:flex; min-height:0; }
.docs-folders { width:250px; flex:none; border-right:1px solid var(--rule); padding:14px 10px; display:flex; flex-direction:column; gap:2px; }
.fold { display:flex; align-items:center; gap:8px; min-height:38px; padding:0 10px; border-radius:8px; border:0; background:transparent; color:var(--ink); font-size:14px; text-align:left; }
.fold:hover { background:var(--raised); }
.fold .m { margin-left:auto; font-size:12px; color:var(--muted); }
.fold[aria-current=true] { color:var(--accent); background:var(--accent-soft); font-weight:600; }
.docs-list { flex:1; min-width:0; padding:14px 16px; display:flex; flex-direction:column; gap:4px; }
.doc-row { display:grid; grid-template-columns:52px minmax(0,1fr) 180px; gap:12px; align-items:center; min-height:48px; padding:0 12px; border-radius:8px; border:0; background:transparent; color:var(--ink); font-size:14px; text-align:left; }
.doc-row:hover { background:var(--raised); }
.doc-row[aria-current=true] { background:var(--accent-soft); }
.doc-row .tbadge { text-align:center; }
.docs-preview { width:380px; flex:none; border-left:1px solid var(--rule); background:var(--raised); padding:20px; display:flex; flex-direction:column; gap:12px; }
.doc-ph { align-self:center; width:280px; aspect-ratio:1/1.414; background:#FFFFFF; border:1px solid var(--rule); box-shadow:var(--shadow); padding:20px; display:flex; flex-direction:column; gap:7px; }
.doc-ph span { height:5px; background:#E1E6EA; display:block; }
.doc-ph span:first-child { height:10px; width:60%; background:#C9D3D9; }
.doc-ph span.box { height:70px; margin:6px 0; background:transparent; border:1px solid #E1E6EA; }
.reader { display:flex; flex-direction:column; flex:1; }
.reader-body { display:flex; flex:1; gap:0; }
.reader-main { flex:1; min-width:0; padding:0 16px 16px; display:flex; flex-direction:column; gap:12px; align-items:stretch; max-width:900px; margin:0 auto; width:100%; }
.reader-page { margin:0; align-self:center; width:min(100%, 640px); background:#FFFFFF; border:1px solid var(--rule); box-shadow:var(--shadow); min-height:200px; }
.reader-page img { width:100%; height:auto; transition:opacity var(--fast); }
.reader-slide img { transition:opacity var(--fast); }
.reader-chaps { width:280px; flex:none; border-right:1px solid var(--rule); padding:8px; overflow-y:auto; max-height:calc(100dvh - 120px); position:sticky; top:0; }
.chap-list { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:2px; }
.chap-list button { display:flex; align-items:center; gap:8px; width:100%; min-height:40px; padding:4px 10px; border:0; border-radius:8px; background:transparent; color:var(--ink); font-size:14px; text-align:left; }
.chap-list button:hover { background:var(--raised); }
.chap-list button .m { margin-left:auto; font-size:12px; flex:none; }
.chap-list button[aria-current=true] { color:var(--accent); background:var(--accent-soft); font-weight:600; }
@media (min-width:1024px) { .reader-main { padding:0 32px 32px; } }
.export-text { margin:0; padding:12px; border-radius:8px; background:var(--raised); border:1px solid var(--rule); font-size:13px; line-height:20px; white-space:pre-wrap; overflow-wrap:anywhere; max-height:50vh; overflow-y:auto; }
.dialog.export-sheet { width:min(640px, calc(100vw - 48px)); }
.ls-slidecol:not(.narrow) { margin:0 auto; }

/* Plain question text keeps its paragraph and <br> breaks (plain() turns them into "\n"). */
.pl, .q-stem, .qopt .qt, .snip { white-space:pre-line; }
/* Miss lists (waypoint check and checkride): question, your answer, the correct answer, explanation on expand. */
.miss-list2 { margin:0; padding:0; list-style:none; border:1px solid var(--rule); border-radius:12px; background:var(--panel); }
.miss2 { display:flex; flex-direction:column; gap:8px; padding:14px; font-size:15px; line-height:22px; min-width:0; }
.miss2 + .miss2 { border-top:1px solid var(--rule); }
.miss2 .ms-q { font-weight:600; overflow-wrap:anywhere; }
.miss2 .ms-a { display:flex; gap:10px; align-items:baseline; padding:6px 10px; border-radius:8px; overflow-wrap:anywhere; min-width:0; }
.miss2 .ms-a .k { flex:none; width:64px; font-size:11px; font-weight:600; }
.miss2 .ms-a.bad { background:var(--bad-soft); }
.miss2 .ms-a.bad .k { color:var(--bad); }
.miss2 .ms-a.ok { background:var(--ok-soft); }
.miss2 .ms-a.ok .k { color:var(--ok); }
.miss2 .ms-x summary { cursor:pointer; font-weight:600; color:var(--accent); min-height:32px; display:flex; align-items:center; }
.miss2 .ms-x .q-expl { margin-top:6px; }
.miss2 .q-fig { max-width:100%; }
.cur-row > span.cur-sub, .cur-row.l > span.cur-sub { grid-column:2 / -1; font-size:12px; line-height:16px; color:var(--muted); margin-top:-4px; text-align:left; }
.cur-row > span:nth-child(3) { font-size:12px; }
.cur-row.l > span:nth-child(3) { font-size:13px; }
