:root{
  --bg:#f6f7f9; --surface:#ffffff; --surface2:#eef1f5; --text:#1b2330; --muted:#4a5565; --border:#c9d1dc;
  --primary:#0b5cad; --primary-text:#ffffff; --link:#0b5cad; --focus:#8a3ffc;
  --ok-bg:#e3f4e8; --ok:#14602b; --warn-bg:#fff2d6; --warn:#7a4a00; --err-bg:#fde8e8; --err:#9b1c1c; --info-bg:#e6eefb; --info:#134a8c;
  --radius:10px; --sidebar:#16324f; --sidebar-text:#ffffff;
}
:root[data-theme="dark"]{
  --bg:#10151c; --surface:#18202b; --surface2:#222c3a; --text:#e8edf3; --muted:#b3bdca; --border:#3a475a;
  --primary:#7db7f5; --primary-text:#0a1522; --link:#8cc2ff; --focus:#c9a3ff;
  --ok-bg:#16301f; --ok:#8fe0a8; --warn-bg:#3a2d10; --warn:#f2c76b; --err-bg:#3d1a1a; --err:#ffb3b3; --info-bg:#172a45; --info:#a9cdfa;
  --sidebar:#0b1118; --sidebar-text:#e8edf3;
}
*{box-sizing:border-box}
html{font-size:100%}
body{margin:0;background:var(--bg);color:var(--text);font:1rem/1.6 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
a{color:var(--link)}
:focus-visible{outline:3px solid var(--focus);outline-offset:2px}
.skip{position:absolute;left:-999px;top:0;background:var(--surface);padding:.5rem 1rem;z-index:100}
.skip:focus{left:.5rem;top:.5rem}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
h1{font-size:1.75rem;line-height:1.25;margin:.5rem 0 1rem}
h2{font-size:1.3rem;margin:1.5rem 0 .6rem}
h3{font-size:1.1rem;margin:1rem 0 .4rem}
.shell{display:grid;grid-template-columns:260px 1fr;min-height:100vh}
.sidebar{background:var(--sidebar);color:var(--sidebar-text);padding:1rem;position:sticky;top:0;height:100vh;overflow:auto}
.sidebar ul{list-style:none;margin:1rem 0;padding:0}
.sidebar a{display:block;color:var(--sidebar-text);padding:.6rem .75rem;border-radius:8px;text-decoration:none}
.sidebar a:hover{background:rgba(255,255,255,.12)}
.sidebar a[aria-current="page"]{background:rgba(255,255,255,.22);font-weight:600}
.sidebar :focus-visible{outline-color:#fff}
.brand{display:flex;gap:.7rem;align-items:center}
.brand-mark{display:inline-grid;place-items:center;width:2.6rem;height:2.6rem;border-radius:10px;background:#fff;color:#16324f;font-weight:800;margin:0}
.brand-mark.big{width:3.4rem;height:3.4rem;background:var(--primary);color:var(--primary-text)}
.brand-text{display:flex;flex-direction:column;font-weight:600;line-height:1.2}
.brand-text small{font-weight:400;opacity:.9}
.edu-note{font-size:.85rem;color:var(--muted)}
.sidebar .edu-note{color:#d3dbe6}
.main-col{min-width:0;display:flex;flex-direction:column}
.topbar{display:flex;gap:.5rem;align-items:center;padding:.6rem 1.25rem;background:var(--surface);border-bottom:1px solid var(--border)}
.topbar .spacer{flex:1}
.who{color:var(--muted)}
main{padding:1.25rem;max-width:62rem;width:100%;margin:0 auto;flex:1}
.foot{padding:1rem 1.25rem;color:var(--muted);font-size:.85rem;border-top:1px solid var(--border)}
.menu-btn{display:none}
.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:1rem 1.25rem;margin:0 0 1rem}
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(15rem,1fr));gap:1rem;margin-bottom:1rem}
.cards .card{margin:0}
.stat{display:flex;flex-direction:column}
.stat .num{font-size:2rem;font-weight:700}
.stat small{font-size:1rem;color:var(--muted)}
.row{display:flex;gap:.75rem;align-items:center;flex-wrap:wrap}
.grow{flex:1;min-width:12rem}
.plain{list-style:none;padding:0;margin:0}
.plain li{padding:.45rem 0;border-bottom:1px solid var(--border)}
.muted{color:var(--muted)}
.inline{display:inline}
.pct{min-width:3.5rem;text-align:right;font-variant-numeric:tabular-nums}
.big{font-size:2rem;font-weight:700}
.btn{display:inline-block;padding:.55rem 1rem;border-radius:8px;border:1px solid var(--primary);background:var(--surface);color:var(--link);font:inherit;font-weight:600;cursor:pointer;text-decoration:none}
.btn.primary{background:var(--primary);color:var(--primary-text)}
.btn.ghost{border-color:transparent;background:transparent}
.btn.small{padding:.2rem .6rem;font-size:.9rem}
.btn:hover{filter:brightness(.95)}
input,select,textarea{font:inherit;color:var(--text);background:var(--surface);border:1px solid var(--muted);border-radius:8px;padding:.5rem .6rem;max-width:100%}
textarea{width:100%}
label{font-weight:500}
.stack{display:flex;flex-direction:column;gap:.5rem}
.stack .btn{margin-top:.75rem}
.check{display:flex;gap:.5rem;align-items:flex-start}
.badge{display:inline-block;padding:.1rem .55rem;border-radius:999px;font-size:.8rem;font-weight:600;background:var(--surface2);color:var(--text);border:1px solid var(--border)}
.badge.ok{background:var(--ok-bg);color:var(--ok)}.badge.warn{background:var(--warn-bg);color:var(--warn)}
.alert{padding:.75rem 1rem;border-radius:8px;margin:0 0 1rem;border:1px solid var(--border)}
.alert.ok{background:var(--ok-bg);color:var(--ok)}.alert.warn{background:var(--warn-bg);color:var(--warn)}.alert.err{background:var(--err-bg);color:var(--err)}
progress{width:10rem;height:.9rem;accent-color:var(--primary)}
meter{width:10rem;height:.9rem}
.progress-card{display:flex;gap:.75rem;align-items:center;flex-wrap:wrap;position:sticky;top:0;z-index:5}
.progress-card progress{flex:0 0 12rem}
table{border-collapse:collapse;width:100%;margin:1rem 0;background:var(--surface)}
caption{text-align:left;font-weight:600;padding:.4rem 0}
th,td{border:1px solid var(--border);padding:.5rem .7rem;text-align:left;vertical-align:top}
th{background:var(--surface2)}
.lesson section{margin:1.25rem 0}
.lesson-list{list-style:none;padding:0}
.module.disabled{opacity:.9}
.level{color:var(--muted);text-transform:uppercase;font-size:.9rem;letter-spacing:.04em}
.item fieldset{border:0;margin:0;padding:0}
.item legend{font-weight:600;padding:0;margin-bottom:.6rem}
.opt{padding:.35rem 0;display:flex;gap:.6rem;align-items:flex-start}
.opt.row{align-items:center}
.opt input[type=radio],.opt input[type=checkbox]{margin-top:.35rem;width:1.1rem;height:1.1rem}
.feedback{margin-top:1rem}
.fb{border-left:5px solid var(--border);padding:.75rem 1rem;border-radius:6px;background:var(--surface2)}
.fb.ok{border-color:var(--ok);background:var(--ok-bg);color:var(--text)}
.fb.err{border-color:var(--err);background:var(--err-bg);color:var(--text)}
.fb.info{border-color:var(--info);background:var(--info-bg);color:var(--text)}
.fb-list{padding-left:1.1rem}
.fb-list .good{color:var(--text)}
.fb-list .good strong{color:var(--ok)}.fb-list .bad strong{color:var(--err)}
.why{color:var(--muted)}
.explain{margin-top:.75rem}
.hint summary{cursor:pointer;color:var(--link)}
.gloss{font:inherit;color:var(--link);background:none;border:0;border-bottom:2px dotted var(--link);padding:0;cursor:help}
.gloss-pop{position:fixed;right:1rem;bottom:1rem;max-width:26rem;background:var(--surface);border:2px solid var(--primary);border-radius:var(--radius);padding:1rem;box-shadow:0 8px 24px rgba(0,0,0,.25);z-index:50}
.gloss-pop[hidden]{display:none}
.cite{white-space:nowrap}
details{margin:.75rem 0;border:1px solid var(--border);border-radius:8px;padding:.5rem .9rem;background:var(--surface)}
summary{cursor:pointer;font-weight:600}
blockquote{margin:1rem 0;padding:.5rem 1rem;border-left:4px solid var(--primary);background:var(--surface2)}
code{background:var(--surface2);padding:.1rem .3rem;border-radius:4px}
.pager{display:flex;justify-content:space-between;gap:1rem;flex-wrap:wrap;margin:2rem 0}
.refs{padding-left:1.1rem}.refs.big{list-style:none;padding:0}
.glossary dt{font-weight:700;margin-top:1rem}.glossary dd{margin:0 0 0 1rem}
.auth-wrap{display:grid;place-items:center;min-height:100vh;padding:1rem}
.auth-card{width:100%;max-width:28rem;background:var(--surface);border:1px solid var(--border);border-radius:14px;padding:1.5rem}
@media (max-width:860px){
  .shell{grid-template-columns:1fr}
  .sidebar{position:fixed;inset:0 25% 0 0;max-width:20rem;z-index:40;height:100vh;transform:translateX(-105%);transition:transform .2s}
  .sidebar.open{transform:none}
  .menu-btn{display:inline-block}
  .progress-card{position:static}
}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
@media print{.sidebar,.topbar,.foot,.btn,.gloss-pop,.noprint{display:none!important}.shell{display:block}body{background:#fff;color:#000}}
.subnav{display:flex;flex-wrap:wrap;gap:.5rem;margin:1rem 0;position:sticky;top:0;background:var(--bg);padding:.5rem 0;z-index:4}
.subnav a{padding:.3rem .7rem;border:1px solid var(--border);border-radius:999px;text-decoration:none;background:var(--surface)}
.tablewrap{overflow-x:auto}
.tablewrap input,.tablewrap select{width:100%;min-width:7rem}
.rub .levels{margin:.5rem 0}
.warnbox legend,.rub legend{font-weight:700}
fieldset.card{margin-bottom:1rem}
.badge.err{background:var(--err-bg);color:var(--err)}
.psec h3{margin-top:0}
.findings{padding-left:1.1rem}
