/* AIQ site styles.
   Pages: Home (how it works), Courses (empty for now), Practice (grouped question list),
   Progress (solved ring, tracks, history), and the problem workspace: a full-height
   split with the question on the left and an editor / answer pane on the right.
   Dark first. Light only when chosen explicitly (data-theme="light"). */
:root {
  --bg: #0f1012;
  --bg-raise: #151619;
  --panel: #18191c;
  --panel-2: #202125;
  --panel-3: #2a2b30;
  --line: #2a2c31;
  --line-strong: #3a3d44;
  --fg: #eceef2;
  --fg-2: #b4b8c1;
  --muted: #7f848e;
  --accent: #7c9cff;
  --accent-strong: #a9bbff;
  --accent-ink: #0b0d12;
  --accent-soft: rgba(124, 156, 255, 0.13);
  --easy: #3ddc97;
  --easy-soft: rgba(61, 220, 151, 0.12);
  --medium: #f5b84a;
  --medium-soft: rgba(245, 184, 74, 0.13);
  --hard: #ff6b81;
  --hard-soft: rgba(255, 107, 129, 0.13);
  --code-bg: #141518;
  --code-fg: #d6dae2;
  --tok-kw: #c4a7ff;
  --tok-str: #8fd7a5;
  --tok-num: #f5b84a;
  --tok-com: #6b7280;
  --tok-fn: #8ab4ff;
  --tok-add: #3ddc97;
  --tok-del: #ff6b81;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  --logo-1: #a9bbff;
  --logo-2: #7c9cff;
  --logo-3: #5f7ef0;
  --logo-hl: rgba(255, 255, 255, 0.28);

  /* editor (VS Code Dark+ flavour) */
  --ide-bg: #1e1e1e;
  --ide-side: #252526;
  --ide-bar: #2d2d30;
  --ide-tab: #2d2d2d;
  --ide-tab-on: #1e1e1e;
  --ide-line: #3a3a3d;
  --ide-fg: #d4d4d4;
  --ide-dim: #858585;
  --ide-gutter: #6e7681;
  --ide-gutter-on: #c6c6c6;
  --ide-sel: #04395e;
  --ide-hover: #2a2d2e;
  --ide-cur: rgba(255, 255, 255, 0.045);
  --ide-status: #007acc;
  --ide-add: #487e02;
  --ide-m: #e2c08d;
  --ide-u: #73c991;
  --ide-kw: #569cd6;
  --ide-ctl: #c586c0;
  --ide-str: #ce9178;
  --ide-num: #b5cea8;
  --ide-com: #6a9955;
  --ide-fn: #dcdcaa;
  --ide-cls: #4ec9b0;
  --ide-var: #9cdcfe;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --max: 1180px;
  --top-h: 56px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-raise: #ffffff;
  --panel: #ffffff;
  --panel-2: #f1f3f6;
  --panel-3: #e7eaef;
  --line: #e2e5ea;
  --line-strong: #cdd2da;
  --fg: #14171c;
  --fg-2: #434a56;
  --muted: #6b7380;
  --accent: #3d5bd9;
  --accent-strong: #2a44b8;
  --accent-ink: #ffffff;
  --accent-soft: rgba(61, 91, 217, 0.1);
  --easy: #0d9668;
  --easy-soft: rgba(13, 150, 104, 0.1);
  --medium: #b2700f;
  --medium-soft: rgba(178, 112, 15, 0.11);
  --hard: #d23452;
  --hard-soft: rgba(210, 52, 82, 0.1);
  --code-bg: #f4f5f8;
  --code-fg: #1d2532;
  --tok-kw: #7b3fd1;
  --tok-str: #18794e;
  --tok-num: #a35c00;
  --tok-com: #7a8597;
  --tok-fn: #2a52be;
  --tok-add: #0d9668;
  --tok-del: #d23452;
  --shadow: 0 16px 48px rgba(20, 30, 50, 0.16);
  --logo-1: #5d78ea;
  --logo-2: #3d5bd9;
  --logo-3: #2a44b8;
  --logo-hl: rgba(255, 255, 255, 0.35);

  --ide-bg: #ffffff;
  --ide-side: #f3f3f3;
  --ide-bar: #e8e8e8;
  --ide-tab: #ececec;
  --ide-tab-on: #ffffff;
  --ide-line: #dcdcdc;
  --ide-fg: #1f1f1f;
  --ide-dim: #6f6f6f;
  --ide-gutter: #8a8a8a;
  --ide-gutter-on: #1f1f1f;
  --ide-sel: #cce4f7;
  --ide-hover: #e8e8e8;
  --ide-cur: rgba(0, 0, 0, 0.04);
  --ide-status: #007acc;
  --ide-add: #81b88b;
  --ide-m: #895503;
  --ide-u: #2e7d32;
  --ide-kw: #0000ff;
  --ide-ctl: #af00db;
  --ide-str: #a31515;
  --ide-num: #098658;
  --ide-com: #008000;
  --ide-fn: #795e26;
  --ide-cls: #267f99;
  --ide-var: #001080;
  color-scheme: light;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.6 var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg-raise); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { line-height: 1.25; text-wrap: balance; margin: 0; letter-spacing: -0.015em; font-weight: 650; }
code, pre, kbd { font-family: var(--font-mono); }
button { font: inherit; color: inherit; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted, .dim { color: var(--muted); }
.wrap { max-width: var(--max); margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.view { flex: 1; outline: none; }
.loading { color: var(--muted); padding: 48px 16px; text-align: center; }
.t-easy { color: var(--easy); }
.t-medium { color: var(--medium); }
.t-hard { color: var(--hard); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg-raise) 90%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner { height: calc(var(--top-h) - 1px); padding: 0 max(20px, env(safe-area-inset-right, 0px)) 0 max(20px, env(safe-area-inset-left, 0px)); display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; color: var(--fg); }
.brand:hover { text-decoration: none; }
.brand .logo { height: 22px; width: auto; display: block; }
.nav { display: flex; gap: 2px; position: absolute; left: 50%; transform: translateX(-50%); }
.nav a { color: var(--fg-2); padding: 7px 14px; border-radius: var(--r-sm); font-weight: 500; font-size: 14.5px; position: relative; }
.nav a:hover { color: var(--fg); background: var(--panel-2); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--fg); }
.nav a[aria-current="page"]::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -11px; height: 2px; background: var(--accent); border-radius: 2px; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.progress-pill { font: 500 12.5px var(--font-mono); color: var(--fg-2); padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; }
.progress-pill:hover { text-decoration: none; border-color: var(--line-strong); color: var(--fg); }
.progress-pill b { color: var(--easy); font-weight: 600; }
.icon-btn { display: grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm); border: 1px solid var(--line); background: transparent; color: var(--fg-2); cursor: pointer; }
.icon-btn:hover { color: var(--fg); border-color: var(--line-strong); background: var(--panel-2); }
.logo .b { fill: var(--logo-2); }
.logo .b0, .logo .b1 { fill: var(--logo-1); }
.logo .b5, .logo .b6 { fill: var(--logo-3); }
.logo .hl { fill: var(--logo-hl); }

