/* Question Bank — design tokens ------------------------------------------------ */
/* Brand: GradeRocket (2026-11-10). Deep Space indigo #171C48 (trust, calm focus) with Ignition orange #FF6B1A to Flame amber #FFB02E
   (energy, action; the rocket flame). Text on orange is Deep Space (--on-accent): white on orange fails WCAG AA.
   Subject colours (--bio/--che/--phy) and chart ramps are unchanged. */
:root {
  color-scheme: light;
  --page: #f4f5fb;
  --surface: #ffffff;
  --surface-2: #f8f8fd;
  --surface-3: #eef0f8;
  --chart-surface: #fbfbfe;
  --ink: #12163a;
  --ink-2: #464b6b;
  --ink-3: #63688a;
  --line: #e3e5f1;
  --line-strong: #cdd1e6;
  --grid: #e4e6f2;
  --axis: #c2c6dc;
  --brand: #171c48;
  --brand-2: #262d66;
  --accent: #ff6b1a;
  --accent-2: #ffb02e;
  --accent-ink: #c2410c;
  --accent-soft: #fff0e5;
  --data: #2f5aa8;
  --focus: #c2410c;
  --on-accent: #12163a;
  --mark-bg: #ffe1c9;
  --bio: #12a37a;
  --che: #eb6834;
  --phy: #2f6fde;
  --good: #0ca30c;
  --warn: #fab219;
  --serious: #ec835a;
  --good-ink: #006300;
  --seq-1: #dbe4f3; --seq-2: #b3c6e6; --seq-3: #86a3d4; --seq-4: #5a80c0; --seq-5: #3a62a8; --seq-6: #25488a; --seq-7: #15306a;
  --hero: radial-gradient(900px 260px at 88% -40px, rgba(255, 107, 26, .30), transparent 62%),
          radial-gradient(700px 240px at 8% 120%, rgba(124, 92, 255, .24), transparent 60%),
          linear-gradient(135deg, #0c1030 0%, #171c48 45%, #252b6e 100%);
  --shadow: 0 1px 2px rgba(16, 27, 48, .05), 0 6px 20px rgba(16, 27, 48, .06);
  --shadow-hover: 0 4px 12px rgba(16, 27, 48, .08), 0 18px 40px rgba(16, 27, 48, .12);
  --shadow-lg: 0 16px 56px rgba(16, 27, 48, .22);
  --radius: 14px;
  --radius-sm: 8px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Sora", "Inter", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0b0d24; --surface: #131739; --surface-2: #171c44; --surface-3: #1f2452; --chart-surface: #171c44;
    --ink: #f2f3fc; --ink-2: #babed9; --ink-3: #8d92b6; --line: #262b58; --line-strong: #353b70;
    --grid: #262b58; --axis: #3c4282; --brand: #e8e9fd; --brand-2: #cdd0f4; --accent: #ff8a3d; --accent-2: #ffbb4d;
    --accent-ink: #ffb07a; --accent-soft: #3b2214; --data: #6d97e0; --focus: #ff8a3d;
    --mark-bg: #6b3a12; --bio: #19b487; --che: #f07a45; --phy: #5b93ec; --good-ink: #2fc42f;
    --seq-1: #172a4d; --seq-2: #1d3a6c; --seq-3: #25488a; --seq-4: #3a62a8; --seq-5: #5a80c0; --seq-6: #86a3d4; --seq-7: #b9cdf0;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.28); --shadow-hover: 0 6px 16px rgba(0,0,0,.4), 0 20px 44px rgba(0,0,0,.4);
    --shadow-lg: 0 16px 56px rgba(0,0,0,.55);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0b0d24; --surface: #131739; --surface-2: #171c44; --surface-3: #1f2452; --chart-surface: #171c44;
  --ink: #f2f3fc; --ink-2: #babed9; --ink-3: #8d92b6; --line: #262b58; --line-strong: #353b70;
  --grid: #262b58; --axis: #3c4282; --brand: #e8e9fd; --brand-2: #cdd0f4; --accent: #ff8a3d; --accent-2: #ffbb4d;
  --accent-ink: #ffb07a; --accent-soft: #3b2214; --data: #6d97e0; --focus: #ff8a3d;
  --mark-bg: #6b3a12; --bio: #19b487; --che: #f07a45; --phy: #5b93ec; --good-ink: #2fc42f;
  --seq-1: #172a4d; --seq-2: #1d3a6c; --seq-3: #25488a; --seq-4: #3a62a8; --seq-5: #5a80c0; --seq-6: #86a3d4; --seq-7: #b9cdf0;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.28); --shadow-hover: 0 6px 16px rgba(0,0,0,.4), 0 20px 44px rgba(0,0,0,.4);
  --shadow-lg: 0 16px 56px rgba(0,0,0,.55);
}

/* Base --------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; font-feature-settings: "cv11", "ss01"; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; letter-spacing: -0.015em; }
h1 { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -0.025em; }
h2 { font-size: 15px; font-weight: 650; }
h3 { font-size: 13px; font-weight: 650; }
.muted { color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
mark { background: var(--mark-bg); color: inherit; border-radius: 3px; padding: 0 2px; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

/* Top bar ---------------------------------------------------------------------- */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 28px; height: 62px;
  padding: 0 24px; background: linear-gradient(90deg, #0c1030, #1b2154); color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .06); box-shadow: 0 1px 0 rgba(0, 0, 0, .08), 0 8px 24px rgba(10, 18, 34, .18); }
.brand { display: flex; align-items: center; gap: 11px; color: #fff; text-decoration: none !important; }
.brand-mark svg { width: 32px; height: 32px; display: block; filter: drop-shadow(0 4px 10px rgba(255, 107, 26, .35)); transition: transform .3s var(--ease); }
.brand:hover .brand-mark svg { transform: translate(1px, -2px) scale(1.05); }
.brand-mark rect { fill: url(#brand-grad); }
.brand-mark .rk { fill: #171c48; }
.brand-mark .win, .brand-mark .fl { fill: #fff; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-size: 16px; font-weight: 800; letter-spacing: -0.02em; }
.brand .wm-2 { color: var(--accent-2); }
.brand-text small { font-size: 11px; color: rgba(255, 255, 255, .6); letter-spacing: .03em; }
.nav { display: flex; gap: 2px; height: 100%; }
.nav a { position: relative; display: flex; align-items: center; padding: 0 14px; color: rgba(255, 255, 255, .7); font-weight: 550;
  text-decoration: none; transition: color .2s; }
.nav a::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); transform: scaleX(0); transition: transform .3s var(--ease); }
.nav a:hover { color: #fff; }
.nav a:hover::after { transform: scaleX(.4); }
.nav a.active { color: #fff; }
.nav a.nav-lock svg { width: 13px; height: 13px; margin-left: 5px; fill: none; stroke: currentColor; stroke-width: 2.2; opacity: .8; }
.papers-card { margin-bottom: 18px; }
.papers-seg { margin-bottom: 16px; flex-wrap: wrap; }
.papers-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.papers-table th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 650; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.papers-table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.papers-table .muted { font-size: 12.5px; margin-top: 2px; }
.papers-actions { white-space: nowrap; }
.papers-actions .btn + .btn { margin-left: 6px; }
@media (max-width: 640px) {
  .papers-table thead { display: none; }
  .papers-table tr { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .papers-table td { padding: 0; border: 0; }
  .papers-table td.papers-actions { grid-column: 1 / -1; white-space: normal; }
}
.nav a.active::after { transform: scaleX(1); }
.nav-badge { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--accent);
  color: var(--on-accent); font-size: 11px; line-height: 18px; text-align: center; font-weight: 700; animation: pop .4s var(--ease); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.search-trigger { display: inline-flex; align-items: center; gap: 8px; height: 36px; min-width: 210px; padding: 0 8px 0 12px; border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); color: rgba(255, 255, 255, .72); font-size: 13px; cursor: pointer;
  transition: background .2s, color .2s; }
.search-trigger:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.search-trigger svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; flex: none; }
.search-trigger kbd { margin-left: auto; background: rgba(255, 255, 255, .08); color: rgba(255, 255, 255, .6); border-color: rgba(255, 255, 255, .16); }
kbd { display: inline-block; font: 600 11px/1 var(--font); padding: 3px 6px; border-radius: 5px; background: var(--surface-3); color: var(--ink-3); border: 1px solid var(--line); }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .04); cursor: pointer; transition: background .2s, transform .2s; }
.icon-btn:hover { background: rgba(255, 255, 255, .12); transform: rotate(-12deg); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 1.8; }

main { position: relative; min-height: calc(100vh - 62px); overflow-x: clip; }
.page { position: relative; max-width: 1480px; margin: 0 auto; padding: 30px 24px 40px; }
.page-head { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; color: #fff; }
/* navy hero band: full viewport width behind the page heading, reaching under the first card */
.page-head::before, .deck-head::before, .home-hero::before, .skel-head::before { content: ""; position: absolute; z-index: -1; top: -30px; bottom: -84px;
  left: calc(50% - 50vw); right: calc(50% - 50vw); background: var(--hero); pointer-events: none; }
.page-head h1, .deck-head h1 { color: #fff; }
.page-head p { margin: 6px 0 0; color: rgba(255, 255, 255, .72); max-width: 780px; }
.page-head .btn:not(.primary), .deck-head .btn:not(.primary) { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .22); color: #fff; }
.page-head .btn:not(.primary):hover, .deck-head .btn:not(.primary):hover { background: rgba(255, 255, 255, .16); }
.page-head .seg { background: rgba(255, 255, 255, .1); }
.page-head .seg button { color: rgba(255, 255, 255, .78); }
.page-head .seg button.on { color: var(--ink); background: #fff; }

.skel { display: block; border-radius: 12px; background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 45%, var(--surface-3) 90%);
  background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; }
.skel-head { position: relative; display: grid; gap: 12px; padding: 4px 0 44px; }
.skel-head .skel { background: rgba(255, 255, 255, .12); animation: none; }
.skel-card { height: 104px; }
.skel-panel { height: 380px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Controls ----------------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 15px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .2s, border-color .2s, transform .2s var(--ease), box-shadow .2s; }
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: var(--on-accent);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 32%, transparent); }
.btn.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px color-mix(in srgb, var(--accent) 40%, transparent); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.small { height: 29px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }

.input, .select { height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); width: 100%;
  transition: border-color .2s, box-shadow .2s; }
.input:hover, .select:hover { border-color: var(--ink-3); }
.input:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 12px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%); stroke: var(--ink-3); fill: none; stroke-width: 2; pointer-events: none; transition: stroke .2s; }
.search-box:focus-within svg { stroke: var(--accent); }
.search-box .input { padding-left: 36px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-weight: 600; cursor: pointer; user-select: none;
  transition: background .2s, border-color .2s, color .2s, transform .15s var(--ease); }
.chip:hover { border-color: var(--ink-3); color: var(--ink); transform: translateY(-1px); }
.chip.on { background: var(--brand); border-color: var(--brand); color: var(--surface); box-shadow: 0 4px 12px rgba(16, 27, 48, .18); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip .count { color: inherit; opacity: .65; font-variant-numeric: tabular-nums; }

.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-3); }
.seg button { height: 30px; padding: 0 13px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-weight: 600; font-size: 12.5px; cursor: pointer;
  transition: background .2s, color .2s, box-shadow .2s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 27, 48, .14); }

