
:root {
  --bg: #f2f3f0; --card: #ffffff; --panel: #f7f8f5;
  --ink: #1a1f1c; --muted: #6a726d;
  --accent: #1f6f4f; --accent-2: #2a8a63; --accent-soft: #e6f1ea; --accent-ink: #185a40;
  --ok: #2f7d4f; --ok-soft: #e4f2e9;
  --err: #b5452f; --err-soft: #f9e8e4;
  --warn: #9c6410; --warn-soft: #f7efdd;
  --info: #2f6f8f; --info-soft: #e5eff5;
  --line: #e2e5e0; --line2: #ebeeea; --th: #f7f8f5;
  --lime: #6b8e23;
  --on-accent: #ffffff; 
  --btn-ink: var(--on-accent);
  --shadow: 0 1px 2px rgba(26, 31, 28, .05), 0 6px 16px rgba(26, 31, 28, .06);
  --focus: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent);
  --overlay: rgba(26, 31, 28, .45);
  --radius: 12px; --radius-sm: 12px;
  color-scheme: light;
}
html[data-theme="dark"] {
    --bg: #121614; --card: #1a201d; --panel: #161b18;
    --ink: #e7eae7; --muted: #9ba39e;
    --accent: #5fc596; --accent-2: #86d6b0; --accent-soft: #1d3a2d; --accent-ink: #b4ead0;
    --ok: #7dcf9a; --ok-soft: #17301f;
    --err: #ef9a88; --err-soft: #3b1e19;
    --warn: #e6b866; --warn-soft: #3a2d14;
    --info: #86c1dc; --info-soft: #14303b;
    --line: #2a322d; --line2: #222925; --th: #161b18;
    --lime: #b5d56a;
    --on-accent: #0e2a1e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 16px rgba(0, 0, 0, .3);
    --overlay: rgba(0, 0, 0, .6);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"], html:not([data-theme]) {
    --bg: #121614; --card: #1a201d; --panel: #161b18;
    --ink: #e7eae7; --muted: #9ba39e;
    --accent: #5fc596; --accent-2: #86d6b0; --accent-soft: #1d3a2d; --accent-ink: #b4ead0;
    --ok: #7dcf9a; --ok-soft: #17301f;
    --err: #ef9a88; --err-soft: #3b1e19;
    --warn: #e6b866; --warn-soft: #3a2d14;
    --info: #86c1dc; --info-soft: #14303b;
    --line: #2a322d; --line2: #222925; --th: #161b18;
    --lime: #b5d56a;
    --on-accent: #0e2a1e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 6px 16px rgba(0, 0, 0, .3);
    --overlay: rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:focus-visible { outline: none; box-shadow: var(--focus); }
.side-controls { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.side-controls .seg {
  display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
}
.side-controls .seg button {
  background: var(--card); color: var(--muted); border: 0; border-radius: 0; min-height: 36px;
  padding: 0 10px; font-size: .8rem; font-weight: 600; line-height: 1;
}
.side-controls .seg button.active { background: var(--accent-soft); color: var(--accent-ink); }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); line-height: 1.45;
  font: 16px/1.45 var(--font-body, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif);
}
h1, h2, h3 { text-wrap: balance; line-height: 1.25; }
h1, h2, h3, .brand, .topbar b, .stat .val, .tab { font-family: var(--font-head, inherit); }
.brand span { font-family: var(--font-body, system-ui, sans-serif); }
p { text-wrap: pretty; }
.ic { vertical-align: -3px; flex-shrink: 0; }
.brand .ic { vertical-align: -4px; margin-right: 2px; }
.banner .ic { margin-top: 3px; }
h2 .ic { vertical-align: -4px; }
main a:not(.btn) { color: var(--accent-ink); text-decoration: none; }
main a:not(.btn):hover { text-decoration: underline; text-underline-offset: 3px; }
main ol li, main ul li { margin: 4px 0; }
.layout { display: flex; min-height: 100vh; }
.layout > aside {
  width: 232px; flex-shrink: 0; background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px; padding: 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { font-weight: 700; font-size: 1rem; padding: 6px 10px 4px; color: var(--ink); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brand .ic { color: var(--accent-alt-ink, var(--on-accent)); background: var(--accent-alt, var(--accent)); border-radius: 12px; padding: 6px; width: 32px; height: 32px; box-sizing: border-box; margin: 0; }
.brand span { flex-basis: 100%; font-weight: 400; font-size: .8rem; color: var(--muted); }
.brand .brand-row { flex-basis: auto; font: inherit; color: inherit; display: inline-flex; align-items: center; gap: 8px; }
.sec-label {
  font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; color: var(--muted);
  padding: 12px 10px 4px; font-weight: 700;
}
.prog-label { text-transform: none; letter-spacing: 0; font-size: .8rem; color: var(--ink); display: flex; gap: 6px; align-items: flex-start;
  margin: 10px 6px 2px; padding: 6px 8px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 12px 12px 0; line-height: 1.25; }
.prog-label svg { flex: 0 0 auto; color: var(--accent); margin-top: 1px; }
nav.side { display: flex; flex-direction: column; gap: 2px; }
.mod-item {
  border: none; background: transparent; border-radius: 12px; padding: 8px 12px; font-size: .95rem; min-height: 44px;
  display: flex; gap: 10px; align-items: center; width: 100%; text-align: left; cursor: pointer; color: var(--ink); font-weight: 500;
}
.mod-item:hover { background: var(--panel); }
.mod-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; box-shadow: inset 3px 0 var(--accent-alt, transparent); }
.mod-item .mod-name { flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; }
.mod-item .st { font-size: .74rem; flex-shrink: 0; }
.mod-sub {
  margin-left: 16px; border: none; border-left: 2px solid var(--line); border-radius: 0 12px 12px 0;
  padding: 6px 10px 6px 12px; font-size: .85rem; display: flex; gap: 8px; align-items: center;
  width: calc(100% - 16px); text-align: left; cursor: pointer; color: var(--ink); background: transparent;
}
.mod-sub:hover { background: var(--panel); }
.mod-sub { min-height: 40px; border-radius: 0 12px 12px 0; }
.mod-sub.active { background: var(--accent); border-left-color: var(--accent); color: var(--btn-ink); font-weight: 600; }
.mod-sub .mod-name { flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.25; }
.side-bottom {
  margin-top: auto; display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid var(--line); padding-top: 12px; font-size: .82rem; color: var(--muted); padding-inline: 10px;
}
.side-bottom .who { color: var(--ink); font-weight: 600; font-size: .9rem; }
.side-bottom a { color: var(--accent); text-decoration: none; }
.topbar {
  display: none; align-items: center; gap: 8px; height: 56px; padding: 0 8px 0 4px;
  border-bottom: 1px solid var(--line); background: var(--card); position: sticky; top: 0; z-index: 20;
  box-shadow: inset 0 -3px var(--accent-alt, transparent);
}
.topbar b { color: var(--ink); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar b[data-letter]::before { content: attr(data-letter); width: 32px; height: 32px; border-radius: 12px; background: var(--accent-alt, var(--accent)); color: var(--accent-alt-ink, var(--on-accent)); font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.topbar button {
  border: 0; background: transparent; color: var(--ink); width: 44px; height: 44px; min-height: 0; padding: 0;
  border-radius: 12px; font-size: 1.25rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.topbar button:hover { background: var(--panel); }
.content { flex: 1; min-width: 0; }
.tabbar { display: none; position: fixed; inset: auto 0 0; z-index: 45; background: var(--card); border-top: 1px solid var(--line); padding: 4px 4px env(safe-area-inset-bottom); }
.tab, .tab:hover { flex: 1; min-width: 0; min-height: 56px; padding: 6px 0; border: 0; background: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: .68rem; font-weight: 600; }
.tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab svg { margin: 0; padding: 2px 16px; box-sizing: content-box; border-radius: 12px; }
.tab.active { color: var(--accent-ink); }
.tab.active svg { background: var(--accent-soft); box-shadow: inset 0 -2px var(--accent-alt, transparent); }
main { max-width: 1040px; margin: 0 auto; padding: 16px 16px 70px; }
@media (min-width: 700px) { main { padding: 24px 32px 70px; } }
@media (max-width: 860px) {
  .layout > aside {
    position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-105%);
    transition: transform .2s; box-shadow: var(--shadow); width: 280px;
  }
  .layout.side-open > aside { transform: none; }
  .layout.side-open::after { content: ""; position: fixed; inset: 0; z-index: 30; background: var(--overlay); }
  .topbar { display: flex; }
  .has-tabbar .tabbar { display: flex; }
  .has-tabbar #burger { display: none; }
  .has-tabbar main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .has-tabbar .offline-pill, .has-tabbar .toast { bottom: calc(78px + env(safe-area-inset-bottom)); }
}
header.top {
  background: var(--panel); color: var(--ink); border-bottom: 1px solid var(--line);
  padding: 12px 18px; display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 5;
}
header.top .logo { font-weight: 800; letter-spacing: .2px; white-space: nowrap; color: var(--accent); }
header.top .logo small { color: var(--muted); font-weight: 400; }
header.top .who { margin-left: auto; font-size: .84rem; text-align: right; color: var(--muted); }
header.top .who div:first-child { color: var(--ink); font-weight: 600; }
header.top a { color: var(--accent); text-decoration: none; }
header.top .nav a { font-size: .9rem; }
header.top ~ main, body > main { max-width: 1020px; margin: 0 auto; padding: 20px 18px 70px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--card-pad, 16px); margin-bottom: 16px;
}
.card.hero, .login-box .card { box-shadow: inset 0 4px var(--accent-alt, transparent), var(--shadow); }
.card h2 { margin: 0 0 10px; font-size: 1.125rem; line-height: 1.3; }
.card h3 { margin: 16px 0 8px; font-size: 1rem; }
.grid { display: grid; gap: 12px; }
@media (min-width: 720px) { .grid.cols2 { grid-template-columns: 1fr 1fr; } .grid.cols4 { grid-template-columns: repeat(4, 1fr); } }
.muted { color: var(--muted); font-size: .875rem; }
.chip {
  display: inline-block; padding: 2px 10px; border-radius: 12px; font-size: .75rem; font-weight: 600;
  background: var(--panel); border: 1px solid var(--line); color: var(--muted); overflow-wrap: anywhere;
}
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: .8rem; font-weight: 600; white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--err-soft); color: var(--err); }
.badge.neutral { background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
.badge.info { background: var(--info-soft); color: var(--info); }
button, .btn {
  background: var(--accent); color: var(--btn-ink); border: 1px solid var(--accent); border-radius: var(--btn-radius, 12px);
  min-height: 44px; padding: 0 var(--btn-pad, 16px); font-size: var(--btn-size, .95rem); font-weight: var(--btn-weight, 600); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-family: var(--btn-font, inherit); line-height: 1.25; text-align: center;
}
button:hover, .btn:hover { background: var(--accent-2); border-color: var(--accent-2); }
button.secondary, .btn.secondary { background: var(--card); color: var(--ink); border-color: var(--line); }
button.secondary:hover, .btn.secondary:hover { background: var(--panel); border-color: var(--line); }
button.ghost, .btn.ghost { background: transparent; color: var(--accent-ink); border-color: transparent; }
button.ghost:hover, .btn.ghost:hover { background: var(--panel); border-color: transparent; }
button.danger { background: transparent; color: var(--err); border-color: var(--err); }
button.danger:hover { background: var(--err-soft); border-color: var(--err); }
button:disabled { opacity: .5; cursor: not-allowed; }
.seg button, .facet button, .toc button.toc-link, .lang-chip, .prog-seg button, table.data button, .test-bar button, .q button.flag,
.card .h-row button, .review-line button { min-height: 0; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 1rem; background: var(--card); color: var(--ink); font-family: inherit;
}
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--accent); margin: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
input:disabled, select:disabled { background: var(--panel); color: var(--muted); border-color: var(--line2); }
label { display: block; margin: 10px 0 6px; font-size: .875rem; font-weight: 600; color: var(--ink); }
.tablewrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9375rem; }
table.data th, table.data td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line2); }
table.data th { background: var(--panel); color: var(--muted); font-weight: 600; font-size: .8rem; border-bottom-color: var(--line); }
table.data tbody tr:hover { background: var(--panel); }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover { background: var(--accent-soft); }
table.data tr.sel td { background: var(--accent-soft); }
table.data td input[type="checkbox"], table.data th input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.progressbar { height: 8px; border-radius: 999px; background: var(--line2); overflow: hidden; }
.progressbar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .3s; }
.tile { text-align: center; padding: 18px 8px; }
.tile .num { font-size: 1.5rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.tile .delta { font-size: .76rem; margin-top: 2px; }
.tile .delta.up { color: var(--ok); }
.tile .delta.down { color: var(--warn); }
.tile.alert .num { color: var(--err); }
.banner {
  background: var(--accent-soft); color: var(--accent-ink); border: 0;
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; font-size: .9rem; line-height: 1.45;
  display: flex; gap: 10px; align-items: flex-start;
}
.banner.reminder { background: var(--warn-soft); color: var(--warn); }
.banner.error, .banner.bad { background: var(--err-soft); color: var(--err); }
.blk { margin: 14px 0; }
.blk h4.sub { margin: 14px 0 6px; font-size: 1.375rem; line-height: 1.25; letter-spacing: -.005em; }
.blk p + p { margin-top: 8px; }
.blk .callout { border-left: 4px solid; border-radius: var(--radius); padding: 12px 14px; font-size: .95rem; color: var(--ink); }
.blk .callout.important { border-color: var(--warn); background: var(--warn-soft); }
.blk .callout.forbidden { border-color: var(--err); background: var(--err-soft); }
.blk .callout.tip { border-color: var(--info); background: var(--info-soft); }
.blk .callout.example { border-color: var(--ok); background: var(--ok-soft); }
.blk .callout b.t { display: block; margin-bottom: 4px; }
.blk .callout.important b.t { color: var(--warn); }
.blk .callout.forbidden b.t { color: var(--err); }
.blk .callout.tip b.t { color: var(--info); }
.blk .callout.example b.t { color: var(--ok); }
.flashcards { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.flashcard { display: flex; flex-direction: column; justify-content: center; min-height: 96px; padding: 12px; text-align: left;
  background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--radius); font-size: .95rem; line-height: 1.35; cursor: pointer; }
.flashcard:hover { border-color: var(--accent); }
.flashcard .fc-term { font-weight: 700; }
.flashcard .fc-term::after { content: " ↻"; opacity: .55; font-weight: 400; }
.flashcard .fc-def { display: none; color: var(--ink); }
.flashcard.flipped { background: var(--accent-soft); border-color: var(--accent); }
.flashcard.flipped .fc-term { display: none; }
.flashcard.flipped .fc-def { display: block; }
.blk.accordion details { border: 1px solid var(--line); border-radius: 12px; padding: 0 14px; margin: 6px 0; background: var(--card); }
.blk.accordion details:hover { background: var(--panel); }
.blk.accordion summary { cursor: pointer; padding: 12px 0; min-height: 48px; box-sizing: border-box; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 10px; }
.blk.accordion summary::-webkit-details-marker { display: none; }
.blk.accordion summary::before { content: "▶"; font-size: .7rem; color: var(--muted); transition: transform .15s; }
.blk.accordion details[open] summary::before { transform: rotate(90deg); }
.blk.accordion details p { margin: 0 0 12px; }
.blk.tablewrap { border: 1px solid var(--line); border-radius: var(--radius); }
.blk table { width: 100%; border-collapse: collapse; font-size: .9375rem; min-width: 0; }
.blk table th, .blk table td { border: 0; border-bottom: 1px solid var(--line2); padding: 10px 12px; text-align: left; }
.blk table th { background: var(--panel); font-weight: 600; border-bottom-color: var(--line); }
.blk table tr:last-child td { border-bottom: 0; }
.blk ol.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; }
.blk ol.steps li { counter-increment: s; margin: 0; padding: 4px 0 16px 44px; position: relative; min-height: 40px; }
.blk ol.steps li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 32px; height: 32px;
  background: var(--accent); color: var(--on-accent);
  border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.blk ol.steps li:not(:last-child)::after { content: ""; position: absolute; left: 15px; top: 36px; bottom: 4px; width: 2px; background: var(--line); }