.foot { border-top: 1px solid var(--line); margin-top: auto; }
.foot-inner { max-width: var(--max); margin: 0 auto; padding: 20px max(20px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-links a { color: var(--fg-2); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-sm); padding: 8px 15px;
  font-weight: 600; font-size: 14px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--fg);
  white-space: nowrap; text-decoration: none;
}
.btn:hover { border-color: var(--muted); text-decoration: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.small { padding: 5px 10px; font-size: 13px; }
.btn.lg { padding: 11px 20px; font-size: 15px; border-radius: 8px; }
.linkish { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font-size: inherit; font-weight: 500; }
.linkish:hover { text-decoration: underline; }
.cta-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
input[type="text"], input[type="search"], input[type="url"], select, textarea {
  font: inherit; color: var(--fg); background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 8px 10px; min-height: 36px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select { padding-right: 28px; cursor: pointer; max-width: 100%; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--panel); flex: none; }
.seg button { border: 0; background: transparent; padding: 7px 12px; cursor: pointer; font-size: 13px; font-weight: 500; color: var(--fg-2); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { color: var(--fg); }
.seg button[aria-pressed="true"] { background: var(--panel-3); color: var(--fg); }
.seg button[data-d="easy"][aria-pressed="true"] { color: var(--easy); }
.seg button[data-d="medium"][aria-pressed="true"] { color: var(--medium); }
.seg button[data-d="hard"][aria-pressed="true"] { color: var(--hard); }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-2); cursor: pointer; user-select: none; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.bar { height: 6px; border-radius: 3px; background: var(--panel-3); overflow: hidden; }
.bar > span { display: block; height: 100%; background: currentColor; border-radius: 3px; }
.counter { font: 500 12px var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.pid { font: 500 0.82em var(--font-mono); color: var(--muted); margin-right: 8px; }
.diff { font-weight: 600; font-size: 13px; white-space: nowrap; }
.diff.easy { color: var(--easy); }
.diff.medium { color: var(--medium); }
.diff.hard { color: var(--hard); }
.pill { display: inline-block; font-weight: 600; font-size: 12px; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill.easy { color: var(--easy); background: var(--easy-soft); }
.pill.medium { color: var(--medium); background: var(--medium-soft); }
.pill.hard { color: var(--hard); background: var(--hard-soft); }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; padding: 2px 7px; border-radius: 4px; background: var(--panel-2); color: var(--fg-2); border: 1px solid var(--line); white-space: nowrap; }
.delta { font: 600 12px var(--font-mono); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--easy); }
.delta.down { color: var(--hard); }
.best { font: 600 13px var(--font-mono); color: var(--fg-2); font-variant-numeric: tabular-nums; }
.best.ok { color: var(--easy); }
.ok { color: var(--easy); }
.bad { color: var(--hard); }
.error-box { border: 1px solid color-mix(in srgb, var(--hard) 50%, transparent); background: var(--hard-soft); color: var(--fg); border-radius: var(--r-sm); padding: 10px 12px; font-size: 13.5px; }
.table-scroll { overflow-x: auto; }
kbd { font-size: 11px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--muted); background: var(--panel-2); }

/* commands: "$" for shell, ">" for Claude Code slash commands */
.cmd { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--code-bg); overflow: hidden; }
.cmd code { flex: 1; min-width: 0; padding: 8px 12px; font-size: 12.5px; overflow-x: auto; white-space: nowrap; color: var(--code-fg); scrollbar-width: none; }
.cmd code::before { content: "$ "; color: var(--muted); }
.cmd.slash code::before { content: "> "; color: var(--accent); }
.cmd button { border: 0; border-left: 1px solid var(--line); background: var(--panel-2); color: var(--fg-2); padding: 0 12px; cursor: pointer; font-size: 12px; font-weight: 600; }
.cmd button:hover { color: var(--fg); }

/* ---------- page scaffolding ---------- */
.page { padding-block: 36px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; font-weight: 700; }
.page-head .sub { color: var(--fg-2); margin: 6px 0 0; font-size: 15px; }
.panel { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); padding: 20px 22px; min-width: 0; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.panel-head h2 { font-size: 16px; }
.subhead { font-size: 11.5px; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 22px 0 10px; font-weight: 600; }
.empty-panel { border: 1px dashed var(--line-strong); border-radius: var(--r-lg); padding: 48px 24px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty-panel h2 { font-size: 19px; }
.empty-panel p { color: var(--fg-2); margin: 0 0 8px; max-width: 52ch; }
.empty-panel.slim { padding: 32px 16px; }
.ep-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 6px; }
.ep-ico svg { width: 24px; height: 24px; }

