/* Current skin, from the Current FX design system (v0.2 draft, not yet approved by Current):
   white ground, ink, one blue. Instrument Serif for large headings only (one weight, never
   bolded), Instrument Sans for words, JetBrains Mono for figures and small labels. */

:root {
  --serif: "Instrument Serif", Georgia, serif;
  --sans: "Instrument Sans", Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --bg: #ffffff;
  --surface: #ffffff;
  --mist: #f5f7fa;
  --ink: #0b0f17;
  --muted: #4a5363;
  --line: #e5e8ee;
  --line-strong: #cfd5df;
  --blue: #2340d9;
  --blue-ink: #ffffff;
  --tint: #eef1fe;
  --err: #b42318;
  --err-soft: #fef3f2;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f17; --surface: #111723; --mist: #151c2a; --ink: #e9edf4; --muted: #9aa4b5;
    --line: #232c3c; --line-strong: #344055; --blue: #8196ff; --blue-ink: #0b0f17; --tint: #18214a;
    --err: #fda29b; --err-soft: #3a1d1b;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0f17; --surface: #111723; --mist: #151c2a; --ink: #e9edf4; --muted: #9aa4b5;
  --line: #232c3c; --line-strong: #344055; --blue: #8196ff; --blue-ink: #0b0f17; --tint: #18214a;
  --err: #fda29b; --err-soft: #3a1d1b;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 700px; margin: 0 auto; padding: 72px 20px 120px; }
.wrap.wide { max-width: 1100px; }
p { margin: 0 0 16px; }
.muted { color: var(--muted); }
h2 { font-family: var(--serif); font-weight: 400; font-size: 2.1rem; line-height: 1.15; margin: 0 0 14px; letter-spacing: -0.005em; }
h3 { font: 600 0.75rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--blue); margin: 44px 0 10px; }
h1 { font-family: var(--serif); font-weight: 400; font-size: 2.25rem; line-height: 1.1; margin: 0 0 20px; }

/* Masthead */
.masthead { margin-bottom: 40px; }
.masthead h1 { margin: 0; }
.eyebrow { font: 500 0.72rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin: 0 0 18px; }
.kicker { display: block; font: 600 0.95rem/1.4 var(--sans); color: var(--blue); margin-bottom: 6px; }
.name { display: block; font-family: var(--serif); font-size: 2.4rem; line-height: 1.05; }
.hero { padding-bottom: 40px; border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.hero .name { font-size: clamp(3rem, 11vw, 4.5rem); letter-spacing: -0.01em; }

/* Start page */
.facts { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0 0 36px; }
.facts li { font: 500 0.8rem/1 var(--mono); padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.facts li:nth-child(2) { color: var(--blue); border-color: var(--blue); }
.lead p { font-size: 1.05rem; line-height: 1.7; margin-bottom: 20px; }
.callout { background: var(--tint); border-radius: var(--radius); padding: 18px 20px; margin: 36px 0; }
.callout strong { color: var(--blue); }
.outline, .notes { margin-top: 48px; }
.outline h2, .notes h2 { font: 600 0.75rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 16px; }
.outline ol { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; padding: 0; margin: 0; }
.outline li { counter-increment: s; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; font-weight: 500; }
.outline li::before { content: counter(s, decimal-leading-zero); display: block; font: 500 0.75rem/1.4 var(--mono); color: var(--blue); margin-bottom: 2px; }
.notes p { color: var(--muted); font-size: 0.95rem; line-height: 1.65; padding-left: 16px; border-left: 2px solid var(--line); margin-bottom: 18px; }
.actions.start { justify-content: flex-start; margin-top: 48px; }

/* Progress */
.progress { display: flex; gap: 8px; margin: 0 0 44px; padding: 0; list-style: none; }
.progress li { flex: 1; min-width: 0; }
.progress button {
  width: 100%; border: 0; background: none; padding: 0; text-align: left;
  font: 500 0.72rem/1.4 var(--mono); color: var(--muted); cursor: pointer;
}
.progress button::before { content: ""; display: block; height: 3px; border-radius: 2px; background: var(--line); margin-bottom: 8px; }
.progress .done button::before, .progress .current button::before { background: var(--blue); }
.progress .current button { color: var(--ink); }
.progress button:disabled { cursor: not-allowed; opacity: 0.5; }
.progress .label { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 520px) { .progress .label { display: none; } }

/* Step */
.card { background: transparent; padding: 0; }
.step-count { font: 500 0.72rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--blue); margin: 0 0 10px; }
.step-intro { background: var(--mist); border-radius: var(--radius); padding: 16px 18px; margin: 16px 0 12px; color: var(--muted); line-height: 1.65; }

/* Questions */
.q { padding: 36px 0; border-top: 1px solid var(--line); }
.q:first-of-type, .q.heading-q { border-top: 0; }
.q[hidden] { display: none; }
.q-label, .q legend { font-weight: 600; font-size: 1.05rem; line-height: 1.5; display: block; padding: 0; margin-bottom: 8px; }
.qn { font: 500 0.75rem/1 var(--mono); color: var(--blue); margin-right: 8px; vertical-align: 1px; }
.opt-tag { color: var(--muted); font-weight: 400; font-size: 0.9rem; }
.hint { color: var(--muted); font-size: 0.92rem; margin: 0 0 14px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }

input[type="text"], input[type="password"], textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 13px 15px; margin-top: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"]:focus, input[type="password"]:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--tint); outline: none; }
textarea { min-height: 104px; resize: vertical; }
button:focus-visible, .choice input:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.code-input { max-width: 11em; font: 500 1.25rem/1.2 var(--mono); letter-spacing: 0.25em; text-transform: uppercase; }

.choices { display: grid; gap: 10px; margin-top: 12px; }
.choices.inline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
  transition: border-color 0.15s, background 0.15s;
}
.choice:hover { border-color: var(--line-strong); background: var(--mist); }
.choice:has(input:checked) { border-color: var(--blue); background: var(--tint); }
.choice input { margin: 5px 0 0; accent-color: var(--blue); flex: none; }
.choices.inline .choice { justify-content: center; align-items: center; }
.choices.inline .choice input { margin: 0; }
.other-input { margin-top: 12px; }
.other-input[hidden] { display: none; }