.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: var(--ink-2); user-select: none; }
.toggle input { appearance: none; width: 34px; height: 20px; border-radius: 10px; background: var(--line-strong); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.toggle input:checked { background: var(--accent); }
.toggle input:checked::after { transform: translateX(14px); }

.subj-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.s-Biology { background: var(--bio); } .s-Chemistry { background: var(--che); } .s-Physics { background: var(--phy); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; flex-wrap: wrap; }
.card-head h2 { font-size: 15.5px; font-weight: 700; }
.card-head p { margin: 2px 0 0; color: var(--ink-3); font-size: 12.5px; }
.card-body { padding: 14px 20px 20px; }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 9px; border-radius: 12px; background: var(--surface-3);
  color: var(--ink-2); font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.pill.strong { background: var(--brand); color: var(--surface); }
.pill.rp { background: var(--accent-soft); color: var(--accent-ink); }
.pill svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.2; }

/* Dashboard ---------------------------------------------------------------------- */
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; padding: 16px 20px; margin-bottom: 20px; box-shadow: var(--shadow-hover); }
.filter-row .grow { flex: 1 1 260px; min-width: 220px; }
.filter-group { display: flex; flex-direction: column; gap: 7px; }
.filter-label { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { position: relative; overflow: hidden; padding: 18px 20px 17px; transition: transform .25s var(--ease), box-shadow .25s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.kpi .label { font-size: 11px; color: var(--ink-3); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.kpi .value { font-size: 31px; font-weight: 750; letter-spacing: -0.03em; margin-top: 6px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 12px; color: var(--ink-3); margin-top: 5px; }
.kpi .sub .good { color: var(--good-ink); font-weight: 650; }

.dash-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.dash-grid.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dash-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 12.5px; color: var(--ink-3); }
.crumbs button { border: 0; background: none; color: var(--accent-ink); cursor: pointer; padding: 2px 6px; border-radius: 6px; font-weight: 600; transition: background .2s; }
.crumbs button:hover { background: var(--accent-soft); }
.crumbs .sep { opacity: .5; }

/* horizontal bar list (HTML chart) */
.hbars { display: flex; flex-direction: column; }
.hbar { display: grid; grid-template-columns: minmax(150px, 34%) minmax(0, 1fr) 92px; align-items: center; gap: 12px; min-height: 32px;
  padding: 3px 8px; border-radius: 8px; cursor: default; transition: background .2s; }
.hbar.clickable { cursor: pointer; }
.hbar:hover, .hbar:focus-visible { background: var(--surface-3); }
.hbar.clickable:hover .chev { transform: translateX(3px); stroke: var(--accent); }
.hbar .name { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; color: var(--ink); }
.hbar .name span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { position: relative; height: 14px; }
.hbar .track::before { content: ""; position: absolute; inset: 6px 0 auto 0; height: 2px; background: var(--grid); border-radius: 1px; }
.hbar .fill { position: absolute; left: 0; top: 0; height: 14px; border-radius: 0 5px 5px 0; min-width: 2px; transform-origin: left center; }
.hbar .val { text-align: right; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar .val b { color: var(--ink); font-weight: 650; }
.hbar .chev { width: 14px; height: 14px; stroke: var(--ink-3); fill: none; stroke-width: 2; flex: none; transition: transform .2s var(--ease), stroke .2s; }
.fill-single { background: linear-gradient(90deg, var(--data), color-mix(in srgb, var(--data) 70%, #8fb0ea)); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* stacked level bars */
.stack-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 70px; gap: 12px; align-items: center; margin: 10px 0; font-size: 13px; }
.stack { display: flex; height: 18px; gap: 2px; transform-origin: left center; }
.stack div { height: 100%; min-width: 2px; }
.stack div:first-child { border-radius: 5px 0 0 5px; }
.stack div:last-child { border-radius: 0 5px 5px 0; }
.lv0 { background: var(--seq-2); } .lv1 { background: var(--seq-4); } .lv2 { background: var(--seq-6); }

/* heatmap */
.heat { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 12.5px; }
.heat th { font-weight: 650; color: var(--ink-3); font-size: 11.5px; text-align: center; padding: 4px; }
.heat th.rowh { text-align: left; color: var(--ink); font-weight: 500; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.heat td { height: 28px; text-align: center; border-radius: 6px; font-variant-numeric: tabular-nums; cursor: pointer; transition: transform .15s var(--ease); }
.heat td:hover { outline: 2px solid var(--accent); outline-offset: -2px; transform: scale(1.06); }
.heat .subj-row th { padding-top: 12px; text-align: left; color: var(--ink-2); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.heat-scale { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--ink-3); }
.heat-scale i { width: 22px; height: 10px; border-radius: 3px; display: inline-block; }

/* histogram */
.vbars { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding: 8px 4px 0; border-bottom: 1px solid var(--axis); }
.vbar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; cursor: default; }
.vbar .col { width: 100%; max-width: 46px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-radius: 6px 6px 0 0; min-height: 2px;
  transform-origin: bottom center; transition: filter .2s; }
.vbar:hover .col { filter: brightness(1.08) saturate(1.1); }
.vbar .v { font-size: 11.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.vlabels { display: flex; gap: 8px; padding: 6px 4px 0; }
.vlabels span { flex: 1; text-align: center; font-size: 12px; color: var(--ink-3); }

/* tables */
.table-wrap { overflow: auto; max-height: 560px; border-top: 1px solid var(--line); }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th { position: sticky; top: 0; z-index: 1; background: var(--surface-2); text-align: left; font-size: 11px; font-weight: 700;
  color: var(--ink-3); letter-spacing: .05em; text-transform: uppercase; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; white-space: nowrap; user-select: none; }
table.data th:hover { color: var(--ink); }
table.data th.r, table.data td.r { text-align: right; }
table.data th .arrow { opacity: .6; margin-left: 4px; }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; vertical-align: middle; }
table.data tbody tr { cursor: pointer; transition: background .15s; }
table.data tbody tr:hover { background: var(--accent-soft); }
.inline-bar { display: inline-block; height: 8px; border-radius: 0 4px 4px 0; background: var(--data); vertical-align: middle; min-width: 2px; transform-origin: left center; }
.cell-concept { font-weight: 600; }
.cell-path { color: var(--ink-3); font-size: 12px; }

.checks { list-style: none; margin: 0; padding: 0; font-size: 12.5px; }
.checks li { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.checks li:last-child { border-bottom: 0; }
.badge-ok { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; height: 20px; border-radius: 10px; font-size: 11px; font-weight: 700; color: var(--good-ink); background: color-mix(in srgb, var(--good) 14%, transparent); }
.badge-bad { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; height: 20px; border-radius: 10px; font-size: 11px; font-weight: 700; color: #b42318; background: color-mix(in srgb, #d03b3b 14%, transparent); }
.badge-ok svg, .badge-bad svg { width: 11px; height: 11px; stroke: currentColor; fill: none; stroke-width: 3; }

/* Explore -------------------------------------------------------------------------- */
.explore { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 0; max-width: 1640px; margin: 0 auto; }
.sidebar { position: sticky; top: 62px; height: calc(100vh - 62px); overflow-y: auto; padding: 22px 18px 40px; border-right: 1px solid var(--line); background: var(--surface); }
.sidebar section { padding: 15px 0; border-bottom: 1px solid var(--line); }
.sidebar section:first-child { padding-top: 0; }
.sidebar section:last-child { border-bottom: 0; }
.sidebar .filter-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 9px; }
.sidebar .filter-label button { border: 0; background: none; color: var(--accent-ink); font-size: 11px; cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 650; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.tree { font-size: 13px; }
.tree-filter { margin-bottom: 8px; }
.tree .node { display: flex; align-items: center; gap: 6px; padding: 3px 5px; border-radius: 7px; transition: background .15s; }
.tree .node:hover { background: var(--surface-3); }
.tree .node .tw { width: 16px; height: 16px; display: grid; place-items: center; border: 0; background: none; cursor: pointer; padding: 0; color: var(--ink-3); flex: none; }
.tree .node .tw svg { width: 12px; height: 12px; stroke: currentColor; fill: none; stroke-width: 2.4; transition: transform .2s var(--ease); }
.tree .node.open > .tw svg { transform: rotate(90deg); }
.tree .node .tw.leaf { visibility: hidden; }
.tree .node input { margin: 0; accent-color: var(--accent); flex: none; }
.tree .node label { flex: 1; min-width: 0; cursor: pointer; display: flex; justify-content: space-between; gap: 6px; }
.tree .node label span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree .node .c { color: var(--ink-3); font-variant-numeric: tabular-nums; font-size: 12px; }
.tree .node.zero label { color: var(--ink-3); }
.tree .kids { padding-left: 16px; }
.tree .lvl-subject > label { font-weight: 650; }
.tree .lvl-topic > label { font-weight: 550; }

.results { padding: 24px 28px 60px; min-width: 0; }
.results-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.results-head .summary { font-size: 13.5px; color: var(--ink-2); }
.results-head .summary b { color: var(--ink); font-size: 24px; font-weight: 750; letter-spacing: -0.02em; margin-right: 3px; font-variant-numeric: tabular-nums; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.active-filters .chip { height: 28px; background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.active-filters .chip svg { width: 11px; height: 11px; stroke: currentColor; stroke-width: 2.6; fill: none; }

.rlist { display: flex; flex-direction: column; gap: 12px; }
.rcard { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 0 16px; padding: 16px 18px 16px 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; box-shadow: 0 1px 2px rgba(16, 27, 48, .04);
  transition: border-color .2s, box-shadow .25s, transform .25s var(--ease); }
.rcard:hover { border-color: var(--line-strong); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.rcard.active { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.rcard .stripe { border-radius: var(--radius) 0 0 var(--radius); margin: -16px 0; }
.rcard .main { min-width: 0; }
.rcard .path { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 12px; color: var(--ink-3); }
.rcard .concept { font-size: 15.5px; font-weight: 700; margin: 3px 0 6px; color: var(--ink); letter-spacing: -0.01em; }
.rcard .snippet { font-size: 13.5px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rcard .snippet .lbl { font-weight: 650; color: var(--ink); margin-right: 4px; }
.rcard .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rcard .side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 10px; }
.marks-badge { display: grid; place-items: center; min-width: 50px; padding: 5px 9px; border-radius: 10px; background: var(--surface-3); text-align: center; line-height: 1.1; }
.rcard:hover .marks-badge { background: var(--accent-soft); }
.rcard:hover .marks-badge b { color: var(--accent-ink); }
.marks-badge b { font-size: 18px; font-weight: 750; transition: color .2s; }
.marks-badge small { font-size: 10.5px; color: var(--ink-3); }
.collect-btn { display: inline-flex; align-items: center; gap: 5px; height: 29px; padding: 0 11px; border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 650; cursor: pointer; white-space: nowrap; transition: all .2s var(--ease); }
.collect-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.collect-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.collect-btn.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); animation: pop .35s var(--ease); }
.conf { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-3); }
.conf i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.conf.hi i { background: var(--good); } .conf.mid i { background: var(--warn); } .conf.lo i { background: var(--serious); }
.conf.rev i { background: var(--accent); }
.empty { padding: 60px 20px; text-align: center; color: var(--ink-3); }
.more { display: flex; justify-content: center; padding: 18px; }

.qgroup { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.qgroup-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.qgroup-head .t { font-weight: 700; }
.qgroup .rcard { border: 0; border-radius: 0; border-bottom: 1px solid var(--line); box-shadow: none; transform: none; }
.qgroup .rcard:hover { background: var(--surface-2); }
.qgroup .rcard:last-child { border-bottom: 0; border-radius: 0 0 var(--radius) var(--radius); }

.filters-toggle { display: none; }

/* Drawer / viewer ----------------------------------------------------------------- */
.backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(10, 18, 34, .5); backdrop-filter: blur(3px); animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 41; width: min(1180px, 96vw); display: flex; flex-direction: column;
  background: var(--page); box-shadow: var(--shadow-lg); animation: slide .35s var(--ease); }
@keyframes slide { from { transform: translateX(60px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 12px; padding: 14px 22px; background: var(--hero); color: #fff; border-bottom: 0; }
.drawer-head .title { min-width: 0; flex: 1; }
.drawer-head .title .path { font-size: 12px; color: rgba(255, 255, 255, .65); display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.drawer-head .title h2 { font-size: 18px; margin-top: 2px; color: #fff; }
.drawer-head .btn:not(.primary) { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .22); color: #fff; }
.drawer-head .btn:not(.primary):hover { background: rgba(255, 255, 255, .16); }
.drawer-head .btn.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.drawer-head .icon-btn { border-color: rgba(255, 255, 255, .22); }
.drawer-body { flex: 1; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) 330px; }
.viewer-main { overflow-y: auto; padding: 20px 22px 40px; }
.viewer-side { overflow-y: auto; padding: 20px 22px 40px; border-left: 1px solid var(--line); background: var(--surface); }
.viewer-tabs { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.paper { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); animation: rise .4s var(--ease) both; }
.paper + .paper { margin-top: 12px; animation-delay: .06s; }
.crop { position: relative; overflow: hidden; width: 100%; background: #fff; }
.crop img { position: absolute; left: 0; width: 100%; height: auto; display: block; user-select: none; }
.crop .hl { position: absolute; left: 0; right: 0; background: rgba(255, 107, 26, .08); border-left: 4px solid var(--accent); pointer-events: none; }
.crop .hl.ctx { background: rgba(47, 111, 222, .07); border-left-color: var(--phy); }
.crop-label { display: flex; align-items: center; justify-content: space-between; padding: 7px 14px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-3); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.crop-label.part { color: var(--accent-ink); }
.reveal { display: grid; place-items: center; gap: 12px; padding: 48px 20px; text-align: center; border: 1.5px dashed var(--line-strong); border-radius: 12px; color: var(--ink-3); background: var(--surface);
  transition: border-color .2s, background .2s; }
.reveal:hover { border-color: var(--accent); background: var(--accent-soft); }
.reveal svg { width: 30px; height: 30px; stroke: var(--accent); fill: none; stroke-width: 1.6; }
.text-block { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; white-space: pre-wrap; font-size: 13.5px; line-height: 1.6; }
.text-block + h3 { margin-top: 16px; }
.side-sec { padding: 0 0 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.side-sec:last-child { border-bottom: 0; }
.side-sec h3 { margin-bottom: 8px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 6px 10px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; color: var(--ink); }
.tagpath { font-size: 12.5px; color: var(--ink-3); }
.tagname { font-size: 15px; font-weight: 700; color: var(--ink); margin: 2px 0; }
.sibs { display: flex; flex-direction: column; gap: 4px; }
.sib { display: grid; grid-template-columns: 54px minmax(0, 1fr) 30px; gap: 8px; align-items: center; padding: 7px 9px; border-radius: 8px; cursor: pointer; font-size: 12.5px; border: 1px solid transparent; background: none; text-align: left; transition: background .15s; }
.sib:hover { background: var(--surface-3); }
.sib.on { border-color: var(--accent); background: var(--accent-soft); }
.sib .l { font-weight: 700; }
.sib .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.sib .m { text-align: right; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.dups a { display: block; font-size: 12.5px; padding: 2px 0; }

/* Collection ------------------------------------------------------------------------ */
.coll-item { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; padding: 20px; }
.coll-item + .coll-item { border-top: 1px solid var(--line); }
.coll-num { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent); font-weight: 750;
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent) 30%, transparent); }
.coll-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.coll-tools .spacer { flex: 1; }
.answers-head { padding: 20px; border-top: 2px solid var(--ink); }

/* Tooltip -------------------------------------------------------------------------- */
.tooltip { position: fixed; z-index: 60; pointer-events: none; max-width: 300px; padding: 10px 12px; border-radius: 10px; background: #171c48; color: #fff;
  font-size: 12px; line-height: 1.45; box-shadow: var(--shadow-lg); border: 1px solid rgba(255, 255, 255, .08); }
.tooltip b { font-weight: 700; }
.tooltip .tt-row { display: flex; justify-content: space-between; gap: 14px; font-variant-numeric: tabular-nums; }

/* Lessons ------------------------------------------------------------------------- */
.lhead-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lsearch { width: min(340px, 100%); }
.lesson-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.coll-limit { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 600; }
.lpaper + .lpaper { margin-top: 18px; }
.lpaper-head { display: flex; align-items: baseline; gap: 6px 14px; flex-wrap: wrap; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 2px solid var(--line); }
.lpaper-title { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.pill.paper { background: var(--brand); color: var(--surface); }
.deck-head .pill.paper { background: rgba(255, 255, 255, .16); color: #fff; margin-right: 4px; }
.lgroup { margin-bottom: 28px; }
.lgroup h2 { font-size: 17px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 10px; }
.lnum { display: inline-grid; place-items: center; min-width: 40px; height: 24px; padding: 0 7px; border-radius: 12px; background: var(--che); color: #fff; font-size: 12px; font-weight: 700; }
.lgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.lcard { overflow: hidden; display: flex; flex-direction: column; transition: transform .25s var(--ease), box-shadow .25s; }
.lcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.lthumb { display: block; aspect-ratio: 16 / 9; background: var(--surface-3); border-bottom: 1px solid var(--line); overflow: hidden; }
.lthumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s var(--ease); }
.lcard:hover .lthumb img { transform: scale(1.04); }
.lcard-body { padding: 13px 15px 15px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.lcard h3 { margin: 0; font-size: 15.5px; font-weight: 700; line-height: 1.3; }
.lcard h3 a { color: var(--ink); }
.lmeta { font-size: 12px; font-weight: 650; color: var(--che); letter-spacing: .01em; }
.lsub { margin: 0; font-size: 12.5px; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lstats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
.lactions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.deck-head { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; color: #fff; }
.deck-head h1 { margin: 2px 0 0; font-size: 26px; line-height: 1.2; }
.deck-head .muted { color: rgba(255, 255, 255, .7); }
.crumb { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink-3); margin-bottom: 6px; }
.deck-head .crumb { color: rgba(255, 255, 255, .72); }
.crumb svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .2s var(--ease); }
.crumb:hover svg { transform: translateX(-3px); }
.deck-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.deck-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.stage { position: relative; aspect-ratio: 16 / 9; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-hover); }
.stage img { width: 100%; height: 100%; object-fit: contain; display: block; cursor: pointer; }
.stage:fullscreen { background: #000; border: 0; border-radius: 0; }
.stage-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 10px; background: rgba(22, 35, 58, .6);
  color: #fff; cursor: pointer; opacity: 0; transition: opacity .2s, background .2s; display: grid; place-items: center; backdrop-filter: blur(4px); }
.stage-nav:hover { background: var(--accent); color: var(--on-accent); }
.stage-nav svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.4; }
.stage-nav.prev { left: 10px; } .stage-nav.next { right: 10px; }
.stage:hover .stage-nav:not(:disabled), .stage:fullscreen .stage-nav:not(:disabled) { opacity: 1; }
.stage-nav:disabled { display: none; }
.stage-bar { display: flex; align-items: center; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.stage-bar .btn:disabled { opacity: .45; cursor: default; }
.stage-bar .counter { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--ink-2); min-width: 110px; text-align: center; }
.stage-bar .spacer { flex: 1; }
.notes { padding: 16px 20px; }
.notes-label { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 4px; }
.notes p { margin: 0; font-size: 14px; line-height: 1.6; white-space: pre-line; }
.deck-pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.deck-outline { position: sticky; top: 78px; max-height: calc(100vh - 100px); display: flex; flex-direction: column; overflow: hidden; }
.outline-head { display: flex; justify-content: space-between; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.outline { position: relative; overflow-y: auto; padding: 6px 6px 10px; }
.og-name { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; padding: 10px 8px 4px; }
.oi { display: flex; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: none; color: var(--ink-2); text-align: left; cursor: pointer; font-size: 13px; line-height: 1.35; transition: background .15s; }
.oi:hover { background: var(--surface-3); color: var(--ink); }
.oi.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; box-shadow: inset 3px 0 0 var(--accent); }
.oi-n { min-width: 22px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.oi.on .oi-n { color: inherit; }

/* Overview ------------------------------------------------------------------------- */
.home-hero { position: relative; color: #fff; padding: 22px 0 40px; }
.home-hero > * { max-width: 820px; }
.eyebrow { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); }
.home-hero h1 { margin: 0; font-size: clamp(30px, 4.2vw, 50px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 800; color: #fff; text-wrap: balance; }
.lede { margin: 16px 0 0; font-size: 17px; line-height: 1.55; color: rgba(255, 255, 255, .78); max-width: 680px; }
.hero-search { margin-top: 26px; display: flex; align-items: center; gap: 10px; max-width: 680px; padding: 6px 6px 6px 18px; border-radius: 16px;
  background: #fff; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); transition: box-shadow .2s; }
.hero-search:focus-within { box-shadow: 0 0 0 4px rgba(255, 107, 26, .35), 0 20px 50px rgba(0, 0, 0, .35); }
.hero-search svg { width: 20px; height: 20px; stroke: #7a8598; fill: none; stroke-width: 2; flex: none; }
.hero-search input { flex: 1; min-width: 0; height: 46px; border: 0; outline: 0; background: transparent; color: #12163a; font-size: 17px; }
.hero-search input::placeholder { color: #8a94a6; }
.hero-search .btn { height: 46px; padding: 0 24px; font-size: 15px; border-radius: 12px; }
.hero-try { margin: 14px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: rgba(255, 255, 255, .6); }
.hero-try a { padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16); color: #fff;
  text-decoration: none; transition: background .2s; }
.hero-try a:hover { background: rgba(255, 255, 255, .18); }
.home-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.coverage thead .tot { color: var(--ink-3); text-align: right; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.home-grid .card-head .btn svg { width: 14px; height: 14px; }
.home-grid .hbars { gap: 2px; padding-top: 12px; }
a.hbar { color: inherit; text-decoration: none !important; }
.home-grid .hbar { grid-template-columns: minmax(140px, 34%) minmax(0, 1fr) 172px; }
.home-grid .hint { margin: 12px 8px 0; font-size: 12.5px; color: var(--ink-3); }
.coverage-card { margin-bottom: 20px; }
.table-scroll { overflow-x: auto; }
table.coverage { width: 100%; min-width: 540px; border-collapse: separate; border-spacing: 0 6px; font-size: 13.5px; }
.coverage thead th { text-align: left; padding: 0 12px 2px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.coverage tbody th { text-align: left; padding: 0 12px 0 0; font-size: 14px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.coverage tbody th .subj-dot { margin-right: 9px; }
.coverage td { padding: 0 6px 0 0; }
.coverage td a { position: relative; display: flex; align-items: center; height: 42px; padding: 0 14px; overflow: hidden; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font-weight: 650; text-decoration: none; transition: border-color .2s, transform .2s var(--ease); }
.coverage td a:hover { border-color: var(--accent); transform: translateY(-1px); }
.cov-bar { position: absolute; left: 0; top: 0; bottom: 0; opacity: .16; transform-origin: left center; }
.coverage td a .num { position: relative; }
.coverage .tot { text-align: right; padding-right: 4px; font-weight: 750; color: var(--ink); }
.features { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.feature { display: flex; align-items: flex-start; gap: 14px; padding: 18px; color: var(--ink); text-decoration: none !important;
  transition: transform .25s var(--ease), box-shadow .25s, border-color .25s; }
.feature:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); border-color: var(--line-strong); }
.feature-icon { flex: none; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); }
.feature-icon svg { width: 20px; height: 20px; stroke: var(--accent-ink); fill: none; stroke-width: 2; }
.feature-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.feature-body b { font-size: 15px; font-weight: 700; }
.feature-body span { font-size: 13px; line-height: 1.45; color: var(--ink-3); }
.feature-go { margin-left: auto; align-self: center; }
.feature-go svg { width: 18px; height: 18px; stroke: var(--ink-3); fill: none; stroke-width: 2; transition: transform .2s var(--ease), stroke .2s; }
.feature:hover .feature-go svg { transform: translateX(3px); stroke: var(--accent); }

/* Site visits */
.visits-card { margin-bottom: 20px; }
.vstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.vstat { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.vstat .label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.vnum { font-size: 13px; color: var(--ink-2); }
.vnum b { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; color: var(--ink); margin-right: 2px; }
.vsub { font-size: 12.5px; color: var(--ink-3); }
.vchart { display: flex; align-items: flex-end; gap: 3px; height: 96px; margin-top: 18px; padding-bottom: 1px; border-bottom: 1px solid var(--axis); }
.vcol { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: default; }
.vcol i { display: block; width: 100%; border-radius: 3px 3px 0 0; background: var(--data); transform-origin: bottom center; transition: filter .2s; }
.vcol:hover i { filter: brightness(1.15); }
.vaxis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11.5px; color: var(--ink-3); }
.vpages { margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-3); }
.vpages b { color: var(--ink); font-weight: 650; margin-right: 3px; }

/* Search palette ------------------------------------------------------------------- */
.palette-wrap { position: fixed; inset: 0; z-index: 70; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px;
  background: rgba(10, 18, 34, .5); backdrop-filter: blur(4px); animation: fade .2s ease; }
.palette { width: min(640px, 100%); overflow: hidden; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: rise .25s var(--ease); }
.pal-input { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); }
.pal-input svg { width: 20px; height: 20px; flex: none; stroke: var(--ink-3); fill: none; stroke-width: 2; }
.pal-input input { flex: 1; min-width: 0; height: 56px; border: 0; outline: 0; background: transparent; font-size: 17px; }
.pal-list { list-style: none; margin: 0; padding: 6px; max-height: min(420px, 55vh); overflow-y: auto; }
.pal-list li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.pal-list li.on { background: var(--accent-soft); }
.pal-ic { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-3); }
.pal-ic svg { width: 16px; height: 16px; stroke: var(--ink-2); fill: none; stroke-width: 2; }
.pal-list li.on .pal-ic { background: var(--accent); }
.pal-list li.on .pal-ic svg { stroke: var(--on-accent); }
.pal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pal-label { font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-path { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-count { flex: none; font-size: 12px; color: var(--ink-3); }
.pal-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 12px; color: var(--ink-3); }
.pal-foot kbd { margin-right: 3px; }

/* Footer ---------------------------------------------------------------------------- */
.site-foot { margin-top: 24px; border-top: 1px solid var(--line); background: var(--surface); }
.foot-in { max-width: 1480px; margin: 0 auto; padding: 18px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; font-size: 12.5px; color: var(--ink-3); }
.foot-brand { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 13.5px; font-weight: 800; color: var(--ink); }
.foot-brand .wm-2 { color: var(--accent-ink); }
.foot-brand svg { width: 22px; height: 22px; display: block; }
.foot-stamp { margin-left: auto; font-variant-numeric: tabular-nums; }

/* Motion: page entry (app.js adds .enter to #app on a route change, then removes it) */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@keyframes growx { from { transform: scaleX(0); } }
@keyframes growy { from { transform: scaleY(0); } }
@keyframes pop { 0% { transform: scale(.85); } 60% { transform: scale(1.08); } 100% { transform: scale(1); } }
#app.enter .page-head, #app.enter .deck-head { animation: rise .55s var(--ease) both; }
#app.enter .page > .card, #app.enter .kpi, #app.enter .dash-grid > .card, #app.enter .lgroup, #app.enter .deck-grid,
#app.enter .results-head, #app.enter .rcard, #app.enter .qgroup { animation: rise .55s var(--ease) both; }
#app.enter .page > .card { animation-delay: .06s; }
#app.enter .kpi:nth-child(1) { animation-delay: .1s; } #app.enter .kpi:nth-child(2) { animation-delay: .15s; }
#app.enter .kpi:nth-child(3) { animation-delay: .2s; } #app.enter .kpi:nth-child(4) { animation-delay: .25s; }
#app.enter .kpi:nth-child(5) { animation-delay: .3s; } #app.enter .kpi:nth-child(6) { animation-delay: .35s; }
#app.enter .dash-grid > .card { animation-delay: .3s; }
#app.enter .rcard:nth-child(2), #app.enter .qgroup:nth-child(2) { animation-delay: .05s; }
#app.enter .rcard:nth-child(3), #app.enter .qgroup:nth-child(3) { animation-delay: .1s; }
#app.enter .rcard:nth-child(4), #app.enter .qgroup:nth-child(4) { animation-delay: .15s; }
#app.enter .rcard:nth-child(n+5), #app.enter .qgroup:nth-child(n+5) { animation-delay: .2s; }
#app.enter .hbar .fill, #app.enter .stack, #app.enter .inline-bar { animation: growx .9s var(--ease) both; animation-delay: .35s; }
#app.enter .hbar:nth-child(2) .fill { animation-delay: .39s; } #app.enter .hbar:nth-child(3) .fill { animation-delay: .43s; }
#app.enter .hbar:nth-child(4) .fill { animation-delay: .47s; } #app.enter .hbar:nth-child(5) .fill { animation-delay: .51s; }
#app.enter .hbar:nth-child(6) .fill { animation-delay: .55s; } #app.enter .hbar:nth-child(7) .fill { animation-delay: .59s; }
#app.enter .hbar:nth-child(n+8) .fill { animation-delay: .63s; }
#app.enter .vbar .col { animation: growy .9s var(--ease) both; animation-delay: .45s; }
#app.enter .heat td { animation: fade .6s ease both; animation-delay: .4s; }
#app.enter .home-hero { animation: rise .55s var(--ease) both; }
#app.enter .home-grid > .card, #app.enter .feature { animation: rise .55s var(--ease) both; animation-delay: .32s; }
#app.enter .home-grid > .card:nth-child(2) { animation-delay: .38s; }
#app.enter .feature:nth-child(2) { animation-delay: .38s; } #app.enter .feature:nth-child(3) { animation-delay: .44s; } #app.enter .feature:nth-child(4) { animation-delay: .5s; }
#app.enter .cov-bar { animation: growx 1.1s var(--ease) both; animation-delay: .5s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Responsive ------------------------------------------------------------------------ */
@media (max-width: 1200px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis.lesson-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .dash-grid, .dash-grid.even, .dash-grid.three, .home-grid { grid-template-columns: minmax(0, 1fr); }
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.home-kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
  .home-kpis .kpi { padding: 15px 14px 14px; }
  .home-kpis .kpi .value { font-size: 25px; }
  .search-trigger { min-width: 0; }   /* the full-width search button pushed the header past 960-1045px screens */
  .search-trigger kbd { display: none; }
}
@media (max-width: 860px) {
  .kpis.home-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-kpis .kpi:last-child { grid-column: 1 / -1; }
}
@media (max-width: 960px) {
  .explore { grid-template-columns: minmax(0, 1fr); }
  .deck-grid { grid-template-columns: minmax(0, 1fr); }
  .deck-outline { position: static; max-height: 420px; }
  .sidebar { position: fixed; top: 62px; left: 0; bottom: 0; z-index: 35; width: min(340px, 92vw); height: auto; transform: translateX(-102%); transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .filters-toggle { display: inline-flex; }
  .drawer-body { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .viewer-main, .viewer-side { overflow: visible; }
  .viewer-side { border-left: 0; border-top: 1px solid var(--line); }
  .search-trigger { min-width: 0; }
  .search-trigger kbd { display: none; }
}
@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 0 12px; }
  .brand-text { display: none; }
  .nav { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 0 7px; font-size: 13px; flex: none; }
  .nav a::after { left: 7px; right: 7px; }
  .topbar-right { margin-left: 0; }
  .page, .results { padding: 20px 16px 32px; }
  h1 { font-size: 22px; }
  .kpis, .kpis.lesson-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 15px 15px 14px; }
  .kpi .value { font-size: 25px; }
  .stage-nav { display: none; }
  .search-trigger { width: 36px; padding: 0; justify-content: center; }
  .search-trigger span { display: none; }
  .features { grid-template-columns: minmax(0, 1fr); }
  .lede { font-size: 15.5px; }
  .hero-search { padding-left: 14px; }
  .hero-search .btn { padding: 0 16px; }
  .foot-in { padding: 16px; }
  .foot-stamp { margin-left: 0; }
  .vstats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-grid .hbar { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; padding: 6px 8px; }
  .home-grid .hbar .track { grid-column: 1 / -1; grid-row: 2; }
  .hbar { grid-template-columns: minmax(110px, 40%) minmax(0, 1fr) 70px; }
  .rcard { grid-template-columns: 4px minmax(0, 1fr); }
  .rcard .side { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; margin-top: 10px; }
}

@media (max-width: 420px) {
  #theme-toggle { display: none; }
}

/* Print (collection worksheets) ---------------------------------------------------- */
@media print {
  .topbar, .site-foot, .palette-wrap, .no-print, #drawer-root, .tooltip { display: none !important; }
  .page-head::before, .deck-head::before { display: none; }
  body { background: #fff; color: #000; }
  .page { padding: 0; max-width: none; }
  .page-head, .page-head h1 { color: #000; }
  .card { box-shadow: none; border: 0; }
  .coll-item { break-inside: avoid; padding: 10px 0; }
  .coll-num { box-shadow: none; }
  .answers-head { break-before: page; }
  .paper { box-shadow: none; animation: none; }
}