/* ---------- home ---------- */
.home-hero { border-bottom: 1px solid var(--line); background: radial-gradient(ellipse 80% 120% at 50% -20%, var(--accent-soft), transparent 60%); }
.home-hero .wrap { padding-block: 72px 56px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.eyebrow { font: 600 12px var(--font-mono); letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); padding: 4px 12px; border-radius: 999px; background: var(--accent-soft); }
.home-hero h1 { font-size: clamp(32px, 5vw, 54px); font-weight: 750; letter-spacing: -0.03em; max-width: 18ch; margin: 22px 0 16px; }
.home-hero h1 em { font-style: normal; color: var(--accent); }
.hero-sub { color: var(--fg-2); font-size: 17px; max-width: 60ch; margin: 0 0 28px; }
.hero-stats { display: flex; gap: 0; margin: 40px 0 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); overflow: hidden; }
.hero-stats div { padding: 12px 26px; display: flex; flex-direction: column-reverse; align-items: center; }
.hero-stats div + div { border-left: 1px solid var(--line); }
.hero-stats dt { font: 500 11.5px var(--font-mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.hero-stats dd { margin: 0; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.home-sec { padding-block: 64px 0; }
.sec-head { margin-bottom: 24px; }
.sec-head h2 { font-size: 26px; font-weight: 700; }
.sec-head p { color: var(--fg-2); margin: 6px 0 0; }
.flow { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.flow li { border: 1px solid var(--line); background: var(--panel); border-radius: var(--r-lg); padding: 20px; position: relative; }
.flow-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font: 700 14px var(--font-mono); margin-bottom: 14px; }
.flow h3 { font-size: 16px; margin-bottom: 6px; }
.flow p { margin: 0; color: var(--fg-2); font-size: 14px; }
.ways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.way { border: 1px solid var(--line); background: var(--panel); border-radius: var(--r-lg); padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.way header { display: flex; gap: 14px; align-items: center; }
.way-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-3); color: var(--fg); flex: none; }
.way-ico svg { width: 20px; height: 20px; }
.way h3 { font-size: 18px; }
.way header .muted { font-size: 13px; }
.way > p { margin: 0; color: var(--fg-2); font-size: 14.5px; }
.cmd-stack { display: flex; flex-direction: column; gap: 6px; }
.cmd-cap { font: 600 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-top: 6px; }
.cmd-cap:first-child { margin-top: 0; }
.mini-steps { margin: 0; padding-left: 20px; color: var(--fg-2); font-size: 14.5px; display: flex; flex-direction: column; gap: 6px; }
.more-link { margin-top: auto; font-weight: 600; font-size: 14px; }
.track-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.tg-label { display: flex; align-items: center; gap: 8px; font: 600 11.5px var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px; }
.track-rows { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; }
.track-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 20px; grid-template-areas: "name count go" "blurb count go"; gap: 2px 14px; width: 100%; text-align: left; background: none; border: 0; padding: 16px 18px; cursor: pointer; align-items: center; }
.track-row + .track-row { border-top: 1px solid var(--line); }
.track-row:hover { background: var(--panel-2); }
.tr-name { grid-area: name; font-weight: 600; font-size: 15px; }
.tr-blurb { grid-area: blurb; color: var(--fg-2); font-size: 13.5px; }
.tr-count { grid-area: count; font: 500 13px var(--font-mono); color: var(--muted); }
.tr-go { grid-area: go; color: var(--muted); display: grid; }
.points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.point { border-top: 2px solid var(--accent); background: var(--panel); border-radius: 0 0 var(--r-lg) var(--r-lg); padding: 18px 20px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.point h3 { font-size: 15.5px; margin-bottom: 6px; }
.point p { margin: 0; color: var(--fg-2); font-size: 14px; }
.home-end { text-align: center; padding-block: 80px 72px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.home-end h2 { font-size: 28px; }
.home-end p { color: var(--fg-2); margin: 0 0 12px; }

/* ---------- practice ---------- */
.overall { min-width: 240px; display: flex; flex-direction: column; gap: 8px; }
.overall-n { font-size: 13.5px; color: var(--fg-2); text-align: right; }
.overall-n b { color: var(--fg); font-size: 16px; }
.overall .bar { color: var(--easy); height: 8px; border-radius: 4px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.search { position: relative; flex: 1 1 260px; min-width: 0; }
.search input { width: 100%; padding-left: 36px; padding-right: 36px; height: 38px; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search input:focus ~ kbd, .search input:not(:placeholder-shown) ~ kbd { display: none; }
.filters-pop { position: relative; }
.filters-pop > summary { list-style: none; height: 38px; font-weight: 500; font-size: 13.5px; background: var(--panel); border-color: var(--line); color: var(--fg-2); }
.filters-pop > summary::-webkit-details-marker { display: none; }
.filters-pop[open] > summary { border-color: var(--accent); color: var(--fg); }
.badge { background: var(--accent); color: var(--accent-ink); font: 700 11px var(--font-mono); border-radius: 999px; min-width: 18px; height: 18px; display: inline-grid; place-items: center; padding: 0 5px; }
.badge:empty { display: none; }
.pop { position: absolute; z-index: 15; top: calc(100% + 6px); left: 0; width: 280px; background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--r-md); box-shadow: var(--shadow); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.pop > label:not(.toggle) { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 600; color: var(--muted); }
.pop select { width: 100%; font-size: 13.5px; color: var(--fg); font-weight: 400; }
.pop .linkish { align-self: flex-start; font-size: 13px; }
.view-seg { margin-left: auto; }
.active-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.active-filters:empty { display: none; }
.fchip { display: inline-flex; gap: 6px; align-items: center; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); color: var(--accent-strong); border-radius: 999px; font-size: 12.5px; padding: 3px 10px; cursor: pointer; }
.fchip span[aria-hidden] { opacity: 0.7; font-size: 14px; line-height: 1; }
.fchip:hover span[aria-hidden] { opacity: 1; }
#plist { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.group { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; }
.group > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 18px auto auto minmax(0, 1fr) 200px; grid-template-areas: "chev name mode blurb prog"; gap: 4px 12px; align-items: center; padding: 16px 18px; }
.group > summary::-webkit-details-marker { display: none; }
.group > summary:hover { background: var(--panel-2); }
.g-chev { grid-area: chev; color: var(--muted); display: grid; transition: transform 0.15s; }
.group[open] .g-chev { transform: rotate(90deg); }
.g-name { grid-area: name; font-weight: 650; font-size: 16px; }
.g-mode { grid-area: mode; display: inline-flex; gap: 5px; align-items: center; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px 1px 7px; white-space: nowrap; }
.g-blurb { grid-area: blurb; color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-prog { grid-area: prog; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; color: var(--easy); }
.g-count { font: 500 12.5px var(--font-mono); color: var(--fg-2); white-space: nowrap; }
.group .table-card { border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.table-card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--panel); overflow: hidden; }
.list-foot { color: var(--muted); font-size: 13px; text-align: center; margin: 4px 0 0; }
.ptable { width: 100%; border-collapse: collapse; }
.ptable th { text-align: left; font: 600 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--bg-raise); white-space: nowrap; }
.ptable td { padding: 0 14px; height: 50px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ptable tr:last-child td { border-bottom: 0; }
.ptable tbody tr { cursor: pointer; }
.ptable tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--panel-2) 50%, transparent); }
.ptable tbody tr:hover td { background: var(--panel-2); }
.c-status { width: 52px; }
.c-title a { color: var(--fg); font-weight: 500; }
.c-title a:hover { color: var(--accent); text-decoration: none; }
.kit-dot { margin-left: 10px; font: 600 10px var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 4px; padding: 1px 5px; vertical-align: 1px; }
.c-where { width: 140px; }
.where { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.c-diff { width: 110px; }
.c-best { width: 70px; text-align: right !important; font-family: var(--font-mono); }
.status-box { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; border: 1.5px solid var(--line-strong); background: transparent; cursor: pointer; padding: 0; color: var(--accent-ink); }
.status-box:hover { border-color: var(--easy); }
.status-box[data-s="solved"] { background: var(--easy); border-color: var(--easy); }
.status-box[data-s="attempted"] { border-color: var(--medium); background: var(--medium-soft); }
.status-box[data-s="attempted"]::after { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--medium); }

