/* =========================================================================
   Exam Practice: stylesheet
   Look: a clean answer sheet. Paper, ink, and filled-in bubbles.
   ========================================================================= */

/* ---------- tokens ---------- */
:root {
  --paper: #f5f3ec;
  --surface: #fffefb;
  --surface-2: #f0ede4;
  --sunken: #ebe7dc;
  --ink: #1c1d21;
  --ink-2: #3d3f45;
  --muted: #6b6a66;
  --line: #dcd7ca;
  --line-strong: #c4bead;

  --accent: #2443c4;
  --accent-ink: #ffffff;
  --accent-soft: #e6eafb;
  --accent-line: #b9c4f1;

  --good: #1d7a4b;
  --good-soft: #e3f3ea;
  --good-line: #9fd2b5;
  --ok: #8a5508;
  --ok-soft: #fbf0db;
  --bad: #bf3a31;
  --bad-soft: #fbe7e4;
  --bad-line: #eeb2ab;
  --flag: #c76a07;
  --flag-soft: #fdf0dd;

  --shadow-1: 0 1px 2px rgb(40 35 20 / .06), 0 1px 1px rgb(40 35 20 / .04);
  --shadow-2: 0 2px 6px rgb(40 35 20 / .07), 0 10px 28px rgb(40 35 20 / .08);
  --shadow-3: 0 18px 50px rgb(20 18 10 / .22);

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;

  --font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Atkinson Hyperlegible Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 32px);
  --topbar-h: 60px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #131416;
    --surface: #1b1d20;
    --surface-2: #222529;
    --sunken: #0f1012;
    --ink: #ece9e2;
    --ink-2: #cfccc4;
    --muted: #9d9a92;
    --line: #2f3237;
    --line-strong: #43474e;
    --accent: #8fa3ff;
    --accent-ink: #0d1330;
    --accent-soft: #1f2645;
    --accent-line: #3b4a8f;
    --good: #5cc48f;
    --good-soft: #15291f;
    --good-line: #2c5d43;
    --ok: #e2ac4f;
    --ok-soft: #2d2412;
    --bad: #f27d72;
    --bad-soft: #321a18;
    --bad-line: #6b302a;
    --flag: #f0a04b;
    --flag-soft: #2f2210;
    --shadow-1: 0 1px 2px rgb(0 0 0 / .4);
    --shadow-2: 0 2px 8px rgb(0 0 0 / .35), 0 12px 30px rgb(0 0 0 / .3);
    --shadow-3: 0 20px 60px rgb(0 0 0 / .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #131416;
  --surface: #1b1d20;
  --surface-2: #222529;
  --sunken: #0f1012;
  --ink: #ece9e2;
  --ink-2: #cfccc4;
  --muted: #9d9a92;
  --line: #2f3237;
  --line-strong: #43474e;
  --accent: #8fa3ff;
  --accent-ink: #0d1330;
  --accent-soft: #1f2645;
  --accent-line: #3b4a8f;
  --good: #5cc48f;
  --good-soft: #15291f;
  --good-line: #2c5d43;
  --ok: #e2ac4f;
  --ok-soft: #2d2412;
  --bad: #f27d72;
  --bad-soft: #321a18;
  --bad-line: #6b302a;
  --flag: #f0a04b;
  --flag-soft: #2f2210;
  --shadow-1: 0 1px 2px rgb(0 0 0 / .4);
  --shadow-2: 0 2px 8px rgb(0 0 0 / .35), 0 12px 30px rgb(0 0 0 / .3);
  --shadow-3: 0 20px 60px rgb(0 0 0 / .6);
  color-scheme: dark;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
html[data-size="s"] { font-size: 14.5px; }
html[data-size="l"] { font-size: 18px; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { flex: 1; outline: none; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
a { color: var(--accent); text-underline-offset: 3px; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }
[hidden] { display: none !important; }

code, kbd, pre { font-family: var(--mono); font-size: .9em; }
:not(pre) > code {
  overflow-wrap: anywhere;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: .05em .35em;
  white-space: break-spaces;
}
kbd {
  display: inline-block;
  min-width: 1.8em;
  padding: .1em .45em;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--surface);
  font-size: .82em;
  text-align: center;
}

.icon { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
.muted { color: var(--muted); }
.faint { opacity: .55; }
.small { font-size: .875rem; }
.center { text-align: center; }
.spacer { flex: 1; }
.mt { margin-top: 1.4rem; }
.good { color: var(--good); }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
strong.good, strong.ok, strong.bad { font-weight: 700; }
.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }

.skip {
  position: absolute; left: -999px; top: 8px; z-index: 100;
  background: var(--ink); color: var(--paper); padding: .5rem .8rem; border-radius: 8px;
}
.skip:focus { left: 8px; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 var(--gutter);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: .6rem;
  color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.05rem;
  min-width: 0;
}
.brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.brand-mark circle { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.brand-mark circle.filled { fill: var(--accent); stroke: var(--accent); }
.topnav { margin-left: auto; display: flex; gap: .25rem; }
.topnav a {
  color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: .45rem .8rem; border-radius: 999px;
}
.topnav a:hover { background: var(--surface-2); }
.topnav a.active { background: var(--ink); color: var(--paper); }

body.focus-mode .topbar, body.focus-mode .sitefoot { display: none; }

/* ---------- page shells ---------- */
.page {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) var(--gutter) 64px;
}
.page.narrow { max-width: 760px; }
.loading { padding: 4rem var(--gutter); text-align: center; color: var(--muted); }
.empty-state { text-align: center; padding-top: clamp(40px, 10vh, 100px); }
.empty-state .crumbs { justify-content: center; }
.empty-state p { color: var(--muted); max-width: 52ch; margin-left: auto; margin-right: auto; }
.empty-state .btn { margin-top: .5rem; }
.lead { font-size: 1.08rem; color: var(--ink-2); max-width: 62ch; }

.sitefoot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem;
  padding: 18px var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: .85rem;
}
.sitefoot a { color: var(--muted); }

.crumbs { display: flex; flex-wrap: wrap; gap: .3rem; font-size: .9rem; margin-bottom: 1rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs a + a::before { content: "›"; margin-right: .3rem; color: var(--line-strong); }

.section-title { margin-top: 2.4rem; font-size: 1.1rem; }
.section-sub { margin-top: -.3rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 42px;
  padding: .5rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 600; font-size: .95rem; line-height: 1.2;
  text-decoration: none;
  box-shadow: var(--shadow-1);
  transition: background .12s, border-color .12s, transform .06s, box-shadow .12s;
  user-select: none;
  white-space: nowrap;
}
@media (hover: hover) { .btn:hover { background: var(--surface-2); border-color: var(--ink-2); } }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
@media (hover: hover) { .btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); border-color: color-mix(in srgb, var(--accent) 88%, var(--ink)); } }
.btn.small { min-height: 34px; padding: .3rem .75rem; font-size: .875rem; border-radius: 8px; }
.btn.big { min-height: 50px; padding: .7rem 1.4rem; font-size: 1.02rem; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.danger-outline { color: var(--bad); border-color: var(--bad-line); }
.btn.danger-outline:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.bad-btn { color: var(--bad); border-color: var(--bad-line); }
.btn.bad-btn:hover { background: var(--bad-soft); }
label.btn { cursor: pointer; }

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px;
  border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--ink-2);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn .icon { width: 20px; height: 20px; }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.small .icon { width: 17px; height: 17px; }

.link-btn {
  border: 0; background: none; padding: .2rem 0;
  color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px;
  display: inline-flex; align-items: center; gap: .35rem;
}
.link-btn:hover { color: var(--ink); }

/* ---------- tags & chips ---------- */
.tag {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .12rem .55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: .78rem; font-weight: 600; line-height: 1.5;
  white-space: nowrap;
}
.tag .icon { width: .95em; height: .95em; }
.tag.diff-easy { color: var(--good); border-color: var(--good-line); background: var(--good-soft); }
.tag.diff-medium { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-soft); }
.tag.diff-hard { color: var(--bad); border-color: var(--bad-line); background: var(--bad-soft); }
.tag.flag-tag { color: var(--flag); background: var(--flag-soft); border-color: color-mix(in srgb, var(--flag) 40%, transparent); }

