/* Current skin. Follows the Current design system, Product theme: paper ground, ink, one
   Current Blue. Every page links tokens.css (generated from projects/design-system, do not
   edit it) before this file; colours, radii, sizes and font families come from there, and its
   dark values apply automatically. Source Sans 3 for words and titles (no serif in product
   screens), JetBrains Mono for figures and small labels.
   The names below are short aliases for the shared tokens, kept because this file and
   workshop.css use them throughout. */

:root {
  --sans: var(--font-sans);
  --mono: var(--font-mono);

  --bg: var(--paper);
  --surface: var(--paper);
  --muted: var(--slate);
  --line-strong: var(--line-control);
  --blue: var(--current-blue);
  --blue-ink: var(--on-current-blue);
  --tint: var(--blue-tint);
  --err: var(--loss);
  --err-soft: var(--loss-tint);
  --radius: var(--radius-md);
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink-body);
  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); }
h1, h2 { color: var(--ink); }
h2 { font: 600 1.5rem/1.25 var(--sans); margin: 0 0 14px; letter-spacing: -0.01em; }
h3 { font: 500 0.75rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--blue); margin: 44px 0 10px; }
h1 { font: 600 2rem/1.2 var(--sans); margin: 0 0 20px; letter-spacing: -0.01em; }

/* 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: 600 2rem/1.15 var(--sans); letter-spacing: -0.01em; }
.hero { padding-bottom: 40px; border-bottom: 1px solid var(--line); margin-bottom: 40px; }
.hero .name { font-size: clamp(2.25rem, 8vw, 3rem); letter-spacing: -0.015em; }

/* 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: var(--radius-pill); 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-lg); padding: 18px 20px; margin: 36px 0; }
.callout strong { color: var(--blue); }
.outline, .notes { margin-top: 48px; }
.outline h2, .notes h2 { font: 500 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-lg); padding: 14px 16px; font-weight: 600; color: var(--ink); }
.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-lg); 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; color: var(--ink); 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: var(--radius-input); 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); outline: 2px solid var(--blue); outline-offset: 2px; box-shadow: 0 0 0 2px var(--focus-ring);
}
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: var(--radius-input); background: var(--surface); color: var(--ink);
  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-lg); }

/* Buttons: one primary per view in Current Blue; secondary is an outline */
.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 15px/20px var(--sans); border-radius: var(--radius-md); padding: 11px 22px; min-height: var(--control-md); cursor: pointer;
  border: 1px solid var(--blue); background: var(--blue); color: var(--blue-ink);
  transition: background 0.15s, border-color 0.15s;
}
button.btn:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
button.btn.big { padding: 15px 28px; min-height: var(--control-lg); font-size: 16px; }
button.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
button.btn.secondary:hover { background: var(--mist); }
button.btn.secondary.danger { color: var(--err); border-color: var(--err); }
button.btn:disabled { background: var(--line); border-color: var(--line); color: var(--haze); cursor: progress; }
.banner { padding: 12px 14px; border-radius: var(--radius-md); 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-lg); 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: var(--radius-pill); 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; } }
