:root {
  --bg: #09080d;
  --grid: #14121d;
  --surface: #121019;
  --surface-on: #1a1530;
  --line: #2a2638;
  --line-strong: #3a3550;
  --line-accent: #4c3a8c;
  --text: #f3f1f9;
  --muted: #a9a5ba;
  --accent: #8b5cf6;
  --accent-solid: #7c3aed;
  --accent-text: #b49cff;
  --ok: #5eead4;
  --ok-bg: #0e2a27;
  --danger: #ff9b9b;
  --danger-bg: #2a1215;
  --sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", Inter, system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
[hidden] { display: none !important; }
a { color: var(--accent-text); }
a:hover { color: #d3c4ff; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
h1, h2, p { margin: 0; }

.shell { min-height: 100%; display: flex; flex-direction: column; }
.shell.gridded { background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 48px 48px; }

.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 40px; border-bottom: 1px solid var(--line); background: var(--bg); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { display: block; }
.brand-rule { width: 1px; height: 20px; background: var(--line); }
.brand-name { font-size: 14px; color: var(--muted); }
.top-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.pill { font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ok); }
.pill.warn { color: var(--danger); }

.progress { display: flex; gap: 4px; padding: 0 40px; margin-top: 18px; min-height: 4px; }
.progress span { flex: 1 1 0; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.progress i { display: block; height: 4px; border-radius: 2px; background: var(--accent); }

.view { flex: 1 0 auto; width: 100%; max-width: 1360px; margin: 0 auto; padding: 40px; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 18px 40px; border-top: 1px solid var(--line); background: var(--bg); font-size: 12px; color: var(--muted); }
.loading, .noscript { color: var(--muted); padding: 40px; }

.eyebrow { font-family: var(--mono); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-text); }
.label-mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small-text { font-size: 13px; }

.btn { min-height: 52px; padding: 0 26px; border-radius: 10px; border: 1px solid transparent; background: var(--accent-solid); color: #fff; font-size: 16px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none; }
.btn:hover { background: #8b4cf7; color: #fff; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost { background: transparent; border-color: var(--line-strong); color: var(--text); font-weight: 500; font-size: 15px; }
.btn.ghost:hover { border-color: var(--accent); background: transparent; }
.btn.small { min-height: 44px; padding: 0 18px; font-size: 14px; }
.btn.full { width: 100%; }
.linklike { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--accent-text); text-decoration: underline; font-size: 14px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .field .legend { font-size: 13px; font-weight: 500; }
.input, .textarea { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--bg); color: var(--text); font-size: 15px; }
.textarea { padding: 12px 14px; min-height: 150px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: #8e8aa3; }
.input.mono { font-family: var(--mono); letter-spacing: 0.08em; }
.input.code { font-family: var(--mono); font-size: 28px; letter-spacing: 0.4em; text-align: center; min-height: 64px; }
.error { padding: 12px 14px; border: 1px solid #7a2b33; border-radius: 10px; background: var(--danger-bg); color: var(--danger); font-size: 14px; }

/* Welcome */
.welcome { display: flex; flex-wrap: wrap; align-items: center; gap: 72px; max-width: 1240px; margin: 0 auto; }
.hero { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.hero h1 { font-family: var(--display); font-weight: 600; font-size: clamp(38px, 5vw, 60px); line-height: 1.05; letter-spacing: -0.02em; }
.hero .lede { max-width: 520px; font-size: 18px; line-height: 1.6; color: var(--muted); }
.points { display: flex; flex-direction: column; gap: 18px; margin-top: 8px; }
.point { display: flex; align-items: flex-start; gap: 16px; }
.point .num { flex-shrink: 0; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 13px; color: var(--accent-text); }
.point strong { display: block; font-size: 16px; font-weight: 600; }
.point span { font-size: 14px; color: var(--muted); }
.card { flex: 1 1 400px; min-width: 0; max-width: 480px; padding: 28px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); display: flex; flex-direction: column; gap: 18px; }
.card h2 { font-family: var(--display); font-weight: 600; font-size: 26px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pair { display: flex; flex-wrap: wrap; gap: 12px; }
.pair .field { flex: 1 1 160px; min-width: 0; }
.toggle { min-height: 48px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg); color: var(--text); font-size: 14px; font-weight: 500; }
.toggle[aria-pressed="true"] { border-color: var(--accent); background: var(--surface-on); }
.toggle[aria-pressed="true"]::before { content: "✓ "; color: var(--accent-text); }
.botcheck { min-height: 65px; }
.narrow { max-width: 520px; margin: 40px auto 0; flex: none; }
.card-title { font-family: var(--display); font-weight: 600; font-size: 28px; line-height: 1.15; }
.card-title:focus { outline: none; }

/* Questions */
.layout { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 48px; }
.sections { flex: 1 1 240px; max-width: 280px; display: flex; flex-direction: column; gap: 2px; }
.sections .label-mono { padding: 0 12px 10px; }
.sec { width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 12px; border: 1px solid transparent; border-radius: 8px; background: none; text-align: left; color: var(--muted); font-size: 13px; }
.sec:hover { border-color: var(--line); }
.sec .dot { flex-shrink: 0; width: 22px; height: 22px; border-radius: 11px; border: 1px solid var(--line-strong); display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 10px; }
.sec .name { flex-grow: 1; }
.sec .sub { display: block; font-size: 12px; color: var(--accent-text); font-weight: 400; }
.sec.done .dot { border-color: transparent; background: var(--ok-bg); color: var(--ok); }
.sec.current { border-color: var(--line-accent); background: var(--surface-on); color: var(--text); font-weight: 600; }
.sec.current .dot { border-color: transparent; background: var(--accent-solid); color: #fff; }
.tag { font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; color: var(--accent-text); border: 1px solid var(--line-accent); border-radius: 4px; padding: 2px 6px; font-weight: 400; }

.question { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 26px; }
.question h1 { font-family: var(--display); font-weight: 600; font-size: clamp(26px, 3vw, 38px); line-height: 1.15; letter-spacing: -0.01em; }
.question h1:focus { outline: none; }
.options { display: flex; flex-direction: column; gap: 10px; }
.option { min-height: 60px; padding: 12px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); text-align: left; display: flex; align-items: center; gap: 16px; font-size: 16px; font-weight: 500; }
.option:hover { border-color: var(--line-accent); }
.option .mark { flex-shrink: 0; width: 22px; height: 22px; border-radius: 11px; border: 2px solid #6b6585; display: flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; color: transparent; }
.option.multi .mark { border-radius: 6px; }
.option[aria-pressed="true"] { border-color: var(--accent); background: var(--surface-on); }
.option[aria-pressed="true"] .mark { border-color: var(--accent-text); background: var(--accent-text); color: var(--bg); }
.nav { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.nav .right { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

.aside { flex: 1 1 260px; max-width: 320px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 14px; font-size: 14px; }
.aside .head { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-text); }
.aside hr { width: 100%; border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* Evidence */
.evidence { display: flex; flex-direction: column; gap: 12px; }
.evidence h2 { font-family: var(--display); font-weight: 600; font-size: 20px; }
.drop { padding: 20px 22px; border: 1px dashed #6b5ba8; border-radius: 14px; background: var(--surface); display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.drop.over { border-color: var(--accent-text); background: var(--surface-on); }
.drop .words { flex: 1 1 220px; min-width: 0; }
.drop .words strong { display: block; font-weight: 500; }
.drop .words span { font-size: 13px; color: var(--muted); }
.file { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: 14px; }
.file .fname { flex: 1 1 200px; min-width: 0; overflow-wrap: anywhere; font-weight: 500; }
.file .fsize { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.file .scan { font-size: 13px; font-weight: 500; color: var(--accent-text); }
.file .scan.clean { color: var(--ok); }
.file .scan.malicious { color: var(--danger); }

/* Review and done */
.stack { max-width: 1040px; margin: 0 auto; display: flex; flex-direction: column; gap: 32px; }
.stack h1 { font-family: var(--display); font-weight: 600; font-size: clamp(34px, 4.5vw, 52px); line-height: 1.08; letter-spacing: -0.02em; }
.stack .lede { max-width: 640px; font-size: 18px; line-height: 1.6; color: var(--muted); }
.rows { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.row .count { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.row .count.gap { color: var(--accent-text); }
.badge { width: 64px; height: 64px; border-radius: 32px; border: 1px solid var(--ok); background: var(--ok-bg); color: var(--ok); display: flex; align-items: center; justify-content: center; font-size: 30px; }
.steps { display: flex; flex-wrap: wrap; gap: 32px; }
.step { flex: 1 1 240px; padding-top: 16px; border-top: 2px solid var(--line-strong); display: flex; flex-direction: column; gap: 8px; }
.step:first-child { border-top-color: var(--accent); }
.step strong { font-size: 17px; font-weight: 600; }
.step span { font-size: 14px; color: var(--muted); }

@media (max-width: 900px) {
  .top, .foot { padding-left: 20px; padding-right: 20px; }
  .progress { padding: 0 20px; }
  .view { padding: 24px 20px; }
  .welcome { gap: 36px; }
  .layout { gap: 24px; }
  .sections { max-width: none; flex-basis: 100%; flex-direction: row; flex-wrap: nowrap; overflow-x: auto; }
  .sections .label-mono { display: none; }
  .sec { width: auto; flex-shrink: 0; }
  .sec:not(.current) .name, .sec:not(.current) .tag { display: none; }
  .aside { max-width: none; flex-basis: 100%; }
}
