:root {
  --bg: #07070b;
  --surface: #0e0f15;
  --surface-2: #151620;
  --border: #23242f;
  --border-strong: #343646;
  --text: #f2f3f7;
  --muted: #a0a5b5;
  --faint: #6f7486;
  --violet: #8b5cf6;
  --pink: #ec4899;
  --orange: #fb923c;
  --teal: #2dd4bf;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --gradient: linear-gradient(90deg, #8b5cf6 0%, #ec4899 60%, #fb923c 100%);
  --radius: 14px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
a.link, .prose a { color: #c4b5fd; text-decoration: underline; text-underline-offset: 3px; }
a.link:hover, .prose a:hover { color: #ddd6fe; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(28px, 4vw, 40px); }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
p { margin: 0; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.stack-lg > * + * { margin-top: 24px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
}
.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Layout */
.testbar {
  background: var(--gradient);
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
}
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(7, 7, 11, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1160px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px; background: var(--gradient);
  display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 800;
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav {
  max-width: 1160px; margin: 0 auto; padding: 0 12px;
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  border-top: 1px solid var(--border);
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 11px 12px; color: var(--muted); font-weight: 500; font-size: 14px; white-space: nowrap;
  border-bottom: 2px solid transparent;
}
.nav a:hover { color: var(--text); }
.nav a.is-active { color: var(--text); border-bottom-color: var(--violet); }
.nav .count {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px;
  background: var(--pink); color: #fff; font-size: 11px; font-weight: 700; text-align: center;
}
.nav .sep { flex: 1 1 auto; }

.container { max-width: 1160px; margin: 0 auto; padding: 28px 20px 64px; }
.narrow { max-width: 560px; margin: 0 auto; }
.page-head { margin-bottom: 24px; }
.page-head p { color: var(--muted); margin-top: 8px; max-width: 68ch; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4, .split { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 560px) and (max-width: 860px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
footer.site {
  border-top: 1px solid var(--border); color: var(--faint); font-size: 13px;
  padding: 20px; text-align: center;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  min-width: 0;
}
.card.accent { border-color: #4c3a8f; background: linear-gradient(180deg, rgba(139, 92, 246, 0.10), rgba(139, 92, 246, 0) 60%), var(--surface); }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.stat-label { color: var(--muted); font-size: 13px; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.stat-note { color: var(--faint); font-size: 13px; margin-top: 4px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: transparent; color: var(--text); font: inherit; font-weight: 600; font-size: 14px;
  cursor: pointer; white-space: nowrap; transition: background 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--surface-2); border-color: #4a4d63; }
.btn-primary { background: #fff; color: #0a0a0f; border-color: #fff; }
.btn-primary:hover { background: #e7e8ee; border-color: #e7e8ee; }
.btn-accent { background: var(--gradient); border-color: transparent; color: #fff; }
.btn-accent:hover { filter: brightness(1.08); background: var(--gradient); }
.btn-danger { color: var(--bad); border-color: #5b2b2b; }
.btn-danger:hover { background: rgba(248, 113, 113, 0.08); border-color: #7f3b3b; }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--violet); outline-offset: 2px;
}
form.inline { display: inline; }

/* Badges */
.badge {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--border-strong); color: var(--muted);
  white-space: nowrap;
}
.badge.good { color: var(--good); border-color: #1f5c47; background: rgba(52, 211, 153, 0.08); }
.badge.warn { color: var(--warn); border-color: #6b5417; background: rgba(251, 191, 36, 0.08); }
.badge.bad { color: var(--bad); border-color: #6b2b2b; background: rgba(248, 113, 113, 0.08); }
.badge.info { color: #c4b5fd; border-color: #4c3a8f; background: rgba(139, 92, 246, 0.10); }
.grade {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  font-weight: 800; font-size: 16px; border: 1px solid var(--border-strong); color: var(--muted);
}
.grade.lg { width: 64px; height: 64px; font-size: 32px; border-radius: 16px; }
.grade-S { background: var(--gradient); color: #fff; border-color: transparent; }
.grade-A { color: var(--teal); border-color: #1d6b62; background: rgba(45, 212, 191, 0.10); }
.grade-B { color: #c4b5fd; border-color: #4c3a8f; background: rgba(139, 92, 246, 0.12); }
.grade-C { color: var(--warn); border-color: #6b5417; background: rgba(251, 191, 36, 0.08); }
.grade-D { color: var(--bad); border-color: #6b2b2b; background: rgba(248, 113, 113, 0.08); }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-weight: 600; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--faint); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td .sub { display: block; color: var(--faint); font-size: 12.5px; }
.empty { color: var(--muted); text-align: center; padding: 28px 12px; }

/* Forms */
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.field + .field { margin-top: 16px; }
.help { color: var(--faint); font-size: 13px; margin-top: 5px; }
.errorlist, .field-error { color: var(--bad); font-size: 13px; margin: 5px 0 0; padding: 0; list-style: none; }
input[type="text"], input[type="email"], input[type="password"], input[type="url"],
input[type="number"], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: #0a0b10; color: var(--text); font: inherit;
}
input[type="file"] { width: 100%; color: var(--muted); font: inherit; }
input[type="file"]::file-selector-button {
  margin-right: 12px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
textarea { resize: vertical; min-height: 84px; }
select { appearance: auto; }
.choices { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; flex-wrap: wrap; }
.choices div, .choices li { margin: 0; }
.choices label {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); font-weight: 500; cursor: pointer;
}
.choices label:has(input:checked) { border-color: var(--violet); background: rgba(139, 92, 246, 0.12); }
.checkline { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.checkline input { margin-top: 4px; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1 1 auto; min-width: 0; }

/* Flash */
.flash {
  padding: 11px 14px; border-radius: 10px; border: 1px solid var(--border-strong);
  background: var(--surface-2); margin-bottom: 14px; font-weight: 500;
}
.flash-success { border-color: #1f5c47; background: rgba(52, 211, 153, 0.08); color: #a7f3d0; }
.flash-error { border-color: #6b2b2b; background: rgba(248, 113, 113, 0.08); color: #fecaca; }
.flash-info, .flash-warning { border-color: #4c3a8f; background: rgba(139, 92, 246, 0.10); color: #ddd6fe; }

/* Progress */
.bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 999px; background: var(--gradient); }
.bar.thin { height: 6px; }
.dots { display: flex; gap: 6px; }
.dot { width: 26px; height: 8px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-strong); }
.dot.on { background: var(--gradient); border-color: transparent; }
.dot.wait { background: #4c3a8f; border-color: transparent; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; padding-bottom: 0; }
.list li:first-child { padding-top: 0; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { padding-left: 24px; position: relative; margin-top: 8px; color: var(--muted); }
.checks li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 700; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.copybox {
  display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: #0a0b10;
}
.copybox code { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--mono); font-size: 13px; }

/* Landing */
.hero { text-align: center; padding: 56px 0 40px; }
.hero h1 { font-size: clamp(40px, 8vw, 84px); letter-spacing: -0.04em; line-height: 1; margin-top: 18px; }
.hero p.lead { color: var(--muted); font-size: clamp(16px, 2.2vw, 19px); max-width: 60ch; margin: 22px auto 0; }
.hero .row { justify-content: center; margin-top: 28px; }
.section { padding: 36px 0; }
.section > h2 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 8px; }
.section > p { color: var(--muted); max-width: 68ch; margin-bottom: 22px; }
.step-num {
  width: 30px; height: 30px; border-radius: 9px; background: rgba(139, 92, 246, 0.14); color: #c4b5fd;
  display: grid; place-items: center; font-weight: 700; font-family: var(--mono); margin-bottom: 12px;
}
.price { font-size: 38px; font-weight: 800; letter-spacing: -0.03em; }
.price small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan { display: flex; flex-direction: column; }
.plan .checks { margin: 16px 0 20px; flex: 1 1 auto; }
.fine { color: var(--faint); font-size: 12.5px; max-width: 80ch; margin: 28px auto 0; text-align: center; }

/* Video */
video.player { width: 100%; max-height: 520px; background: #000; border-radius: 12px; border: 1px solid var(--border); }
.score-row { display: grid; grid-template-columns: minmax(0, 1fr) 130px 54px; gap: 12px; align-items: center; padding: 8px 0; }
.score-row .bar { height: 6px; }
@media (max-width: 560px) { .score-row { grid-template-columns: minmax(0, 1fr) 70px 46px; } }
.rubric-field { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 14px; align-items: start; padding: 12px 0; border-bottom: 1px solid var(--border); }
.rubric-field:last-child { border-bottom: 0; }
.rubric-field label { margin-bottom: 2px; }
@media (max-width: 640px) { .rubric-field { grid-template-columns: minmax(0, 1fr); } }
.sticky { position: sticky; top: 118px; }

/* Radio groups rendered by Django */
.choices-wrap > div { display: flex; gap: 10px; flex-wrap: wrap; }
.choices-wrap > div > div { margin: 0; }
.choices-wrap label {
  display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); font-weight: 500; cursor: pointer;
}
.choices-wrap label:has(input:checked) { border-color: var(--violet); background: rgba(139, 92, 246, 0.12); }
a.card { display: block; transition: border-color 0.15s; }
a.card:hover { border-color: #4a4d63; }