figure.media { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; background: var(--card); }
figure.media img { display: block; max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 0 auto; }
figure.media figcaption { margin-top: 8px; font-size: .875rem; color: var(--muted); text-align: left; }
figure.media.audio b.t { display: block; margin-bottom: 8px; color: var(--accent-ink); }
figure.media.audio audio { width: 100%; }
figure.media.audio figcaption { text-align: left; }
figure.media.video b.t { display: block; margin-bottom: 8px; color: var(--accent-ink); }
figure.media.video video { display: block; width: 100%; max-height: 70vh; background: #000; border-radius: 12px; }
figure.media.video figcaption { text-align: left; }
.yt-lite { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; cursor: pointer; }
.yt-lite img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .85; }
.yt-play { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; }
.yt-play svg { width: 64px; height: 64px; padding: 14px; border-radius: 50%; background: rgba(0,0,0,.55); }
.yt-lite:hover .yt-play svg, .yt-lite:focus-visible .yt-play svg { background: var(--accent); }
.vsum { margin: 10px 0 0; padding-left: 22px; font-size: .95rem; }
.vsum li { margin: 4px 0; }
figure.media.video .narration { margin-top: 10px; border: 0; padding: 0; background: transparent; }
.yt-frame { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; background: #000; }
.yt-note { font-size: .8rem; margin-top: 6px; }
.lang-chips { display: flex; gap: 6px; margin-bottom: 8px; }
.lang-chip {
  padding: 4px 14px; font-size: .8rem; border-radius: 12px; background: var(--card);
  color: var(--muted); border: 1.5px solid var(--line); font-weight: 600;
}
.lang-chip.active { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
.dialog { border: 0; border-radius: var(--radius); padding: 0; background: transparent; }
.dialog b.t { display: block; margin-bottom: 10px; color: var(--accent-ink); }
.dialog .line { display: flex; flex-direction: column; margin: 8px 0; max-width: 85%; }
.dialog .line.b { margin-left: auto; align-items: flex-end; }
.dialog .who { font-size: .72rem; color: var(--muted); margin: 0 6px 2px; }
.dialog .bubble {
  padding: 10px 14px; border-radius: 12px; font-size: .95rem;
  background: var(--card); border: 1px solid var(--line);
}
.dialog .line.a .bubble { border-bottom-left-radius: 4px; }
.dialog .line.b .bubble { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--ink); }
.dialog .line.b .bubble { border-bottom-right-radius: 4px; }
.bank-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.course-card {
  padding: 0; overflow: hidden; display: flex; flex-direction: column;
  transition: transform .15s ease, box-shadow .15s ease;
}
.course-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(16, 40, 28, .12); }
.course-cover {
  aspect-ratio: 16 / 7; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-ink) 100%);
  display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, .85);
}
.course-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.course-cover .ver {
  position: absolute; top: 10px; right: 10px; background: rgba(10, 25, 18, .55);
  color: #fff; font-size: .72rem; font-weight: 700; padding: 2px 10px; border-radius: 12px;
  backdrop-filter: blur(4px);
}
.course-cover .mand {
  position: absolute; top: 10px; left: 10px; background: rgba(10, 25, 18, .55);
  color: #d9f99d; font-size: .72rem; font-weight: 700; padding: 2px 10px; border-radius: 12px;
  backdrop-filter: blur(4px);
}
.course-cover .mand.off { left: auto; right: 10px; top: 40px; background: rgba(185, 28, 28, .8); color: #fff; }
.course-card.off { opacity: .8; }
.course-card.off .course-cover { filter: grayscale(1); }
.course-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.course-body h2 { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.course-desc {
  color: var(--muted); font-size: .87rem; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.meta-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 12px;
  font-size: .76rem; font-weight: 600; background: var(--line2); color: var(--muted);
}
.meta-chip .ic { vertical-align: 0; }
.meta-chip.ok { background: var(--ok-soft); color: var(--ok); }
.meta-chip.warn { background: var(--warn-soft); color: var(--warn); }
.meta-chip.accent { background: var(--accent-soft); color: var(--accent-ink); }
.course-foot {
  margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line2);
  display: flex; gap: 8px; align-items: center;
}
.course-foot .muted { flex: 1; font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-lesson { border-left: 3px solid var(--accent); }
.sb-q { border: 1px dashed var(--line); border-radius: 12px; padding: 10px 14px; margin: 8px 0; font-size: .9rem; }
.sb-q .ans { color: var(--ok); font-weight: 600; }
.sb-q .fail-hot { color: var(--err); font-weight: 700; }
.q { margin: 16px 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.q .opts label {
  display: flex; gap: 10px; align-items: center; margin: 6px 0; padding: 10px 12px; min-height: 44px;
  border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: 1rem; color: var(--ink); font-weight: 400;
}
.q .opts label:hover { border-color: var(--accent); }
.q .opts label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.q .opts input[type="radio"], .q .opts input[type="checkbox"] { width: 20px; flex: none; }
.q .opts input[type="number"] { width: 100%; max-width: 240px; min-height: 44px; font-size: 1.1rem; }
.q.correct { border-color: var(--ok); background: var(--ok-soft); }
.q.wrong { border-color: var(--err); background: var(--err-soft); }
.q .verdict { font-weight: 700; margin-top: 8px; }
.q.flagged { border-color: var(--warn); }
.q .q-photo { display: block; width: 100%; max-width: 560px; margin: 10px 0 0; border-radius: 12px; border: 1px solid var(--line); }
.q button.flag { margin-top: 8px; padding: 4px 10px; font-size: .8rem; border-radius: 12px; }
.q.flagged button.flag { color: var(--warn); border-color: var(--warn); }
.test-bar { position: sticky; top: 0; z-index: 5; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 12px; margin: 0 0 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; font-size: .875rem; color: var(--muted); }
.test-bar .spacer { flex: 1; }
.test-bar .timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
.test-bar .timer.warn { color: var(--err); }
.test-bar button { padding: 4px 10px; font-size: .8rem; border-radius: 12px; }
.crit { color: var(--err); font-size: .72rem; font-weight: 700; letter-spacing: .06em; }
.marks { display: flex; gap: 8px; }
.marks button {
  flex: 1; padding: 13px 4px; font-size: .88rem; background: var(--card);
  color: var(--ink); border: 1.5px solid var(--line); font-weight: 600;
}
.marks button.sel-yes { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.marks button.sel-partial { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.marks button.sel-no { border-color: var(--err); background: var(--err-soft); color: var(--err); }
.offline-pill {
  position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%);
  background: var(--warn-soft); color: var(--warn); padding: 6px 12px; border-radius: 12px;
  font-size: .8rem; font-weight: 600; box-shadow: var(--shadow); z-index: 50; display: none;
}
body.offline .offline-pill { display: block; }
.seg.seg-lang button { min-height: 44px; min-width: 44px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.toolbar .spacer { flex: 1; }
dialog {
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 16px; max-width: 520px; width: 92vw; background: var(--card); color: var(--ink);
}
@media (max-width: 699px) { dialog { width: 100vw; max-width: none; margin: auto 0 0; border-radius: 12px 12px 0 0; max-height: 85vh; overflow: auto; } }
dialog::backdrop { background: var(--overlay); }
.lesson-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; gap: 10px; }
:root { --wide: 0; }
@media (min-width: 700px) { :root { --wide: 1; } }
.hero { border-color: var(--line); background: var(--card); }
.hero .eyebrow { font-size: .8rem; color: var(--muted); font-weight: 400; }
.hero h2 { margin: 2px 0 6px; font-size: 1.125rem; line-height: 1.3; }
.hero-cta { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; margin: 14px 0 0; }
.hero .btn, .course-row .btn { min-height: 44px; display: inline-flex; align-items: center; }
.hero-cta .btn { min-height: 48px; flex: 1 1 100%; }
@media (min-width: 700px) { .hero-cta .btn { flex: 0 0 auto; } }
details.hint summary, .hero-lessons-box summary { cursor: pointer; list-style: none; display: flex; gap: 8px; align-items: center; color: var(--accent-ink); font-weight: 600; }
details.hint summary::-webkit-details-marker, .hero-lessons-box summary::-webkit-details-marker { display: none; }
details.hint[open] summary .tw, .hero-lessons-box[open] summary .tw { transform: rotate(90deg); }
.hero-lessons-box { margin: 10px 0 0; }
.hero-lessons-box summary { font-size: .88rem; padding: 8px 0; min-height: 40px; }
.hero-lessons li a { color: var(--ink); flex: 1; }
.hero-lessons li.done { color: var(--muted); }
.hero-lessons li.done a { color: var(--muted); }
.hero-lessons li.cur { background: var(--accent-soft); border-radius: var(--radius-sm); padding-inline: 8px; margin-inline: -8px; }
.hero-lessons li.cur a { color: var(--accent-ink); font-weight: 700; }
.hero-lessons .n { color: var(--muted); font-variant-numeric: tabular-nums; width: 24px; height: 24px; flex: none; border: 1px solid var(--line); border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; align-self: center; }
.hero-lessons li.cur .n { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.hero-lessons li.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.hero-lessons .ok { color: var(--ok); font-size: .85rem; }
.hero-lessons, .due-list, .results { list-style: none; margin: 0; padding: 0; }
.hero-lessons li, .due-list li, .results li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px solid var(--line2); font-size: .92rem; }
.hero-lessons li:last-child, .due-list li:last-child, .results li:last-child { border-bottom: 0; }
.hero-lessons li { gap: 12px; align-items: center; flex-wrap: nowrap; min-height: 44px; }
.due-list .spacer { flex: 1; }
.results .pct { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 3.2em; text-align: right; }
.lpath-box { margin: 8px 0 0; }
.lp-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lp-title { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.lp-count { margin-left: auto; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.lp-empty { margin: 6px 0 0; }
.lpath { list-style: none; margin: 8px 0 0; padding: 0; }
.lp-step { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 0 0 12px; min-height: 40px; }
.lp-step::before { content: ""; position: absolute; left: 11px; top: 26px; bottom: 2px; width: 2px; background: var(--line); }
.lp-step:last-child::before { display: none; }
.lp-dot { flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); color: var(--muted); font-size: .76rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; font-variant-numeric: tabular-nums; margin-top: 1px; }
.lp-step.done .lp-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.lp-step.cur .lp-dot { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }
.lp-step.rec .lp-dot { border-style: dashed; }
.lp-body { flex: 1; min-width: 0; }
.lp-name { color: var(--ink); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.lp-step.cur .lp-name { color: var(--accent-ink); }
.lp-step.done .lp-name, .lp-step.rec .lp-name { color: var(--muted); }
.lp-step.rec .lp-name { font-weight: 500; }
.lp-here { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: .72rem; font-weight: 700; vertical-align: middle; }
.lp-meta, .lp-see { color: var(--muted); font-size: .82rem; margin-top: 2px; }
.lp-note { font-size: .85rem; margin-top: 3px; }
.related-box { margin-top: 12px; }
.related-title { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 6px; font-size: 1rem; }
.related { list-style: none; margin: 0; padding: 0; }
.related li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line2); font-size: .92rem; }
.related li:last-child { border-bottom: 0; }
.related .kind { flex-shrink: 0; margin-top: 2px; }
.related .why { font-size: .85rem; margin-top: 2px; }
@media (min-width: 700px) { .lp-meta, .lp-see { font-size: .85rem; } .lp-step { padding-bottom: 14px; } }
@media (min-width: 700px) {
  .hero-lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 24px; }
}
.course-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t btn" "pb pb" "badge badge"; gap: 8px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line2); }
.course-row:last-child { border-bottom: 0; }
.course-row .t { grid-area: t; min-width: 0; }
.course-row .t a { color: var(--ink); font-weight: 600; }
.course-row .m { font-size: .8rem; color: var(--muted); }
.course-row .btn { grid-area: btn; padding: 6px 14px; font-size: .85rem; white-space: nowrap; }
.course-row .pb { grid-area: pb; }
.course-row .badge { grid-area: badge; justify-self: start; }
.course-row .badge.neutral { display: none; }
@media (min-width: 700px) {
  .course-row { grid-template-columns: minmax(0, 1.6fr) 110px minmax(120px, 1fr) auto; grid-template-areas: "t badge pb btn"; gap: 12px; padding: 10px 0; }
  .course-row .badge.neutral { display: inline-block; }
}
.stat-strip.four { grid-template-columns: repeat(4, 1fr); }
.stat-strip.four .stat .sub { display: none; }
.stat-strip.four .stat .val { font-size: clamp(1rem, 4.6vw, 1.45rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-strip.four .stat { padding: 10px 8px; }
.stat-strip.four .stat .lbl { font-size: .75rem; white-space: normal; overflow: visible; line-height: 1.2; }
@media (min-width: 700px) { .stat-strip.four .stat .sub { display: block; } }
.readbar { position: sticky; top: 0; z-index: 6; height: 3px; background: var(--line2); margin: 0 0 8px; overflow: hidden; }
.readbar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.toc { display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; margin: 4px -16px 14px; padding: 8px 16px; background: var(--panel); border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); overflow-x: auto; scrollbar-width: none; }
.toc::-webkit-scrollbar { display: none; }
.toc .toc-title { font-size: .8rem; color: var(--muted); font-weight: 600; margin-right: 4px; white-space: nowrap; }
.toc button.toc-link { background: transparent; color: var(--muted); border: 0; border-radius: 12px; padding: 6px 10px; font-size: .875rem; font-weight: 500; white-space: nowrap; min-height: 36px; }
.toc button.toc-link.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
@media (min-width: 860px) {
  .card.lesson:has(> .toc) { display: grid; grid-template-columns: minmax(0, 1fr) 260px; column-gap: 24px; }
  .card.lesson > * { grid-column: 1; min-width: 0; }
  .card.lesson > .toc { grid-column: 2; grid-row: 1 / span 60; align-self: start; position: sticky; top: 12px; flex-direction: column; align-items: stretch; margin: 0; padding: 0 0 0 16px; background: transparent; border: 0; border-left: 1px solid var(--line); overflow: visible; }
  .card.lesson > .toc button.toc-link { text-align: left; white-space: normal; border-radius: 0 12px 12px 0; border-left: 2px solid transparent; margin-left: -17px; padding-left: 14px; }
  .card.lesson > .toc button.toc-link.active { border-left-color: var(--accent); background: var(--accent-soft); }
}
.due.warn { color: var(--warn); font-weight: 600; }
.due.err { color: var(--err); font-weight: 600; }
.note {
  border-left: 4px solid var(--accent); padding: 10px 14px; background: var(--accent-soft);
  border-radius: var(--radius); font-size: .875rem; margin: 10px 0; color: var(--ink);
}
.review-bar, .release-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.release-bar { padding: 12px 18px; margin-bottom: 14px; }
.review-line { margin-top: 6px; font-size: .82rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.review-select { font-size: .8rem; padding: 2px 6px; width: auto; }
.chip.review-ok, .chip.review-fixed { background: var(--accent-soft); color: var(--accent-ink); }
.chip.review-question { background: color-mix(in srgb, var(--warn, #d97706) 18%, transparent); color: var(--warn, #b45309); }
.chip.review-todo { background: var(--line2); color: var(--muted); }
.chip.review-stale { text-decoration: line-through; opacity: .8; }
.narration-missing { font-size: .8rem; margin: 4px 0 6px; display: flex; align-items: center; gap: 4px; }
body.wide main { max-width: 1280px; }
.page-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; font-size: 1.45rem; letter-spacing: -.01em; }
.page-head .sub { color: var(--muted); font-size: .86rem; }
.page-head .spacer { flex: 1; }
.page-head select, .page-head input { width: auto; padding: 7px 10px; font-size: .88rem; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.filters select { flex: 1 1 40%; min-width: 0; width: auto; padding: 7px 10px; font-size: .88rem; }
.filters input[type="search"] { flex: 1 1 100%; width: auto; padding: 7px 10px; font-size: .88rem; }
.filters .actions { display: flex; gap: 8px; margin-left: auto; }
@media (min-width: 700px) { .filters select { flex: 0 1 auto; } .filters input[type="search"] { flex: 0 1 200px; } }
.kpi-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin-bottom: 14px; }
@media (min-width: 700px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; min-width: 0;
}
.kpi .lbl { font-size: .8rem; color: var(--muted); font-weight: 400; text-wrap: balance; }
.kpi .val { font-size: 1.375rem; font-weight: 700; color: var(--ink); line-height: 1.2; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .val.word { font-size: .95rem; line-height: 1.3; }
.kpi .sub { font-size: .8rem; color: var(--muted); margin-top: 2px; }
.kpi.accent .val { color: var(--accent); }
.kpi.bad .val { color: var(--err); }
.kpi.warn .val { color: var(--warn); }
.kpi.click { cursor: pointer; }
.kpi.click:hover { border-color: var(--accent); }
.stack { display: flex; height: 16px; border-radius: 99px; overflow: hidden; background: var(--line2); }
.stack > i { display: block; height: 100%; min-width: 0; transition: width .3s; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: var(--muted); margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend b { color: var(--ink); font-variant-numeric: tabular-nums; }
.hbar { display: grid; grid-template-columns: minmax(140px, 2fr) 3fr auto; gap: 10px; align-items: center; font-size: .88rem; padding: 5px 0; }
.hbar .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hbar .bar { height: 10px; border-radius: 99px; background: var(--line2); overflow: hidden; }
.hbar .bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.hbar .bar > i.bad { background: var(--err); }
.hbar .bar > i.warn { background: var(--warn); }
.hbar .bar > i.info { background: var(--info); }
.hbar .n { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 4.5em; text-align: right; white-space: nowrap; }
.hbar.click { cursor: pointer; border-radius: 12px; }
.hbar.click:hover { background: var(--line2); }
.spark { width: 100%; height: auto; display: block; }
.spark text { fill: var(--muted); font-size: 10px; }
.spark line.grid { stroke: var(--line); stroke-width: 1; }
.split { display: grid; gap: 14px; }
.split > * { min-width: 0; }
.split > .card { margin-bottom: 0; }
.split { margin-bottom: 14px; }
@media (min-width: 900px) { .split { grid-template-columns: 1fr 1fr; } .split.w2-1 { grid-template-columns: 2fr 1fr; } }
@media (min-width: 700px) { .split.three { grid-template-columns: 1fr 1fr; } .split.three > :last-child { grid-column: 1 / -1; } }
@media (min-width: 1000px) { .split.three { grid-template-columns: 1fr 1fr 1fr; } .split.three > :last-child { grid-column: auto; } }
.sm-hide, .sm-hide-inline { display: none; }
@media (min-width: 700px) { .sm-hide { display: table-cell; } .sm-hide-inline { display: inline; } .lg-hide { display: none; } }
.stat-strip.eight { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .stat-strip.eight { grid-template-columns: repeat(4, 1fr); } }
.stat.bad .val { color: var(--err); }
.stat .sub.wrap { white-space: normal; line-height: 1.3; }
.meter { display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); margin: -6px 0 14px; padding: 0 4px; line-height: 1.35; }
.meter .bar { flex: 1 1 160px; height: 6px; border-radius: 99px; background: var(--line2); overflow: hidden; }
.meter .bar > i { display: block; height: 100%; background: var(--accent); }
.meter .bar > i.warn { background: var(--warn); } .meter .bar > i.bad { background: var(--err); }
.card .h-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 10px; }
.card .h-row h2 { margin: 0; }
.card .h-row .muted { font-size: .84rem; }
table.data.dense th, table.data.dense td { padding: 6px 8px; font-size: .85rem; } 
table.data.dense td.num, table.data.dense th.num { white-space: nowrap; }
@media (min-width: 700px) { table.data.dense th, table.data.dense td { padding: 7px 10px; font-size: .9rem; } }
table.data.dense td .muted { font-size: .8rem; }
table.data.dense td:has(> .where) { white-space: nowrap; } 
table.data.dense td .where { display: inline-block; margin-left: 4px; max-width: 120px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
@media (min-width: 700px) { table.data.dense td .where { max-width: none; } }
.pb-inline { display: none; }
@media (min-width: 700px) { .pb-inline { display: inline-block; } }
.more-row { text-align: center; padding: 10px 0 2px; }
table.data th.sort { cursor: pointer; user-select: none; white-space: nowrap; }
table.data th.sort:hover, table.data th.sort.active { color: var(--accent-ink); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.sub td { background: var(--panel); font-size: .85rem; }
table.data tr.sub td:first-child { padding-left: 32px; }
.tw { display: inline-block; width: 14px; color: var(--muted); font-size: .68rem; text-align: center; transition: transform .15s; }
.tw.open { transform: rotate(90deg); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .84em; letter-spacing: .02em; }
.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; }
.empty { color: var(--muted); font-size: .875rem; padding: 20px 16px; text-align: center; border: 1px dashed var(--line); border-radius: var(--radius); text-wrap: pretty; }
.subnav { display: flex; gap: 2px; margin-bottom: 16px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.subnav a { flex: none; white-space: nowrap; }
.subnav a {
  padding: 0 14px; min-height: 44px; font-size: .95rem; color: var(--muted); text-decoration: none !important;
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; display: inline-flex; gap: 7px; align-items: center;
}
.subnav a:hover { color: var(--ink); }
.subnav a.active { color: var(--accent-ink); border-bottom-color: var(--accent); }
.facet { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 4px 0 10px; }
.facet button { background: var(--card); color: var(--muted); border-color: var(--line); padding: 5px 12px; font-size: .8rem; border-radius: 12px; font-weight: 600; }
.facet button.active { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
.facet select { width: auto; padding: 4px 8px; font-size: .82rem; }
.role-chip { display: inline-block; padding: 1px 8px; border-radius: 12px; font-size: .72rem; background: var(--line2); color: var(--muted); margin: 1px 2px 1px 0; }
.role-chip.strong { background: var(--accent-soft); color: var(--accent-ink); }
.kv-grid { display: grid; gap: 10px 16px; grid-template-columns: 1fr 1fr; margin: 8px 0 14px; }
@media (max-width: 600px) { .kv-grid { grid-template-columns: 1fr; } }
.kv { font-size: .9rem; min-width: 0; overflow-wrap: anywhere; }
.kv b { display: block; font-size: .8rem; color: var(--muted); font-weight: 400; margin-bottom: 1px; }
.drawer-section { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.drawer-section h3 { margin: 0 0 8px; font-size: .9rem; }
.stat-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; min-width: 0; }
.stat .lbl { font-size: .8rem; color: var(--muted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat .val { font-size: 1.375rem; font-weight: 700; line-height: 1.2; margin-top: 2px; font-variant-numeric: tabular-nums; color: var(--ink); }
.stat .sub { font-size: .8rem; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat.accent .val { color: var(--accent); }
.stat.warn .val { color: var(--warn); }
.filterbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card); }
.seg button { background: transparent; color: var(--ink); border: 0; border-radius: 0; min-height: 40px; padding: 0 12px; font-size: .875rem; font-weight: 600; line-height: 1.25; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.active { background: var(--accent); color: var(--on-accent); }
.filterbar select { width: auto; max-width: 230px; padding: 5px 9px; font-size: .82rem; border-radius: 12px; background: var(--card); }
.filterbar .reset { background: transparent; border: 0; color: var(--muted); font-size: .8rem; padding: 4px 6px; text-decoration: underline; text-underline-offset: 3px; }
.filterbar .reset:hover { color: var(--ink); }
.list-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.list-head h2 { margin: 0; font-size: 1.12rem; }
.list-head .spacer { flex: 1; }
.list-head input[type="search"] { flex: 1 1 200px; max-width: 340px; padding: 8px 12px; font-size: .9rem; border-radius: 12px; }
.list-head .primary { flex-shrink: 0; padding: 8px 14px; }
.pos-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.pos-chips .meta-chip { white-space: nowrap; flex-shrink: 0; cursor: pointer; border: 1px solid transparent; }
.pos-chips .meta-chip:hover { border-color: var(--line); color: var(--ink); }
.pos-chips .meta-chip b { font-weight: 700; color: var(--ink); }
.pos-chips .meta-chip.accent b { color: var(--accent-ink); }
details.hint { font-size: .84rem; color: var(--muted); margin: 0 0 10px; line-height: 1.5; }
details.hint summary { display: inline-flex; gap: 6px; } 
details.hint p { margin: 6px 0 0; }
table.data.people td { padding: 8px 12px; vertical-align: middle; }
table.data.people a.name { color: var(--ink); font-weight: 600; }
table.data.people tr:hover a.name { color: var(--accent); }
table.data.people .ids { font-size: .76rem; color: var(--muted); white-space: nowrap; margin-top: 1px; }
table.data.people td.where, table.data.people td.pos { max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.data.people td.date { white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data.people .role-plain { font-size: .8rem; color: var(--muted); }
.dot-ok { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); vertical-align: 1px; margin-right: 6px; }
.cat-list { display: flex; flex-direction: column; }
.cat-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t btn" "chips chips";
  gap: 6px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line2); }
.cat-row:last-child { border-bottom: 0; }
.cat-row .t { grid-area: t; min-width: 0; }
.cat-row .t a, .cat-row .t b { color: var(--ink); font-weight: 600; }
.cat-row .m { color: var(--muted); font-size: .82rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cat-row .meta-chips { grid-area: chips; }
.cat-row > .btn { grid-area: btn; }
.picker { display: flex; flex-direction: column; gap: 6px; }
.picker input, .picker select { width: 100%; }
table.data button, .card .ghost, .card .secondary { min-height: 40px; }
main.busy { opacity: .55; pointer-events: none; transition: opacity .15s; }
.toast { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 60; }
body.offline .toast { bottom: 64px; } 
.prog-card { padding: 14px 16px; }
.prog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.prog-title { min-width: 0; flex: 1 1 260px; }
.prog-title h3 { font-size: 1.02rem; line-height: 1.3; }
.prog-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.prog-chips .chip { font-size: .76rem; }
.prog-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; flex: 0 0 auto; }
.prog-seg button { border: 0; background: transparent; color: var(--muted); padding: 6px 12px; font-size: .82rem; cursor: pointer; min-height: 32px; }
.prog-seg button.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.prog-seg button:disabled { cursor: default; }
table.data.prog-table th, table.data.prog-table td { padding: 6px 10px; }
table.data.prog-table td.num, table.data.prog-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.data.prog-table tr.muted td { color: var(--muted); }
.prog-table .lp-move button { padding: 0 6px; font-size: .78rem; min-height: 24px; }
.media.document { padding: 12px 14px; }
.doc-row { display: flex; gap: 12px; align-items: flex-start; }
.doc-row > svg { flex: 0 0 auto; color: var(--accent); margin-top: 2px; }
.doc-body { flex: 1 1 auto; min-width: 0; }
.doc-body .t { display: block; margin-bottom: 2px; }
.doc-actions { flex: 0 0 auto; display: flex; gap: 8px; align-items: center; }
.doc-row .btn { white-space: nowrap; }
@media (max-width: 699px) { .doc-row { flex-wrap: wrap; } .doc-actions { width: 100%; } .doc-row .btn { width: 100%; text-align: center; } }
.reg-card h2 { font-size: 1.05rem; }
.reg-courses { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; }
.reg-courses .chip { text-decoration: none; }
.grid > *, .stat-strip > *, .kpi-grid > *, .hbar > *, .kv-grid > * { min-width: 0; }
body { overflow-wrap: break-word; }
.card > :first-child { margin-top: 0; }
.pg-page[hidden] { display: none; }
main.paged .card.lesson { margin-bottom: 0; }
.pg-bar { position: sticky; bottom: 8px; z-index: 7; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; margin: 12px 0 0; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pg-info { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pg-status { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pg-track { display: flex; gap: 3px; }
.pg-track i { flex: 1; height: 4px; border-radius: 2px; background: var(--line2); overflow: hidden; }
.pg-track i.cur { background: var(--line); }
.pg-track b { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.pg-actions { display: flex; gap: 8px; flex: 1 1 100%; }
.pg-actions > * { flex: 1; min-width: 0; }
.pg-actions > :first-child:not(:last-child) { flex: 0 0 auto; }
@media (min-width: 700px) { .pg-actions { flex: 0 0 auto; margin-left: auto; } .pg-actions > * { flex: 0 0 auto; } }
@media (max-width: 860px) { .has-tabbar .pg-bar { bottom: calc(72px + env(safe-area-inset-bottom)); } }
