:root {
  --bg: #0b0d10;
  --bg-raised: #14171b;
  --bg-card: #171b20;
  --border: #262b32;
  --text: #f2f4f6;
  --text-muted: #9aa3ad;
  --text-faint: #6b7480;
  --accent: #3b9dff;
  --accent-dim: #1f4d7a;
  --risk: #ff5c5c;
  --risk-dim: #4a1f1f;
  --answered: #35c98f;
  --partial: #e0b84a;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 96px;
  min-height: 100vh;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  font-size: 13px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand-row .logo { color: var(--text); font-weight: 600; letter-spacing: 0; text-transform: none; }

.screen { animation: fadein 0.25s ease; }
@media (prefers-reduced-motion: reduce) { .screen { animation: none; } }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.15; margin: 0 0 12px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 24px; margin: 0 0 10px; font-weight: 650; }
h3 { font-size: 17px; margin: 0 0 8px; font-weight: 600; }
p { color: var(--text-muted); margin: 0 0 16px; }
.subhead { font-size: 17px; color: var(--text-muted); margin-bottom: 24px; max-width: 60ch; }

.microcopy { font-size: 13px; color: var(--text-faint); }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 16px;
}

.two-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
@media (max-width: 520px) { .two-tabs { grid-template-columns: 1fr; } }
.tab-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; background: var(--bg-raised); }
.tab-card .tab-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: 6px; }
.tab-card.tab-b { border-color: var(--accent-dim); }
.tab-line { font-size: 14px; color: var(--text-muted); margin: 0 0 4px; }
.callout-line { text-align: center; font-size: 15px; color: var(--text); font-style: italic; margin: 18px 0; }

.for-not-for { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
@media (max-width: 520px) { .for-not-for { grid-template-columns: 1fr; } }
.for-not-for .card h3 { color: var(--accent); }
.for-not-for .card.not h3 { color: var(--text-muted); }
.for-not-for ul { margin: 0; padding-left: 18px; color: var(--text-muted); font-size: 14px; }

button {
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
}

.btn-primary {
  background: var(--accent);
  color: #051221;
  border: none;
  border-radius: 999px;
  padding: 14px 28px;
  font-weight: 650;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary:hover { box-shadow: 0 0 0 4px var(--accent-dim); }
.btn-primary:focus-visible, button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

.btn-secondary {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 12px 22px;
  font-weight: 600;
}
.btn-secondary:hover { border-color: var(--accent-dim); color: var(--text); }

.btn-text {
  background: none;
  border: none;
  color: var(--text-faint);
  text-decoration: underline;
  padding: 6px 0;
}

.btn-row { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }
.btn-row.split { justify-content: space-between; }

label { display: block; font-size: 13px; color: var(--text-muted); margin: 14px 0 6px; }
input[type="text"], textarea, select {
  width: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 11px 12px;
  font-family: inherit;
  font-size: 15px;
  resize: vertical;
}
textarea { min-height: 70px; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }

.progress-track { display: flex; align-items: center; gap: 8px; margin-bottom: 22px; }
.progress-label { font-size: 13px; color: var(--text-faint); white-space: nowrap; }
.progress-bar { flex: 1; height: 4px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); transition: width 0.3s ease; }
@media (prefers-reduced-motion: reduce) { .progress-fill { transition: none; } }

.question-why { font-size: 14px; color: var(--text-muted); border-left: 2px solid var(--accent-dim); padding-left: 12px; margin-bottom: 20px; }

.score-choices { display: grid; gap: 10px; margin-bottom: 18px; }
.score-choice {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--text);
}
.score-choice .sc-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.score-choice .sc-num { font-size: 22px; font-weight: 700; color: var(--text-faint); }
.score-choice .sc-label { font-weight: 650; font-size: 15px; }
.score-choice .sc-text { font-size: 13px; color: var(--text-muted); }
.score-choice[aria-pressed="true"] { border-color: var(--accent); background: rgba(59,157,255,0.08); }
.score-choice[aria-pressed="true"] .sc-num, .score-choice[aria-pressed="true"] .sc-label { color: var(--accent); }
.score-choice[data-score="0"][aria-pressed="true"] { border-color: var(--risk); background: rgba(255,92,92,0.08); }
.score-choice[data-score="0"][aria-pressed="true"] .sc-num, .score-choice[data-score="0"][aria-pressed="true"] .sc-label { color: var(--risk); }