/* ---------- problem workspace ---------- */
body.fullbleed .foot { display: none; }
body.fullbleed .view { flex: none; display: flex; flex-direction: column; height: calc(100dvh - var(--top-h) - env(safe-area-inset-top, 0px)); min-height: 520px; }
.problem { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.pbar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg-raise); min-width: 0; }
.pbar-btn { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid transparent; background: none; color: var(--fg-2); font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.pbar-btn:hover { background: var(--panel-2); color: var(--fg); text-decoration: none; }
.pbar-btn.icon { width: 30px; padding: 0; justify-content: center; font-size: 20px; line-height: 1; }
.pbar-btn.off { opacity: 0.35; pointer-events: none; }
.pbar-nav { display: inline-flex; gap: 2px; padding-left: 6px; border-left: 1px solid var(--line); }
.pbar-title { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-left: 6px; min-width: 0; }
.pbar-sp { flex: 1; }
.solved-btn { border-color: var(--line); }
.solved-btn[data-s="solved"] { color: var(--easy); border-color: color-mix(in srgb, var(--easy) 45%, transparent); background: var(--easy-soft); }
.split { --left: 46%; flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, var(--left)) 8px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); padding: 8px; gap: 0; background: var(--bg); }
.split.dragging { cursor: col-resize; user-select: none; }
.split.dragging iframe { pointer-events: none; }
.pane { display: flex; flex-direction: column; min-height: 0; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); overflow: hidden; }
.gutter { cursor: col-resize; display: grid; place-items: center; touch-action: none; }
.gutter span { width: 2px; height: 32px; border-radius: 2px; background: var(--line-strong); transition: background 0.15s, height 0.15s; }
.gutter:hover span, .gutter:focus-visible span, .split.dragging .gutter span { background: var(--accent); height: 100%; }
.gutter:focus-visible { outline: none; }
.ptabs { display: flex; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--line); background: var(--bg-raise); overflow-x: auto; scrollbar-width: none; flex: none; }
.ptabs button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer; padding: 10px 12px 9px; font-size: 13.5px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.ptabs button:hover { color: var(--fg); }
.ptabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.ptabs .count { font: 500 11px var(--font-mono); color: var(--muted); background: var(--panel-3); border-radius: 999px; padding: 0 6px; }
.pane-body { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.pane-body.flush { overflow: hidden; display: flex; }
.pad { padding: 22px 24px 40px; }

/* question description: clearly separated blocks */
.q-head { padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.q-head h1 { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.q-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; font-size: 13px; color: var(--fg-2); }
.meta-i { display: inline-flex; align-items: center; gap: 6px; }
.meta-i svg { color: var(--muted); }
.meta-i.kit { color: var(--accent); }
.q-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: var(--panel-2); color: var(--fg-2); border: 1px solid var(--line); }
.tag.company { color: var(--fg); border-color: var(--line-strong); background: transparent; font-weight: 500; }
.tag.src { font: 500 10.5px var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: transparent; }
.q-rule { display: flex; gap: 12px; align-items: baseline; padding: 10px 14px; border-radius: var(--r-sm); background: var(--panel-2); font-size: 13.5px; color: var(--fg-2); margin-bottom: 26px; }
.q-rule-k { font: 600 10.5px var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); white-space: nowrap; }
.q-sec { margin-bottom: 30px; }
.q-label { display: flex; align-items: center; gap: 8px; font: 600 11.5px var(--font-mono); text-transform: uppercase; letter-spacing: 0.09em; color: var(--muted); margin-bottom: 14px; }
.q-label::after { content: ""; flex: 1; height: 1px; background: var(--line); order: 9; }
.q-count { background: var(--panel-3); color: var(--fg-2); border-radius: 999px; padding: 0 7px; font-size: 11px; letter-spacing: 0; }
.q-label-act { order: 10; font: 500 12.5px var(--font-body); text-transform: none; letter-spacing: 0; }
.q-note { color: var(--muted); font-size: 13px; margin: -6px 0 14px; }
.ws .q-note, .setup .q-note, .pad > .q-note { margin: 0; }
.phases { display: flex; flex-direction: column; gap: 12px; }
.phase { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-raise); overflow: hidden; }
.phase-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel-2); }
.phase-head h3 { font-size: 15px; font-weight: 650; flex: 1; min-width: 0; }
.phase-n { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 6px; background: var(--accent); color: var(--accent-ink); font: 700 12px var(--font-mono); }
.phase-tag { font: 600 10.5px var(--font-mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--accent); display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; }
.phase-body { padding: 16px 18px 6px; }
.phase.locked { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; cursor: pointer; text-align: left; border-style: dashed; background: transparent; color: var(--fg-2); font-size: 14.5px; font-weight: 500; }
.phase.locked .phase-n { background: var(--panel-3); color: var(--fg-2); }
.phase.locked .phase-title { flex: 1; }
.phase.locked .phase-tag { color: var(--muted); }
.phase.locked:hover { border-color: var(--accent); color: var(--fg); }
.phase.locked:hover .phase-tag { color: var(--accent); }

