/* Tokens follow design/DESIGN-claude.md: cream canvas, coral actions, dark product surfaces. */
:root {
  --primary: #cc785c;
  --primary-active: #a9583e;
  --primary-disabled: #e6dfd8;
  --ink: #141413;
  --body: #3d3d3a;
  --body-strong: #252523;
  --muted: #6c6a64;
  --muted-soft: #8e8b82;
  --hairline: #e6dfd8;
  --hairline-soft: #ebe6df;
  --canvas: #faf9f5;
  --surface-soft: #f5f0e8;
  --surface-card: #efe9de;
  --surface-cream-strong: #e8e0d2;
  --surface-dark: #181715;
  --surface-dark-elevated: #252320;
  --surface-dark-soft: #1f1e1b;
  --on-primary: #ffffff;
  --on-dark: #faf9f5;
  --on-dark-soft: #a09d96;
  --accent-teal: #5db8a6;
  --accent-amber: #e8a55a;
  --success: #5db872;
  --success-ink: #2f7a44;
  --warning: #d4a017;
  --error: #c64545;

  --serif: "Copernicus", "Tiempos Headline", "Cormorant Garamond", "EB Garamond", Garamond, "Times New Roman", serif;
  --sans: "StyreneB", Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-pill: 9999px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--canvas);
  color: var(--body);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { color: var(--ink); margin: 0; }

.display-xl, .display-lg, .display-md, .display-sm { font-family: var(--serif); font-weight: 500; color: var(--ink); }
.display-xl { font-size: 64px; line-height: 1.05; letter-spacing: -1.5px; }
.display-lg { font-size: 48px; line-height: 1.1; letter-spacing: -1px; }
.display-md { font-size: 36px; line-height: 1.15; letter-spacing: -0.5px; }
.display-sm { font-size: 28px; line-height: 1.2; letter-spacing: -0.3px; }

.caption-upper { font-size: 12px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }

a { color: var(--primary); text-decoration: none; }
a:active { text-decoration: underline; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-card);
  padding: 1px 6px;
  border-radius: var(--r-xs);
  color: var(--body-strong);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 20px;
  font: 500 14px/1 var(--sans);
  border-radius: var(--r-md); border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
}
.btn:disabled { cursor: default; }
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:active { background: var(--primary-active); }
.btn-primary:disabled { background: var(--primary-disabled); color: var(--muted); }
.btn-secondary { background: var(--canvas); color: var(--ink); border-color: var(--hairline); }
.btn-secondary:active { background: var(--surface-soft); }
.btn-secondary:disabled { color: var(--muted-soft); }
.btn-dark { background: var(--surface-dark-elevated); color: var(--on-dark); }
.btn-dark:active { background: #33302b; }
.btn-dark:disabled { color: var(--on-dark-soft); }
.btn-text { background: transparent; color: var(--ink); padding: 0 8px; }
.btn-cream { background: var(--canvas); color: var(--ink); }
.btn-cream:active { background: var(--surface-card); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r-sm); }

/* Inputs */
.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 13px; font-weight: 500; color: var(--body-strong); margin-bottom: 6px; }
.input {
  width: 100%; height: 40px; padding: 10px 14px;
  font: 400 16px var(--sans); color: var(--ink);
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-md);
  outline: none;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(204, 120, 92, 0.15); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--r-pill);
  background: var(--surface-card); color: var(--ink);
  font-size: 13px; font-weight: 500; line-height: 1.4;
}
.badge-coral { background: var(--primary); color: var(--on-primary); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; }
.badge-amber { background: var(--accent-amber); color: var(--ink); font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; }
.badge-dark { background: var(--surface-dark-elevated); color: var(--on-dark); }

/* Brand */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font: 500 18px var(--sans); }
.brand-mark { width: 22px; height: 22px; flex: none; }

/* Top navigation */
.top-nav {
  height: 64px; padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--canvas); border-bottom: 1px solid var(--hairline-soft);
  position: sticky; top: 0; z-index: 20;
}
.nav-right { display: flex; align-items: center; gap: 16px; font-size: 14px; font-weight: 500; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }

/* Sign-in page */
.auth-wrap { background: radial-gradient(900px 420px at 88% 0%, rgba(204, 120, 92, 0.16), transparent 70%), var(--surface-soft); border-bottom: 1px solid var(--hairline-soft); }
.auth-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 440px); gap: 72px; align-items: center; padding: 64px 0 80px; }
.auth-hero .display-xl { margin-top: 20px; }
.auth-hero .lede { font-size: 18px; color: var(--body); max-width: 500px; margin: 20px 0 0; }
.badge-live { background: var(--canvas); border: 1px solid var(--hairline); }
.badge-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); display: inline-block; }
.pitch-stats { display: flex; gap: 40px; margin: 32px 0 36px; }
.pitch-stats b { display: block; font-family: var(--serif); font-weight: 500; font-size: 40px; line-height: 1; letter-spacing: -0.5px; color: var(--ink); }
.pitch-stats span { display: block; font-size: 13px; color: var(--muted); margin-top: 6px; }
.pitch-stats div + div { padding-left: 40px; border-left: 1px solid var(--hairline); }

