:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --ink: #1d2433;
  --muted: #5b6475;
  --line: #dde1e8;
  --accent: #2f5d8a;
  --accent-ink: #ffffff;
  --fail: #b42318;
  --fail-bg: #fdecea;
  --instructor: #5b3fb8;
  --instructor-bg: #efeafd;
  --review: #9a4a06;
  --review-bg: #fdf1e3;
  --pass: #11704a;
  --pass-bg: #e6f4ee;
  --na: #5b6475;
  --na-bg: #eef0f3;
  --radius: 8px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171d;
    --surface: #1c2028;
    --ink: #e7e9ee;
    --muted: #a3aab8;
    --line: #2f3542;
    --accent: #7aa7d6;
    --accent-ink: #0d1520;
    --fail: #ff8a80;
    --fail-bg: #3a1d1b;
    --instructor: #b9a6ff;
    --instructor-bg: #2a2340;
    --review: #f3b26b;
    --review-bg: #36281a;
    --pass: #72d1a6;
    --pass-bg: #17312a;
    --na: #a3aab8;
    --na-bg: #262b35;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); line-height: 1.5; font-size: 16px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
a { color: var(--accent); }
code { font-size: 0.92em; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); padding: 28px 0 20px; margin-bottom: 28px; }
.top h1 { margin: 0 0 6px; font-size: 1.6rem; letter-spacing: -0.01em; }
.lede { margin: 0; color: var(--muted); max-width: 52em; }

.drop { background: var(--surface); border: 2px dashed var(--line); border-radius: 12px; padding: 40px 24px; text-align: center; }
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.drop-title { font-size: 1.2rem; font-weight: 600; margin: 0; }
.drop-or { color: var(--muted); margin: 8px 0; }
.privacy { margin: 20px auto 0; max-width: 40em; color: var(--muted); }
.howto { margin: 16px 0 0; color: var(--muted); }
.howto summary { cursor: pointer; }

.button { display: inline-block; font: inherit; font-weight: 600; padding: 9px 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.button:hover { border-color: var(--accent); }
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button.quiet { border-color: transparent; background: transparent; color: var(--accent); }
.button:focus-visible, label.button:focus-within, input:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
#file:focus-visible + .button, .drop:focus-within label.button { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

.status { min-height: 1.5em; color: var(--muted); }
.status.error { color: var(--fail); font-weight: 600; }

.toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-bottom: 24px; }
.mode { border: 0; margin: 0; padding: 0; }
.mode legend { font-weight: 700; margin-bottom: 6px; }
.mode label { display: block; margin: 2px 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.hint { color: var(--muted); font-size: 0.92rem; margin: 6px 0 0; }

.report { outline: none; }
.report section { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 24px 20px; margin-bottom: 24px; }
.report h2 { font-size: 1.25rem; margin: 18px 0 10px; }
.report h3.gs { font-size: 1.05rem; margin: 22px 0 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.report h4 { margin: 14px 0 6px; font-size: 0.98rem; }
.course { margin: 0 0 12px; }

.tiles { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 8px 0 14px; }
.tile { border-radius: var(--radius); padding: 10px 12px; }
.tile .n { display: block; font-size: 1.6rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .l { font-size: 0.88rem; }
.tile-fail { background: var(--fail-bg); color: var(--fail); }
.tile-instructor { background: var(--instructor-bg); color: var(--instructor); }
.tile-review { background: var(--review-bg); color: var(--review); }
.tile-pass { background: var(--pass-bg); color: var(--pass); }
.tile-na { background: var(--na-bg); color: var(--na); }
.settled { margin: 0 0 8px; }
.jump a { margin-right: 14px; }

.chip { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; vertical-align: 1px; white-space: nowrap; }
.chip-fail { background: var(--fail-bg); color: var(--fail); }
.chip-instructor { background: var(--instructor-bg); color: var(--instructor); }
.chip-review { background: var(--review-bg); color: var(--review); }
.chip-pass { background: var(--pass-bg); color: var(--pass); }
.chip-na { background: var(--na-bg); color: var(--na); }

.std-block { border: 1px solid var(--line); border-radius: var(--radius); margin: 8px 0; }
.std-block > summary { cursor: pointer; padding: 9px 12px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.std-block[open] > summary { border-bottom: 1px solid var(--line); }
.std-block .num { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 2.2em; }
.std-block .label { flex: 1 1 24em; }
.std-block .pts { color: var(--muted); font-size: 0.9rem; }
.std-block .outcome { flex-basis: 100%; padding-left: 3.2em; font-size: 0.88rem; color: var(--muted); }
.outcome-blocked { border-left: 4px solid var(--fail); }
.outcome-blocked .outcome { color: var(--fail); }
.outcome-instructor { border-left: 4px solid var(--instructor); }
.outcome-review { border-left: 4px solid var(--review); }
.outcome-complete { border-left: 4px solid var(--pass); }
.ess { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent); border: 1px solid currentColor; border-radius: 4px; padding: 0 5px; }
.std { color: var(--muted); font-size: 0.9rem; }
.check { padding: 10px 14px; border-top: 1px solid var(--line); }
.check:first-of-type { border-top: 0; }
.check.supporting { opacity: 0.85; }

.evidence { margin: 6px 0 0; padding-left: 20px; font-size: 0.93rem; }
.evidence li { margin: 2px 0; overflow-wrap: anywhere; }
.where { font-weight: 600; }
.where::after { content: ":"; }
.from, .muted { color: var(--muted); font-size: 0.88rem; }
details > summary { cursor: pointer; }
.report details:not(.std-block) { margin: 6px 0; }

.fixes { padding-left: 22px; }
.fixes > li { margin: 0 0 16px; }
.fix-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.fixes p { margin: 4px 0; }
.tree ul { margin: 2px 0 8px; }

.foot { color: var(--muted); font-size: 0.9rem; padding-top: 8px; padding-bottom: 40px; }
@media (max-width: 720px) {
  .toolbar { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
}