/* Sliders */
.slider { margin-top: 14px; }
.slider-item + .slider-item { margin-top: 32px; }
.slider-item > p { margin: 0 0 4px; }
.slider-row { display: flex; align-items: center; gap: 14px; }
.slider input[type="range"] { flex: 1; accent-color: var(--blue); height: 28px; margin: 0; }
.slider output { min-width: 4.5em; text-align: right; font: 500 1.1rem/1 var(--mono); color: var(--blue); }
.slider.unset output { color: var(--muted); font: 400 0.8rem/1 var(--mono); }
.slider.unset input[type="range"] { opacity: 0.4; }
.ticks { display: flex; justify-content: space-between; font: 400 0.7rem/1 var(--mono); color: var(--muted); padding: 2px 4px 0; margin-right: calc(4.5em + 14px); }
.ends { display: flex; justify-content: space-between; gap: 12px; font-size: 0.82rem; color: var(--muted); margin: 6px calc(4.5em + 14px) 0 0; }
.ends span:last-child { text-align: right; }

.err { color: var(--err); font-size: 0.9rem; margin: 8px 0 0; }
.err:empty { display: none; }
.q.has-err { background: var(--err-soft); margin: 0 -16px; padding: 36px 16px; border-radius: var(--radius); }

/* Buttons */
.actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.actions.start { border-top: 0; padding-top: 0; }
button.btn {
  font: 600 0.98rem/1 var(--sans); border-radius: 8px; padding: 13px 22px; cursor: pointer;
  border: 1px solid var(--blue); background: var(--blue); color: var(--blue-ink);
  transition: filter 0.15s;
}
button.btn:hover { filter: brightness(1.08); }
button.btn.big { padding: 16px 28px; font-size: 1.05rem; }
button.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
button.btn.secondary.danger { color: var(--err); border-color: var(--err); }
button.btn:disabled { opacity: 0.6; cursor: progress; }
.banner { padding: 12px 14px; border-radius: 8px; background: var(--err-soft); color: var(--err); margin-top: 16px; }

/* Done */
.done { padding: 40px 0; }
.tick { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--tint); color: var(--blue); font-size: 1.4rem; margin-bottom: 16px; }

/* Admin */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 8px 0 0; font: 400 0.82rem/1.5 var(--mono); color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font: 500 0.72rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); white-space: nowrap; }
td:first-child { font-family: var(--mono); font-size: 0.82rem; }
tr:last-child td { border-bottom: 0; }
td button { font: inherit; font-size: 0.85rem; background: none; border: 0; color: var(--err); cursor: pointer; padding: 0; }
form.card .q-label + input { margin-bottom: 4px; }

/* Light / dark switch */
.theme-toggle {
  position: absolute; top: 18px; right: 20px; z-index: 2;
  font: 500 0.75rem/1 var(--mono); color: var(--muted); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; cursor: pointer;
}
.theme-toggle:hover { color: var(--ink); border-color: var(--line-strong); }
@media (max-width: 520px) { .wrap { padding-top: 64px; } .q { padding: 30px 0; } }