.mock { max-width: 520px; background: var(--surface-dark); border-radius: var(--r-xl); overflow: hidden; color: var(--on-dark); }
.mock-bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 0 12px; }
.mock-tabs { display: flex; gap: 2px; }
.mock-tabs span { padding: 8px 14px; border-radius: var(--r-md) var(--r-md) 0 0; font-size: 13px; font-weight: 500; color: var(--on-dark-soft); }
.mock-tabs .on { background: var(--surface-dark-soft); color: var(--on-dark); }
.mock-clock { font: 500 16px var(--mono); color: var(--accent-amber); }
.mock-code { background: var(--surface-dark-soft); padding: 16px 0; font: 400 13.5px/1.75 var(--mono); counter-reset: line; white-space: nowrap; overflow: hidden; }
.mock-line { counter-increment: line; }
.mock-line i::before { content: counter(line); display: inline-block; width: 40px; padding-right: 14px; text-align: right; color: #5e5b54; font-style: normal; }
.mock-code .k { color: #e0957b; }
.mock-code .d { color: #d9c7a3; }
.mock-code .b { color: #9cc4e0; }
.mock-code .n { color: var(--accent-amber); }
.mock-foot { display: flex; align-items: center; gap: 12px; padding: 14px 16px; font-size: 13px; color: var(--on-dark-soft); }
.mock-foot .pill { padding: 3px 10px; border-radius: var(--r-pill); font-size: 11px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; background: rgba(93, 184, 114, 0.18); color: #8fd6a0; }
.mock-dots { margin-left: auto; display: flex; gap: 4px; }
.mock-dots i { width: 8px; height: 8px; border-radius: 2px; background: var(--success); opacity: 0.85; }

.auth-card { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-xl); padding: 32px; box-shadow: 0 24px 48px -32px rgba(20, 20, 19, 0.28); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-card); border-radius: var(--r-lg); margin-bottom: 28px; }
.seg-btn { height: 36px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--muted); font: 500 14px/1 var(--sans); cursor: pointer; }
.seg-btn.active { background: var(--canvas); color: var(--ink); box-shadow: 0 1px 2px rgba(20, 20, 19, 0.12); }
.auth-card h2 { font-family: var(--serif); font-weight: 500; font-size: 32px; line-height: 1.15; letter-spacing: -0.4px; }
.auth-sub { margin: 6px 0 24px; color: var(--muted); font-size: 15px; }
.auth-card .input { height: 44px; background: #ffffff; }
.auth-card .input::placeholder { color: var(--muted-soft); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 64px; }
.reveal { position: absolute; right: 6px; top: 6px; height: 32px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--muted); font: 500 13px/1 var(--sans); cursor: pointer; }
.reveal:active { background: var(--surface-card); }
.field-hint { font-size: 13px; color: var(--muted); margin: -4px 0 12px; }
.btn-block { width: 100%; height: 44px; font-size: 15px; }
.auth-swap { text-align: center; font-size: 14px; color: var(--muted); margin: 18px 0 0; }
.auth-swap a { font-weight: 500; }
.auth-points { list-style: none; margin: 24px 0 0; padding: 20px 0 0; border-top: 1px solid var(--hairline-soft); }
.auth-points li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--body); padding: 4px 0; }
.auth-points svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--primary); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.auth-wrap + .band-soft { background: var(--canvas); }
.tab-chip {
  padding: 8px 14px; border-radius: var(--r-md); border: 0; background: transparent;
  color: var(--muted); font: 500 14px/1.4 var(--sans); cursor: pointer;
}
.tab-chip.active { background: var(--surface-card); color: var(--ink); }
.tab-chip .count { font: 400 12px var(--mono); color: var(--muted-soft); margin-left: 4px; }
.form-error { color: var(--error); font-size: 14px; min-height: 22px; margin: 0 0 8px; }

.code-window, .next-card { background: var(--surface-dark); color: var(--on-dark); border-radius: var(--r-xl); padding: 24px; }
.code-window .bar, .next-card .bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; color: var(--on-dark-soft); font-size: 13px; }
.code-window .clock, .next-card .clock { font: 500 28px var(--mono); color: var(--on-dark); letter-spacing: -0.5px; }
.format-row {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: center;
  padding: 18px 20px; margin-top: 10px; background: var(--surface-dark-soft); border-radius: var(--r-lg);
}
.format-row .num { font: 400 14px var(--mono); color: var(--on-dark-soft); }
.format-row .name { font-weight: 500; }
.format-row .desc { font-size: 14px; color: var(--on-dark-soft); }
.format-row .lang { font: 400 13px var(--mono); color: var(--accent-amber); }

/* Dashboard */
.dash-hero { padding: 64px 0 40px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 64px; align-items: center; }
.dash-hero p { font-size: 18px; max-width: 520px; margin: 20px 0 0; }
.dash-hero .display-xl { margin-top: 14px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.next-card h3 { font-family: var(--serif); font-weight: 500; font-size: 32px; line-height: 1.15; letter-spacing: -0.4px; color: var(--on-dark); }
.next-card .next-origin { font-size: 14px; color: var(--on-dark-soft); margin: 4px 0 18px; }
.next-card .bar span:first-child { font-size: 12px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent-amber); }

