:root {
  --bg: #0f1220;
  --panel: #171a2e;
  --panel-2: #1f2440;
  --ink: #e9ecf8;
  --muted: #9aa3c7;
  --line: #2a3056;
  --accent: #7c9cff;
  --accent-2: #5be3c0;
  --warn: #ffb86b;
  --bad: #ff6b8a;
  --good: #5be3c0;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", system-ui, sans-serif;
  background:
    radial-gradient(1200px 600px at 10% -10%, #1a2050 0%, transparent 60%),
    radial-gradient(900px 500px at 110% 10%, #2a1a4b 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.5;
}

.shell { max-width: 1100px; margin: 0 auto; padding: 28px 24px 80px; }

header.hero {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: end; justify-content: space-between;
  padding: 22px 24px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(124,156,255,.12), rgba(91,227,192,.08));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
header.hero .title { display: flex; flex-direction: column; gap: 4px; }
header.hero h1 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
header.hero .sub { color: var(--muted); font-size: 13px; }
header.hero .role-badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: rgba(124,156,255,.18); color: var(--accent); font-size: 12px; font-weight: 600;
  border: 1px solid rgba(124,156,255,.35);
}

.candidate {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px;
}
.candidate input {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,.05); color: var(--ink);
  border: 1px solid var(--line); font: inherit;
}
.candidate input:focus { outline: 2px solid var(--accent); }

nav.tabs {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 22px 0 14px;
  padding: 6px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px;
}
nav.tabs button {
  background: transparent; color: var(--muted); border: 1px solid transparent;
  padding: 8px 12px; border-radius: 8px; cursor: pointer; font: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
nav.tabs button .pill {
  font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: rgba(255,255,255,.07); color: var(--muted);
}
nav.tabs button.active {
  background: var(--panel-2); color: var(--ink); border-color: var(--line);
}
nav.tabs button.active .pill { background: rgba(124,156,255,.2); color: var(--accent); }

.topic-head {
  display: flex; align-items: center; gap: 12px; margin: 6px 4px 14px;
}
.topic-head h2 { margin: 0; font-size: 18px; }
.topic-head .topic-meta { color: var(--muted); font-size: 13px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 14px; margin-bottom: 14px; box-shadow: var(--shadow);
}

.q-header {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin-bottom: 8px;
}
.q-num {
  font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase;
}
.q-text { font-size: 16px; font-weight: 600; margin: 4px 0 10px; }

/* Live-exercise tag + code snippet */
.q-tag {
  flex: none; font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--accent);
  background: rgba(124,156,255,.18); border: 1px solid var(--line);
  padding: 3px 8px; border-radius: 999px;
}
.q-snippet-wrap { margin: 0 0 12px; }
.q-snippet-label {
  font-size: 11px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent); opacity: .9; margin-bottom: 6px;
}
.q-snippet {
  margin: 0; padding: 12px 14px; border-radius: 10px;
  background: rgba(0,0,0,.25); border: 1px solid var(--line);
  overflow-x: auto; white-space: pre; tab-size: 4;
  font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.55; color: var(--ink);
}
.q-snippet code { font: inherit; background: none; padding: 0; color: inherit; }

details.reveal { margin-top: 6px; }
details.reveal summary {
  cursor: pointer; user-select: none; color: var(--accent);
  font-size: 13px; padding: 6px 0;
}
details.reveal summary::-webkit-details-marker { display: none; }
details.reveal summary::before { content: "▸ "; display: inline-block; transition: transform .2s; }
details.reveal[open] summary::before { transform: rotate(90deg); }
details.reveal .reveal-body {
  padding: 10px 12px; background: var(--panel-2); border-radius: 10px;
  border: 1px dashed var(--line); margin-top: 6px; font-size: 14px; color: var(--ink);
}
details.reveal .reveal-body ul { margin: 6px 0 0; padding-left: 18px; }
details.reveal .reveal-body li { margin-bottom: 4px; }
details.reveal .reveal-body .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }

.kb-link {
  display: inline-block; text-decoration: none;
  margin-left: 6px; opacity: .55; font-size: 13px;
  transition: opacity .15s ease, transform .15s ease;
}
.kb-link:hover { opacity: 1; transform: translateY(-1px); }
.kb-link-block {
  display: inline-block; margin: 10px 0 0;
  padding: 6px 10px; border-radius: 8px;
  background: rgba(124,156,255,.10); border: 1px solid rgba(124,156,255,.25);
  color: var(--accent); font-size: 12px; opacity: .9;
}
.kb-link-block:hover { background: rgba(124,156,255,.18); opacity: 1; transform: none; }