.chip-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
label.chip { position: relative; cursor: pointer; }
label.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
label.chip span {
  display: inline-flex; align-items: center; gap: .4rem;
  min-height: 38px; padding: .4rem .9rem;
  border: 1.5px solid var(--line-strong); border-radius: 999px;
  background: var(--surface);
  font-weight: 600; font-size: .92rem;
  transition: background .12s, border-color .12s;
}
label.chip span::before {
  content: ""; width: .7em; height: .7em; border-radius: 50%;
  border: 1.5px solid var(--line-strong); flex: none;
}
label.chip input[type="checkbox"] + span::before { border-radius: 3px; }
label.chip:hover span { border-color: var(--ink-2); }
label.chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); }
label.chip input:checked + span::before { background: var(--accent); border-color: var(--accent); }
label.chip input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- forms ---------- */
.setup-form { display: grid; gap: 1.1rem; margin-top: 1.5rem; }
.setup-form fieldset {
  margin: 0; padding: 1.1rem 1.2rem 1.2rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
}
.setup-form legend {
  padding: 0 .4rem; margin-left: -.4rem;
  font-weight: 700; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.setup-form fieldset > .chip-row:first-of-type:has(.link-btn) { margin-bottom: .6rem; gap: 1rem; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .4rem; }
label.check {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .55rem .7rem; border-radius: var(--radius-sm);
  cursor: pointer;
}
@media (hover: hover) { label.check:hover { background: var(--surface-2); } }
label.check input { width: 18px; height: 18px; margin: .15rem 0 0; accent-color: var(--accent); flex: none; }
label.check .muted { font-size: .85em; margin-left: .2rem; }
.inline-fields { display: flex; flex-wrap: wrap; gap: 1rem; }
.inline-fields legend { display: none; }
.field { display: grid; gap: .35rem; flex: 1 1 200px; }
.field > span { font-weight: 700; font-size: .85rem; color: var(--ink-2); }
select, input[type="number"], input[type="text"], input[type="search"], textarea {
  min-height: 42px;
  padding: .45rem .7rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  width: 100%;
}
select { appearance: none; padding-right: 2.2rem; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { resize: vertical; line-height: 1.5; }
.setup-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  padding-top: .4rem;
}
.match-count { margin: 0; font-weight: 600; color: var(--ink-2); }
.match-count.bad { color: var(--bad); }

/* real-exam rules */
.exam-rules {
  margin: 1.4rem 0 1.6rem;
  padding: 1.4rem;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface);
}
.facts-list { display: flex; flex-wrap: wrap; gap: 1rem 2.2rem; margin: 0 0 1rem; }
.facts-list div { min-width: 0; }
.facts-list dt { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.facts-list dd { margin: .1rem 0 0; font-size: 1.1rem; font-weight: 700; }
.rules { margin: 0; padding-left: 1.2rem; color: var(--ink-2); }
.rules li { margin: .35rem 0; }
.note {
  margin: 1rem 0 0; padding: .7rem .9rem;
  border-left: 3px solid var(--ok); background: var(--ok-soft); border-radius: 0 8px 8px 0;
  font-size: .92rem;
}

/* ---------- rings & meters ---------- */
.ring { position: relative; flex: none; --tone: var(--accent); }
.ring svg { width: 100%; height: 100%; display: block; }
.ring-track { stroke: var(--sunken); }
.ring-fill { stroke: var(--tone); transition: stroke-dashoffset .6s cubic-bezier(.2,.7,.2,1); }
.ring.good { --tone: var(--good); }
.ring.ok { --tone: var(--ok); }
.ring.bad { --tone: var(--bad); }
.ring.muted { --tone: var(--line-strong); }
.ring-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; line-height: 1.1; padding: 0 12%;
}
.ring-text strong { font-size: 1.55em; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.ring-text span { font-size: .72rem; color: var(--muted); margin-top: .25rem; font-weight: 600; }
.ring-caption { font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.meter {
  position: relative; display: block; height: 8px; min-width: 60px;
  border-radius: 999px; background: var(--sunken); overflow: hidden;
  --tone: var(--accent);
}
.meter > span { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--tone); transition: width .5s cubic-bezier(.2,.7,.2,1); }
.meter.good { --tone: var(--good); }
.meter.ok { --tone: var(--ok); }
.meter.bad { --tone: var(--bad); }
.meter.muted { --tone: var(--line-strong); }

/* ---------- home ---------- */
.home-head { margin-bottom: 1.6rem; }
.home-head h1 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.8rem); margin-bottom: .2rem; }
.tagline { color: var(--muted); font-size: 1.05rem; margin: 0; }

.resume-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.4rem; padding: 1rem 1.2rem;
  border: 1.5px solid var(--accent-line); border-radius: var(--radius);
  background: var(--accent-soft);
}
.resume-banner > div:first-child { display: grid; gap: .1rem; }

.exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.exam-card {
  position: relative;
  display: flex; flex-direction: column; gap: 1rem;
  padding: 1.3rem 1.4rem;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink); text-decoration: none;
  box-shadow: var(--shadow-1);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
@media (hover: hover) { .exam-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); transform: translateY(-2px); } }
.exam-card h2 { font-size: 1.25rem; margin-bottom: .3rem; }
.exam-card p { margin: 0 0 .35rem; }
.exam-card .course { font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); margin-bottom: .3rem; }
.exam-card .desc { color: var(--ink-2); }
.exam-card .facts { color: var(--muted); font-size: .92rem; }
.exam-card .countdown { display: inline-block; font-weight: 700; color: var(--flag); font-size: .92rem; }
.exam-card .last { color: var(--muted); font-size: .85rem; }
.exam-card-go {
  align-self: flex-start; margin-top: auto;
  font-weight: 700; color: var(--accent); font-size: .95rem;
}
.exam-card-go::after { content: " →"; transition: margin .15s; }
.exam-card:hover .exam-card-go::after { margin-left: .25rem; }

.exam-card.big {
  display: grid; grid-template-columns: 1fr auto; grid-template-rows: 1fr auto;
  gap: 1rem 2rem;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border-width: 1.5px;
  background:
    radial-gradient(circle at 1px 1px, var(--line) 1px, transparent 1.4px) 0 0 / 22px 22px,
    var(--surface);
}
.exam-card.big h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); }
.exam-card.big .exam-card-main { grid-column: 1; }
.exam-card.big .exam-card-side { grid-column: 2; grid-row: 1 / span 2; display: flex; flex-direction: column; align-items: center; gap: .5rem; align-self: center; }
.exam-card.big .exam-card-go {
  grid-column: 1;
  padding: .7rem 1.3rem; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink);
}

/* ---------- exam hub ---------- */
.hub-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.2rem; margin-bottom: 1.6rem; }
.hub-head h1 { margin-bottom: .2rem; }
.hub-head p { margin: 0; }
.hub-head .course { font-size: .8rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); margin-bottom: .3rem; }
.hub-ready {
  display: flex; align-items: center; gap: .9rem;
  padding: .6rem 1.1rem .6rem .6rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink); text-decoration: none;
  box-shadow: var(--shadow-1);
}
.hub-ready:hover { border-color: var(--line-strong); }
.hub-ready > span { display: grid; line-height: 1.3; }
.hub-ready .ring-text strong { font-size: 1.25rem; }

.mode-primary { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .75rem; }
.mode-card {
  position: relative;
  display: flex; flex-direction: column; gap: .3rem;
  padding: 1rem 1.1rem 1.05rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink); text-decoration: none;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