.progress-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1.5fr; gap: 12px; padding-bottom: 64px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { background: var(--surface-card); border-radius: var(--r-lg); padding: 24px; }
.stat .value { font-family: var(--serif); font-weight: 500; font-size: 36px; line-height: 1.1; letter-spacing: -0.5px; color: var(--ink); }
.stat .value small { font-size: 20px; letter-spacing: 0; color: var(--muted-soft); }
.stat .label { font-size: 13px; font-weight: 500; color: var(--muted); margin-top: 6px; }
.stat .label.soft { font-weight: 400; color: var(--muted-soft); margin-top: 14px; }
.stat .label.strong { color: var(--ink); margin: 0 0 14px; }
.section-bar { display: grid; grid-template-columns: 56px 1fr 34px; gap: 12px; align-items: center; font-size: 13px; color: var(--muted); padding: 5px 0; }
.section-bar .meter { margin-top: 0; }
.section-bar b { text-align: right; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 28px; }
.feature-icon { width: 48px; height: 48px; border-radius: var(--r-lg); background: var(--surface-dark); display: flex; align-items: center; justify-content: center; margin-bottom: 20px; }
.feature-icon svg { width: 26px; height: 26px; fill: none; stroke: var(--accent-amber); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.feature-card h3 { font-family: var(--serif); font-weight: 500; font-size: 26px; line-height: 1.2; letter-spacing: -0.3px; margin: 6px 0 10px; }
.feature-card p { margin: 0 0 16px; font-size: 15px; }
.feature-card ul { list-style: none; margin: 0; padding: 0; }
.feature-card li { position: relative; padding: 8px 0 8px 20px; border-top: 1px solid var(--hairline-soft); font-size: 14px; color: var(--body-strong); }
.feature-card li::before { content: ""; position: absolute; left: 2px; top: 16px; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }

.filters { display: flex; gap: 4px; flex-wrap: wrap; }
.empty-card { border: 1px dashed var(--surface-cream-strong); border-radius: var(--r-lg); padding: 40px 32px; text-align: center; background: var(--canvas); }
.empty-card h3 { font-family: var(--serif); font-weight: 500; font-size: 26px; letter-spacing: -0.3px; margin-bottom: 8px; }
.empty-card p { max-width: 520px; margin: 0 auto; color: var(--muted); }
.history-wrap { background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 8px 16px 4px; overflow-x: auto; }
.history-wrap tr:last-child td { border-bottom: 0; }

.callout { display: flex; align-items: center; justify-content: space-between; gap: 40px; background: var(--primary); border-radius: var(--r-xl); padding: 48px 56px; margin: 64px 0 16px; }
.callout h2 { color: var(--on-primary); }
.callout p { color: rgba(255, 255, 255, 0.88); margin: 10px 0 0; max-width: 560px; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 24px; }
.section-head { gap: 20px; flex-wrap: wrap; }
.band { padding: 64px 0; }
.band-soft { background: var(--surface-soft); }

.band-dark { background: var(--surface-dark); color: var(--on-dark-soft); }
.band-dark h2, .band-dark .test-card h3 { color: var(--on-dark); }
.band-dark .caption-upper { color: var(--on-dark-soft); }
.band-dark .section-head { align-items: flex-end; flex-wrap: nowrap; gap: 48px; }
.hard-note { max-width: 560px; margin: 0; font-size: 15px; }
.band-dark .test-card { background: var(--surface-dark-elevated); border-color: #33302b; }
.band-dark .topic-list li { border-top-color: #33302b; }
.band-dark .topic-list li span:first-child { color: var(--on-dark-soft); }
.band-dark .topic-list li span:nth-child(2) { color: var(--on-dark); }
.band-dark .topic-list .mini { background: #3a362f; }
.band-dark .set-num { color: var(--accent-amber); }
.band-dark .score-line { color: var(--on-dark-soft); }
.band-dark .score-line b { color: var(--on-dark); }
.band-dark .btn-secondary { background: transparent; color: var(--on-dark); border-color: #4a4439; }
.band-dark .btn-text, .band-dark a.btn-text { color: var(--on-dark); }
.band-dark + .band-soft { margin-top: 0; }
.test-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.test-card {
  display: flex; flex-direction: column;
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg); padding: 28px;
}
.band-soft .test-card { background: var(--canvas); }
.test-card .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; min-height: 26px; }
.test-card h3 { font-family: var(--serif); font-weight: 500; font-size: 28px; line-height: 1.2; letter-spacing: -0.3px; }
.set-title { display: flex; align-items: baseline; gap: 12px; }
.set-num { font: 400 13px var(--mono); color: var(--primary); }
.topic-list { list-style: none; margin: 18px 0 24px; padding: 0; flex: 1; }
.topic-list li { display: grid; grid-template-columns: 62px 1fr 40px; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--hairline-soft); font-size: 14px; }
.topic-list li span:first-child { color: var(--muted-soft); font-weight: 500; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.topic-list li span:nth-child(2) { color: var(--body-strong); }
.topic-list .mini { height: 4px; border-radius: 2px; background: var(--surface-cream-strong); overflow: hidden; }
.topic-list .mini i { display: block; height: 100%; background: var(--primary); }
.test-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.test-card .foot > span:last-child { display: inline-flex; align-items: center; gap: 4px; }
.score-line { font-size: 14px; color: var(--muted); }
.score-line b { color: var(--ink); font-weight: 500; }

.history { width: 100%; border-collapse: collapse; font-size: 14px; }
.history th { text-align: left; font-size: 12px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--hairline); }
.history td { padding: 14px 12px; border-bottom: 1px solid var(--hairline-soft); color: var(--body); }
.history td.num, .history th.num { text-align: right; font-variant-numeric: tabular-nums; }
.history td b { color: var(--ink); font-weight: 500; }

.footer { background: var(--surface-dark); color: var(--on-dark-soft); padding: 56px 0; font-size: 14px; margin-top: 64px; }
.footer .brand { color: var(--on-dark); margin-bottom: 12px; }
.footer p { max-width: 440px; margin: 0; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 48px; }
.foot-head { font-size: 12px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; color: var(--on-dark); margin-bottom: 12px; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { padding: 3px 0; }

/* Test runner */
.runner { height: 100vh; display: flex; flex-direction: column; background: var(--canvas); min-width: 1024px; }
.runner-bar {
  flex: none; height: 56px; padding: 0 16px 0 20px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
  border-bottom: 1px solid var(--hairline);
}
.runner-bar .left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.runner-bar .left .title { font-weight: 500; color: var(--ink); font-size: 15px; white-space: nowrap; }
.runner-bar .right { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.q-tabs { display: flex; gap: 4px; }
.q-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 0; border-radius: var(--r-md); background: transparent;
  color: var(--muted); font: 500 14px/1.4 var(--sans); cursor: pointer;
}
.q-tab.active { background: var(--surface-card); color: var(--ink); }
.q-tab .n { font: 400 12px var(--mono); color: var(--muted-soft); }
.q-tab .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--hairline); }
.q-tab .dot.part { background: var(--accent-amber); }
.q-tab .dot.full { background: var(--success); }
.timer { font: 500 18px var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.timer.low { color: var(--error); }
.save-note { font-size: 12px; color: var(--muted-soft); min-width: 44px; text-align: right; }

.runner-body { flex: 1; min-height: 0; display: flex; }
.pane-left { flex: none; width: 38%; min-width: 280px; overflow-y: auto; padding: 28px 28px 40px; }
.splitter-x { flex: none; width: 10px; cursor: col-resize; position: relative; }
.splitter-x::after { content: ""; position: absolute; top: 0; bottom: 0; left: 4px; width: 1px; background: var(--hairline); }
.splitter-x:active::after, .splitter-y:active::after { background: var(--primary); }
.pane-right { flex: 1; min-width: 0; padding: 12px 12px 12px 2px; display: flex; }
.dragging iframe { pointer-events: none; }
.dragging { user-select: none; }

.statement h2 { font-family: var(--serif); font-weight: 500; font-size: 36px; line-height: 1.15; letter-spacing: -0.5px; margin: 10px 0 18px; }
.statement h4 { font: 500 12px var(--sans); letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin: 28px 0 10px; }
.statement p { margin: 0 0 14px; }
.statement ul, .statement ol { padding-left: 22px; margin: 0 0 14px; }
.statement li { margin-bottom: 6px; }
.statement b { color: var(--body-strong); font-weight: 600; }
.statement .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.example { background: var(--surface-card); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 12px; }
.example .row { display: grid; grid-template-columns: 70px 1fr; gap: 8px; font-size: 14px; padding: 2px 0; }
.example .row > span:first-child { color: var(--muted); font-weight: 500; }
.example .row .mono { font-size: 13px; color: var(--ink); word-break: break-word; }
.example .note { font-size: 14px; color: var(--muted); margin-top: 8px; }

.schema-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.schema-table { border: 1px solid var(--hairline); border-radius: var(--r-lg); overflow: hidden; background: var(--canvas); }
.schema-table .name { background: var(--surface-card); padding: 10px 14px; font: 500 13px var(--mono); color: var(--ink); }
.schema-table .col { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 7px 14px; border-top: 1px solid var(--hairline-soft); font-size: 13px; }
.schema-table .col .cname { font-family: var(--mono); color: var(--body-strong); }
.schema-table .col .ctype { font-family: var(--mono); font-size: 12px; color: var(--muted-soft); }
.key { display: inline-block; font: 500 10px var(--sans); letter-spacing: 0.5px; padding: 1px 5px; border-radius: var(--r-xs); margin-left: 6px; vertical-align: 1px; }
.key.pk { background: var(--primary); color: var(--on-primary); }
.key.fk { background: var(--surface-cream-strong); color: var(--body-strong); }
.schema-table .ref { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: -2px; }

.task-list { list-style: none; padding: 0; margin: 0; }
.statement .task-list, .statement .check-list { padding-left: 0; }
.task { background: var(--surface-card); border-radius: var(--r-lg); padding: 16px 18px; margin-bottom: 12px; font-size: 15px; }
.task .t-head { font: 500 12px var(--sans); letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.check-list { list-style: none; padding: 0; margin: 12px 0 0; border-top: 1px solid var(--hairline); }
.check-list li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; padding: 7px 0 0; color: var(--muted); }
.check-list li.pass { color: var(--success-ink); }
.check-list li.fail { color: var(--error); }
.check-list .mark { font-family: var(--mono); flex: none; width: 14px; }

/* Dark workspace */
.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--surface-dark); border-radius: var(--r-lg); overflow: hidden; color: var(--on-dark); }
.ws-head { flex: none; height: 44px; display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 16px; background: var(--surface-dark); }
.ws-file { font: 400 13px var(--mono); color: var(--on-dark-soft); display: inline-flex; align-items: center; gap: 8px; }
.ws-file i { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); display: inline-block; }
.ws-editor { flex: 1; min-height: 80px; background: var(--surface-dark-soft); position: relative; }
.ws-editor .CodeMirror { position: absolute; inset: 0; height: auto; }
.splitter-y { flex: none; height: 9px; cursor: row-resize; position: relative; background: var(--surface-dark); }
.splitter-y::after { content: ""; position: absolute; left: 50%; top: 3px; width: 36px; height: 3px; margin-left: -18px; border-radius: 2px; background: var(--surface-dark-elevated); }
.ws-output { flex: none; height: 38%; min-height: 60px; display: flex; flex-direction: column; background: var(--surface-dark); }
.ws-output-head { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 4px 16px 8px; font-size: 13px; color: var(--on-dark-soft); }
.ws-output-body { flex: 1; overflow: auto; padding: 0 16px 12px; font-size: 14px; }
.ws-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--surface-dark); border-top: 1px solid var(--surface-dark-elevated); }
.ws-foot .hint { font-size: 13px; color: var(--on-dark-soft); padding-left: 4px; }
.ws-foot .actions { display: flex; gap: 8px; }
.placeholder { color: var(--on-dark-soft); padding-top: 4px; }