.buyer-lens { font-size: 13px; color: var(--accent); background: rgba(59,157,255,0.08); border-radius: 8px; padding: 10px 12px; margin-bottom: 14px; }

.timer-display { font-size: 48px; font-weight: 700; text-align: center; margin: 10px 0; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.timer-controls { display: flex; gap: 10px; justify-content: center; margin-bottom: 8px; }

/* Results */
.score-total { font-size: 56px; font-weight: 800; text-align: center; margin: 8px 0 2px; }
.score-total span { font-size: 22px; color: var(--text-faint); font-weight: 500; }
.band-label { text-align: center; font-size: 16px; font-weight: 650; color: var(--accent); margin-bottom: 4px; }
.band-text { text-align: center; font-size: 14px; color: var(--text-muted); max-width: 48ch; margin: 0 auto 24px; }

.q-overview { display: grid; gap: 8px; margin-bottom: 24px; }
.q-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 10px; background: var(--bg-raised); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.q-row .q-num-chip { width: 26px; height: 26px; border-radius: 50%; background: var(--bg-card); display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--text-faint); }
.q-row .q-text { font-size: 13px; color: var(--text-muted); }
.chip { font-size: 12px; font-weight: 650; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.chip.state-0 { background: var(--risk-dim); color: var(--risk); }
.chip.state-1 { background: rgba(224,184,74,0.15); color: var(--partial); }
.chip.state-2 { background: rgba(53,201,143,0.15); color: var(--answered); }

.weakest-panel { border: 1px solid var(--accent-dim); border-radius: var(--radius); padding: 18px; margin-bottom: 20px; background: rgba(59,157,255,0.04); }
.weakest-item { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 14px; }
.weakest-item:first-of-type { border-top: none; margin-top: 8px; padding-top: 0; }
.weakest-rank { display: inline-block; font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.evidence-quote { font-size: 13px; color: var(--text-muted); font-style: italic; background: var(--bg-raised); border-radius: 8px; padding: 8px 10px; margin: 6px 0; border-left: 2px solid var(--border); }
.content-move { font-size: 13px; color: var(--text); background: rgba(59,157,255,0.06); border-radius: 8px; padding: 8px 10px; margin-top: 6px; }

.honest-limit { font-size: 13px; color: var(--text-faint); border-top: 1px solid var(--border); padding-top: 16px; margin-top: 8px; }

.workspace-preview { background: var(--bg-raised); border: 1px dashed var(--border); border-radius: 8px; padding: 12px; font-size: 14px; margin: 12px 0; min-height: 20px; }
.checklist-row { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.checklist-row input[type="checkbox"] { width: 18px; height: 18px; }

.warning-box { font-size: 13px; color: var(--risk); background: var(--risk-dim); border-radius: 8px; padding: 10px 12px; margin: 10px 0; }

.copy-feedback { font-size: 13px; color: var(--answered); margin-left: 10px; opacity: 0; transition: opacity 0.2s; }
.copy-feedback.show { opacity: 1; }

.resume-banner { background: var(--bg-raised); border: 1px solid var(--accent-dim); border-radius: var(--radius); padding: 16px; margin-bottom: 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }

.footer-nav { text-align: center; margin-top: 40px; font-size: 12px; color: var(--text-faint); }

.go-deeper { border-top: 1px solid var(--border); margin-top: 32px; padding-top: 20px; }
.go-deeper h3 { color: var(--text-faint); font-size: 13px; text-transform: uppercase; letter-spacing: 0.05em; }
.resource-link { display: inline-block; color: var(--accent); text-decoration: none; border: 1px solid var(--accent-dim); border-radius: 999px; padding: 10px 18px; margin: 4px 8px 4px 0; font-size: 14px; }
.resource-link:hover { background: rgba(59,157,255,0.08); }

.recheck-table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13px; }
.recheck-table th, .recheck-table td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.recheck-table th { color: var(--text-faint); font-weight: 600; }

sr-only, .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* Print */
@media print {
  body { background: #fff; color: #111; }
  .no-print { display: none !important; }
  #app { max-width: 100%; padding: 0; }
  .card, .weakest-panel { border: 1px solid #ccc; background: #fff; break-inside: avoid; }
  a.resource-link { color: #111; border-color: #999; }
  .chip.state-0 { background: #fde; color: #900; }
  .chip.state-1 { background: #ffe; color: #960; }
  .chip.state-2 { background: #efe; color: #090; }
}