@media (hover: hover) { .mode-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); transform: translateY(-1px); } }
.mode-name { font-weight: 700; font-size: 1.02rem; }
.mode-sub { color: var(--muted); font-size: .9rem; line-height: 1.4; }
.mode-card.disabled { opacity: .55; cursor: default; box-shadow: none; transform: none; }
.mode-card.disabled:hover { border-color: var(--line); }
.mode-primary .mode-card { padding: 1.4rem 1.5rem; border-width: 1.5px; }
.mode-primary .mode-name { font-size: 1.2rem; }
.mode-primary .mode-name::after { content: " →"; }
.mode-card.exam { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.mode-card.exam .mode-sub { color: color-mix(in srgb, var(--paper) 72%, transparent); }
.mode-card.exam::before {
  content: ""; position: absolute; right: 1.2rem; top: 1.2rem; width: 46px; height: 18px;
  background:
    radial-gradient(circle, var(--paper) 4px, transparent 4.5px) 0 50% / 15px 15px repeat-x;
  opacity: .25;
}
.mode-card.smart { border-color: var(--accent-line); background: var(--accent-soft); }

.topic-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.topic-list li {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(90px, 220px) auto; align-items: center; gap: 1rem;
  padding: .85rem 1.1rem;
}
.topic-list li + li { border-top: 1px solid var(--line); }
.topic-info { display: grid; min-width: 0; }
.topic-name { font-weight: 700; }

/* ---------- quiz ---------- */
.quiz { min-height: 100vh; display: flex; flex-direction: column; }
.quiz-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  min-height: 60px; padding: .5rem clamp(10px, 2.5vw, 24px);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.quiz-bar-left, .quiz-bar-right { display: flex; align-items: center; gap: .35rem; min-width: 0; }
.quiz-bar-right { flex: none; }
.quiz-title { display: grid; min-width: 0; line-height: 1.25; margin-left: .2rem; }
.quiz-title strong, .quiz-title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.quiz-title span { font-size: .82rem; color: var(--muted); }
.timer {
  display: inline-flex; align-items: center; gap: .4rem;
  margin-right: .3rem; padding: .3rem .7rem;
  border-radius: 999px; background: var(--surface-2);
  font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; font-size: .95rem;
}
.timer-icon { display: inline-flex; color: var(--muted); }
.timer.low { background: var(--flag-soft); color: var(--flag); }
.timer.low .timer-icon { color: var(--flag); }
.timer.critical { background: var(--bad); color: #fff; animation: pulse 1s ease-in-out infinite; }
.timer.critical .timer-icon { color: #fff; }
@keyframes pulse { 50% { opacity: .7; } }
.quiz-progress { height: 3px; background: var(--line); position: sticky; top: 60px; z-index: 19; }
.quiz-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s ease; }

.quiz-body {
  flex: 1;
  display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: clamp(16px, 3vw, 36px);
  width: 100%; max-width: 1180px; margin: 0 auto;
  padding: clamp(16px, 3vw, 32px) clamp(12px, 3vw, 28px) 48px;
}
.quiz-main { min-width: 0; }

.qcard {
  padding: clamp(1.1rem, 3vw, 2rem);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  scroll-margin-top: 80px;
}
.qhead { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; margin-bottom: 1.1rem; }
.qnum { font-weight: 700; font-size: 1.05rem; margin-right: .2rem; }
.qmeta { display: flex; flex-wrap: wrap; gap: .35rem; }
.qtools { display: flex; gap: .35rem; margin-left: auto; }
.tool {
  display: inline-flex; align-items: center; gap: .35rem;
  min-height: 34px; padding: .25rem .7rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-2);
  font-size: .85rem; font-weight: 600;
}
.tool:hover { border-color: var(--line-strong); color: var(--ink); }
.tool.on { color: var(--flag); border-color: color-mix(in srgb, var(--flag) 45%, transparent); background: var(--flag-soft); }
.tool.on .icon { fill: currentColor; }
.tool.on.star { color: #b8860b; background: color-mix(in srgb, #f5c542 18%, var(--surface)); border-color: color-mix(in srgb, #d4a017 45%, transparent); }
:root[data-theme="dark"] .tool.on.star { color: #f5c542; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tool.on.star { color: #f5c542; } }

.qtext { font-size: 1.12rem; line-height: 1.6; }
.qtype { margin: 1rem 0 .6rem; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

/* answer choices: lettered bubbles like an answer sheet */
.opts { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.opt { display: flex; align-items: stretch; gap: .35rem; }
.opt-btn {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: .9rem;
  padding: .75rem 1rem .75rem .8rem;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
  text-align: left; line-height: 1.45;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
@media (hover: hover) { .opt:not(.selected) > button.opt-btn:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-2); } }
.opt-btn:disabled { cursor: default; }
.opt-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.opt-text p { margin: 0; }
.opt-text pre { margin: .4rem 0 0; }
.bubble {
  flex: none;
  display: grid; place-items: center;
  width: 32px; height: 32px;
  border: 1.5px solid var(--line-strong); border-radius: 50%;
  font-weight: 700; font-size: .85rem; color: var(--ink-2);
  background: var(--surface);
  transition: background .12s, border-color .12s, color .12s;
}
.bubble.square { border-radius: 8px; }
.bubble.small { width: 24px; height: 24px; font-size: .72rem; }
.opt.selected .opt-btn { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.opt.selected .bubble { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.opt.struck .opt-text { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--muted); }
.opt.struck .bubble { opacity: .45; }
.opt.is-correct .opt-btn { border-color: var(--good); background: var(--good-soft); box-shadow: 0 0 0 1px var(--good) inset; }
.opt.is-correct .bubble { background: var(--good); border-color: var(--good); color: #fff; }
.opt.is-wrong .opt-btn { border-color: var(--bad); background: var(--bad-soft); box-shadow: 0 0 0 1px var(--bad) inset; }
.opt.is-wrong .bubble { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt-mark { flex: none; display: inline-flex; }
.opt-mark .icon { width: 22px; height: 22px; stroke-width: 2.4; }
.opt.is-correct .opt-mark { color: var(--good); }
.opt.is-wrong .opt-mark { color: var(--bad); }
.strike-btn {
  flex: none; width: 40px;
  display: grid; place-items: center;
  border: 1.5px solid transparent; border-radius: var(--radius);
  background: transparent; color: var(--muted);
  opacity: .55;
}
.strike-btn:focus-visible { opacity: 1; }
@media (hover: hover) { .opt:hover .strike-btn { opacity: 1; } }
@media (hover: none) { .strike-btn { opacity: .8; } }
@media (hover: hover) { .strike-btn:hover { background: var(--surface-2); color: var(--ink); } }
.opt.struck .strike-btn { opacity: 1; color: var(--ink); }

.typed { display: grid; gap: .45rem; max-width: 460px; }
.typed-input {
  min-height: 52px !important;
  font-size: 1.15rem !important;
  font-family: var(--mono);
  border-width: 2px !important;
}
.typed.is-correct .typed-input { border-color: var(--good); background: var(--good-soft); }
.typed.is-wrong .typed-input { border-color: var(--bad); background: var(--bad-soft); }

.hint-btn { margin-top: 1rem; }
.hint {
  display: flex; gap: .7rem; align-items: flex-start;
  margin-top: 1rem; padding: .8rem 1rem;
  border-radius: var(--radius-sm); background: var(--ok-soft);
}
.hint > .icon { color: var(--ok); margin-top: .2rem; }
.hint p:last-child { margin: 0; }

.feedback {
  margin-top: 1.3rem; padding: 1rem 1.2rem;
  border-radius: var(--radius); border: 1.5px solid;
  animation: rise .25s ease;
}
.feedback.good { border-color: var(--good-line); background: var(--good-soft); }
.feedback.bad { border-color: var(--bad-line); background: var(--bad-soft); }
.verdict { display: flex; align-items: center; gap: .4rem; margin: 0 0 .4rem; font-weight: 700; font-size: 1.08rem; }
.feedback.good .verdict { color: var(--good); }
.feedback.bad .verdict { color: var(--bad); }
.verdict .icon { stroke-width: 2.6; }
.accepted { margin: .3rem 0; }
.explanation { margin-top: .5rem; color: var(--ink-2); }
.explanation > :last-child { margin-bottom: 0; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

.quiz-nav {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: 1rem;
}
.quiz-nav .btn { min-width: 130px; }
.quiz-count { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

/* answer sheet */
.sheet {
  position: sticky; top: 84px; align-self: start;
  padding: 1.1rem;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface);
  max-height: calc(100vh - 110px); overflow: auto;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .8rem; }
.sheet-head h2 { margin: 0; font-size: .8rem; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.sheet-close { display: none; }
.sheet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: .4rem; }
.bub {
  position: relative;
  display: grid; place-items: center;
  aspect-ratio: 1; min-width: 34px;
  border: 1.5px solid var(--line-strong); border-radius: 50%;
  background: var(--surface);
  font-size: .8rem; font-weight: 700; color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  padding: 0;
}
button.bub:hover { border-color: var(--ink-2); }
.bub.filled { background: var(--ink-2); border-color: var(--ink-2); color: var(--surface); }
.bub.right { background: var(--good); border-color: var(--good); color: #fff; }
.bub.wrong { background: var(--bad); border-color: var(--bad); color: #fff; }
.bub.flagged::after {
  content: ""; position: absolute; top: -3px; right: -3px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--flag); border: 2px solid var(--surface);
}
.bub.current { box-shadow: 0 0 0 2.5px var(--surface), 0 0 0 4.5px var(--accent); }
.sheet-legend { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem .8rem; margin: 1rem 0 .6rem; font-size: .8rem; color: var(--muted); }
.sheet-legend div { display: flex; align-items: center; gap: .45rem; }
.sheet-legend dt, .sheet-legend dd { margin: 0; }
.sheet-legend .bub { width: 16px; min-width: 16px; height: 16px; border-width: 1.5px; }
.sheet-legend .bub.flagged::after { width: 8px; height: 8px; top: -3px; right: -4px; border-width: 1.5px; }
.sheet-summary { margin: .4rem 0 0; padding-top: .7rem; border-top: 1px solid var(--line); font-size: .88rem; font-weight: 600; }
.sheet-toggle { display: none !important; }

.bub-row { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .9rem; }
.small-bub { width: 36px; min-width: 36px; }
.submit-label { margin: .9rem 0 .4rem; font-weight: 700; font-size: .9rem; }

.pause-overlay {
  position: fixed; inset: 0; z-index: 40;
  display: grid; place-items: center; text-align: center;
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.pause-overlay p { color: var(--muted); }

/* ---------- prose (question text, explanations) ---------- */
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 .75em; }
.prose ul, .prose ol { margin: 0 0 .75em; padding-left: 1.4em; }
.prose li { margin: .2em 0; }
.prose img {
  display: block; max-width: min(100%, 520px); height: auto; margin: .6em 0 .9em;
  border-radius: var(--radius-sm); background: #fff; padding: 6px; border: 1px solid var(--line);
}
.prose blockquote { margin: 0 0 .75em; padding-left: 1em; border-left: 3px solid var(--line-strong); color: var(--ink-2); }
.prose pre, .cheatsheet pre {
  margin: .5em 0 .9em; padding: .9rem 1rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow-x: auto; line-height: 1.5; font-size: .88rem;
}
.prose pre code.hljs, .prose pre code { background: transparent; padding: 0; border: 0; }
.table-wrap { overflow-x: auto; margin: .4em 0 .9em; }
.prose table, table.history { border-collapse: collapse; width: auto; min-width: 50%; font-size: .95em; }
.prose th, .prose td { border: 1px solid var(--line); padding: .4rem .75rem; text-align: left; }
.prose th { background: var(--surface-2); font-weight: 700; }
.katex { font-size: 1.08em; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: .2em 0; margin: .6em 0; }
.hljs { background: transparent !important; }

/* ---------- modal ---------- */
.modal-back {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center; padding: 16px;
  background: rgb(15 15 18 / .45);
  animation: fade .15s ease;
}
.modal {
  width: min(480px, 100%); max-height: calc(100vh - 32px); overflow: auto;
  border-radius: var(--radius-lg); background: var(--surface);
  box-shadow: var(--shadow-3);
  animation: pop .18s cubic-bezier(.2,.8,.2,1);
}
.modal.wide { width: min(720px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1rem .4rem 1.4rem; }
.modal-head h2 { margin: 0; font-size: 1.2rem; }
.modal-body { padding: .4rem 1.4rem 1rem; color: var(--ink-2); }
.modal-foot { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .6rem; padding: .8rem 1.4rem 1.2rem; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.shortcuts { margin: 0; display: grid; gap: .5rem; }
.shortcuts div { display: grid; grid-template-columns: 170px 1fr; gap: 1rem; align-items: center; }
.shortcuts dt, .shortcuts dd { margin: 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 80;
  transform: translate(-50%, 20px);
  max-width: calc(100vw - 32px);
  padding: .7rem 1.1rem;
  border-radius: 999px;
  background: var(--ink); color: var(--paper);
  font-weight: 600; font-size: .92rem;
  box-shadow: var(--shadow-3);
  opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { background: var(--good); color: #fff; }
.toast.bad { background: var(--bad); color: #fff; }

/* ---------- calculator ---------- */
.calc {
  position: fixed; right: 20px; bottom: 20px; z-index: 50;
  width: 300px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-3);
  overflow: hidden;
  animation: pop .18s ease;
}
.calc-head {
  display: flex; align-items: center; gap: .5rem;
  padding: .45rem .45rem .45rem .9rem;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  cursor: grab; user-select: none; touch-action: none;
  font-weight: 700; font-size: .9rem;
}
.calc-head span { flex: 1; }
.calc-mode {
  border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface);
  padding: .1rem .5rem; font-family: var(--mono); font-size: .75rem; font-weight: 600;
}
.calc-hist { min-height: 1.2rem; padding: .5rem .9rem 0; font-family: var(--mono); font-size: .78rem; color: var(--muted); text-align: right; }
.calc-input {
  display: block; width: calc(100% - 1.2rem) !important; margin: .3rem .6rem 0;
  border: 0 !important; box-shadow: none !important; background: transparent !important;
  text-align: right; font-family: var(--mono); font-size: 1.45rem !important; min-height: 46px !important;
}
.calc-out { min-height: 1.4rem; padding: 0 .9rem .4rem; text-align: right; font-family: var(--mono); font-size: .88rem; color: var(--muted); }
.calc-out.err { color: var(--bad); }
.calc-keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; padding: .5rem .6rem .7rem; }
.calc-keys button {
  min-height: 40px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); font-family: var(--mono); font-size: .88rem; font-weight: 600;
}
.calc-keys button:hover { border-color: var(--line-strong); }
.calc-keys button.num { background: var(--surface); font-size: 1rem; }
.calc-keys button.eq { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-size: 1.1rem; }

/* ---------- panels, bars, charts ---------- */
.panel {
  padding: 1.3rem 1.4rem;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface);
  min-width: 0;
}
.panel + .panel, .result-grid + .panel, .panel + .result-grid { margin-top: 1rem; }
.panel h2 { font-size: 1.05rem; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: .6rem; }
.panel-head h2 { margin: 0; }
.result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1rem; margin-top: 1rem; }

.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.bars li, .bars.clickable li a {
  display: grid; grid-template-columns: minmax(90px, 38%) minmax(60px, 1fr) 3.6rem; align-items: center; gap: .8rem;
}
.bars.clickable li a { color: var(--ink); text-decoration: none; padding: .35rem .5rem; margin: -.35rem -.5rem; border-radius: 8px; }
.bars.clickable li a:hover { background: var(--surface-2); }
.bar-label { font-weight: 600; font-size: .93rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; font-size: .9rem; color: var(--ink-2); }

.time-strip {
  display: flex; align-items: flex-end; gap: 2px; overflow: hidden;
  height: 90px; padding: 6px 0 0; margin-bottom: .5rem;
  border-bottom: 1px solid var(--line);
}
.time-strip span { flex: 1 1 0; min-width: 0; max-width: 26px; border-radius: 2px 2px 0 0; }
.time-strip span.good { background: var(--good); opacity: .75; }
.time-strip span.bad { background: var(--bad); opacity: .85; }

.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); gap: 2px; flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; border-radius: 999px;
  padding: .35rem .85rem; font-weight: 600; font-size: .87rem; color: var(--ink-2);
}
.seg button span { margin-left: .25rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.seg button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

.chart { margin-top: .4rem; }
.line-chart { width: 100%; height: auto; overflow: visible; }
.line-chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.line-chart .grid { stroke: var(--line); stroke-width: 1; }
.line-chart .target { stroke: var(--good); stroke-width: 1.5; stroke-dasharray: 5 5; }
.line-chart .target-label { fill: var(--good); font-weight: 700; }
.line-chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.line-chart .dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2.5; }
.line-chart .dot:hover { fill: var(--accent); }

/* ---------- results ---------- */
.result-hero {
  display: flex; flex-wrap: wrap; align-items: center; gap: clamp(1.2rem, 4vw, 2.6rem);
  padding: clamp(1.3rem, 3vw, 2.2rem);
  border: 1.5px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface);
}
.result-hero.good { border-color: var(--good-line); background: linear-gradient(135deg, var(--good-soft), var(--surface) 60%); }
.result-hero.ok { border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: linear-gradient(135deg, var(--ok-soft), var(--surface) 60%); }
.result-hero.bad { border-color: var(--bad-line); background: linear-gradient(135deg, var(--bad-soft), var(--surface) 60%); }
.result-text { flex: 1; min-width: 240px; }
.result-text h1 { margin-bottom: .15rem; }
.result-text .facts-list { margin: 1rem 0 0; }
.result-text .facts-list dd { font-size: 1rem; }
.result-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.1rem 0 .4rem; }

.review { margin-top: 2rem; }
.review-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin-bottom: 1rem; }
.review-head h2 { margin: 0; }
.review-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.review-item {
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--line); border-left: 4px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
}
.review-item.good { border-left-color: var(--good); }
.review-item.bad { border-left-color: var(--bad); }
.review-item > header { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .7rem; margin-bottom: .8rem; }
.review-num {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: var(--surface-2); border: 1.5px solid var(--line-strong); font-weight: 700; font-size: .82rem;
}
.review-verdict { display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; }
.review-item.good .review-verdict { color: var(--good); }
.review-item.bad .review-verdict { color: var(--bad); }
.review-item .qtext { font-size: 1.02rem; margin-bottom: .8rem; }
.review-opts { gap: .4rem; }
.opt-btn.static { padding: .55rem .85rem .55rem .6rem; }
.review-opts .bubble { width: 28px; height: 28px; font-size: .78rem; }
.you {
  flex: none; padding: .1rem .5rem; border-radius: 999px;
  background: var(--ink); color: var(--surface); font-size: .72rem; font-weight: 700; white-space: nowrap;
}
.review-opts .opt.selected:not(.is-correct):not(.is-wrong) .opt-btn { box-shadow: none; }
.typed-review p { margin: .2rem 0; }
.typed-review strong.good { color: var(--good); }
.typed-review strong.bad { color: var(--bad); }
details.explain { margin-top: .9rem; border-top: 1px dashed var(--line); padding-top: .7rem; }
details.explain summary { cursor: pointer; font-weight: 700; color: var(--accent); font-size: .92rem; }
details.explain .prose { margin-top: .5rem; color: var(--ink-2); }
.empty-row { padding: 2rem 1rem; text-align: center; color: var(--muted); list-style: none; }

/* ---------- progress ---------- */
.ready-panel {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 2.4rem;
  padding: clamp(1.3rem, 3vw, 2rem);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface);
}
.ready-panel > div:last-child { flex: 1; min-width: 260px; }
.ready-parts { list-style: none; margin: .8rem 0 1rem; padding: 0; display: grid; gap: .6rem; max-width: 460px; }
.ready-parts li { display: grid; grid-template-columns: 110px 1fr 70px; align-items: center; gap: .8rem; font-size: .92rem; }
.ready-parts li span:last-child { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px;
  margin: 1rem 0; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--line); overflow: hidden;
}
.stat-row > div { background: var(--surface); padding: 1rem 1.2rem; }
.stat-row dt { font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.stat-row dd { margin: .2rem 0 0; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.missed { margin: 0 0 1rem; padding-left: 1.3rem; display: grid; gap: .7rem; }
.missed li { padding-left: .2rem; }
.missed li::marker { color: var(--muted); font-weight: 700; }
.missed-text { display: block; font-weight: 600; line-height: 1.4; }

table.history { width: 100%; }
table.history th, table.history td { padding: .65rem .8rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.history th { font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
table.history tbody tr { cursor: pointer; }
table.history tbody tr:hover, table.history tbody tr:focus-visible { background: var(--surface-2); outline: none; }
table.history td:nth-child(2) { white-space: normal; }

/* ---------- flashcards ---------- */
.flash-top { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: .8rem; }
.flash-card {
  position: relative;
  min-height: 320px;
  padding: clamp(1.4rem, 4vw, 2.4rem);
  border: 1.5px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  cursor: pointer;
  transition: border-color .15s;
}
.flash-card::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -7px; height: 7px;
  border: 1.5px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  background: var(--surface-2); z-index: -1;
}
.flash-card:hover { border-color: var(--line-strong); }
.flash-card.flipped { border-color: var(--accent-line); animation: flip .28s ease; }
@keyframes flip { 0% { transform: rotateX(8deg) scale(.985); opacity: .6; } }
.flash-face { display: grid; gap: 1rem; }
.flash-face > .tag { justify-self: start; }
.flash-face > .prose { font-size: 1.15rem; }
.flip-hint { margin: 0; }
.flash-back { padding-top: 1rem; border-top: 1.5px dashed var(--line); }
.flash-back > p:first-child { margin-bottom: .3rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.flash-answers { margin: 0 0 .6rem; padding-left: 1.2rem; font-size: 1.1rem; font-weight: 700; color: var(--good); }
.flash-answer { font-size: 1.15rem; font-weight: 700; color: var(--good); }
.flash-actions { display: flex; justify-content: center; gap: .8rem; margin: 1.6rem 0 .8rem; }
.flash-actions .btn { min-width: 160px; }

/* ---------- browse ---------- */
.filters { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 1rem 0 .6rem; }
.filters select { width: auto; min-width: 150px; }
.search { position: relative; flex: 1 1 260px; display: flex; align-items: center; }
.search .icon { position: absolute; left: .75rem; color: var(--muted); pointer-events: none; }
.search input { padding-left: 2.3rem; }
.switch { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; cursor: pointer; padding: 0 .3rem; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.browse-topic { margin: 2rem 0 .7rem; padding-bottom: .4rem; border-bottom: 2px solid var(--ink); font-size: 1.15rem; }
.browse-item {
  padding: 1.1rem 1.2rem; margin-bottom: .8rem;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface);
}
.browse-item > header { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .7rem; }
.browse-item .tool { padding: .25rem .5rem; }
.qid { font-family: var(--mono); font-weight: 600; font-size: .85rem; padding: .1rem .45rem; border-radius: 6px; background: var(--surface-2); }
.browse-opts { list-style: none; padding: 0; margin: .7rem 0; display: grid; gap: .35rem; }
.browse-opts li { display: flex; align-items: flex-start; gap: .6rem; padding: .35rem .5rem; border-radius: 8px; }
.browse-opts li.correct { background: var(--good-soft); font-weight: 700; }
.browse-opts li.correct .bubble { background: var(--good); border-color: var(--good); color: #fff; }
.flash-face .browse-opts { list-style: upper-alpha; padding-left: 1.6rem; }
.flash-face .browse-opts li { display: list-item; padding: .1rem .2rem; }
.note-box { margin-top: .8rem; }
.browse-item .accepted, .browse-item .explanation { margin-top: .6rem; }
.browse-item .explanation { padding: .7rem .9rem; border-radius: 8px; background: var(--surface-2); }

/* ---------- settings ---------- */
.settings .setup-form label.check { padding-left: 0; }
.data-actions { display: grid; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; margin-top: 1rem; }
.data-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem 1.2rem; }
.data-row + .data-row { border-top: 1px solid var(--line); }
.data-row > div { display: grid; gap: .1rem; min-width: 0; }

/* ---------- author / checker ---------- */
.dropzone {
  display: grid; place-items: center; gap: .3rem; text-align: center;
  margin: 1.4rem 0; padding: 2.6rem 1rem;
  border: 2px dashed var(--line-strong); border-radius: var(--radius-lg);
  background: var(--surface); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone .icon { width: 34px; height: 34px; color: var(--accent); }
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.report { margin-bottom: 1.4rem; padding: 1.3rem 1.4rem; border: 1.5px solid; border-radius: var(--radius-lg); background: var(--surface); }
.report.good { border-color: var(--good-line); }
.report.bad { border-color: var(--bad-line); }
.report.good > h2 { color: var(--good); }
.report.bad > h2 { color: var(--bad); }
.report h3 { margin-top: 1.2rem; color: var(--ok); }
.issues { list-style: none; margin: .8rem 0; padding: 0; display: grid; gap: .5rem; }
.issues li { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; padding: .7rem .9rem; border-radius: 8px; }
.issues li.err { background: var(--bad-soft); }
.issues li.warn { background: var(--ok-soft); }
.issue-line { font-family: var(--mono); font-weight: 700; font-size: .85rem; white-space: nowrap; }
.issue-src { grid-column: 2; font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.topics-preview { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; }
.cheatsheet { margin-top: 1rem; padding: 1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.cheatsheet summary { cursor: pointer; font-weight: 700; }
.cheatsheet ul { padding-left: 1.2rem; color: var(--ink-2); }
.cheatsheet li { margin: .3rem 0; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .quiz-body { grid-template-columns: 1fr; }
  .sheet-toggle { display: inline-grid !important; }
  .sheet {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 45;
    max-height: 70vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-bottom: 0;
    box-shadow: var(--shadow-3);
    transform: translateY(105%); transition: transform .25s cubic-bezier(.2,.8,.2,1);
    padding-bottom: calc(1.1rem + env(safe-area-inset-bottom));
  }
  .sheet.open { transform: none; }
  .sheet-close { display: inline-grid; }
  .sheet-grid { grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); }
}

@media (max-width: 640px) {
  :root { --topbar-h: 56px; }
  .topnav a { padding: .4rem .6rem; }
  .exam-card.big { grid-template-columns: 1fr; }
  .exam-card.big .exam-card-side { grid-column: 1; grid-row: auto; flex-direction: row; justify-self: start; }
  .exam-card.big .exam-card-go { justify-self: stretch; text-align: center; }
  .topic-list li { grid-template-columns: 1fr auto; }
  .topic-list .topic-meter { grid-column: 1 / -1; grid-row: 2; }
  .quiz-title span { display: none; }
  .quiz-bar { gap: .3rem; }
  .quiz-bar-right .icon-btn { width: 36px; height: 36px; }
  [data-keys] { display: none !important; }
  .timer { padding: .25rem .55rem; margin-right: 0; font-size: .88rem; }
  .timer-icon { display: none; }
  .qtext { font-size: 1.05rem; }
  .qtools .tool span { display: none; }
  .quiz-nav .btn { min-width: 0; flex: 1; }
  .quiz-count { flex: none; }
  .opt-btn { gap: .7rem; padding: .7rem .8rem .7rem .65rem; }
  .strike-btn { width: 34px; }
  .bars li, .bars.clickable li a { grid-template-columns: minmax(80px, 34%) 1fr 3.2rem; gap: .6rem; }
  .ready-parts li { grid-template-columns: 90px 1fr 56px; }
  .data-row { flex-direction: column; align-items: stretch; }
  .flash-actions .btn { min-width: 0; flex: 1; }
  .setup-foot .row { width: 100%; }
  .setup-foot .row .btn { flex: 1; }
  .modal-foot .btn { flex: 1; }
  .shortcuts div { grid-template-columns: 1fr; gap: .2rem; }
  .sitefoot { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

@media print {
  .topbar, .sitefoot, .quiz-bar, .sheet, .quiz-nav, .result-actions, .seg { display: none !important; }
  body { background: #fff; }
}

/* containers that carry a good/ok/bad state keep normal text color */
.review-item.good, .review-item.bad,
.result-hero.good, .result-hero.ok, .result-hero.bad,
.feedback.good, .feedback.bad,
.report.good, .report.bad { color: var(--ink); }
.result-hero .muted { color: var(--muted); }
.bars.clickable li { display: block; }


/* =========================================================================
   Usability fixes (phone layout, accessibility, clearer controls)
   ========================================================================= */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* nothing may push the page wider than the screen */
.quiz-main, .qcard, .prose, .qtext, .review-list > li, .result-grid > *, .panel, .browse-item, .flash-face, .opt-text { min-width: 0; }
.prose, .qtext, .explanation, .flash-face { overflow-wrap: anywhere; }
.prose pre { max-width: 100%; }
.browse-opts li > span:last-child { min-width: 0; overflow-wrap: anywhere; }

/* code colors that pass WCAG AA contrast in both themes */
.hljs-keyword, .hljs-type, .hljs-selector-tag, .hljs-meta .hljs-keyword { color: #a3172d !important; }
.hljs-string, .hljs-char, .hljs-regexp { color: #0f6a3b !important; }
.hljs-number, .hljs-literal, .hljs-variable, .hljs-attr { color: #0b54b0 !important; }
.hljs-title, .hljs-title.function_, .hljs-title.class_ { color: #6b32b8 !important; }
.hljs-comment, .hljs-quote { color: #5f6670 !important; font-style: italic; }
.hljs-built_in, .hljs-params, .hljs-meta { color: #8a4a00 !important; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .hljs-keyword, :root:not([data-theme="light"]) .hljs-type, :root:not([data-theme="light"]) .hljs-selector-tag { color: #ff8f9f !important; }
  :root:not([data-theme="light"]) .hljs-string, :root:not([data-theme="light"]) .hljs-char { color: #8fd99a !important; }
  :root:not([data-theme="light"]) .hljs-number, :root:not([data-theme="light"]) .hljs-literal, :root:not([data-theme="light"]) .hljs-variable, :root:not([data-theme="light"]) .hljs-attr { color: #86c5ff !important; }
  :root:not([data-theme="light"]) .hljs-title { color: #d2b0ff !important; }
  :root:not([data-theme="light"]) .hljs-comment { color: #a2a9b2 !important; }
  :root:not([data-theme="light"]) .hljs-built_in, :root:not([data-theme="light"]) .hljs-params, :root:not([data-theme="light"]) .hljs-meta { color: #ffbb73 !important; }
}
:root[data-theme="dark"] .hljs-keyword, :root[data-theme="dark"] .hljs-type, :root[data-theme="dark"] .hljs-selector-tag { color: #ff8f9f !important; }
:root[data-theme="dark"] .hljs-string, :root[data-theme="dark"] .hljs-char { color: #8fd99a !important; }
:root[data-theme="dark"] .hljs-number, :root[data-theme="dark"] .hljs-literal, :root[data-theme="dark"] .hljs-variable, :root[data-theme="dark"] .hljs-attr { color: #86c5ff !important; }
:root[data-theme="dark"] .hljs-title { color: #d2b0ff !important; }
:root[data-theme="dark"] .hljs-comment { color: #a2a9b2 !important; }
:root[data-theme="dark"] .hljs-built_in, :root[data-theme="dark"] .hljs-params, :root[data-theme="dark"] .hljs-meta { color: #ffbb73 !important; }

/* quiz header: back button never squeezed */
.quiz-bar-left { flex: 1 1 auto; min-width: 0; }
.quiz-bar-left > .icon-btn { flex: none; }
.quiz-title { flex: 1 1 auto; }
h1.qnum { margin: 0; font-size: 1.05rem; letter-spacing: 0; line-height: 1.3; }

/* separate Skip button */
.btn.ghost { background: transparent; box-shadow: none; border-color: transparent; color: var(--ink-2); }
@media (hover: hover) { .btn.ghost:hover { background: var(--surface-2); border-color: var(--line); } }
.quiz-nav { flex-wrap: nowrap; }
.quiz-nav .quiz-count { margin-right: auto; margin-left: .4rem; }
.quiz-nav [data-skip] { min-width: 0; }

/* comfortable touch targets */
.tool { min-height: 40px; min-width: 40px; justify-content: center; }
.sheet-close, .icon-btn.small { width: 40px; height: 40px; }
.link-btn { min-height: 40px; }
.crumbs a { display: inline-block; padding: .45rem 0; }
.seg button { min-height: 38px; }

/* stats grid: last box stretches so there is no empty grey cell */
.stat-row > div:last-child { grid-column: auto / -1; }

/* mock exam card */
.mode-card.mock { border-color: var(--accent-line); }
.mode-card.mock .mode-name { color: var(--accent); }
.mode-primary { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* setup forms: Start button always reachable */
.setup-foot, .setup-actions {
  position: sticky; bottom: 0; z-index: 5;
  margin: 0 calc(-1 * var(--gutter)); padding: .8rem var(--gutter) calc(.8rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.inline-fields.plain { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0; padding: 0; border: 0; }

/* calculator: bottom sheet on phones that pushes content up instead of covering it */
@media (max-width: 640px) {
  .calc {
    left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important;
    width: auto; border-radius: var(--radius-lg) var(--radius-lg) 0 0; border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .calc-head { cursor: default; }
  .calc-keys button { min-height: 38px; }
  .calc-hist { display: none; }
  body.calc-open .quiz-body { padding-bottom: 380px; }
}

@media (max-width: 640px) {
  .quiz-bar-right .icon-btn { width: 40px; height: 40px; }
  .quiz-bar-right .btn.small { min-height: 40px; }
  .mode-grid { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .mode-grid .mode-card { padding: .8rem .85rem .85rem; }
  .mode-grid .mode-name { font-size: .95rem; }
  .mode-grid .mode-sub { font-size: .8rem; }
  .mode-primary .mode-card { padding: 1.1rem 1.2rem; }
  .bars li, .bars.clickable li a { grid-template-columns: 1fr 3.4rem; row-gap: .3rem; }
  .bar-label { grid-column: 1 / -1; white-space: normal; overflow: visible; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .stat-row dd { font-size: 1.25rem; }
  .qhead { gap: .4rem .6rem; }
  .qtools { margin-left: auto; }
  .quiz-nav .btn { flex: 0 1 auto; padding-left: .8rem; padding-right: .8rem; }
  .quiz-nav [data-next] { flex: 1 1 auto; }
  .result-actions .btn { flex: 1 1 auto; white-space: normal; }
  .flash-face > .prose { font-size: 1.05rem; }
}

@media (max-width: 420px) {
  .quiz-title { display: none; }
  .quiz-bar-left { flex: 0 0 auto; }
}

/* the <pre> (which is keyboard-focusable) does the scrolling, not the inner <code> */
pre code.hljs, .prose pre code { overflow-x: visible !important; display: block; }
.topnav a { min-height: 40px; display: inline-flex; align-items: center; }
@media (max-width: 640px) {
  .btn.small { min-height: 40px; }
  .strike-btn { width: 40px; }
}

@media (max-width: 640px) {
  /* question header: number + flag/save on one row, tags underneath */
  .qhead .qmeta { order: 3; flex-basis: 100%; }
  /* bottom bar: icon-only Previous, no counter (the header already shows it) */
  .quiz-nav { gap: .5rem; }
  .quiz-nav [data-prev] { width: 48px; min-width: 48px; padding: 0; flex: none; }
  .quiz-nav [data-prev] span { display: none; }
  .quiz-nav .quiz-count { display: none; }
  .quiz-nav [data-skip] { flex: none; margin-left: auto; }
  .quiz-nav [data-next] { flex: 1 1 auto; max-width: 220px; }
  /* compact calculator */
  .calc-keys { gap: 4px; padding: .4rem .5rem .6rem; }
  .calc-keys button { min-height: 36px; font-size: .85rem; }
  .calc-input { min-height: 38px !important; font-size: 1.25rem !important; margin-top: 0; }
  .calc-out { min-height: 1.1rem; padding-bottom: .2rem; }
  .calc-head { padding-top: .3rem; padding-bottom: .3rem; }
  body.calc-open .quiz-body { padding-bottom: 400px; }
}

@media (hover: none) { .kbd-only { display: none; } }

/* subjects on the home page */
.course-group + .course-group { margin-top: 2.6rem; }
.course-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; margin-bottom: .9rem; padding-bottom: .5rem; border-bottom: 2px solid var(--ink); }
.course-head h2 { margin: 0; font-size: 1.35rem; }
.course-group .exam-grid { margin-top: 1rem; }

/* =========================================================================
   Programming assignments
   ========================================================================= */
.code-card {
  display: flex; align-items: center; gap: 1rem;
  margin: 0 0 1rem; padding: 1.1rem 1.3rem;
  border: 1.5px solid var(--accent-line); border-radius: var(--radius);
  background: linear-gradient(120deg, var(--accent-soft), var(--surface) 70%);
  color: var(--ink); text-decoration: none;
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
@media (hover: hover) { .code-card:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); border-color: var(--accent); } }
.code-card-icon {
  flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px;
  background: var(--ink); color: var(--paper); font-family: var(--mono); font-weight: 700; font-size: 1.05rem;
}
.code-card-text { display: grid; gap: .2rem; flex: 1; min-width: 0; }
.code-card .mode-name { font-size: 1.15rem; }
.code-card-meter { width: 110px; flex: none; }
.code-card > .icon { flex: none; color: var(--accent); width: 22px; height: 22px; }
@media (max-width: 560px) { .code-card-meter { display: none; } .code-card { padding: 1rem; gap: .8rem; } }

/* list */
.asg-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1.2rem; margin-bottom: 1.6rem; }
.asg-head > div:first-child { max-width: 60ch; }
.asg-head .course { font-size: .8rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); margin-bottom: .3rem; }
.asg-summary {
  display: grid; gap: .45rem; min-width: 260px;
  padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.asg-summary > strong { font-size: 1.5rem; line-height: 1; }
.asg-summary > strong + span { margin-top: -.3rem; }
.asg-summary .btn { white-space: normal; text-align: center; }
.asg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.asg-card a {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1rem;
  padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
@media (hover: hover) { .asg-card a:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); } }
.asg-num {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid var(--line-strong); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2);
}
.asg-card.done .asg-num { background: var(--good); border-color: var(--good); color: var(--surface); }
.asg-card.progress .asg-num { border-color: var(--accent); color: var(--accent); }
.asg-num .icon { width: 20px; height: 20px; }
.asg-main { display: grid; gap: .35rem; min-width: 0; }
.asg-title { font-weight: 700; font-size: 1.05rem; }
.asg-topics { display: flex; flex-wrap: wrap; gap: .3rem; }
.asg-topics .tag { font-size: .75rem; }
.asg-meta { display: flex; align-items: center; gap: .8rem; justify-content: flex-end; flex-wrap: wrap; }
.asg-meta .icon { width: 1em; height: 1em; vertical-align: -2px; }
.asg-status { display: grid; text-align: right; line-height: 1.25; min-width: 108px; font-size: .85rem; }
.asg-status span { color: var(--muted); font-size: .8rem; }
.asg-status.done strong { color: var(--good); }
.asg-status.progress strong { color: var(--accent); }
.asg-foot { margin-top: 1.2rem; }
@media (max-width: 640px) {
  .asg-card a { grid-template-columns: auto 1fr; gap: .4rem .8rem; padding: .85rem .9rem; }
  .asg-meta { grid-column: 2; justify-content: flex-start; }
  .asg-status { text-align: left; min-width: 0; display: flex; gap: .4rem; align-items: baseline; }
  .asg-summary { min-width: 0; width: 100%; }
}

/* workspace */
body.focus-mode:has(.ide) { height: 100dvh; overflow: hidden; }
.ide {
  height: 100dvh; display: grid; grid-template-rows: auto auto 1fr;
  background: var(--paper);
}
.ide-bar {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .75rem; border-bottom: 1px solid var(--line); background: var(--surface);
  min-width: 0;
}
.ide-title { display: grid; line-height: 1.25; min-width: 0; flex: 1; }
.ide-title h1 { font-size: 1rem; margin: 0; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ide-title span { font-size: .8rem; color: var(--muted); }
.ide-saved { white-space: nowrap; }
.ide-actions { display: flex; gap: .4rem; flex: none; }
.ide-actions .icon { width: 16px; height: 16px; }
.ide-tabs { display: none; }
.ide-body { display: grid; grid-template-columns: minmax(320px, 42%) 1fr; min-height: 0; }
.ide-left { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface); }
.ide-lefttabs { margin: .7rem .9rem .2rem; align-self: flex-start; }
.ide-left-body { overflow: auto; padding: .8rem 1.2rem 2rem; flex: 1; min-height: 0; }
.ide-right { display: grid; grid-template-rows: auto 1fr minmax(150px, 34%); min-height: 0; min-width: 0; }

.asg-intro .asg-title-big { font-size: 1.5rem; margin: .6rem 0 .3rem; }
.asg-intro .done-tag { color: var(--good); border-color: var(--good-line); background: var(--good-soft); }
.asg-body { margin-top: 1rem; }
.asg-body h2, .asg-body h3 { font-size: 1.02rem; margin-top: 1.3em; }
.asg-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 1.6rem 0 .6rem; }
.req-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.req-list li { display: flex; gap: .5rem; align-items: flex-start; font-size: .92rem; }
.req-list .icon { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--muted); }
.req-list li.pass .icon { color: var(--good); }
.req-list li.fail { color: var(--bad); }
.req-list li.fail .icon { color: var(--bad); }
.hint-list { list-style: none; padding: 0; margin: 0 0 .7rem; display: grid; gap: .5rem; }
.hint-list li { padding: .65rem .8rem; border-radius: var(--radius-sm); background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.hint-n { display: block; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ok); margin-bottom: .15rem; }
.asg-nav { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.asg-nav .btn { white-space: normal; }

.editor-head {
  display: flex; align-items: center; gap: .3rem;
  padding: .35rem .5rem .35rem .8rem; border-bottom: 1px solid var(--line); background: var(--surface-2);
}
.file-tab { display: inline-flex; align-items: center; gap: .35rem; font-family: var(--mono); font-size: .85rem; font-weight: 600; }
.file-tab .icon { width: 15px; height: 15px; color: var(--muted); }
.spacer { flex: 1; }
.tool {
  display: inline-flex; align-items: center; gap: .3rem; min-height: 34px; padding: .25rem .6rem;
  border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ink-2); font-size: .85rem; font-weight: 600;
}
.tool:hover { background: var(--surface); border-color: var(--line); color: var(--ink); }
.tool .icon { width: 15px; height: 15px; }

.editor-wrap {
  --code-size: 14px; --code-lh: 1.6;
  display: flex; align-items: flex-start; overflow: auto; min-height: 0;
  background: var(--surface); font-family: var(--mono); font-size: var(--code-size); line-height: var(--code-lh);
}
.gutter {
  position: sticky; left: 0; z-index: 1; flex: none;
  display: flex; flex-direction: column; align-items: flex-end;
  min-height: 100%; padding: 12px .6rem 40px .5rem; min-width: 3.2em;
  background: var(--surface-2); color: var(--muted); border-right: 1px solid var(--line);
  user-select: none; font-variant-numeric: tabular-nums;
}
.gutter span { display: block; height: calc(var(--code-size) * var(--code-lh)); }
.gutter span.err { color: var(--bad); font-weight: 700; background: var(--bad-soft); margin-right: -.6rem; padding-right: .6rem; margin-left: -.5rem; padding-left: .5rem; }
.editor {
  flex: 1; min-height: 100%; min-width: max-content;
  padding: 12px 16px 40px 12px; margin: 0;
  white-space: pre; tab-size: 4; outline: none; caret-color: var(--ink);
  font-family: inherit; font-size: inherit; line-height: inherit;
}
.editor.hljs, .editor { background: transparent !important; color: var(--ink); }
.editor:focus-visible { outline: none; }
.editor-wrap:focus-within { box-shadow: inset 0 0 0 2px var(--accent-line); }

.console { display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--line-strong); background: var(--surface-2); }
.console-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .35rem .6rem; }
.console-head .seg button { min-height: 32px; padding: .2rem .8rem; }
.console-status .bad, .console-out .bad { color: var(--bad); }
.console-input { display: flex; flex-direction: column; gap: .3rem; padding: 0 .6rem .6rem; flex: 1; min-height: 0; }
.console-input textarea {
  flex: 1; min-height: 60px; resize: none; width: 100%;
  padding: .5rem .65rem; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface);
  font-family: var(--mono); font-size: 14px; line-height: 1.5;
}
.console-input .chip-row { gap: .2rem .8rem; color: var(--muted); }
.console-input .link-btn { min-height: 30px; font-size: .85rem; }
.console-out {
  flex: 1; min-height: 0; overflow: auto; margin: 0 .6rem .6rem; padding: .6rem .75rem;
  border: 1px solid var(--line); border-radius: 8px; background: var(--sunken);
  font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}

.test-summary { display: grid; gap: .4rem; padding: .9rem 1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); margin-bottom: .6rem; }
.test-summary strong { font-size: 1.1rem; display: inline-flex; align-items: center; gap: .35rem; }
.test-summary strong .icon { width: 20px; height: 20px; }
.test-summary.good { background: var(--good-soft); border-color: var(--good-line); }
.test-summary.good strong { color: var(--good); }
.test-summary.bad { background: var(--bad-soft); border-color: var(--bad-line); }
.test-summary.bad strong { color: var(--bad); }
.test-summary.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.testing-note { margin: 0 0 .6rem; }
.err-list { list-style: none; padding: 0; margin: 0 0 .5rem; display: grid; gap: .4rem; }
.err-list li { padding: .5rem .7rem; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); font-size: .9rem; }
.err-list pre { margin: .3rem 0 0; font-size: 12.5px; overflow-x: auto; color: var(--ink-2); }
.err-list .link-btn { min-height: 0; color: var(--bad); }
.test-list { display: grid; gap: .45rem; }
.test-item { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.test-item summary {
  display: flex; align-items: center; gap: .55rem; padding: .6rem .8rem; cursor: pointer; list-style: none; min-height: 44px; flex-wrap: wrap;
}
.test-item summary::-webkit-details-marker { display: none; }
.test-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-strong); flex: none; }
.test-icon .icon { width: 14px; height: 14px; }
.test-item.pass .test-icon { background: var(--good); border-color: var(--good); color: var(--surface); }
.test-item.fail .test-icon { background: var(--bad); border-color: var(--bad); color: var(--surface); }
.test-item.fail { border-color: var(--bad-line); }
.test-name { font-weight: 600; }
.test-item .tag { font-size: .72rem; padding: 0 .45rem; }
.test-in { margin-left: auto; font-family: var(--mono); font-size: .78rem; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.test-item > :not(summary) { margin-left: .8rem; margin-right: .8rem; }
.test-item > :last-child { margin-bottom: .8rem; }
.test-note { font-size: .88rem; margin: .4rem 0; }
.test-note.bad { color: var(--bad); }
.io { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .6rem; margin: .2rem 0 .5rem; }
.io .io-h { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 .25rem; }
.io pre { margin: 0; padding: .5rem .6rem; border-radius: 8px; background: var(--sunken); border: 1px solid var(--line); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }
.diff { border: 1px solid var(--line); border-radius: 8px; overflow: auto; max-height: 360px; font-family: var(--mono); font-size: 12.5px; line-height: 1.5; margin-bottom: .4rem; }
.diff-row { display: grid; grid-template-columns: 2.4em 1fr 1fr; min-width: 420px; }
.diff-row > span { padding: .1rem .5rem; white-space: pre-wrap; word-break: break-word; border-top: 1px solid var(--line); }
.diff-row > span:first-child { color: var(--muted); text-align: right; background: var(--surface-2); }
.diff-row > span:nth-child(2) { border-right: 1px solid var(--line); }
.diff-hd > span { font-family: var(--font); font-weight: 700; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-top: 0; background: var(--surface-2); position: sticky; top: 0; }
.diff-row.bad > span:nth-child(2) { background: var(--good-soft); }
.diff-row.bad > span:nth-child(3) { background: var(--bad-soft); }
.diff-row.first > span:first-child { color: var(--bad); font-weight: 700; }
.diff .ws { color: var(--line-strong); }

@media (max-width: 900px) {
  .ide { grid-template-rows: auto auto 1fr; }
  .ide-tabs { display: flex; gap: 2px; padding: 0 .5rem; background: var(--surface); border-bottom: 1px solid var(--line); }
  .ide-tabs button {
    flex: 1; min-height: 44px; border: 0; background: none; font-weight: 600; color: var(--muted);
    border-bottom: 2.5px solid transparent; font-size: .92rem;
  }
  .ide-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
  .ide-tabs button span { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
  .ide-body { grid-template-columns: 1fr; }
  .ide-left { border-right: 0; }
  .ide-lefttabs { display: none; }
  .ide[data-pane="code"] .ide-left { display: none; }
  .ide:not([data-pane="code"]) .ide-right { display: none; }
  .ide-left-body { padding: 1rem var(--gutter) 2rem; }
  .ide-right { grid-template-rows: auto 1fr minmax(170px, 40%); }
  .editor-wrap { --code-size: 16px; --code-lh: 1.5; } /* 16px stops iPhone zooming in on tap */
  .console-input textarea { font-size: 16px; }
  .ide-saved { display: none; }
}
@media (max-width: 520px) {
  .ide-bar { padding: .4rem .5rem; gap: .35rem; }
  .ide-actions .btn { padding: .3rem .6rem; }
  .ide-actions [data-run] span { display: none; }
  .ide-actions [data-run] { width: 40px; padding: 0; }
  .tool span { display: none; }
  .tool { width: 38px; justify-content: center; padding: 0; }
  .gutter { min-width: 2.6em; padding-right: .4rem; }
  .editor { padding-left: 8px; }
}

/* =========================================================================
   Class (subject) picker
   ========================================================================= */
.subject-picker { padding-top: clamp(28px, 8vh, 80px); }
.subject-picker h1 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem); }
.eyebrow { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); margin-bottom: .5rem; }
.subject-grid { border: 0; padding: 0; margin: 1.4rem 0 1rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.subject-grid.compact { margin: .6rem 0 0; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.subject-card { position: relative; display: block; cursor: pointer; }
.subject-card input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.subject-body {
  display: grid; gap: .25rem; height: 100%;
  padding: 1rem 1.1rem 1rem 3.1rem; border: 1.5px solid var(--line); border-radius: var(--radius);
  background: var(--surface); transition: border-color .12s, background .12s, box-shadow .12s;
  position: relative;
}
.subject-check {
  position: absolute; left: 1rem; top: 1.05rem; width: 22px; height: 22px; border-radius: 6px;
  border: 1.5px solid var(--line-strong); display: grid; place-items: center; color: transparent; background: var(--surface);
}
.subject-check .icon { width: 15px; height: 15px; }
.subject-name { font-weight: 700; font-size: 1.15rem; line-height: 1.25; }
.subject-sub { color: var(--ink-2); font-size: .92rem; }
@media (hover: hover) { .subject-card:hover .subject-body { border-color: var(--ink-2); } }
.subject-card input:checked + .subject-body { border-color: var(--accent); background: var(--accent-soft); box-shadow: var(--shadow-1); }
.subject-card input:checked + .subject-body .subject-check { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.subject-card input:focus-visible + .subject-body { outline: 3px solid var(--accent); outline-offset: 2px; }
.subject-picker .row { margin-top: .4rem; }
.subject-picker .btn .icon { width: 18px; height: 18px; }
.form-error { margin: 0 0 .6rem; font-weight: 600; color: var(--bad); }
.privacy-note { margin-top: 2rem; display: flex; gap: .4rem; align-items: center; }
.privacy-note .icon { width: 16px; height: 16px; flex: none; }
.fieldset-help { margin: -.2rem 0 .2rem; }
.my-subjects { margin: .6rem 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .7rem; color: var(--ink-2); }
.my-subjects .link-btn { font-size: .92rem; }
.new-course { border-color: var(--accent-line); background: var(--accent-soft); }
@media (max-width: 560px) {
  .subject-grid { grid-template-columns: 1fr; }
  .subject-picker .row .btn { flex: 1; }
}
.field-help { margin: -.2rem 0 .4rem; max-width: 60ch; }
.exact-note { margin-top: 1.6rem; }

/* =========================================================================
   Sign-in, account, instructor dashboard
   ========================================================================= */
body.signed-out .topnav { display: none; }
.signin { padding-top: clamp(32px, 10vh, 110px); }
.signin-card {
  max-width: 480px; margin: 0 auto; text-align: center;
  padding: clamp(24px, 5vw, 40px); border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); box-shadow: var(--shadow-2);
}
.brand-mark.big { width: 56px; height: 56px; margin-bottom: .8rem; }
.signin-card h1 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.2rem); }
.signin-card .lead { margin: 0 auto 1.4rem; }
.signin-btn { width: 100%; white-space: normal; gap: .7rem; margin-bottom: .8rem; }
.signin-btn svg { flex: none; }
.signin-error {
  display: flex; gap: .5rem; align-items: flex-start; text-align: left;
  padding: .7rem .85rem; margin: 0 0 1rem; border-radius: var(--radius-sm);
  background: var(--bad-soft); border: 1px solid var(--bad-line); color: var(--bad); font-weight: 600; font-size: .92rem;
}
.signin-error .icon { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.signin-more { text-align: left; margin-top: 1.4rem; border-top: 1px solid var(--line); padding-top: 1rem; }
.signin-more summary { cursor: pointer; font-weight: 600; color: var(--ink-2); min-height: 40px; display: flex; align-items: center; }
.signin-more ul { padding-left: 1.2rem; margin: .4rem 0 0; color: var(--ink-2); font-size: .92rem; display: grid; gap: .35rem; }

.account-chip {
  display: inline-grid !important; place-items: center; width: 36px; height: 36px; padding: 0 !important; margin-left: .2rem;
  border-radius: 50% !important; background: var(--accent-soft) !important; color: var(--accent) !important;
  font-weight: 700; font-size: .85rem; overflow: hidden; border: 1.5px solid var(--accent-line);
}
.account-chip img { width: 100%; height: 100%; object-fit: cover; }
.account-box {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.2rem; margin-bottom: 1.4rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.account-who { display: grid; gap: .1rem; min-width: 0; }
.account-who strong { overflow-wrap: anywhere; }
.sync-line.good { color: var(--good); }
.sync-line.bad { color: var(--bad); }

.inst-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.4rem; }
.inst-head select { min-height: 42px; padding: .4rem .6rem; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); max-width: 100%; }
.field.inline { display: inline-flex; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: .5rem; }
.stat-tile { display: grid; gap: .1rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.stat-tile strong { font-size: 1.6rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-tile > span:first-of-type { color: var(--ink-2); font-size: .9rem; }
.stat-tiles.small .stat-tile strong { font-size: 1.25rem; }
.inst-topics { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.inst-topics li { display: grid; grid-template-columns: minmax(140px, 1.4fr) 2fr 3.2em minmax(90px, auto); gap: .8rem; align-items: center; padding: .45rem .2rem; border-bottom: 1px solid var(--line); }
.inst-topics .t-num { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.inst-tools { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; margin-bottom: .8rem; }
.inst-tools input[type=search] { min-height: 42px; padding: .4rem .7rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); min-width: 240px; flex: 1; max-width: 360px; }
.inst-table-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.inst-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.inst-table th, .inst-table td { padding: .55rem .75rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.inst-table td:first-child { white-space: normal; min-width: 180px; }
.inst-table th button { border: 0; background: none; padding: 0; font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); min-height: 32px; }
.inst-table thead th { position: sticky; top: 0; background: var(--surface-2); }
.inst-table tbody tr:hover { background: var(--surface-2); }
.inst-table .block { display: block; }
.inst-table .link-btn { min-height: 0; text-align: left; }
.inst-table.compact th { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pill { display: inline-block; padding: .05rem .5rem; border-radius: 999px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--surface-2); }
.pill.good { background: var(--good-soft); color: var(--good); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.code-view { max-height: 420px; overflow: auto; padding: .8rem; border-radius: 8px; border: 1px solid var(--line); background: var(--sunken); font-size: 13px; line-height: 1.5; }
.code-view code.hljs { background: transparent; padding: 0; }
@media (max-width: 640px) {
  .inst-topics li { grid-template-columns: 1fr 3.2em; gap: .3rem .6rem; }
  .inst-topics .t-bar { grid-column: 1 / -1; grid-row: 2; }
  .inst-topics .t-tried { grid-column: 1 / -1; }
  .inst-tools input[type=search] { min-width: 0; max-width: none; width: 100%; }
}
.stat-tile .of { font-size: 1rem; color: var(--muted); font-weight: 600; }
.section-pick { display: inline-flex; align-items: center; gap: .5rem; margin-bottom: 1rem; font-weight: 600; }
.section-pick select { min-height: 40px; padding: .3rem .5rem; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); }

/* classes landing */
.class-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.class-head .btn .icon { width: 18px; height: 18px; }
.class-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.class-card {
  display: grid; gap: .35rem; padding: 1.2rem 1.3rem; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow-1); transition: box-shadow .15s, transform .15s;
}
@media (hover: hover) { .class-card:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); } }
.class-course { font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); }
.class-name { font-size: 1.3rem; font-weight: 700; }
.class-foot { display: flex; justify-content: space-between; align-items: center; margin-top: .4rem; }
.role-tag { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.admin-note { margin-top: 1.5rem; }
.not-enrolled strong { overflow-wrap: anywhere; }

/* admin */
.class-admin-list { display: grid; gap: .8rem; }
.class-admin { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: 1.1rem 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.class-admin h2 { margin-bottom: .2rem; }
.class-admin p { margin: 0 0 .3rem; }
.class-admin-main { min-width: 0; flex: 1 1 320px; }
.admin-edit input[name], .admin-edit textarea { width: 100%; padding: .55rem .7rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); font-size: 16px; }
.admin-edit textarea[name=paste] { font-family: var(--mono); font-size: 13px; margin-top: .6rem; }
.admin-edit .field { display: grid; gap: .3rem; margin-bottom: .6rem; }
.exam-group { margin: .5rem 0 .3rem; font-weight: 700; }
.roster-preview { margin-top: .8rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.roster-preview p { margin: 0 0 .5rem; }
.roster-preview .table-wrap { margin-bottom: .6rem; background: var(--surface); border-radius: 8px; }
.skipped summary { cursor: pointer; font-weight: 700; min-height: 36px; display: flex; align-items: center; }
.skipped ul { margin: .3rem 0 .5rem; padding-left: 1.2rem; font-size: .88rem; display: grid; gap: .2rem; }