.rubric {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 12px 0 8px;
}
@media (max-width: 640px) {
  .rubric { grid-template-columns: repeat(2, 1fr); }
}
.rubric label {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 10px; border: 1px solid var(--line); padding: 10px 6px;
  cursor: pointer; transition: all .15s ease;
  background: rgba(255,255,255,.02); text-align: center;
}
.rubric label .lvl { font-size: 11px; color: var(--muted); }
.rubric label .name { font-weight: 600; font-size: 12px; margin-top: 2px; line-height: 1.2; }
.rubric label input { position: absolute; opacity: 0; pointer-events: none; }
.rubric label.no-signal.checked { border-color: var(--bad);   background: rgba(255,107,138,.14); }
.rubric label.below.checked     { border-color: #ff8e7a;      background: rgba(255,142,122,.10); }
.rubric label.meets.checked     { border-color: var(--warn);  background: rgba(255,184,107,.10); }
.rubric label.strong.checked    { border-color: #b8e08a;      background: rgba(184,224,138,.10); }
.rubric label.exceeds.checked   { border-color: var(--good);  background: rgba(91,227,192,.14); }
.rubric label.checked .name { color: var(--ink); }
.rubric label:hover { border-color: var(--accent); }

textarea.notes {
  width: 100%; min-height: 60px; resize: vertical;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255,255,255,.04); color: var(--ink);
  border: 1px solid var(--line); font: inherit;
}
textarea.notes:focus { outline: 2px solid var(--accent); }

.actions {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
}
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); color: var(--ink); border: 1px solid var(--line);
  padding: 9px 14px; border-radius: 10px; cursor: pointer; font: inherit; font-size: 13px;
  text-decoration: none; line-height: 1; white-space: nowrap;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
a.btn { color: var(--ink); }
.btn.primary { background: var(--accent); color: #0b1024; border-color: transparent; font-weight: 600; }
a.btn.primary { color: #0b1024; }
.btn.danger  { color: var(--bad); border-color: rgba(255,107,138,.4); background: transparent; }
.btn:hover { transform: translateY(-1px); }
.btn.primary:hover { background: #92aeff; }

/* Report */
.report-grid {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 18px; align-items: stretch;
}
@media (max-width: 900px) { .report-grid { grid-template-columns: 1fr; } }

.radar-wrap {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 16px 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; justify-content: center;
}
.radar-wrap svg {
  width: 100%; height: auto; display: block;
  max-width: 520px; margin: 0 auto;
  overflow: visible;
}
.radar-wrap .legend {
  display: flex; gap: 14px; margin-top: 10px; color: var(--muted); font-size: 12px;
  justify-content: center; flex-wrap: wrap;
}
.radar-wrap .legend .dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; margin-right: 6px; vertical-align: middle; }

.topic-bars {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.topic-bars-title {
  font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase;
  margin: 0 0 12px;
}
.topic-bars .bars { display: flex; flex-direction: column; justify-content: space-between; flex: 1; gap: 4px; }
.bar-row {
  display: grid; grid-template-columns: minmax(120px, 160px) 1fr 56px;
  gap: 12px; align-items: center; padding: 6px 0;
}
.bar-row .label { font-size: 13px; color: var(--ink); }
.bar-row .label .sub { color: var(--muted); font-size: 11px; }
.bar-row .track { background: rgba(255,255,255,.07); border-radius: 999px; height: 12px; overflow: hidden; }
.bar-row .fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .3s ease; }
.bar-row .val  { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--ink); font-weight: 600; }

.summary {
  margin-top: 18px; padding: 18px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(91,227,192,.10), rgba(124,156,255,.08));
  border: 1px solid var(--line);
}
.summary h3 { margin: 0 0 6px; }
.summary .verdict { font-size: 22px; font-weight: 700; }
.summary .verdict.strong-hire { color: var(--good); }
.summary .verdict.hire { color: var(--accent-2); }
.summary .verdict.lean-no { color: var(--warn); }
.summary .verdict.no-hire { color: var(--bad); }
.summary .verdict.incomplete { color: var(--muted); }
.summary .meta { color: var(--muted); font-size: 13px; margin-top: 6px; }

.note-list { margin-top: 12px; }
.note-list .note-item {
  border-left: 3px solid var(--accent); padding: 8px 12px; margin-bottom: 8px;
  background: rgba(124,156,255,.06); border-radius: 0 8px 8px 0;
}
.note-list .note-item .who { font-size: 12px; color: var(--muted); margin-bottom: 2px; }

footer.foot {
  margin-top: 30px; color: var(--muted); font-size: 12px; text-align: center;
}

@media print {
  body { background: white; color: #111; }
  nav.tabs, .actions, header.hero .role-badge { display: none !important; }
  .card, .radar-wrap, .topic-bars, .summary { box-shadow: none; border-color: #ddd; background: white; color: #111; }
  .topic-pane { display: block !important; page-break-inside: avoid; }
  details.reveal { display: none; }
}