.verdict { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-weight: 500; }
.verdict .pill { padding: 3px 10px; border-radius: var(--r-pill); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; }
.verdict .pill.ok { background: rgba(93, 184, 114, 0.18); color: #8fd6a0; }
.verdict .pill.no { background: rgba(198, 69, 69, 0.2); color: #ef9a9a; }
.verdict .pill.mid { background: rgba(232, 165, 90, 0.18); color: var(--accent-amber); }
.case { background: var(--surface-dark-soft); border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 8px; }
.case .c-head { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.case .c-head .s { font-family: var(--mono); }
.case.pass .c-head .s { color: var(--success); }
.case.fail .c-head .s { color: #ef8a8a; }
.case dl { display: grid; grid-template-columns: 76px 1fr; gap: 4px 10px; margin: 10px 0 0; font-size: 13px; }
.case dt { color: var(--on-dark-soft); }
.case dd { margin: 0; font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-word; color: var(--on-dark); }
.case dd.err { color: #ef9a9a; }
.hidden-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px; }
.hidden-grid span { width: 26px; height: 26px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; font: 400 11px var(--mono); }
.hidden-grid .pass { background: rgba(93, 184, 114, 0.18); color: #8fd6a0; }
.hidden-grid .fail { background: rgba(198, 69, 69, 0.22); color: #ef9a9a; }
.sub-label { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--on-dark-soft); margin: 4px 0 8px; }

.result-table { border-collapse: collapse; font: 400 12.5px var(--mono); min-width: 240px; }
.result-table th { text-align: left; color: var(--on-dark-soft); font-weight: 500; padding: 6px 18px 6px 0; border-bottom: 1px solid var(--surface-dark-elevated); white-space: nowrap; }
.result-table td { padding: 6px 18px 6px 0; border-bottom: 1px solid var(--surface-dark-soft); color: var(--on-dark); white-space: nowrap; }
.result-table td.null { color: var(--on-dark-soft); font-style: italic; }
.sql-error { font-family: var(--mono); font-size: 13px; color: #ef9a9a; white-space: pre-wrap; }

/* Web question: one editor with a tab per file, over a live preview */
.file-tabs { display: flex; gap: 2px; align-self: flex-end; margin-left: -8px; }
.file-tab {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 18px;
  border: 0; border-radius: var(--r-md) var(--r-md) 0 0; background: transparent;
  color: var(--on-dark-soft); font: 400 13px var(--mono); cursor: pointer;
}
.file-tab.active { background: var(--surface-dark-soft); color: var(--on-dark); }
.file-tab i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.file-tab .html { background: var(--primary); }
.file-tab .css { background: var(--accent-teal); }
.file-tab .js { background: var(--accent-amber); }
.pen-stack .pen-cm { position: absolute; inset: 0; }
.pen-preview { flex: none; height: 46%; min-height: 80px; display: flex; flex-direction: column; background: var(--surface-dark); }
.preview-bar { flex: none; display: flex; align-items: center; justify-content: space-between; padding: 2px 12px 8px 16px; font-size: 13px; color: var(--on-dark-soft); }
.preview-bar .live { display: inline-flex; align-items: center; gap: 8px; }
.preview-bar .live i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-teal); display: inline-block; }
.preview-frame { flex: 1; min-height: 0; margin: 0 12px; background: #ffffff; border-radius: var(--r-md); overflow: hidden; }
.preview-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #ffffff; }
.console { flex: none; max-height: 96px; overflow: auto; margin: 8px 12px 0; padding: 8px 12px; background: var(--surface-dark-soft); border-radius: var(--r-md); font: 400 12px var(--mono); }
.console div { white-space: pre-wrap; color: var(--on-dark); padding: 1px 0; }
.console .error { color: #ef9a9a; }
.console .warn { color: var(--accent-amber); }
.console:empty { display: none; }

/* CodeMirror theme */
.CodeMirror { font-family: var(--mono); font-size: 14px; line-height: 1.6; }
.CodeMirror, .CodeMirror pre, .mono, code, pre, .case dd, .result-table, .ws-file, .timer {
  font-variant-ligatures: none;
  font-feature-settings: "liga" 0, "calt" 0;
}
.cm-s-oa.CodeMirror { background: var(--surface-dark-soft); color: var(--on-dark); }
.cm-s-oa .CodeMirror-gutters { background: var(--surface-dark-soft); border-right: 0; }
.cm-s-oa .CodeMirror-linenumber { color: #5e5b54; padding: 0 12px 0 8px; }
.cm-s-oa .CodeMirror-cursor { border-left: 2px solid var(--primary); }
.cm-s-oa .CodeMirror-selected, .cm-s-oa.CodeMirror-focused .CodeMirror-selected { background: #3a362f; }
.cm-s-oa .CodeMirror-lines { padding: 12px 0; }
.cm-s-oa .CodeMirror-matchingbracket { color: var(--on-dark) !important; background: #4a4439; }
.cm-s-oa .cm-keyword, .cm-s-oa .cm-tag { color: #e0957b; }
.cm-s-oa .cm-def, .cm-s-oa .cm-property, .cm-s-oa .cm-attribute, .cm-s-oa .cm-qualifier { color: #d9c7a3; }
.cm-s-oa .cm-string, .cm-s-oa .cm-string-2 { color: #86c9ba; }
.cm-s-oa .cm-number, .cm-s-oa .cm-atom { color: var(--accent-amber); }
.cm-s-oa .cm-comment { color: #7d7a72; font-style: italic; }
.cm-s-oa .cm-builtin, .cm-s-oa .cm-variable-2, .cm-s-oa .cm-variable-3, .cm-s-oa .cm-type { color: #9cc4e0; }
.cm-s-oa .cm-operator, .cm-s-oa .cm-bracket, .cm-s-oa .cm-meta { color: #c9c4b8; }
.cm-s-oa .cm-error { color: #ef9a9a; }

/* Results page */
.result-hero { padding: 64px 0 64px; display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: end; }
.result-hero .score { font-family: var(--serif); font-weight: 500; font-size: 96px; line-height: 1; letter-spacing: -3px; color: var(--ink); }
.result-hero .score small { font-size: 36px; letter-spacing: -0.5px; color: var(--muted-soft); }
.section-scores { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.meter { height: 6px; border-radius: 3px; background: var(--surface-cream-strong); margin-top: 14px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.result-note { font-size: 18px; margin: 16px 0 0; }
.band-soft + .footer { margin-top: 0; }
.review { margin-bottom: 32px; }
.review:last-child { margin-bottom: 0; }
.review h3 { font-family: var(--serif); font-weight: 500; font-size: 28px; letter-spacing: -0.3px; margin-bottom: 4px; }
.review-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.code-card { background: var(--surface-dark); border-radius: var(--r-lg); padding: 20px 24px; color: var(--on-dark); min-width: 0; }
.code-card .label { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--on-dark-soft); margin-bottom: 12px; }
.code-card pre { margin: 0 0 16px; font: 400 13px/1.6 var(--mono); white-space: pre; overflow-x: auto; color: var(--on-dark); }
.code-card pre:last-child { margin-bottom: 0; }
.code-card .file { font: 400 12px var(--mono); color: var(--accent-amber); margin-bottom: 6px; }
.code-card .none { color: var(--on-dark-soft); font-size: 14px; }

/* Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20, 20, 19, 0.45); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal { background: var(--canvas); border-radius: var(--r-xl); padding: 32px; width: 440px; max-width: calc(100vw - 32px); }
.modal h3 { font-family: var(--serif); font-weight: 500; font-size: 28px; letter-spacing: -0.3px; margin-bottom: 10px; }
.modal p { margin: 0 0 24px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; }

.center-note { padding: 96px 0; text-align: center; color: var(--muted); }

@media (max-width: 1023px) {
  .auth-hero, .dash-hero, .result-hero { grid-template-columns: 1fr; gap: 40px; padding-top: 40px; }
  .test-grid { grid-template-columns: repeat(2, 1fr); }
  .progress-row { grid-template-columns: repeat(3, 1fr); }
  .auth-hero { gap: 32px; }
  .auth-pitch .mock { display: none; }
  .pitch-stats { margin-bottom: 0; }
  .auth-card { max-width: 480px; }
  .progress-row .wide { grid-column: 1 / -1; }
  .feature-grid, .footer-grid { grid-template-columns: 1fr; }
  .band-dark .section-head { flex-wrap: wrap; gap: 16px; }
  .callout { flex-direction: column; align-items: flex-start; padding: 36px 32px; }
  .review-grid { grid-template-columns: 1fr; }
  .display-xl { font-size: 48px; letter-spacing: -1px; }
}
@media (max-width: 767px) {
  .container { padding: 0 20px; }
  .top-nav { padding: 0 20px; }
  .test-grid, .stat-row, .section-scores, .progress-row { grid-template-columns: 1fr; }
  .display-xl { font-size: 36px; letter-spacing: -0.5px; }
  .pitch-stats { gap: 20px; }
  .pitch-stats div + div { padding-left: 20px; }
  .pitch-stats b { font-size: 30px; }
  .auth-card { padding: 24px; }
  .result-hero .score { font-size: 72px; }
  .history th:nth-child(3), .history td:nth-child(3) { display: none; }
}

/* Undertaking */
.modal-wide { width: 560px; }
.modal-wide .caption-upper { margin-bottom: 8px; }
.rules { list-style: none; margin: 8px 0 20px; padding: 0; }
.rules li { position: relative; padding: 10px 0 10px 22px; border-top: 1px solid var(--hairline-soft); font-size: 15px; }
.rules li:first-child { border-top: 0; }
.rules li::before { content: ""; position: absolute; left: 2px; top: 19px; width: 7px; height: 7px; border-radius: 50%; background: var(--primary); }
.rules b { color: var(--ink); font-weight: 600; }
.pledge { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 24px; background: var(--surface-card); border-radius: var(--r-lg); font-size: 15px; color: var(--body-strong); cursor: pointer; }
.pledge input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--primary); flex: none; }

/* Runner overview */
.runner-body.overview { display: block; overflow-y: auto; background: var(--surface-soft); }
.runner-body.overview[hidden] { display: none; }
.ov-wrap { max-width: 1120px; margin: 0 auto; padding: 48px 32px 40px; }
.ov-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; }
.ov-head h2 { margin-top: 8px; }
.ov-head p { margin: 10px 0 0; color: var(--muted); }
.ov-clock { text-align: right; flex: none; }
.ov-clock span { display: block; font: 500 44px/1 var(--mono); color: var(--ink); letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.ov-clock small { font-size: 12px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.ov-legend { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 32px 0 16px; font-size: 14px; color: var(--muted); }
.ov-legend #ov-summary { font-weight: 500; color: var(--ink); }
.ov-legend .keys { display: inline-flex; align-items: center; gap: 8px; }
.ov-legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-left: 14px; }
.ov-legend .solved, .ov-card.solved .ov-chip::before { background: var(--success); }
.ov-legend .tried, .ov-card.tried .ov-chip::before { background: var(--accent-amber); }
.ov-legend .none, .ov-card.none .ov-chip::before { background: var(--surface-cream-strong); }
.ov-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.ov-card {
  display: flex; flex-direction: column; align-items: stretch; text-align: left; gap: 0;
  padding: 28px; background: var(--canvas); border: 1px solid var(--hairline); border-top: 4px solid var(--surface-cream-strong);
  border-radius: var(--r-lg); font: inherit; color: var(--body); cursor: pointer;
}
.ov-card:active { background: var(--surface-card); }
.ov-card.solved { border-top-color: var(--success); }
.ov-card.tried { border-top-color: var(--accent-amber); }
.ov-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.ov-num { font: 400 15px var(--mono); color: var(--muted-soft); }
.ov-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: var(--r-pill); background: var(--surface-card); font-size: 13px; font-weight: 500; color: var(--ink); }
.ov-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.ov-card.solved .ov-chip { background: rgba(93, 184, 114, 0.18); color: var(--success-ink); }
.ov-card.tried .ov-chip { background: rgba(232, 165, 90, 0.22); color: #8a5a17; }
.ov-card h3 { font-family: var(--serif); font-weight: 500; font-size: 28px; line-height: 1.2; letter-spacing: -0.3px; margin: 8px 0 24px; min-height: 68px; }
.ov-score { font-size: 14px; color: var(--muted); }
.ov-score b { font-family: var(--serif); font-weight: 500; font-size: 32px; color: var(--ink); letter-spacing: -0.4px; }
.ov-card .meter { margin-top: 10px; }
.ov-card.solved .meter i { background: var(--success); }
.ov-line { font-size: 14px; color: var(--muted); margin-top: 12px; }
.ov-open { margin-top: 24px; font-size: 14px; font-weight: 500; color: var(--primary); }
.ov-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 24px; font-size: 13px; color: var(--muted); }
.q-tab .dot.part { background: var(--accent-amber); }

.fs-gate { position: fixed; inset: 0; z-index: 40; background: rgba(20, 20, 19, 0.72); display: flex; align-items: center; justify-content: center; }
.fs-gate .btn-text { color: var(--muted); }

/* Output tabs and custom input */
.out-tabs { display: inline-flex; gap: 4px; margin-left: -8px; }
.out-tab { padding: 5px 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--on-dark-soft); font: 500 13px/1.4 var(--sans); cursor: pointer; }
.out-tab.active { background: var(--surface-dark-elevated); color: var(--on-dark); }
.custom-row { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 10px; }
.custom-row textarea {
  flex: 1; min-height: 56px; resize: vertical; padding: 10px 12px; border: 1px solid var(--surface-dark-elevated); border-radius: var(--r-md);
  background: var(--surface-dark-soft); color: var(--on-dark); font: 400 13px/1.5 var(--mono); outline: none;
}
.custom-row textarea:focus { border-color: var(--primary); }
#custom-output { margin-top: 12px; }
.pill-s { padding: 2px 8px; border-radius: var(--r-pill); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; }
.pill-s.ok { background: rgba(93, 184, 114, 0.18); color: #8fd6a0; }
.pill-s.no { background: rgba(198, 69, 69, 0.2); color: #ef9a9a; }
.pill-s.mid { background: rgba(232, 165, 90, 0.18); color: var(--accent-amber); }

/* AI review */
.ai-card { margin-top: 14px; padding: 16px 18px; border-radius: var(--r-lg); background: var(--surface-dark-elevated); border-left: 3px solid var(--primary); color: var(--on-dark); font-size: 14px; }
.ai-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; color: var(--on-dark-soft); margin-bottom: 10px; }
.ai-mark { padding: 2px 6px; border-radius: var(--r-xs); background: var(--primary); color: var(--on-primary); font-size: 10px; letter-spacing: 0.5px; }
.ai-card p { margin: 0; }
.ai-verdict { font-size: 15px; font-weight: 500; }
.ai-wait { color: var(--on-dark-soft); }
.ai-label { font-size: 12px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; color: var(--on-dark-soft); margin: 14px 0 4px; }
.ai-card ul { margin: 0; padding-left: 18px; }
.ai-card li { margin: 3px 0; }
.ai-card code { background: rgba(250, 249, 245, 0.1); color: var(--accent-amber); }
.ai-card.light { background: var(--canvas); border: 1px solid var(--hairline); border-left: 3px solid var(--primary); color: var(--body); }
.ai-card.light .ai-head, .ai-card.light .ai-label, .ai-card.light .ai-wait { color: var(--muted); }
.ai-card.light .ai-verdict { color: var(--ink); }
.ai-card.light code { background: var(--surface-card); color: var(--body-strong); }
.review .ai-card { margin-top: 16px; }

/* Leaderboard */
.board td.rank { width: 64px; }
.board .rank span { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; font: 500 13px var(--mono); color: var(--muted); }
.board .rank-1 { background: var(--primary); color: var(--on-primary) !important; }
.board .rank-2 { background: var(--surface-dark); color: var(--on-dark) !important; }
.board .rank-3 { background: var(--surface-cream-strong); color: var(--ink) !important; }
.board tr.me td { background: var(--surface-soft); }
.board .you { margin-left: 6px; padding: 2px 8px; border-radius: var(--r-pill); background: var(--primary); color: var(--on-primary); font-size: 11px; font-weight: 500; letter-spacing: 0.5px; }
.board tr.gap td { text-align: center; color: var(--muted-soft); padding: 4px; }

@media (max-width: 767px) {
  .board th:nth-child(4), .board td:nth-child(4), .board th:nth-child(5), .board td:nth-child(5), .board th:nth-child(6), .board td:nth-child(6) { display: none; }
}

/* The `font` shorthand resets ligature settings, so code surfaces switch them off last. */
.CodeMirror, .CodeMirror pre, .mono, code, pre, .code-card pre, .case dd, .result-table, .result-table th, .result-table td,
.example .mono, .schema-table .name, .schema-table .cname, .schema-table .ctype, .sql-error, .console, .timer, .ws-file, .file-tab, .mock-code, .mock-clock, .ov-clock span, .custom-row textarea, .ai-card code, .set-num, .tab-chip .count {
  font-variant-ligatures: none !important;
  font-feature-settings: "liga" 0, "calt" 0 !important;
}

/* --- review by Claude ------------------------------------------------------ */
.claude-panel { margin: 0 0 64px; padding: 40px 44px; border-radius: var(--r-lg); background: var(--surface-dark); color: var(--on-dark); }
.claude-intro { display: flex; align-items: center; justify-content: space-between; gap: 40px; }
.claude-intro .caption-upper { color: var(--primary); }
.claude-intro h2 { color: var(--on-dark); margin: 8px 0 10px; }
.claude-intro p { margin: 0; max-width: 620px; color: var(--on-dark-soft); }
.claude-intro .btn { flex: none; padding: 16px 28px; font-size: 16px; }
.claude-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 28px; }
.claude-grid .ai-card { margin-top: 0; }
@media (max-width: 1023px) {
  .claude-panel { padding: 28px 22px; }
  .claude-intro { flex-direction: column; align-items: flex-start; gap: 20px; }
  .claude-grid { grid-template-columns: 1fr; }
}