.prose { color: var(--fg); font-size: 14.5px; line-height: 1.68; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 5px 0; }
.prose li::marker { color: var(--muted); }
.prose h2 { font-size: 16px; margin: 26px 0 10px; }
.prose h3 { font-size: 15px; margin: 22px 0 8px; }
.prose strong { color: var(--fg); font-weight: 650; }
.prose blockquote { margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--line); border-left: 3px solid var(--medium); border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--panel-2); color: var(--fg-2); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote > p:first-child:has(> strong:first-child):not(:only-child) { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.prose blockquote strong:first-child { font-family: var(--font-mono); font-size: 13px; color: var(--medium); }
.prose :not(pre) > code { font-size: 0.86em; background: var(--panel-3); padding: 1px 6px; border-radius: 4px; color: var(--fg); }
.prose table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 0 0 16px; display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: 7px 10px; border: 1px solid var(--line); }
.prose th { background: var(--panel-2); font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
pre { background: var(--code-bg); color: var(--code-fg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; overflow-x: auto; font-size: 12.8px; line-height: 1.55; margin: 0 0 16px; }
pre code { background: none; border: 0; padding: 0; }
.hljs-keyword, .hljs-built_in, .hljs-literal, .hljs-meta { color: var(--tok-kw); }
.hljs-string, .hljs-regexp { color: var(--tok-str); }
.hljs-number { color: var(--tok-num); }
.hljs-comment { color: var(--tok-com); font-style: italic; }
.hljs-title, .hljs-title.function_, .hljs-params { color: var(--tok-fn); }
.hljs-addition { color: var(--tok-add); }
.hljs-deletion { color: var(--tok-del); }

/* rubric */
.rubric-intro { color: var(--fg-2); font-size: 14px; margin: 0 0 16px; }
.crit { border: 1px solid var(--line); border-radius: var(--r-md); margin-bottom: 12px; overflow: hidden; }
.crit-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 11px 14px; background: var(--panel-2); }
.crit-head h3 { font-size: 14px; font-weight: 600; }
.crit-tag { font: 500 10.5px var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); white-space: nowrap; }
.anchors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.anchor { padding: 10px 14px; font-size: 13px; color: var(--fg-2); border-top: 1px solid var(--line); }
.anchor + .anchor { border-left: 1px solid var(--line); }
.anchor b { display: block; font: 600 10.5px var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.anchor.s b { color: var(--easy); }
.anchor.w b { color: var(--medium); }
.anchor.r b { color: var(--hard); }
.outcome-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 18px; }
.outcome-table td, .outcome-table th { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.outcome-table th { font: 600 10.5px var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.outcome-table td.num { text-align: right; font-family: var(--font-mono); }
.checklist { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 5px; font-size: 13px; color: var(--fg-2); }
.checklist li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 7px; align-items: start; }
.checklist .mk { font: 600 12px var(--font-mono); line-height: 1.5; }
.checklist li.met .mk { color: var(--easy); }
.checklist li.not_met .mk { color: var(--hard); }
.checklist li.not_observed .mk { color: var(--muted); }
.checklist li.flag .mk, .checklist li.flag { color: var(--hard); }
.checklist.plain { margin: 0; padding: 12px 14px; border-top: 1px solid var(--line); }
.checklist.plain .mk { color: var(--muted); }
.checklist q { margin-top: 3px; }

.spoiler { border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: 36px 22px; text-align: center; color: var(--fg-2); display: flex; flex-direction: column; gap: 10px; align-items: center; font-size: 14px; }
.spoiler strong { color: var(--fg); font-size: 16px; }
.spoiler .btn { margin-top: 6px; }
.sp-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--panel-3); color: var(--fg-2); }
.sp-ico svg { width: 18px; height: 18px; }
.sol-code-cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); border-radius: var(--r-md); margin-bottom: 22px; flex-wrap: wrap; }
.sol-code-cta div { display: flex; flex-direction: column; font-size: 13px; color: var(--fg-2); }
.sol-code-cta b { color: var(--fg); font-size: 14px; }
.hints { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.hint { border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px 16px; background: var(--bg-raise); }
.hint p { margin: 4px 0 0; font-size: 14.5px; }
.hint-n { font: 600 11px var(--font-mono); color: var(--accent); text-transform: uppercase; letter-spacing: 0.08em; }
.hint.locked { display: flex; justify-content: space-between; align-items: center; width: 100%; border-style: dashed; background: transparent; cursor: pointer; color: var(--fg-2); font-size: 13.5px; text-align: left; }
.hint.locked span:last-child { display: inline-flex; gap: 6px; align-items: center; }
button.hint.locked:hover { border-color: var(--accent); color: var(--fg); }
.hint.locked.dim { opacity: 0.45; cursor: default; }
.hint.locked.dim .hint-n { color: var(--muted); }
.video-wrap { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r-md); overflow: hidden; background: #000; border: 1px solid var(--line); }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* right pane: answer + solve */
.ws { display: flex; flex-direction: column; gap: 16px; }
.ws-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.editor-box { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-raise); display: flex; flex-direction: column; overflow: hidden; }
.editor-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.eb-head, .eb-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; font-size: 12.5px; color: var(--muted); }
.eb-head { border-bottom: 1px solid var(--line); font: 600 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; }
.eb-foot { border-top: 1px solid var(--line); flex-wrap: wrap; }
.editor-box textarea { border: 0; border-radius: 0; background: transparent; min-height: 340px; resize: vertical; font: 14px/1.65 var(--font-mono); padding: 14px; box-shadow: none !important; }
.ws textarea#answer:not(.editor-box textarea) { width: 100%; min-height: 200px; resize: vertical; font: 13px/1.55 var(--font-mono); }
.provider-line { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.on { background: var(--easy); }
.ws-card { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-raise); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.ws-card-head { display: flex; gap: 12px; align-items: flex-start; }
.ws-card-head h3 { font-size: 15px; }
.ws-card-head p { margin: 2px 0 0; color: var(--fg-2); font-size: 13.5px; }
.ws-ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--panel-3); flex: none; }
.setup { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); }
.setup > summary { cursor: pointer; padding: 9px 12px; font-size: 13px; color: var(--fg-2); font-weight: 500; }
.setup-body { padding: 0 12px 12px; display: flex; flex-direction: column; gap: 6px; }
.stage { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.stage-k { display: flex; gap: 8px; align-items: center; font: 600 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.stage-k span { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; background: var(--panel-3); color: var(--fg); font-size: 10.5px; letter-spacing: 0; }
.cmd-item { display: grid; grid-template-columns: minmax(170px, 0.9fr) minmax(0, 1.1fr); gap: 12px; align-items: center; }
.cmd-item > span { font-size: 13px; color: var(--fg-2); }
.drop { border: 1.5px dashed var(--line-strong); border-radius: var(--r-sm); padding: 16px; text-align: center; color: var(--fg-2); font-size: 13px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.drop code { font-size: 12px; color: var(--fg); word-break: break-all; }
.drop span { color: var(--muted); }
.drop:hover { border-color: var(--muted); }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
details.more { border-top: 1px solid var(--line); padding-top: 14px; }
details.more summary { cursor: pointer; color: var(--fg-2); font-size: 13.5px; font-weight: 500; }
details.more[open] summary { margin-bottom: 10px; }
details.more > * + * { margin-top: 8px; }
.attempts { display: flex; align-items: center; gap: 20px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-raise); flex-wrap: wrap; }
.att-stat { display: flex; flex-direction: column; line-height: 1.15; }
.att-stat b { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.att-stat b.ok { color: var(--easy); }
.att-stat span { font: 500 10.5px var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.spark { margin-left: auto; overflow: visible; }
.spark path { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: var(--accent); stroke: var(--bg-raise); stroke-width: 2; }
.spark .ref { stroke: var(--line-strong); stroke-dasharray: 3 3; stroke-width: 1; }
.history { display: flex; flex-direction: column; gap: 6px; }
.history button { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel); cursor: pointer; text-align: left; }
.history button:hover { border-color: var(--line-strong); }
.after-grade { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

/* grade result */
.result { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--bg-raise); }
.result-top { display: flex; align-items: center; gap: 16px; padding: 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.verdict { font: 700 11.5px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 5px 10px; border-radius: 5px; white-space: nowrap; }
.verdict.strong-pass, .verdict.pass { color: var(--easy); background: var(--easy-soft); }
.verdict.no-pass { color: var(--hard); background: var(--hard-soft); }
.verdict.ungraded { color: var(--medium); background: var(--medium-soft); }
.total { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; }
.total small { font-size: 14px; color: var(--muted); font-weight: 500; }
.result-meta { margin-left: auto; font-size: 12px; color: var(--muted); text-align: right; }
.result-sec { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.result-sec:last-child { border-bottom: 0; }
.result-sec h4 { margin: 0 0 10px; font: 600 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); display: flex; justify-content: space-between; }
.rrow { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.rrow:first-of-type { border-top: 0; }
.rrow .lbl { font-weight: 600; font-size: 13.5px; }
.rrow .fb { font-size: 13px; color: var(--fg-2); margin-top: 4px; }
.rrow q { display: block; quotes: none; font: 12px/1.5 var(--font-mono); color: var(--fg-2); border-left: 2px solid var(--line-strong); padding: 2px 8px; margin-top: 6px; white-space: pre-wrap; word-break: break-word; }
.pct { font: 700 14px var(--font-mono); color: var(--fg); }
.pct.bad { color: var(--hard); }
.rel { font: 500 12px var(--font-mono); color: var(--muted); margin: 0 0 8px; }
.rel.warn { color: var(--medium); }
.meter { display: flex; gap: 3px; padding-top: 3px; }
.meter i { width: 14px; height: 14px; border-radius: 3px; background: var(--line); display: block; }
.meter.s3 i { background: var(--easy); }
.meter.s2 i:nth-child(-n+2) { background: var(--accent); }
.meter.s1 i:nth-child(1) { background: var(--medium); }
.meter.s0 i:nth-child(1) { background: var(--hard); opacity: 0.85; }
.meter.no i { background: repeating-linear-gradient(45deg, var(--line) 0 3px, transparent 3px 6px); }
.no-obs { font: 500 10px var(--font-mono); color: var(--muted); text-transform: uppercase; display: block; margin-top: 4px; }
.lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.lists ul { margin: 0; padding-left: 18px; font-size: 13px; color: var(--fg-2); }
.tests-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 80px; gap: 8px; font-size: 13px; padding: 5px 0; font-variant-numeric: tabular-nums; }
.tests-row span:nth-child(n+2) { text-align: right; font-family: var(--font-mono); }
.gate { font-size: 13px; padding: 3px 0; }
.mutants { list-style: none; margin: 0 0 6px; padding: 0 0 0 12px; font-size: 12.5px; display: grid; gap: 2px; }
.mutants li { color: var(--fg-2); }
.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 13px; }
.facts b { display: block; font: 600 10.5px var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.grading-live { display: flex; align-items: center; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); color: var(--fg-2); font-size: 14px; background: var(--bg-raise); }
.spinner { display: flex; gap: 3px; }
.spinner i { width: 7px; height: 7px; border-radius: 2px; background: var(--accent); animation: pulse 1s infinite ease-in-out; display: block; }
.spinner i:nth-child(2) { animation-delay: 0.15s; }
.spinner i:nth-child(3) { animation-delay: 0.3s; }
@keyframes pulse { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }

/* ---------- editor (read-only IDE) ---------- */
.ide { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; background: var(--ide-bg); color: var(--ide-fg); font-size: 13px; }
.ide-loading { padding: 24px; color: var(--ide-dim); }
.ide-bar { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 8px; background: var(--ide-bar); border-bottom: 1px solid var(--ide-line); flex: none; }
.ide-title { font-size: 12.5px; color: var(--ide-dim); }
.ide-sp { flex: 1; }
.ide-count { font: 12px var(--font-mono); color: var(--ide-dim); white-space: nowrap; }
.ib { border: 1px solid transparent; background: none; color: var(--ide-dim); border-radius: 4px; padding: 3px 8px; font-size: 12px; cursor: pointer; display: inline-grid; place-items: center; }
.ib:hover { background: var(--ide-hover); color: var(--ide-fg); }
.ib.icon { width: 28px; height: 28px; padding: 0; }
.ib[aria-pressed="true"] { color: var(--ide-fg); }
.ide-seg { display: inline-flex; background: var(--ide-bg); border: 1px solid var(--ide-line); border-radius: 5px; padding: 2px; }
.ide-seg button { border: 0; background: none; color: var(--ide-dim); font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 3px; cursor: pointer; }
.ide-seg button:hover { color: var(--ide-fg); }
.ide-seg button[aria-pressed="true"] { background: var(--ide-tab); color: var(--ide-fg); box-shadow: inset 0 -2px 0 var(--ide-status); }
.ide-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(170px, 230px) minmax(0, 1fr); }
.ide.no-side .ide-main { grid-template-columns: minmax(0, 1fr); }
.ide.no-side .ide-side { display: none; }
.ide-side { background: var(--ide-side); border-right: 1px solid var(--ide-line); display: flex; flex-direction: column; min-height: 0; }
.ide-side-head { font: 600 11px var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--ide-dim); padding: 10px 12px 6px; }
.ide-filter { padding: 0 8px 8px; }
.ide-filter input { width: 100%; min-height: 26px; height: 26px; padding: 2px 8px; font-size: 12px; background: var(--ide-bg); border-color: var(--ide-line); color: var(--ide-fg); border-radius: 3px; }
.ide-filter input:focus { box-shadow: none; border-color: var(--ide-status); }
.ide-sec { font: 600 11px var(--font-body); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ide-fg); padding: 6px 12px 4px; display: flex; justify-content: space-between; border-top: 1px solid var(--ide-line); }
.ide-sec span { background: var(--ide-hover); border-radius: 999px; padding: 0 6px; font-weight: 500; }
.ide-changes { padding-bottom: 6px; }
.ide-tree { flex: 1; overflow: auto; padding-bottom: 12px; min-height: 0; }
.tr { --d: 0; display: flex; align-items: center; gap: 4px; width: 100%; height: 22px; padding: 0 8px 0 calc(6px + var(--d) * 12px); border: 0; background: none; color: var(--ide-fg); font: 13px var(--font-body); text-align: left; cursor: pointer; white-space: nowrap; border-left: 1px solid transparent; }
.tr:hover { background: var(--ide-hover); }
.tr.on { background: var(--ide-sel); }
.tr .nm { overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.tr .chev { color: var(--ide-dim); flex: none; transform: rotate(90deg); transition: transform 0.1s; }
.tr.dir.closed .chev { transform: none; }
.chev-space { width: 16px; flex: none; }
.ide-changes .chev-space { width: 4px; }
.tr.st-changed .nm { color: var(--ide-m); }
.tr.st-new .nm { color: var(--ide-u); }
.deco { font: 600 11px var(--font-mono); margin-left: 6px; flex: none; }
.deco.m { color: var(--ide-m); }
.deco.u { color: var(--ide-u); }
.deco.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ide-m); opacity: 0.8; }
.fi { flex: none; width: 18px; text-align: center; font: 700 9.5px var(--font-mono); letter-spacing: -0.04em; }
.i-py { color: #4b8bbe; }
.i-md { color: #519aba; }
.i-json { color: #cbcb41; }
.i-cfg { color: #8a8a8a; font-size: 11px; }
.i-yaml { color: #a074c4; }
.i-sh { color: #89e051; }
.i-sql { color: #dad8d8; }
.i-txt { color: var(--ide-dim); }
.ide-empty { color: var(--ide-dim); padding: 8px 14px; margin: 0; font-size: 12.5px; }
.ide-editor { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ide-tabs { position: relative; display: flex; background: var(--ide-bar); overflow-x: auto; scrollbar-width: thin; flex: none; min-height: 35px; }
.etab { display: flex; align-items: center; gap: 6px; padding: 0 6px 0 12px; height: 35px; background: var(--ide-tab); color: var(--ide-dim); border-right: 1px solid var(--ide-line); cursor: pointer; white-space: nowrap; font-size: 13px; user-select: none; }
.etab .nm.m { color: var(--ide-m); }
.etab .nm.u { color: var(--ide-u); }
.etab.on { background: var(--ide-tab-on); color: var(--ide-fg); box-shadow: inset 0 1px 0 var(--ide-status); }
.etab .x { width: 20px; height: 20px; border: 0; background: none; color: inherit; border-radius: 4px; cursor: pointer; font-size: 16px; line-height: 1; opacity: 0; }
.etab.on .x, .etab:hover .x { opacity: 0.8; }
.etab .x:hover { background: var(--ide-hover); opacity: 1; }
.ide-crumbs { display: flex; align-items: center; gap: 4px; padding: 0 10px 0 14px; height: 26px; font-size: 12.5px; color: var(--ide-dim); background: var(--ide-tab-on); flex: none; white-space: nowrap; overflow: hidden; }
.ide-crumbs .leaf { color: var(--ide-fg); display: inline-flex; align-items: center; }
.ide-crumbs .sep { opacity: 0.6; }
.ide-actions { margin-left: auto; display: flex; gap: 2px; }
.ide-code { position: relative; flex: 1; min-height: 0; overflow: auto; font: 13px/20px var(--font-mono); padding: 4px 0 24px; tab-size: 4; }
.lines { min-width: max-content; }
.ln { display: grid; grid-template-columns: calc(var(--gw) + 26px) 6px auto; cursor: text; }
.ln:hover { background: var(--ide-cur); }
.ln.cur { background: var(--ide-cur); box-shadow: inset 0 1px 0 var(--ide-line), inset 0 -1px 0 var(--ide-line); }
.ln .no { color: var(--ide-gutter); text-align: right; padding-right: 14px; user-select: none; }
.ln.cur .no { color: var(--ide-gutter-on); }
.ln .mk { user-select: none; }
.ln.add .mk { background: var(--ide-add); width: 3px; }
.ln code { white-space: pre; padding: 0 24px 0 10px; color: var(--ide-fg); }
.ide-md { flex: 1; min-height: 0; overflow: auto; padding: 18px 26px 30px; background: var(--ide-bg); max-width: none; }
.ide-md.prose { color: var(--ide-fg); }
.ide-status { display: flex; align-items: center; gap: 2px; height: 24px; padding: 0 6px; background: var(--ide-status); color: #fff; font-size: 12px; flex: none; overflow: hidden; white-space: nowrap; }
.sb-item { padding: 0 8px; }
.sb-mode { font-weight: 600; }
.sb-sp { flex: 1; }
.ide .hljs-keyword { color: var(--ide-kw); }
.ide .hljs-built_in { color: var(--ide-cls); }
.ide .hljs-literal { color: var(--ide-kw); }
.ide .hljs-meta { color: var(--ide-fn); }
.ide .hljs-string, .ide .hljs-regexp { color: var(--ide-str); }
.ide .hljs-number { color: var(--ide-num); }
.ide .hljs-comment { color: var(--ide-com); font-style: normal; }
.ide .hljs-title.function_ { color: var(--ide-fn); }
.ide .hljs-title.class_, .ide .hljs-type { color: var(--ide-cls); }
.ide .hljs-params, .ide .hljs-variable, .ide .hljs-attr, .ide .hljs-property { color: var(--ide-var); }
.ide .hljs-subst { color: var(--ide-fg); }
.ide .hljs-section { color: var(--ide-kw); font-weight: 600; }
.ide .hljs-bullet { color: var(--ide-ctl); }
.ide .hljs-code { color: var(--ide-str); }
.ide .hljs-emphasis { font-style: italic; }
.ide .hljs-strong { font-weight: 700; }
.ide .hljs-link { color: var(--ide-var); }
.ide-md pre { background: var(--ide-side); border-color: var(--ide-line); }
.ide-md :not(pre) > code { background: var(--ide-hover); }
.ide.ide-max { position: fixed; inset: 0; z-index: 40; }
body.ide-open-max { overflow: hidden; }

/* ---------- progress ---------- */
.prog { display: flex; flex-direction: column; gap: 16px; }
.prog .page-head { margin-bottom: 8px; }
.prog-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.solved-panel { display: flex; align-items: center; gap: 28px; }
.ring { flex: none; }
.ring-bg { fill: none; stroke: var(--panel-3); stroke-width: 9; }
.ring-arc { fill: none; stroke: currentColor; stroke-width: 9; transform: rotate(-90deg); transform-origin: 64px 64px; }
.ring-n { fill: var(--fg); font: 700 30px var(--font-body); }
.ring-l { fill: var(--muted); font: 500 10px var(--font-body); }
.diff-rows { flex: 1; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dr { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: baseline; }
.dr-l { font-weight: 600; font-size: 13.5px; }
.dr-n { font: 500 12.5px var(--font-mono); color: var(--muted); }
.dr-n b { color: var(--fg); }
.dr .bar { grid-column: 1 / -1; }
.stat-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; padding: 0; overflow: hidden; }
.stat { padding: 18px 20px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat:nth-child(odd) { border-right: 1px solid var(--line); }
.stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
.sl { font: 600 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.sv { font-size: 28px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sv small { font-size: 14px; font-weight: 500; color: var(--muted); }
.ss { font-size: 12.5px; color: var(--fg-2); display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.tcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tcard { text-align: left; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-raise); padding: 14px; display: flex; flex-direction: column; gap: 10px; cursor: pointer; color: var(--easy); }
.tcard:hover { border-color: var(--line-strong); background: var(--panel-2); }
.tc-top { display: flex; justify-content: space-between; align-items: center; color: var(--fg); }
.tc-name { font-weight: 600; font-size: 14px; }
.tc-mode { color: var(--muted); display: grid; }
.tc-foot { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.tc-foot b { color: var(--fg); }
.import { padding: 0; }
.import > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 22px; font-size: 14px; }
.import > summary::-webkit-details-marker { display: none; }
.import > summary svg { color: var(--muted); transition: transform 0.15s; }
.import[open] > summary svg { transform: rotate(90deg); }
.import > :not(summary) { margin: 0 22px 16px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.two.inner { gap: 24px; }
.two.inner .subhead { margin-top: 0; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--fg-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; }
.lg-line { width: 16px; height: 2px; background: var(--fg-2); display: inline-block; border-radius: 1px; }
.lg-ref { width: 16px; height: 0; border-top: 1.5px dashed var(--muted); display: inline-block; }
.chart-wrap { overflow-x: auto; }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .tick { fill: var(--muted); font: 11px var(--font-mono); }
.chart .ref { stroke: var(--muted); stroke-dasharray: 4 4; stroke-width: 1.5; }
.chart .ref-label { fill: var(--muted); font: 11px var(--font-mono); }
.chart .avg { fill: none; stroke: var(--fg-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--accent); stroke: var(--panel); stroke-width: 2; cursor: default; }
.chart .dot:hover, .chart .dot:focus { r: 6.5; outline: none; }
.heat { width: auto; max-width: none; }
.hm { cursor: default; }
.hm.l0, .heat-key i.l0 { fill: var(--panel-3); background: var(--panel-3); }
.hm.l1, .heat-key i.l1 { fill: color-mix(in srgb, var(--easy) 30%, var(--panel)); background: color-mix(in srgb, var(--easy) 30%, var(--panel)); }
.hm.l2, .heat-key i.l2 { fill: color-mix(in srgb, var(--easy) 52%, var(--panel)); background: color-mix(in srgb, var(--easy) 52%, var(--panel)); }
.hm.l3, .heat-key i.l3 { fill: color-mix(in srgb, var(--easy) 76%, var(--panel)); background: color-mix(in srgb, var(--easy) 76%, var(--panel)); }
.hm.l4, .heat-key i.l4 { fill: var(--easy); background: var(--easy); }
.heat-key { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); margin-top: 10px; justify-content: flex-end; }
.heat-key i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) 34px 64px; gap: 10px; align-items: center; font-size: 13px; }
.hb-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg); }
.hb-track { position: relative; height: 10px; background: var(--panel-3); border-radius: 3px; }
.hb-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 3px; }
.hb-pass { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 1.5px dashed var(--fg-2); }
.hb-val { font: 600 13px var(--font-mono); text-align: right; }
.hb-go { font-size: 12.5px; text-align: right; }
.qlinks { display: flex; flex-direction: column; gap: 6px; }
.qlink { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); color: var(--fg); font-size: 13.5px; background: var(--bg-raise); }
.qlink:hover { border-color: var(--line-strong); text-decoration: none; }
.qlink > span:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rtable { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.rtable th, .rtable td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rtable tr:last-child td { border-bottom: 0; }
.rtable th { font: 600 10.5px var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.rtable td:nth-child(2) { white-space: normal; }
.rtable td a { color: var(--fg); }
.rtable .num { text-align: right; font-family: var(--font-mono); }
.rtable .verdict { font-size: 10.5px; padding: 3px 7px; }
.tip { position: fixed; z-index: 60; pointer-events: none; background: var(--fg); color: var(--bg); font: 500 12px var(--font-body); padding: 6px 9px; border-radius: 5px; box-shadow: var(--shadow); max-width: 280px; }

/* ---------- docs pages ---------- */
.doc { max-width: 800px; padding-block: 40px 64px; }
.doc h1 { font-size: 30px; margin-bottom: 10px; }
.doc .lede { color: var(--fg-2); font-size: 16.5px; margin: 0 0 28px; }
.doc h2 { font-size: 19px; margin: 36px 0 12px; padding-top: 24px; border-top: 1px solid var(--line); }
.doc p, .doc li { color: var(--fg-2); }
.doc .cmd { margin: 8px 0 12px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 16px; }
.doc th, .doc td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { font: 600 11px var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.doc td.num { font-family: var(--font-mono); text-align: right; white-space: nowrap; }
.doc td code { word-break: break-word; }
tr.layer td { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); padding-top: 16px; }
.callout { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r-sm); padding: 12px 14px; background: var(--panel); color: var(--fg-2); font-size: 14px; margin: 14px 0; }

/* ---------- modal + toast ---------- */
.modal { border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--panel); color: var(--fg); padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(5, 8, 12, 0.6); backdrop-filter: blur(2px); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 17px; }
.modal-body { padding: 16px 18px; display: flex; flex-direction: column; gap: 18px; }
.modal-foot { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .field .label { font-size: 13px; font-weight: 600; }
.field .help { font-size: 12.5px; color: var(--muted); margin: 0; }
.field input, .field select { width: 100%; }
.radio-cards { display: grid; gap: 8px; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; cursor: pointer; }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.field .radio-card input[type="radio"] { width: auto; flex: none; margin-top: 3px; accent-color: var(--accent); }
.radio-card b { display: block; font-size: 14px; }
.radio-card span { font-size: 12.5px; color: var(--muted); }
.radio-card[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.sub-fields { display: grid; gap: 10px; padding: 4px 0 0 26px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 9px 16px; border-radius: var(--r-sm); font-size: 14px; font-weight: 500; z-index: 50; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }

/* ---------- presenter (author builds only) ---------- */
body.presenting .topbar, body.presenting .foot { display: none; }
.present { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: var(--bg); }
.slide { flex: 1; overflow: auto; width: 100%; max-width: 1180px; margin: 0 auto; padding: 7vh 5vw 4vh; font-size: clamp(17px, 1.55vw, 30px); line-height: 1.55; }
.slide .prose { max-width: none; font-size: 1em; }
.slide .prose h2 { font-size: 1.35em; margin-top: 0; }
.slide .prose pre { font-size: 0.8em; }
.sl-kicker { font-family: var(--font-mono); font-size: 0.6em; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 1.2em; }
.slide.title, .slide.end { display: flex; flex-direction: column; justify-content: center; }
.slide.title h1, .slide.end h1 { font-size: 2.4em; line-height: 1.15; margin: 0.25em 0 0.5em; }
.sl-id { font-family: var(--font-mono); color: var(--muted); font-size: 0.7em; letter-spacing: 0.08em; text-transform: uppercase; }
.slide .sl-sum { color: var(--fg-2); font-size: 1.05em; max-width: 46ch; margin: 1em 0 0.6em; }
.sl-facts { color: var(--muted); font-family: var(--font-mono); font-size: 0.65em; }
.slide .p-meta { font-size: 0.6em; display: flex; gap: 8px; flex-wrap: wrap; }
.sl-crit > li { margin-bottom: 0.6em; }
.sl-crit ul { color: var(--fg-2); font-size: 0.85em; }
.sl-bar { display: flex; align-items: center; gap: 12px; padding: 10px max(16px, 3vw); border-top: 1px solid var(--line); background: var(--bg-raise); }
.sl-exit { color: var(--fg-2); }
.sl-progress { flex: 1; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.sl-progress i { display: block; height: 100%; background: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .g-blurb { display: none; }
  .group > summary { grid-template-columns: 18px auto minmax(0, 1fr) 180px; grid-template-areas: "chev name mode prog"; }
  .g-mode { justify-self: start; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  /* the workspace stacks: question first, then editor/answer */
  body.fullbleed .view { height: auto; display: block; flex: 1; }
  body.fullbleed .foot { display: block; }
  .split { display: flex; flex-direction: column; gap: 10px; padding: 10px; }
  .gutter { display: none; }
  .pane-body { overflow: visible; }
  .pane-body.flush { height: 72vh; min-height: 420px; }
  .pbar { position: sticky; top: calc(var(--top-h) + env(safe-area-inset-top, 0px)); z-index: 10; }
  .ways, .track-groups, .prog-top, .two { grid-template-columns: minmax(0, 1fr); }
  .points { grid-template-columns: minmax(0, 1fr); }
  .tcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c-where { display: none; }
}
@media (max-width: 720px) {
  .nav { position: static; transform: none; }
  .nav a { padding: 6px 9px; font-size: 14px; }
  .nav a[aria-current="page"]::after { left: 9px; right: 9px; }
  .topbar-inner { gap: 10px; }
  .progress-pill { display: none; }
  .page { padding-block: 24px 48px; }
  .page-head h1 { font-size: 26px; }
  .overall { min-width: 0; width: 100%; }
  .overall-n { text-align: left; }
  .view-seg { margin-left: 0; }
  .flow { grid-template-columns: minmax(0, 1fr); }
  .home-hero .wrap { padding-block: 48px 40px; }
  .hero-stats { flex-wrap: wrap; width: 100%; }
  .hero-stats div { flex: 1 1 45%; padding: 10px 12px; }
  .hero-stats div:nth-child(3) { border-left: 0; }
  .hero-stats div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .home-sec { padding-top: 48px; }
  .group > summary { grid-template-columns: 18px minmax(0, 1fr) auto; grid-template-areas: "chev name mode" ". prog prog"; padding: 14px; }
  .ptable thead { display: none; }
  .ptable td { height: auto; padding: 12px 8px; }
  .ptable td.c-status { padding-left: 14px; width: 40px; }
  .c-diff { width: auto; }
  .c-best { display: none; }
  .kit-dot { display: none; }
  .pad { padding: 18px 16px 32px; }
  .cmd-item { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .anchors { grid-template-columns: minmax(0, 1fr); }
  .anchor + .anchor { border-left: 0; }
  .lists { grid-template-columns: minmax(0, 1fr); }
  .result-meta { margin-left: 0; text-align: left; width: 100%; }
  .solved-panel { flex-direction: column; align-items: stretch; }
  .ring { align-self: center; }
  .tcards { grid-template-columns: minmax(0, 1fr); }
  .hbar { grid-template-columns: minmax(0, 110px) minmax(0, 1fr) 30px 56px; }
  .pbar-btn span { display: none; }
  .ide-main { grid-template-columns: minmax(0, 1fr); position: relative; }
  .ide-side { position: absolute; inset: 0 auto 0 0; width: min(80%, 300px); z-index: 2; box-shadow: var(--shadow); }
  .ide-count { display: none; }
  .sb-item:nth-last-child(-n+3) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
.ptable.grouped .c-where { display: none; }
