:root {
  --bg: #0b0e14;
  --panel: #11151f;
  --panel-2: #161b28;
  --line: #242b3d;
  --text: #e7eaf2;
  --text-dim: #9aa3b8;
  --text-faint: #8b94a8;
  --accent: #5a8dee;
  --accent-soft: #1c2740;
  --ok: #3fb97c;
  --ok-soft: #10281d;
  --warn: #d79a3a;
  --warn-soft: #2c2210;
  --bad: #de5c5c;
  --bad-soft: #2d1414;
  --radius: 10px;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
  font-family: -apple-system, "Segoe UI", Inter, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent); }

header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #0d111a, #0b0e14);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(6px);
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brandmark {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: linear-gradient(135deg, #3a6cc9, #6a3ec9);
  color: #fff;
  font-size: 13px;
}

.brandlight { color: var(--text-dim); font-weight: 500; }

.header-meta {
  color: var(--text-dim);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: auto;
}

.sep { color: var(--text-faint); }

.live-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok);
}

header a { font-size: 13px; text-decoration: none; }
header a:hover { text-decoration: underline; }

main {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

.intro { margin-bottom: 22px; }

h1 {
  font-size: 28px;
  line-height: 1.25;
  margin: 0 0 10px;
  font-weight: 700;
  color: #fff;
}

.stepper {
  display: flex;
  gap: 0;
  margin: 0 0 26px;
  font-size: 12.5px;
  color: var(--text-faint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.stepper::-webkit-scrollbar { display: none; }
.stepper span {
  padding: 6px 14px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.stepper span.current { background: var(--accent-soft); color: #a9c0f5; font-weight: 600; }
.stepper span.done { color: var(--ok); }

h2 { font-size: 20px; margin: 0 0 10px; }

.lede { color: var(--text-dim); max-width: 70ch; line-height: 1.55; }

code {
  font-family: "JetBrains Mono", ui-monospace, Consolas, monospace;
  font-size: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
}

.workbench {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 18px;
}

.stage-panel, .evidence-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.options {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.option {
  text-align: left;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 15px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}

.option:hover { border-color: var(--accent); transform: translateY(-1px); }

.button {
  background: linear-gradient(135deg, var(--accent), #4a6fd0);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 14px;
}

.button:hover { filter: brightness(1.08); }

.button.secondary {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
}

.answer-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.answer-row input {
  flex: 1;
  min-width: 160px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  padding: 10px 12px;
  font-size: 15px;
}

.answer-row input:focus, .option:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.hint-box {
  margin-top: 12px;
  background: var(--warn-soft);
  border: 1px solid #4a3a16;
  color: #f0cf8e;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
}

.remediation {
  background: var(--accent-soft);
  border: 1px solid #2c3f6b;
  border-radius: 8px;
  padding: 12px 14px;
  line-height: 1.5;
}

.note {
  color: var(--text-dim);
  font-size: 13.5px;
  line-height: 1.5;
  margin-top: 10px;
}

.note.flash {
  color: var(--warn);
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.status-row span:first-child {
  color: var(--text-dim);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
}

.badge-mastered { background: var(--ok-soft); border-color: #214a34; color: #8fe3b6; }
.badge-verified_independent { background: var(--accent-soft); border-color: #2c3f6b; color: #a9c0f5; }
.badge-regressed { background: var(--bad-soft); border-color: #4a2323; color: #f0a0a0; }
.badge-practicing, .badge-diagnosed { background: var(--warn-soft); border-color: #4a3a16; color: #f0cf8e; }

.due-note {
  font-size: 12.5px;
  color: var(--text-faint);
  margin-bottom: 16px;
}

.evidence-panel h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 0 0 10px;
}

#trace-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
}

#trace-list li {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 12.5px;
  line-height: 1.6;
}

#trace-list li code {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  background: transparent;
  border: none;
  padding: 0;
  color: var(--text-dim);
}

#trace-list .arrow { color: var(--accent); margin: 0 4px; }
#trace-list small { display: block; color: var(--text-faint); margin-top: 2px; }
#trace-list .empty { color: var(--text-faint); background: transparent; border-style: dashed; }

.disclaimer {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-faint);
  line-height: 1.5;
}

footer {
  text-align: center;
  color: var(--text-faint);
  font-size: 12.5px;
  padding: 24px;
  border-top: 1px solid var(--line);
}

@media (max-width: 820px) {
  .workbench { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
  * { transition: none !important; }
}
