/* Layout: app shell — hangar-board sidebar on desktop, bottom tab bar on phones; one working surface per view. */
:root{
  --bg:#EEEBE3; --surface:#F8F6F1; --sunk:#E4E0D5; --ink:#1B1F27; --muted:#5A5F6B; --line:#D3CEC1;
  --accent:#E0A91F; --accent-ink:#8A6406; --accent-soft:#F4E3B2;
  --good:#2E7A55; --good-soft:#D6EBDF; --bad:#B23A2E; --bad-soft:#F3D9D5; --info:#2F5E8C;
  --shell:#1B1F27; --shell-ink:#EDE5CF; --shell-muted:#9CA1AC;
  --press:#C2412D; --ret:#2F6DB5; --air:#1F7A73; --c1:#1F66B8; --c2:#B07D0B;
  --f-display:"Archivo","Arial Narrow",system-ui,sans-serif;
  --f-body:"Public Sans",system-ui,-apple-system,"Segoe UI",sans-serif;
  --f-mono:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;
  --r:10px;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#15181F; --surface:#1E222B; --sunk:#262B35; --ink:#EDE5CF; --muted:#A3A7B1; --line:#343A46;
  --accent:#F0BE3C; --accent-ink:#F0BE3C; --accent-soft:#3A3322;
  --good:#6BC794; --good-soft:#1F3A2C; --bad:#F08A7C; --bad-soft:#442622; --info:#8AB6E0;
  --shell:#101319; --shell-ink:#EDE5CF; --shell-muted:#8D929D; --press:#F07A5E; --ret:#6FA8E8; --air:#5CC2B8; --c1:#4F93E6; --c2:#B8860B; color-scheme:dark}}
:root[data-theme="dark"]{
  --bg:#15181F; --surface:#1E222B; --sunk:#262B35; --ink:#EDE5CF; --muted:#A3A7B1; --line:#343A46;
  --accent:#F0BE3C; --accent-ink:#F0BE3C; --accent-soft:#3A3322;
  --good:#6BC794; --good-soft:#1F3A2C; --bad:#F08A7C; --bad-soft:#442622; --info:#8AB6E0;
  --shell:#101319; --shell-ink:#EDE5CF; --shell-muted:#8D929D; --press:#F07A5E; --ret:#6FA8E8; --air:#5CC2B8; --c1:#4F93E6; --c2:#B8860B; color-scheme:dark}

*{box-sizing:border-box}
html,body{height:100%}
body{background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:15px;line-height:1.55}
h1,h2,h3,h4{font-family:var(--f-display);font-stretch:88%;margin:0;line-height:1.15;text-wrap:balance;letter-spacing:-.01em}
h1{font-size:clamp(26px,4vw,36px);font-weight:800}
h2{font-size:22px;font-weight:750}
h3{font-size:17px;font-weight:700}
p{margin:0}
button{font:inherit;color:inherit;cursor:pointer}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px;border-radius:6px}
.mono{font-family:var(--f-mono);font-variant-numeric:tabular-nums}
.label{font-family:var(--f-display);font-stretch:75%;text-transform:uppercase;letter-spacing:.09em;font-size:12px;font-weight:700;color:var(--muted)}
.muted{color:var(--muted)}

/* Shell */
.app{display:grid;grid-template-columns:248px 1fr;min-height:100%}
.side{background:var(--shell);color:var(--shell-ink);padding:22px 16px;display:flex;flex-direction:column;gap:22px;position:sticky;top:0;height:100vh}
.logo{display:block;width:170px;aspect-ratio:700/213;max-width:100%;background:currentColor;-webkit-mask:url(logo.png) center/contain no-repeat;mask:url(logo.png) center/contain no-repeat}
.side .sub{font-family:var(--f-display);font-stretch:75%;text-transform:uppercase;letter-spacing:.14em;font-size:11px;color:var(--shell-muted);margin-top:4px;padding-left:6px}
.nav{display:flex;flex-direction:column;gap:2px}
.nav button{display:flex;align-items:center;gap:12px;background:none;border:0;padding:10px 12px;border-radius:8px;color:var(--shell-muted);text-align:left;font-weight:600}
.nav button:hover{color:var(--shell-ink);background:rgba(255,255,255,.05)}
.nav button[aria-current="page"]{color:var(--shell);background:var(--shell-ink)}
.nav svg{width:20px;height:20px;flex:none}
.side-foot{margin-top:auto;display:flex;flex-direction:column;gap:10px;font-size:12.5px;color:var(--shell-muted)}
.theme-row{display:flex;gap:4px;background:rgba(255,255,255,.06);padding:3px;border-radius:8px}
.theme-row button{flex:1;border:0;background:none;color:var(--shell-muted);padding:5px 0;border-radius:6px;font-size:12px;font-weight:600}
.theme-row button[aria-pressed="true"]{background:rgba(255,255,255,.14);color:var(--shell-ink)}
.main{min-width:0;padding-inline:clamp(16px,4vw,44px);padding-block:28px 60px}
.view{max-width:1080px;margin:0 auto;display:flex;flex-direction:column;gap:26px}
.topbar{display:none}

/* Mobile */
@media (max-width:860px){
  .app{grid-template-columns:1fr}
  .side{display:none}
  .topbar{display:flex;align-items:center;justify-content:space-between;background:var(--shell);color:var(--shell-ink);padding:12px 16px;position:sticky;top:env(safe-area-inset-top,0px);z-index:20}
  .topbar .logo{width:128px}
  .topbar .theme-row{width:132px}
  .tabbar{position:fixed;left:0;right:0;bottom:0;z-index:30;background:var(--shell);display:grid;grid-template-columns:repeat(6,1fr);padding:6px 4px calc(6px + env(safe-area-inset-bottom,0px))}
  .tabbar button{background:none;border:0;display:flex;flex-direction:column;align-items:center;gap:3px;color:var(--shell-muted);font-size:10.5px;font-weight:600;padding:6px 0;border-radius:8px}
  .tabbar button[aria-current="page"]{color:var(--accent)}
  .tabbar svg{width:22px;height:22px}
  .main{padding-block:20px 110px}
}
@media (min-width:861px){.tabbar{display:none}}

/* Components */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:20px}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid var(--line);background:var(--surface);padding:10px 16px;border-radius:8px;font-weight:650;font-size:14px;text-decoration:none;color:var(--ink)}
.btn:hover{border-color:var(--ink)}
.btn.primary{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.btn.primary:hover{opacity:.9}
.btn.accent{background:var(--accent);color:#1B1F27;border-color:var(--accent)}
.btn.small{padding:6px 11px;font-size:13px}
.btn:disabled{opacity:.45;cursor:not-allowed}
.row{display:flex;gap:12px;flex-wrap:wrap;align-items:center}
.pill{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:650;padding:3px 10px;border-radius:999px;background:var(--sunk);color:var(--muted);white-space:nowrap}
.pill.good{background:var(--good-soft);color:var(--good)}
.pill.bad{background:var(--bad-soft);color:var(--bad)}
.pill.warn{background:var(--accent-soft);color:var(--accent-ink)}
.seg{display:inline-flex;background:var(--sunk);padding:3px;border-radius:9px;gap:2px;flex-wrap:wrap}
.seg button{border:0;background:none;padding:7px 14px;border-radius:7px;font-weight:650;font-size:13.5px;color:var(--muted)}
.seg button[aria-pressed="true"]{background:var(--surface);color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.12)}
.bar{height:8px;background:var(--sunk);border-radius:99px;overflow:hidden}
.bar > i{display:block;height:100%;background:var(--ink);border-radius:99px;transition:width .5s}
.bar.accent > i{background:var(--accent)}
.hazard{height:6px;background:repeating-linear-gradient(-45deg,var(--accent) 0 10px,var(--ink) 10px 20px);border-radius:3px;opacity:.9}
.note{border-left:3px solid var(--accent);background:var(--accent-soft);padding:12px 14px;border-radius:0 8px 8px 0;font-size:14px}
.note b{font-family:var(--f-display);font-stretch:80%;text-transform:uppercase;letter-spacing:.06em;font-size:12.5px;display:block;margin-bottom:2px;color:var(--accent-ink)}

/* Hangar */
.hero{background:var(--shell);color:var(--shell-ink);border-radius:14px;padding:clamp(20px,3.5vw,34px);display:grid;grid-template-columns:1.3fr 1fr;gap:28px;position:relative;overflow:hidden}
.hero h1{color:var(--shell-ink)}
.hero p{color:var(--shell-muted);max-width:52ch;margin-top:10px}
.hero .row{margin-top:18px}
.hero .btn{background:transparent;color:var(--shell-ink);border-color:rgba(237,229,207,.3)}
.hero .btn.accent{background:var(--accent);color:#1B1F27;border-color:var(--accent)}
.runway{display:flex;flex-direction:column;gap:0;align-self:center}
.rw-step{display:grid;grid-template-columns:26px 1fr auto;gap:12px;align-items:center;padding:9px 0;position:relative}
.rw-step .dot{width:14px;height:14px;border-radius:50%;border:2px solid var(--shell-muted);margin:auto;background:var(--shell);position:relative;z-index:1}
.rw-step.done .dot{background:var(--accent);border-color:var(--accent)}
.rw-step:not(:last-child)::after{content:"";position:absolute;left:12px;top:50%;height:100%;border-left:2px dashed rgba(237,229,207,.22)}
.rw-step .t{font-weight:600;font-size:14px}
.rw-step .s{font-size:12px;color:var(--shell-muted)}
.rw-step .v{font-family:var(--f-mono);font-size:12px;color:var(--shell-muted)}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:16px}
.grid2{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}
.ready{display:flex;flex-direction:column;gap:12px}
.ready .top{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}
.ready .big{font-family:var(--f-display);font-stretch:80%;font-size:40px;font-weight:800;line-height:1}
.ready .big small{font-size:16px;font-weight:600;color:var(--muted);margin-left:2px}
.ready .meta{display:flex;justify-content:space-between;font-size:12.5px;color:var(--muted)}
.letter{font-family:var(--f-display);font-weight:800;font-size:13px;width:30px;height:30px;border-radius:7px;display:grid;place-items:center;background:var(--ink);color:var(--bg);flex:none}
.list{display:flex;flex-direction:column}
.list > *{padding:12px 0;border-top:1px solid var(--line)}
.list > *:first-child{border-top:0;padding-top:0}
.weak{display:flex;justify-content:space-between;align-items:center;gap:12px}
.sect-head{display:flex;justify-content:space-between;align-items:end;gap:12px;flex-wrap:wrap}

/* Learn */
.topics{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:12px}
.topic{text-align:left;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px;display:flex;flex-direction:column;gap:8px;transition:border-color .15s,transform .15s}
.topic:hover{border-color:var(--ink);transform:translateY(-1px)}
.topic .tag{font-family:var(--f-mono);font-size:11.5px;color:var(--muted)}
.topic h3{font-size:16px}
.topic p{font-size:13.5px;color:var(--muted)}
.topic .foot{display:flex;justify-content:space-between;align-items:center;margin-top:auto;padding-top:6px}
.check{width:20px;height:20px;border-radius:50%;border:2px solid var(--line);display:grid;place-items:center;flex:none}
.check.on{background:var(--good);border-color:var(--good);color:var(--surface)}
.check svg{width:12px;height:12px}
.lesson{display:grid;grid-template-columns:1fr 300px;gap:22px;align-items:start}
.lesson .body{display:flex;flex-direction:column;gap:18px;min-width:0}
.points{display:flex;flex-direction:column;gap:12px;margin:0;padding:0;list-style:none;counter-reset:p}
.points li{display:grid;grid-template-columns:32px 1fr;gap:12px;align-items:start;max-width:68ch}
.points li::before{counter-increment:p;content:counter(p);font-family:var(--f-mono);font-size:12px;font-weight:600;width:26px;height:26px;border-radius:6px;display:grid;place-items:center;background:var(--sunk);color:var(--muted);margin-top:1px}
.aside{display:flex;flex-direction:column;gap:14px;position:sticky;top:20px}
.back{background:none;border:0;padding:0;color:var(--muted);font-weight:600;display:inline-flex;gap:6px;align-items:center;font-size:14px}
.back:hover{color:var(--ink)}

/* Diagrams */
.diag{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:20px;align-items:start}
.stage{background:var(--sunk);border-radius:var(--r);padding:12px;display:flex;justify-content:center;overflow-x:auto}
.stage svg{max-width:100%;height:auto;display:block}
.readout{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.readout div{background:var(--sunk);border-radius:8px;padding:10px 12px}
.readout .v{font-family:var(--f-mono);font-size:18px;font-weight:600;font-variant-numeric:tabular-nums}
.phase{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}
.phase button{border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:8px 4px;font-size:12.5px;font-weight:650;color:var(--muted)}
.phase button.on{background:var(--ink);color:var(--bg);border-color:var(--ink)}
input[type=range]{width:100%;accent-color:var(--accent)}
.field{display:flex;flex-direction:column;gap:4px}
.field label{font-size:13px;font-weight:600;display:flex;justify-content:space-between}
.wb{width:100%;border-collapse:collapse;font-size:14px}
.wb th{font-family:var(--f-display);font-stretch:78%;text-transform:uppercase;letter-spacing:.06em;font-size:11.5px;color:var(--muted);text-align:right;padding:8px;border-bottom:1px solid var(--line);font-weight:700}
.wb th:first-child,.wb td:first-child{text-align:left}
.wb td{padding:6px 8px;border-bottom:1px solid var(--line);text-align:right;font-variant-numeric:tabular-nums;font-family:var(--f-mono);font-size:13.5px}
.wb td:first-child{font-family:var(--f-body);font-size:14px}
.wb tfoot td{font-weight:700;border-bottom:0;border-top:2px solid var(--ink)}
.wb input{width:74px;text-align:right;font-family:var(--f-mono);font-size:13.5px;padding:5px 6px;border:1px solid var(--line);border-radius:6px;background:var(--bg);color:var(--ink)}
.scroll{overflow-x:auto}
.gauge{position:relative;height:54px;margin-top:6px}
.gauge .track{position:absolute;left:0;right:0;top:20px;height:12px;background:var(--sunk);border-radius:6px}
.gauge .ok{position:absolute;top:20px;height:12px;background:var(--good-soft);border:1px solid var(--good);border-radius:4px}
.gauge .mk{position:absolute;top:8px;width:3px;height:36px;background:var(--ink);border-radius:2px;transition:left .3s;transform:translateX(-50%)}
.gauge .tick{position:absolute;top:38px;font-family:var(--f-mono);font-size:11px;color:var(--muted);transform:translateX(-50%)}

/* Quiz */
.qwrap{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:20px;align-items:start}
.qhead{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap}
.qtext{font-size:18px;font-weight:600;line-height:1.45;max-width:62ch}
.opts{display:flex;flex-direction:column;gap:10px}
.opt{display:grid;grid-template-columns:30px 1fr;gap:12px;align-items:center;text-align:left;background:var(--surface);border:1.5px solid var(--line);border-radius:10px;padding:12px 14px;font-size:15px}
.opt:hover:not(:disabled){border-color:var(--ink)}
.opt .k{font-family:var(--f-mono);font-weight:600;font-size:13px;width:28px;height:28px;border-radius:6px;display:grid;place-items:center;background:var(--sunk)}
.opt.sel{border-color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink)}
.opt.right{border-color:var(--good);background:var(--good-soft)}
.opt.right .k{background:var(--good);color:var(--surface)}
.opt.wrong{border-color:var(--bad);background:var(--bad-soft)}
.opt.wrong .k{background:var(--bad);color:var(--surface)}
.opt:disabled{cursor:default}
.explain{border-radius:10px;padding:14px 16px;background:var(--sunk);font-size:14.5px;display:flex;flex-direction:column;gap:6px}
.explain .ref{font-family:var(--f-mono);font-size:12px;color:var(--muted)}
.qmap{display:grid;grid-template-columns:repeat(auto-fill,minmax(32px,1fr));gap:5px}
.qmap span{height:30px;border-radius:6px;background:var(--sunk);display:grid;place-items:center;font-family:var(--f-mono);font-size:11px;color:var(--muted)}
.qmap span.cur{outline:2px solid var(--ink)}
.qmap span.a{background:var(--ink);color:var(--bg)}
.qmap span.r{background:var(--good);color:var(--surface)}
.qmap span.w{background:var(--bad);color:var(--surface)}
.score{font-family:var(--f-display);font-stretch:80%;font-weight:800;font-size:64px;line-height:1}
.setup{display:flex;flex-direction:column;gap:18px}
.setup .field > span{font-size:13px;font-weight:650}

/* Oral / practical */
.flip{perspective:1200px;min-height:260px}
.flip-in{position:relative;width:100%;min-height:260px;transition:transform .5s;transform-style:preserve-3d}
.flip.on .flip-in{transform:rotateY(180deg)}
.face{position:absolute;inset:0;backface-visibility:hidden;-webkit-backface-visibility:hidden;border-radius:14px;padding:26px;display:flex;flex-direction:column;gap:12px;border:1px solid var(--line);background:var(--surface);overflow:auto}
.face.back{transform:rotateY(180deg);background:var(--shell);color:var(--shell-ink);border-color:var(--shell)}
.face.back .label{color:var(--accent)}
.face .q{font-family:var(--f-display);font-stretch:90%;font-size:clamp(20px,2.6vw,26px);font-weight:700;line-height:1.25;text-wrap:balance}
.face .a{font-size:15.5px;line-height:1.6;max-width:62ch}
.face .hint{margin-top:auto;font-size:12.5px;color:var(--muted)}
.face.back .hint{color:var(--shell-muted)}
.proj{display:grid;grid-template-columns:24px 1fr auto;gap:12px;align-items:start;cursor:pointer}
.proj input{width:18px;height:18px;margin-top:3px;accent-color:var(--good)}
.proj .d{font-size:13px;color:var(--muted)}
.proj.done .t{text-decoration:line-through;text-decoration-color:var(--muted)}


/* System diagrams */
.stage.wide{justify-content:flex-start}
.stage.wide svg{width:100%;min-width:640px;height:auto}
.scroll > svg{width:100%;min-width:360px;height:auto;display:block}
.sysgrid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
@media (min-width:981px){.span2{grid-column:span 2}}
@media (max-width:980px){.sysgrid{grid-template-columns:1fr}}
.ctl{display:flex;flex-direction:column;gap:12px}
.gseq{margin:0;padding-left:18px;font-size:13px;color:var(--muted);display:flex;flex-direction:column;gap:3px}
.gseq li:last-child{color:var(--ink);font-weight:600}
.swipe{display:none;font-size:12.5px;margin-top:-8px}
@media (max-width:700px){.swipe{display:block}}
.sysgrid .readout{grid-template-columns:repeat(2,minmax(0,1fr))}
.sysgrid .readout .v{font-size:15px;overflow-wrap:anywhere}
.dl{font-family:var(--f-display);font-stretch:80%;font-size:11.5px;letter-spacing:.04em;fill:var(--muted);font-weight:600}
text.mono{font-family:var(--f-mono)}
.pb{stroke:var(--ink)} .pb:not([stroke-width]){stroke-width:2} .pb:not([fill]){fill:var(--surface)}
.part{cursor:pointer;outline:none}
.part:hover .pb,.part:focus-visible .pb,.part.sel .pb{stroke:var(--accent);stroke-width:3}
.ln{fill:none;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;transition:stroke .2s}
.lp{stroke:var(--press)} .lr{stroke:var(--ret)} .lt{stroke:var(--line)} .la{stroke:var(--air)} .lf{stroke:var(--c2)} .le{stroke:var(--line);stroke-width:3} .le.flow{stroke:var(--accent)}
.flow{stroke-dasharray:8 10;animation:dash .8s linear infinite}
.flow.rev{animation-direction:reverse}
@keyframes dash{to{stroke-dashoffset:-36}}
.tgl{display:inline-flex;align-items:center;gap:8px;border:1px solid var(--line);background:var(--surface);border-radius:8px;padding:7px 11px;font-size:13px;font-weight:650}
.tgl:hover{border-color:var(--ink)}
.tgl .sw{width:26px;height:15px;border-radius:99px;background:var(--sunk);position:relative;border:1px solid var(--line);flex:none}
.tgl .sw::after{content:"";position:absolute;left:2px;top:2px;width:9px;height:9px;border-radius:50%;background:var(--muted);transition:transform .15s}
.tgl[aria-pressed="true"] .sw{background:var(--accent);border-color:var(--accent)}
.tgl[aria-pressed="true"] .sw::after{transform:translateX(11px);background:#1B1F27}

/* ACS, logbook, account */
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.pill.acs{background:var(--accent-soft);color:var(--accent-ink);font-size:11.5px}
.ellist{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.ellist .el{display:grid;grid-template-columns:52px minmax(0,1fr) auto;gap:12px;align-items:center;padding:10px 0;border-top:1px solid var(--line);font-size:14px}
.ellist .el:first-child{border-top:0}
.ec{font-size:12px;font-weight:600;color:var(--muted)}
.et{min-width:0;overflow-wrap:anywhere}
.eq{border:1px solid var(--line);background:var(--surface);border-radius:999px;padding:4px 10px;font-size:12px;font-weight:650;font-family:var(--f-mono);white-space:nowrap;display:inline-flex;align-items:center;gap:6px}
.eq::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--line)}
.eq.dot-g::before{background:var(--good)} .eq.dot-w::before{background:var(--accent)}
.eq:hover{border-color:var(--ink)}
.skst{border:1.5px solid var(--line);background:var(--surface);border-radius:999px;padding:5px 12px;font-size:12.5px;font-weight:700;white-space:nowrap;min-width:92px}
.skst.st-p{border-color:var(--accent);background:var(--accent-soft);color:var(--accent-ink)}
.skst.st-v{border-color:var(--good);background:var(--good-soft);color:var(--good)}
.skst:hover{border-color:var(--ink)}
.acsbox{display:flex;flex-direction:column;gap:12px}
.formgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.formgrid .wide{grid-column:1/-1}
.field label.row{justify-content:flex-start}
.field label,.field > span{font-size:13px;font-weight:650}
.inp{font:inherit;font-size:14px;padding:9px 11px;border-radius:8px;border:1px solid var(--line);background:var(--bg);color:var(--ink);width:100%;max-width:100%}
.inp:focus{outline:2px solid var(--accent);outline-offset:1px}
textarea.inp{resize:vertical;line-height:1.5}
.skpick{display:flex;flex-direction:column;gap:2px;max-height:260px;overflow:auto;border:1px solid var(--line);border-radius:8px;padding:6px;background:var(--bg)}
.field .skopt,.skopt{display:grid;justify-content:stretch;grid-template-columns:20px 40px minmax(0,1fr);gap:8px;align-items:start;padding:6px;border-radius:6px;font-size:13.5px;font-weight:500;cursor:pointer}
.skopt:hover{background:var(--sunk)}
.skopt input{width:16px;height:16px;margin-top:2px;accent-color:var(--accent)}
.skopt .mono{font-size:12px;color:var(--muted);padding-top:1px}
.grid4{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.stat{display:flex;flex-direction:column;gap:6px;padding:16px}
.big2{font-size:24px;font-weight:600}
.logs{display:flex;flex-direction:column;gap:12px}
.logent{display:flex;flex-direction:column;gap:8px}
.lg-h{display:flex;justify-content:space-between;align-items:center;gap:10px;flex-wrap:wrap}
.lg-d{font-weight:600;margin-right:4px}
.lg-item{font-weight:650}
.lg-desc{max-width:72ch;white-space:pre-wrap}
.lg-meta{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:8px 18px;margin:0;font-size:13.5px}
.lg-meta dt{font-family:var(--f-display);font-stretch:78%;text-transform:uppercase;letter-spacing:.07em;font-size:11px;font-weight:700;color:var(--muted)}
.lg-meta dd{margin:2px 0 0;overflow-wrap:anywhere}
.lg-meta .pill{font-size:11px;margin:0 2px 2px 0}
.empty{text-align:left}
.subjs{display:flex;flex-direction:column;gap:10px}
.subj{padding:0}
.subj-h{width:100%;display:flex;justify-content:space-between;align-items:center;gap:12px;background:none;border:0;padding:14px 18px;text-align:left}
.subj .ellist{padding:0 18px 8px}
.subj-p{display:flex;align-items:center;gap:10px;flex:none}
.bar.mini{width:90px;height:6px}
.certlist{display:flex;flex-direction:column;gap:10px}
.cstep label.row{align-items:flex-start;flex-wrap:nowrap;cursor:pointer}
.cstep input[type=checkbox]{width:20px;height:20px;margin-top:2px;accent-color:var(--good);flex:none}
.signup{border:1.5px solid var(--accent);display:flex;flex-direction:column;gap:12px}
.acct-wrap{display:block}
.acct{display:flex;align-items:center;gap:10px;width:100%;background:rgba(255,255,255,.05);border:1px solid rgba(255,255,255,.08);border-radius:10px;padding:8px 10px;color:var(--shell-ink);text-align:left}
.acct:hover,.acct[aria-current="page"]{background:rgba(255,255,255,.1)}
.av{width:30px;height:30px;border-radius:50%;flex:none;object-fit:cover;display:grid;place-items:center;font-weight:700;font-size:13px}
.av-ph{background:var(--accent);color:#1B1F27}
.acct-t{display:flex;flex-direction:column;min-width:0}
.acct-n{font-weight:650;font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.acct-s{font-size:11.5px;color:var(--shell-muted)}
.acct-wrap.mini .acct{padding:4px;background:none;border:0;width:auto}
.acct-wrap.mini .acct-t{display:none}
.topbar{gap:10px}
.topbar .acct-wrap.mini{margin-left:auto}
.btn.danger{border-color:var(--bad);color:var(--bad)}
.btn.danger:hover{background:var(--bad);color:var(--surface)}
.linkbtn{background:none;border:0;padding:0;color:inherit;font-weight:700;text-decoration:underline}
.aktr{display:flex;flex-direction:column;gap:12px}
button.rw-step{background:none;border:0;color:inherit;text-align:left;width:100%;font:inherit;cursor:pointer;border-radius:8px}
button.rw-step:hover .t{text-decoration:underline}
.rw-step .t,.rw-step .s{display:block}
#toast{position:fixed;left:50%;bottom:calc(24px + env(safe-area-inset-bottom,0px));transform:translate(-50%,20px);background:var(--ink);color:var(--bg);padding:10px 16px;border-radius:10px;font-size:14px;font-weight:600;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:50;max-width:calc(100vw - 32px)}
#toast.on{opacity:1;transform:translate(-50%,0)}
@media (max-width:860px){ .tabbar{grid-template-columns:repeat(6,1fr)} .tabbar button{font-size:10px} #toast{bottom:calc(84px + env(safe-area-inset-bottom,0px))} }
@media (max-width:760px){ .formgrid{grid-template-columns:1fr} .grid4{grid-template-columns:repeat(2,minmax(0,1fr))} .ellist .el{grid-template-columns:40px minmax(0,1fr)} .ellist .el > :last-child{grid-column:2;justify-self:start} }

/* Feedback */
.fbgrid{align-items:start}
.rate{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.rate button{width:40px;height:36px;border-radius:8px;border:1.5px solid var(--line);background:var(--surface);font-weight:700;font-family:var(--f-mono)}
.rate button[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:#1B1F27}
.ctxbox{background:var(--sunk);border-radius:8px;padding:10px 12px}
.rq{display:grid;grid-template-columns:56px minmax(0,1fr);gap:14px;align-items:start}
.rq-b{display:flex;flex-direction:column;gap:6px;min-width:0}
.rq-b h3{overflow-wrap:anywhere}
.vote{display:flex;flex-direction:column;align-items:center;gap:2px;border:1.5px solid var(--line);background:var(--surface);border-radius:10px;padding:8px 0;font-weight:700}
.vote .vote-a{font-size:12px;color:var(--muted)}
.vote.on{border-color:var(--accent);background:var(--accent-soft);color:var(--accent-ink)}
.vote.on .vote-a{color:var(--accent-ink)}
.vote:disabled{opacity:.6;cursor:default}
.fbband{display:flex;justify-content:space-between;align-items:center;gap:16px;flex-wrap:wrap;border:1.5px dashed var(--accent)}
.rpt{font-size:13px;align-self:flex-start;margin-top:4px}
.tb-fb{display:none}
@media (max-width:860px){.tb-fb{display:grid;place-items:center;width:36px;height:36px;border-radius:8px;border:0;background:rgba(255,255,255,.08);color:var(--shell-ink);margin-left:auto}.tb-fb svg{width:20px;height:20px}.tb-fb[aria-current="page"]{color:var(--accent)}.topbar .acct-wrap.mini{margin-left:0}}
@media (max-width:980px){.lesson,.qwrap,.diag{grid-template-columns:1fr}.aside{position:static}}
@media (max-width:760px){.hero{grid-template-columns:1fr}.grid3{grid-template-columns:1fr}.grid2{grid-template-columns:1fr}.readout{grid-template-columns:repeat(2,1fr)}.qtext{font-size:17px}}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
/* ---------- Sign-in, paywall & loading screens ---------- */
[hidden]{display:none!important}
html,body{margin:0}
.gate{min-height:100vh;min-height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:18px;padding:32px 16px;background:var(--shell);color:var(--shell-ink)}
.gate-card{width:100%;max-width:420px;background:var(--surface);color:var(--ink);border-radius:14px;padding:30px 28px;display:flex;flex-direction:column;gap:14px;box-shadow:0 18px 50px rgba(0,0,0,.35);border-top:4px solid var(--accent)}
.gate-card h1{font-size:26px}
.gate-logo{width:190px;color:var(--shell);margin:0 0 6px}
.gform{display:flex;flex-direction:column;gap:12px}
.gform .field{display:flex;flex-direction:column;gap:6px}
.gform .field label{font-weight:650;font-size:13.5px}
.btn.wide{width:100%;padding:12px 16px;font-size:15px}
.g-msg{font-size:13.5px;min-height:1em;color:var(--muted)}
.g-msg:empty{display:none}
.g-msg.bad{color:var(--bad);font-weight:600}
.g-alt{font-size:14px;color:var(--muted);text-align:center}
.g-alt .linkbtn{color:var(--ink)}
.gate-foot{font-size:12.5px;color:var(--shell-muted);text-align:center}
.brk{overflow-wrap:anywhere}
.spin{width:34px;height:34px;border-radius:50%;border:3px solid var(--line);border-top-color:var(--accent);animation:spin .8s linear infinite;margin:12px auto}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.spin{animation-duration:2.4s}}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]) .gate-logo{color:var(--shell-ink)}}
:root[data-theme="dark"] .gate-logo{color:var(--shell-ink)}
