/* app.css — Sofia Playground. Brand tokens exactly as spec §4 (Fermioniq customer 3-pager).
   Persona 1 uses purple as the accent, Persona 2 teal: one data-mode attribute on <body> switches it.
   Fonts are self-hosted WOFF2 (public/fonts, SIL OFL) — no third-party request of any kind. */

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/montserrat-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(fonts/inter-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url(fonts/space-grotesk-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/jetbrains-mono-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* spec §4 */
  --purple: #592FF3;
  --blue: #0436C7;
  --lavender: #D1CCFF;
  --lavender-light: #EEEBFF;
  --lime: #EEFF41;
  --ink: #091220;
  --grey: #5C6272;
  --line: #E2E8F0;
  --bg: #F7F7FA;
  --teal: #0097A7;
  --teal-light: #E6F5F7;
  --magenta: #B81270;

  --font-heading: 'Montserrat', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-label: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'DejaVu Sans Mono', ui-monospace, monospace;

  /* Persona 1 (default) */
  --accent: var(--purple);
  --accent-light: var(--lavender-light);
  --accent-line: var(--lavender);
  --alt: var(--teal);
}
body[data-mode="p2"] {
  --accent: var(--teal);
  --accent-light: var(--teal-light);
  --accent-line: color-mix(in srgb, var(--teal) 32%, white);
  --alt: var(--purple);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── shared pieces ─────────────────────────────────────────────────────── */
.eyebrow {
  font: 600 12.5px/1.3 var(--font-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.wordmark { font: 600 21px/1 var(--font-heading); color: var(--blue); letter-spacing: -0.01em; }
.wordmark--on-dark { color: var(--lavender); }
.brand-logo { display: block; height: 28px; width: auto; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 22px;
  border: 1.5px solid var(--accent); border-radius: 2px;
  background: #fff; color: var(--accent);
  font: 600 15px/1.2 var(--font-body);
  text-decoration: none; cursor: pointer;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn--small { padding: 5px 12px; font-size: 13.5px; }
.btn--danger { border-color: var(--magenta); color: var(--magenta); }
.btn--on-dark { border-color: rgba(255, 255, 255, 0.6); color: #fff; background: transparent; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 22px 24px; }
.card--flush { padding: 0; overflow: hidden; }
.hint { font-size: 13px; color: var(--grey); }
.mono { font-family: var(--font-mono); font-size: 13px; }
.nowrap { white-space: nowrap; }
.sig { font-style: italic; }
.loading { padding: 64px 40px; color: var(--grey); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.errors { margin-top: 18px; padding: 12px 16px; border-left: 4px solid var(--magenta); background: color-mix(in srgb, var(--magenta) 8%, white); }
.errors ul { margin: 6px 0 0; padding-left: 20px; }
.preview-banner {
  background: var(--lime); color: var(--ink); text-align: center;
  font: 600 12.5px/1.4 var(--font-label); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 12px;
}

/* ── lead pages (2.1 / 3.1) ────────────────────────────────────────────── */
.lead { min-height: 100vh; display: flex; flex-direction: column; }
.lead-top {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 16px 40px; background: #fff; border-bottom: 1px solid var(--line);
}
.lead-top__brand { display: flex; align-items: center; gap: 18px; }
.lead-top__product { font: 500 14px/1 var(--font-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--grey); }
.lead-top__status { font-size: 14.5px; color: var(--grey); text-align: right; }
.lead-top__status strong { color: var(--ink); font-weight: 600; }

.lead-grid {
  display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 36px; align-items: start;
  width: 100%; max-width: 1280px; margin: 0 auto; padding: 34px 40px 64px;
}
.note {
  margin: 0 0 30px; padding: 12px 22px;
  border-left: 4px solid var(--accent); background: var(--accent-light);
  font-size: 16px; line-height: 1.5;
}
.lead-main h1 { font: 600 30px/1.3 var(--font-heading); letter-spacing: -0.01em; }
.lede { margin: 8px 0 28px; color: var(--grey); font-size: 16.5px; line-height: 1.55; }

.case-list { display: flex; flex-direction: column; gap: 18px; }
.case-card {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; align-items: center; gap: 20px;
  padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 4px;
  text-decoration: none; color: inherit;
}
a.case-card:hover { border-color: var(--accent); }
.case-card--lead { border: 2px solid var(--accent); background: var(--accent-light); padding: 17px 19px; }
.case-card__thumb { width: 96px; height: 66px; border-radius: 2px; }
.thumb-0 { background: linear-gradient(135deg, var(--accent), var(--lavender)); }
.thumb-1 { background: linear-gradient(135deg, var(--blue), var(--lavender)); }
.thumb-2 { background: linear-gradient(135deg, var(--alt), var(--lavender)); }
.thumb-pool { background: linear-gradient(135deg, var(--line), var(--bg)); }
.case-card__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.case-card__title { font: 600 17.5px/1.3 var(--font-body); }
.case-card__sub { color: var(--grey); font-size: 15px; }
.case-card__metric { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; text-align: right; }
.case-card__num { font: 600 18px/1.2 var(--font-body); color: var(--blue); white-space: nowrap; }
.case-card__num-note { font-size: 14px; color: var(--grey); white-space: nowrap; }
.case-card--pool { grid-template-columns: 96px minmax(0, 1fr); }
.case-card--pool .case-card__title { color: var(--grey); }
.case-card__sep { color: var(--grey); line-height: 1; }
.case-card__caption { font-size: 14.5px; color: var(--grey); opacity: 0.8; }

.lead-side { display: flex; flex-direction: column; gap: 22px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 24px 26px; }
.panel__list { margin: 16px 0 0; padding-left: 22px; display: flex; flex-direction: column; gap: 2px; font-size: 15.5px; line-height: 1.5; }
.cta { background: var(--accent-light); border: 1px solid var(--accent-line); border-radius: 4px; padding: 24px 26px; }
.cta p { margin: 16px 0 18px; font-size: 16px; }

.message { width: 100%; max-width: 660px; margin: 64px auto; padding: 0 20px; }
.message__card h1 { font: 600 26px/1.3 var(--font-heading); margin: 10px 0 12px; }
.message__card p + p { margin-top: 10px; }

/* ── login ─────────────────────────────────────────────────────────────── */
.auth { min-height: 100vh; display: flex; flex-direction: column; }
.auth__body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 30px 30px 28px; }
.auth-card h1 { font: 600 24px/1.3 var(--font-heading); margin: 10px 0 8px; }
.auth-card__intro { color: var(--grey); margin-bottom: 20px; }
.auth-card .input { margin-top: 6px; }
.auth-card .btn { width: 100%; margin-top: 16px; }
.form-error { margin-top: 10px; min-height: 1.3em; color: var(--magenta); font-size: 14px; }

/* ── admin (1.3) ───────────────────────────────────────────────────────── */
.admin { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.admin-nav { background: var(--ink); color: #fff; display: flex; flex-direction: column; padding: 24px 0; }
.admin-nav__brand { padding: 0 26px 24px; margin-bottom: 14px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.admin-nav__item { display: block; padding: 12px 26px; color: #fff; text-decoration: none; font-size: 15.5px; border-left: 4px solid transparent; }
.admin-nav__item:hover { background: rgba(255, 255, 255, 0.05); }
.admin-nav__item[aria-current="page"] { background: rgba(255, 255, 255, 0.09); border-left-color: var(--purple); }
.admin-main { padding: 30px 36px 64px; min-width: 0; }
.crumbs { font: 500 13.5px/1.3 var(--font-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--grey); }
.admin-main h1 { font: 600 26px/1.3 var(--font-heading); margin: 10px 0 6px; }
.title-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.intro { color: var(--grey); margin: 0 0 24px; max-width: 72ch; font-size: 15.5px; }
.admin-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.empty { padding: 22px 24px; color: var(--grey); }

.field { display: flex; flex-direction: column; gap: 6px; margin-top: 18px; }
.field__label { font-size: 14.5px; color: var(--grey); }
.field-row { display: flex; flex-wrap: wrap; gap: 36px; }
.input, .textarea {
  width: 100%; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 2px; background: #fff; font-size: 15.5px;
}
.input--mono { font-family: var(--font-mono); font-size: 14px; }
.textarea { min-height: 78px; resize: vertical; line-height: 1.45; }
.input:focus, .textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-light); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 15px; border: 1px solid var(--line); border-radius: 999px; background: #fff;
  font-size: 15px; cursor: pointer;
}
.chip[aria-pressed="true"] { border: 1.5px solid var(--purple); padding: 5.5px 14.5px; background: var(--lavender-light); color: var(--purple); font-weight: 600; }
.chip:disabled { color: #B3B8C2; cursor: not-allowed; }
.chip[aria-pressed="true"]:disabled { color: var(--purple); opacity: 1; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th {
  font: 600 12px/1.3 var(--font-label); letter-spacing: 0.1em; text-transform: uppercase; color: var(--grey);
  text-align: left; padding: 12px 14px; border-bottom: 1.5px solid var(--ink); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table--writes { margin-top: 14px; }
.table--writes td:first-child { width: 110px; }
.writes__then { margin-top: 26px; }
.row-actions { display: flex; gap: 8px; white-space: nowrap; }
.payload { color: var(--grey); word-break: break-all; }
.pill { display: inline-block; padding: 1px 10px; border-radius: 999px; font: 600 12px/1.7 var(--font-label); background: var(--bg); color: var(--grey); white-space: nowrap; }
.pill--active { background: color-mix(in srgb, var(--teal) 14%, white); color: #00626D; }
.pill--revoked, .pill--expired, .pill--exhausted { background: color-mix(in srgb, var(--magenta) 10%, white); color: var(--magenta); }

.toast {
  position: fixed; right: 28px; bottom: 28px; z-index: 10;
  max-width: min(720px, calc(100vw - 40px));
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 14px 18px; border-radius: 2px;
  background: var(--ink); color: #fff; font-size: 15px;
  box-shadow: 0 10px 30px rgba(9, 18, 32, 0.28);
}
/* The URL carries the whole signed token (~400 chars): show all of it, but in a capped, scrollable
   block so the toast stays compact and does not bury the form. */
.toast__url {
  flex: 1 1 100%; order: 3;
  max-height: 4.5em; overflow-y: auto;
  color: var(--lime); font: 600 12.5px/1.5 var(--font-mono); word-break: break-all;
}
.toast__sep { opacity: 0.6; }
.toast__actions { display: flex; gap: 8px; margin-left: auto; }

/* ── case screens (2.2–2.7) ────────────────────────────────────────────── */
:root {
  --ok: #0B7A5A;            /* done-stage hours, CONVERGED, checks passing (p.9, p.10) */
  --ok-bg: #E3F4EE;
  --amber: #8A5A00;
  --amber-bg: #FFF1C2;
  --term-bg: #0E1522;
  --term-fg: #DCE2EC;
  --term-dim: #8A94A8;
}
.pill-illustrative {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  background: #ECEDF1; color: var(--grey); font: 600 11.5px/1.6 var(--font-label); letter-spacing: 0.08em; text-transform: uppercase;
  cursor: help; white-space: nowrap;
}
.pill-status, .pill-check {
  display: inline-block; padding: 4px 14px; border-radius: 2px;
  background: var(--ok-bg); color: var(--ok); font: 600 13px/1.4 var(--font-label); letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap;
}
.pill-status--bad { background: color-mix(in srgb, var(--magenta) 10%, white); color: var(--magenta); }
.pill-check { background: #ECEDF1; color: var(--grey); }
.pill-check--ok { background: var(--ok-bg); color: var(--ok); }

/* 2.2 config — p.8 */
.config {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.4fr); gap: 34px; align-items: start;
  width: 100%; max-width: 1280px; margin: 0 auto; padding: 32px 40px 64px;
}
.case-card--config { grid-template-columns: 96px minmax(0, 1fr); margin-top: 12px; }
.config__knobs-title { margin-top: 34px; }
.knob { margin-top: 14px; }
.knob__label { display: block; margin-bottom: 8px; font-size: 15px; color: var(--grey); }
.config .chip[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.config__run { margin-top: 22px; padding-bottom: 16px; border-bottom: 1.5px dashed var(--line); }
.config__foot { margin-top: 14px; color: var(--grey); font-size: 14px; line-height: 1.5; }
.see { min-height: 420px; }
.see__table { margin-top: 14px; }
.see__table td { padding: 12px 12px; font-size: 15px; }
.see__table td:first-child { width: 18%; }
.see__table td:nth-child(2) { width: 22%; }
.see__note { margin-top: 20px; color: var(--grey); font-size: 15px; }

/* 2.3 run — p.9: two equal halves, each header · screen · process strip */
.run-page { width: 100%; max-width: 1400px; margin: 0 auto; padding: 22px 28px 40px; }
.run-halves { display: flex; gap: 28px; align-items: stretch; }
.run-half {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
}
.run-half__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 20px; min-height: 58px; }
.run-half__head--sofia { background: var(--lavender-light); }
.run-half__head--of { background: #F1F2F5; }
.run-half__title { display: flex; align-items: center; gap: 10px; min-width: 0; font: 600 18px/1.25 var(--font-heading); color: var(--ink); }
.run-half__head--sofia .run-half__title { color: var(--blue); }
.run-half__title > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-half__brand .wordmark { font-size: 14px; }
.run-half__brand .brand-logo { height: 18px; }
.run-half__meta { flex: none; max-width: 42%; text-align: right; font: 500 12.5px/1.35 var(--font-label); letter-spacing: 0.06em; color: var(--grey); }
.run-half__screen { flex: 1; display: flex; flex-direction: column; gap: 14px; padding: 16px 20px 18px; overflow: hidden; }
.run-half__strip { padding: 14px 20px 18px; border-top: 1px solid var(--line); }

.term {
  background: var(--term-bg); color: var(--term-fg); border-radius: 2px; padding: 12px 16px;
  font: 400 12.5px/1.6 var(--font-mono); white-space: pre; overflow: hidden; max-width: 100%;
}
.term--sofia { min-height: 150px; }
.term--of { height: 290px; }
.term__line { overflow: hidden; text-overflow: ellipsis; }
.term__ts { color: var(--term-dim); margin-right: 10px; }
.term__tag { display: inline-block; width: 9ch; }
.term__tag--physics, .term__tag--codegen, .term__tag--validate, .term__tag--mesh { color: #7EE0A1; }
.term__tag--run { color: #7FA8FF; }
.term__tag--check { color: #5FD4E0; }
.term__line--cmd { color: #FFFFFF; }
.term__line--dim { color: var(--term-dim); }
.term__line--warn { color: #F4C95D; }
.term__line--err { color: #FF7A7A; }

.trace-plot {
  position: relative; height: 150px; border: 1px solid var(--lavender); border-radius: 2px;
  background: linear-gradient(180deg, #fff 0%, var(--lavender-light) 100%);
}
.trace-plot__label { position: absolute; left: 14px; top: 10px; font: 500 13px/1 var(--font-label); color: var(--grey); letter-spacing: 0.02em; }
.trace-plot__svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.trace { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.trace--u { stroke: var(--purple); }
.trace--p { stroke: var(--teal); }

.run-big-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.run-big { font: 700 42px/1.1 var(--font-heading); letter-spacing: -0.01em; }
.run-big--sofia { color: var(--accent); }
.run-big--of { color: #3A4152; }
.run-big__note { margin-top: 4px; font-size: 15px; color: var(--grey); }
.run-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--grey); }
.run-checks li.is-ok { color: var(--ok); }
.run-checks__mark { display: inline-block; width: 1.2em; }

.gui { border-radius: 2px; overflow: hidden; border: 1px solid #C9CDD6; }
.gui__bar { display: flex; align-items: center; gap: 12px; padding: 6px 12px; background: #D6D9E0; font: 500 13.5px/1.3 var(--font-body); color: #2A3040; }
.gui__dots { color: #3A4152; letter-spacing: 1px; font-size: 10px; }
.gui__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gui__menu { display: flex; gap: 20px; padding: 4px 12px; background: #EDEFF3; font-size: 13.5px; color: #2A3040; }
.gui__body { position: relative; height: 110px; background: #2B303C; }
.gui__view { position: absolute; inset: 0; }
.gui__view img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gui__caption { position: absolute; left: 12px; bottom: 10px; right: 12px; font: 400 12px/1.3 var(--font-mono); color: #A9B1C2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.of-badges { display: flex; gap: 8px; }
.of-badge { padding: 5px 14px; border-radius: 2px; font: 600 13px/1.4 var(--font-label); letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap; }
.of-badge--warn { background: var(--amber-bg); color: var(--amber); }
.of-badge--error { background: color-mix(in srgb, var(--magenta) 12%, white); color: var(--magenta); }
.of-controls { display: flex; gap: 10px; }

.strip-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.strip-head__left { font: 500 13px/1.3 var(--font-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--grey); }
.strip-head__right { font-size: 14px; color: var(--ink); }
.strip-head__right--strong { font-weight: 600; }
.strip__row { display: flex; align-items: flex-start; }
.strip__row + .strip__row { margin-top: 12px; }
.strip__return { flex: none; width: 18px; padding-top: 16px; color: var(--grey); font-size: 14px; }
.strip__sep { flex: none; width: 14px; padding-top: 16px; text-align: center; color: #A7ADB9; font-size: 13px; }
.strip__step { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: stretch; }
.strip__box {
  min-height: 50px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  padding: 6px; border: 1px solid #C9CDD6; border-radius: 2px; background: #fff;
  font-size: 13.5px; line-height: 1.2; color: var(--ink); overflow-wrap: anywhere;
}
.strip__step--io .strip__box { border-style: dashed; color: var(--grey); }
.strip__under { margin-top: 6px; text-align: center; font-size: 13.5px; color: var(--grey); white-space: nowrap; }
.strip__loop { text-align: center; font-size: 12px; color: var(--magenta); }
.strip__step--done .strip__under { color: var(--ok); }
.strip__step--active .strip__under { color: var(--ink); font-weight: 600; }
.strip--of .strip__step--active .strip__box { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.strip--sofia .strip__box { min-height: 58px; font-size: 14.5px; }
.strip--sofia .strip__step--done .strip__box { background: #ECEDF1; }
.strip--sofia .strip__step--active .strip__box { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.strip--sofia .strip__step--active .strip__under { color: var(--accent); }
.strip__sub { display: block; margin-top: 3px; font-weight: 600; font-size: 13.5px; }

/* 2.4 result — p.10 */
.result { width: 100%; max-width: 1280px; margin: 0 auto; padding: 34px 40px 64px; }
.result__title { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; }
.result__title h1 { font: 600 30px/1.25 var(--font-heading); letter-spacing: -0.01em; }
.headline { display: flex; flex-wrap: wrap; gap: 20px 56px; margin: 26px 0 28px; }
.headline__num { font: 700 38px/1.1 var(--font-heading); letter-spacing: -0.01em; }
.headline__num--accent { color: var(--accent); }
.headline__num--grey { color: var(--grey); }
.headline__label { margin-top: 4px; font-size: 14.5px; color: var(--grey); }
.result__grid { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.qoi-table td { padding: 12px 14px; font-size: 15.5px; }
.result__plot { margin: 0; border: 1px solid var(--line); border-radius: 2px; background: #fff; overflow: hidden; }
.result__plot img { display: block; width: 100%; height: auto; }
.result__plot figcaption { padding: 8px 12px; font: 400 13px/1.3 var(--font-label); color: var(--grey); }
.method { margin-top: 26px; padding-top: 16px; border-top: 1.5px dashed var(--line); color: var(--grey); font-size: 15px; line-height: 1.55; }
.method strong { color: var(--ink); }
.result__meta { margin-top: 8px; color: var(--grey); font-size: 12.5px; }
.result__ctas { margin-top: 26px; }

/* 2.6 email gate — p.12 */
.modal-overlay { display: none; position: fixed; inset: 0; z-index: 20; background: rgba(9, 18, 32, 0.45); align-items: center; justify-content: center; padding: 20px; }
.modal-overlay.open { display: flex; }
.modal { width: 100%; max-width: 500px; background: #fff; border-radius: 4px; padding: 30px 32px 28px; box-shadow: 0 20px 50px rgba(9, 18, 32, 0.3); }
.modal h2 { font: 600 24px/1.3 var(--font-heading); }
.modal__body { margin: 14px 0 20px; color: var(--grey); font-size: 16px; line-height: 1.5; }
.modal .input { margin-top: 6px; }
.modal__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* 2.5 code — p.11 */
.code-page { width: 100%; max-width: 1400px; margin: 0 auto; padding: 22px 28px 48px; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.tab { padding: 8px 18px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 2px 2px 0 0; background: #F1F2F5; color: var(--grey); font-size: 14.5px; cursor: pointer; }
.tab[aria-selected="true"] { background: #fff; border-color: var(--accent); color: var(--blue); font-weight: 600; }
.code-pair { display: flex; gap: 28px; align-items: stretch; }
.code-panel { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.code-panel__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 20px; background: #F1F2F5; min-height: 58px; }
.code-panel--write .code-panel__head { background: var(--lavender-light); }
.code-panel__brand .wordmark { font-size: 14px; }
.code-panel__file { font: 600 18px/1.3 var(--font-heading); color: var(--ink); }
.code-panel__file--accent { color: var(--blue); }
.code-panel__meta { margin-left: auto; font-size: 13.5px; color: var(--grey); }
.code { flex: 1; margin: 0; padding: 16px 20px; min-height: 480px; font: 400 12.5px/1.55 var(--font-mono); white-space: pre; overflow-x: auto; color: var(--ink); }
.code__line { display: block; min-height: 1.55em; }
.tok-c { color: #7C8496; font-style: italic; }
.tok-s { color: #1B7F4B; }
.tok-k { color: var(--purple); }
.tok-n { color: var(--blue); }
.code-panel__foot { padding: 14px 20px; border-top: 1px solid var(--line); color: var(--grey); font-size: 14px; line-height: 1.45; }
.doc-view { max-width: 980px; }
.doc { margin: 14px 0 0; font: 400 13px/1.6 var(--font-mono); white-space: pre-wrap; color: var(--ink); }
.meta-table { margin-top: 12px; }
.meta-table th { width: 220px; text-align: left; font: 400 14px/1.4 var(--font-body); letter-spacing: 0; text-transform: none; color: var(--grey); border-bottom: 1px solid var(--line); white-space: normal; }

/* 2.7 book — p.13 */
.book { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.book__main {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 2.6fr); align-items: stretch;
  width: 100%; max-width: 1280px; margin: 28px auto; background: #fff; border: 1px solid var(--line); border-radius: 4px; min-height: 640px;
}
.book__left { padding: 30px; border-right: 1px solid var(--line); }
.book__left h1 { margin-top: 28px; font: 600 24px/1.3 var(--font-heading); }
.book__with { margin-top: 6px; color: var(--grey); font-size: 15.5px; }
.book__dl { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 12px; margin: 22px 0 0; padding-bottom: 18px; border-bottom: 1.5px dashed var(--line); font-size: 15px; }
.book__dl dt { color: var(--grey); }
.book__dl dd { margin: 0; }
.book__foot { margin-top: 16px; color: var(--grey); font-size: 14px; line-height: 1.5; }
.book__right { padding: 30px 40px 36px; display: flex; flex-direction: column; gap: 28px; }
.book__picker { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); gap: 40px; }
.cal__head { display: flex; align-items: center; justify-content: space-between; }
.cal__head h2, .slots h2 { font: 600 20px/1.3 var(--font-heading); }
.cal__nav { display: flex; gap: 6px; }
.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px 6px; margin-top: 18px; text-align: center; }
.cal__wd { font-size: 13px; color: var(--grey); padding-bottom: 6px; }
.cal__cell { height: 42px; display: flex; align-items: center; justify-content: center; }
.cal__day { font-size: 15px; color: var(--ink); border: 0; background: none; border-radius: 999px; }
.cal__day--open { background: var(--accent-light); color: var(--blue); font-weight: 600; cursor: pointer; }
.cal__day--open.is-picked { background: var(--accent); color: #fff; }
.slots { display: flex; flex-direction: column; gap: 12px; }
.slot { padding: 11px; border: 1.5px solid var(--accent); border-radius: 2px; background: #fff; color: var(--accent); font-weight: 600; cursor: pointer; }
.slot.is-picked { background: var(--accent); color: #fff; }
.book__confirm .field { margin-top: 12px; }
.book__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.book__done h2 { font: 600 22px/1.3 var(--font-heading); margin-bottom: 10px; }

/* ── narrow screens ────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .admin-cols { grid-template-columns: 1fr; }
  .run-halves, .code-pair { flex-direction: column; }
  .config, .result__grid, .book__picker { grid-template-columns: 1fr; }
  .book__main { grid-template-columns: 1fr; margin: 0; border-radius: 0; }
  .book__left { border-right: 0; border-bottom: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .lead-grid { grid-template-columns: 1fr; padding: 24px 20px 48px; }
  .lead-top { padding: 12px 20px; flex-wrap: wrap; }
  .lead-top__status { text-align: left; }
  .config, .result, .run-page, .code-page { padding-left: 20px; padding-right: 20px; }
  .headline { gap: 18px 32px; }
  .book__right { padding: 24px 20px; }
  .book__row { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .admin { grid-template-columns: 1fr; }
  .admin-nav { flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; }
  .admin-nav__brand { padding: 0 14px 0 6px; margin: 0; border: 0; }
  .admin-nav__item { padding: 8px 12px; border-left: 0; border-bottom: 3px solid transparent; }
  .admin-nav__item[aria-current="page"] { border-bottom-color: var(--purple); }
  .admin-main { padding: 22px 18px 48px; }
  .case-card { grid-template-columns: 64px minmax(0, 1fr); }
  .case-card__thumb { width: 64px; height: 48px; }
  .case-card__metric { grid-column: 2; align-items: flex-start; text-align: left; gap: 2px; }
}
