/* Scenarios (the Digital Lab's step for envisioning future movements), in the Lab's look.
   Loaded only inside the Lab (base /comdyn), after the Lab's own /field-study/theme.css and fonts.css, which give
   every colour, the type, the stickers, the buttons and the dark/light roles. This file keeps layout and shape and
   names no colour: role tokens only (--text, --surface, --edge, ...), so the page changes with the Lab's one switch.
   The parts other files draw (the course bar, the helper, the Desk round, the built-in card example) are given the
   same look here. */

* { box-sizing: border-box; }
html { overflow-y: auto; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
p { margin: 0; }
.visually-hidden, .sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link { position: absolute; z-index: 30; top: 8px; left: 16px; transform: translateY(-200%); }
.skip-link:focus { transform: none; }
code, .scn-mono { font-family: var(--mono); font-weight: 700; }

/* The way back: one quiet line above the header (the Lab's course bar replaces it when the Lab opened this step). */
.lab-bar { padding: 6px max(16px, calc((100% - 1312px) / 2)) 0; }
.lab-bar-link {
  display: inline-flex; align-items: center; gap: 0.4em; min-height: 44px;
  color: var(--text-dim); font: 700 max(12px, 0.76rem)/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; text-decoration: none;
}
.lab-bar-link:hover { color: var(--text); text-decoration: underline 3px var(--link-line); text-underline-offset: 0.3em; }

/* The header: the step's tile and its name, the Lab's switch. */
.site-header {
  position: sticky; z-index: 20; top: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px;
  min-height: 4.65rem; padding: 0 max(16px, calc((100% - 1312px) / 2));
}
.wordmark { display: inline-flex; align-items: center; gap: 10px; min-width: 0; min-height: 2.75rem; }
.wordmark strong { display: block; white-space: nowrap; }
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }

/* One column, as the Lab's guided steps. The run's chart and the built-in example get a little more room. */
.scn { width: min(46rem, 100% - 32px); margin: 0 auto; padding: 24px 0 72px; }
.scn:focus { outline: none; }
.scn-course:empty { display: none; }

/* The case, in one quiet card (said once: the Lab's course bar names it when that bar is here). */
.scn-context { margin: 0 0 22px; padding: 10px 8px 12px 16px; border: var(--ol-thin) solid var(--control-edge); border-radius: var(--r); background: var(--surface); }
.scn-context-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; }
.scn-context-head .scn-info { margin: -6px 0; }
.scn-context-line { margin: 2px 0 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.scn-context-line strong { font-weight: 800; }
.scn-context-line > span:last-child { color: var(--text-dim); font-size: 0.95rem; }
.scn-context-sep { margin: 0 0.25em; color: var(--text-dim); }

/* The steps: numbered tabs; the one you are on is the picked sticker; one not open yet is dashed. */
.scn-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 6px; padding: 0; list-style: none; }
.scn-steps button {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 48px; padding: 6px 10px;
  border: var(--ol-thin) solid var(--control-edge); border-radius: var(--r);
  color: var(--text); background: var(--surface); box-shadow: var(--pop-sm) var(--pop-sm) 0 var(--edge);
  font: 700 0.95rem/1.2 var(--display); text-align: left; cursor: pointer;
  transition: transform var(--t-press) var(--ease), box-shadow var(--t-press) var(--ease);
}
.scn-steps .workflow-question-n { width: 1.7em; height: 1.7em; font-size: 0.85rem; transform: none; box-shadow: none; }
.scn-steps button[aria-current="step"] { border-color: var(--edge); color: var(--on-picked); background: var(--picked); transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--edge); font-weight: 800; }
.scn-steps button[aria-current="step"] .workflow-question-n { border-color: var(--on-picked); color: var(--on-picked); background: transparent; }
.scn-steps button[data-state="later"] { border-style: dashed; color: var(--text-dim); box-shadow: none; cursor: not-allowed; }
.scn-steps button[data-state="later"] .workflow-question-n { border-style: dashed; color: var(--text-dim); }
.scn-step-short { display: none; }
@media (hover: hover) {
  .scn-steps button:not([aria-current="step"]):not([data-state="later"]):hover { transform: translate(-1px, -1px); box-shadow: calc(var(--pop-sm) + 1px) calc(var(--pop-sm) + 1px) 0 var(--edge); }
}
.scn-status { min-height: 22px; margin: 0 0 6px; color: var(--text); font-size: 0.92rem; font-weight: 700; }

/* A screen: kicker and its "i", the question, one line, what to do, one lime action. */
.scn-step { margin: 0; }
.scn-kicker-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.scn-title { margin: 6px 0 10px; font: 800 clamp(2rem, 4.4vw, 3.1rem)/1.04 var(--display); letter-spacing: -0.03em; overflow-wrap: anywhere; }
.scn-title:focus, .scn-title:focus-visible { outline: none; }
/* Focus that moves to a screen's question or a run's sentence stops clear of the sticky header. */
.scn-title, .scn-sentence, .scn [id] { scroll-margin-top: 6rem; }
.scn-line { margin: 0 0 24px; color: var(--text-dim); font-size: 1.1rem; line-height: 1.45; }
.scn-hint { margin: 8px 0 0; color: var(--text-dim); font-size: 0.92rem; line-height: 1.5; }
.scn-hint strong { color: var(--text); }
.scn-note { margin: 0 0 18px; padding: 12px 16px; border: var(--ol-thin) dashed var(--control-edge); border-radius: var(--r); color: var(--text); font-weight: 600; }
.scn-subtitle { margin: 26px 0 10px; font: 800 1.25rem/1.2 var(--display); letter-spacing: -0.02em; }
.scn-loading { padding: 48px 0; color: var(--text-dim); font-weight: 700; }

/* An alert: errors only are red; the words are the text's colour. */
.scn-alert {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 18px; padding: 12px 16px;
  border: var(--ol) solid var(--danger); border-radius: var(--r); color: var(--text); background: var(--surface); font-weight: 600;
}
.scn-alert > span { flex: 1 1 16rem; }

/* The "i": one tap away, never inline. */
.scn-info { position: relative; }
.scn-info > summary { list-style: none; }
.scn-info > summary::-webkit-details-marker { display: none; }
.lab-info-open { display: grid; flex: none; width: 44px; height: 44px; place-items: center; padding: 0; border: 0; background: transparent; cursor: pointer; }
.scn-info[open] .lab-info-open > span[aria-hidden] { border-color: var(--edge); color: var(--on-picked); background: var(--picked); }
.scn-info-text {
  position: absolute; z-index: 5; right: 0; width: min(24rem, calc(100vw - 32px)); margin-top: 6px; padding: 14px 16px;
  border: var(--ol) solid var(--edge); border-radius: var(--r); color: var(--text); background: var(--surface);
  box-shadow: var(--pop-lg) var(--pop-lg) 0 var(--edge); font-size: 0.95rem; line-height: 1.5;
}
.scn-info-text p + p { margin-top: 0.6rem; }

/* Where to start: choices as stickers, each a whole button. */
.scn-choices { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.scn-choice {
  display: flex; align-items: center; gap: 16px; width: 100%; min-height: 72px; padding: 14px 18px;
  border: var(--ol) solid var(--edge); border-radius: var(--r-lg); color: var(--text); background: var(--surface);
  box-shadow: var(--pop) var(--pop) 0 var(--edge); font: 500 1rem/1.4 var(--display); text-align: left; cursor: pointer;
  transition: transform var(--t-lift) var(--ease), box-shadow var(--t-lift) var(--ease);
}
.scn-choice-text { display: grid; flex: 1; gap: 3px; min-width: 0; }
.scn-choice-text strong { font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; }
.scn-choice-text > span:not(.tag) { color: var(--text-dim); }
.scn-choice-text small { color: var(--text-dim); font: 700 max(12px, 0.74rem)/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.scn-choice-text .tag { justify-self: start; margin-bottom: 2px; }
.scn-choice-go { flex: none; font-weight: 800; font-size: 1.3rem; }
@media (hover: hover) {
  .scn-choice:hover { transform: translate(-2px, -2px); box-shadow: var(--pop-lg) var(--pop-lg) 0 var(--edge); }
}
.scn-choice:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--edge); }

/* Fields: the Lab's (theme.css section 14), drawn with its roles. */
.scn-field { margin: 0 0 18px; min-width: 0; }
.scn-field > label, .scn-field > span { display: block; margin: 0 0 8px; font-weight: 800; font-size: 1rem; }
.scn-field :is(input, textarea, select), .scn-edit input, .scn-event-fields input {
  display: block; width: 100%; min-height: 3rem; padding: 10px 14px;
  border: var(--ol) solid var(--control-edge); border-radius: var(--r);
  color: var(--text); background-color: var(--surface); box-shadow: var(--pop) var(--pop) 0 var(--edge);
  font: 600 1rem/1.4 var(--display);
}
.scn-field textarea { min-height: 7.5rem; resize: vertical; }
.scn-field :is(input, textarea)::placeholder { color: var(--text-dim); opacity: 1; }
.scn-field select {
  appearance: none; padding-right: 44px;
  background:
    linear-gradient(45deg, transparent 50%, var(--text) 50%) right 22px center / 7px 7px no-repeat,
    linear-gradient(135deg, var(--text) 50%, transparent 50%) right 15px center / 7px 7px no-repeat,
    var(--surface);
}
.scn-field .scn-mono, .scn-field input.scn-mono { font-family: var(--mono); font-weight: 700; }
:is(.scn-field, .scn-edit, .scn-event-fields) [aria-invalid="true"] { border-color: var(--danger); }
.scn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
input[type="checkbox"] { width: 22px; height: 22px; accent-color: var(--text); }
input[type="range"] { accent-color: var(--text); }

/* Build your own: one row per part, move or speed, its fields side by side when there is room. */
.scn-rows { display: grid; gap: 14px; margin: 0 0 14px; padding: 0; list-style: none; }
.scn-build-row {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 12px; padding: 14px 14px 0;
  border: var(--ol-thin) solid var(--control-edge); border-radius: var(--r); background: var(--surface);
}
.scn-build-row .scn-field { flex: 1 1 9rem; margin-bottom: 14px; }
.scn-build-row .scn-field-wide { flex: 2 1 14rem; }
.scn-build-row .scn-field-short { flex: 1 1 7rem; }
.scn-build-row .scn-field-tiny { flex: 1 1 5.5rem; }
.scn-build-row .scn-field > span { font-size: 0.9rem; }
.scn-remove {
  flex: none; width: 44px; height: 44px; margin: 0 0 16px auto; padding: 0;
  border: var(--ol-thin) solid var(--control-edge); border-radius: 50%; color: var(--text); background: var(--surface);
  box-shadow: var(--pop-sm) var(--pop-sm) 0 var(--edge); font: 800 1.3rem/1 var(--display); cursor: pointer;
}
.scn-remove:disabled { border-style: dashed; color: var(--text-dim); box-shadow: none; cursor: not-allowed; }
.scn-add { margin-top: 4px; }

/* Actions: back on the left, the one lime action on the right. */
.scn-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.scn-actions-end { display: inline-flex; align-items: center; justify-content: flex-end; gap: 12px 18px; flex-wrap: wrap; margin-left: auto; }
.scn-actions .scn-hint { margin: 0; }
.primary-action, .quiet-action, .back-action {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em; min-height: 3rem; padding: 0 1.25rem; font-size: 1rem; cursor: pointer;
}
.primary-action { padding: 0 24px; font-size: 1.05rem; }
.back-action { min-height: 44px; padding: 0 0.25rem; }
.lead-text, .text-button { display: inline-flex; align-items: center; gap: 0.3em; min-height: 44px; padding: 0 0.35rem; font-size: 0.95rem; cursor: pointer; }

/* What moves: three quiet cards; every number is one press from changing. */
.scn-cards { display: grid; gap: 16px; }
.scn-card { padding: 16px 18px 6px; border: var(--ol) solid var(--edge); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--pop) var(--pop) 0 var(--edge); }
.scn-card-title { margin: 0 0 4px; font: 800 1.3rem/1.2 var(--display); letter-spacing: -0.02em; }
.scn-card-line { margin: 0 0 8px; color: var(--text-dim); font-size: 0.95rem; }
.scn-card-line strong { color: var(--text); }
.scn-list { margin: 0; padding: 0; list-style: none; }
.scn-list > li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px 12px; min-height: 52px; padding: 4px 0; border-top: var(--ol-thin) solid var(--divider); }
.scn-list > li:first-child { border-top: 0; }
.scn-list-name { flex: 1 1 12rem; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.scn-moves > li { flex-direction: column; align-items: flex-start; justify-content: center; }
.scn-moves .scn-list-name { flex: none; }
.scn-moves small { color: var(--text-dim); font-size: 0.92rem; }
.scn-value {
  min-height: 44px; padding: 0 14px; border: var(--ol-thin) solid var(--control-edge); border-radius: var(--pill);
  color: var(--text); background: var(--bg); font: 800 1rem/1 var(--display); font-variant-numeric: tabular-nums; cursor: pointer;
}
.scn-value.scn-overridden { border-color: var(--edge); color: var(--on-picked); background: var(--picked); }
@media (hover: hover) { .scn-value:hover { text-decoration: underline 3px var(--link-line); text-underline-offset: 0.3em; } }
.scn-edit { display: inline-flex; align-items: center; gap: 8px; }
.scn-edit input { width: 8.5rem; min-height: 44px; padding: 6px 10px; box-shadow: none; font-variant-numeric: tabular-nums; }
.scn-formulas h3 { margin: 4px 0 6px; font: 700 max(12px, 0.76rem)/1.3 var(--mono); color: var(--text-dim); letter-spacing: 0.12em; text-transform: uppercase; }
.scn-formulas ul { margin: 0 0 14px; padding: 0; list-style: none; }
.scn-formulas li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 6px 0; border-top: var(--ol-thin) solid var(--divider); }
.scn-formulas li:first-child { border-top: 0; }
.scn-formulas code { overflow-wrap: anywhere; font-size: 0.85rem; }

/* What could happen: the events on one timeline, then each with its switch and one line. */
.scn-timeline { margin: 0 0 6px; padding: 18px 16px 10px; border: var(--ol-thin) solid var(--control-edge); border-radius: var(--r); background: var(--surface); }
.scn-timeline-track { position: relative; height: 30px; margin: 0 14px; background: linear-gradient(var(--control-edge), var(--control-edge)) center / 100% 3px no-repeat; }
.scn-timeline-mark {
  position: absolute; top: 50%; display: grid; width: 28px; height: 28px; place-items: center; transform: translate(-50%, -50%);
  border: var(--ol-thin) solid var(--edge); border-radius: 50%; color: var(--on-picked); background: var(--picked);
  font: 800 0.8rem/1 var(--display); font-variant-numeric: tabular-nums;
}
.scn-timeline-mark[data-on="false"] { border: var(--ol-thin) dashed var(--text-dim); color: var(--text-dim); background: var(--surface); }
.scn-timeline-track[data-rows="many"] { height: 88px; }
.scn-timeline-mark[data-row="1"] { top: calc(50% - 30px); }
.scn-timeline-mark[data-row="2"] { top: calc(50% + 30px); }
.scn-timeline-ends { display: flex; justify-content: space-between; margin-top: 8px; color: var(--text-dim); font: 700 max(12px, 0.74rem)/1.3 var(--mono); }
.scn-events { display: grid; gap: 12px; margin: 14px 0 16px; padding: 0; list-style: none; }
.scn-event {
  display: flex; align-items: flex-start; gap: 14px; padding: 12px 14px;
  border: var(--ol) solid var(--edge); border-radius: var(--r); background: var(--surface); box-shadow: var(--pop) var(--pop) 0 var(--edge);
}
.scn-event[data-on="false"] { border-style: dashed; border-color: var(--control-edge); box-shadow: none; }
.scn-event-text { flex: 1; min-width: 0; }
.scn-event-name { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; font-weight: 800; font-size: 1.05rem; overflow-wrap: anywhere; }
.scn-event-name .workflow-question-n { width: 1.6em; height: 1.6em; font-size: 0.8rem; transform: none; box-shadow: none; }
.scn-event-line { color: var(--text-dim); }
.scn-event[data-on="false"] .scn-event-name { color: var(--text-dim); }
.scn-switch {
  display: inline-flex; flex: none; flex-direction: column; align-items: center; gap: 2px; min-width: 56px; min-height: 52px; padding: 4px 2px;
  border: 0; color: var(--text); background: transparent; font: 800 0.8rem/1 var(--display); cursor: pointer;
}
.scn-switch-track {
  position: relative; display: block; width: 50px; height: 28px; border: var(--ol-thin) solid var(--edge); border-radius: var(--pill);
  background: var(--picked); transition: background var(--t-press) var(--ease);
}
.scn-switch-knob {
  position: absolute; top: 3px; left: 25px; width: 18px; height: 18px; border-radius: 50%; background: var(--on-picked);
  transition: left var(--t-press) var(--ease);
}
.scn-switch[aria-checked="false"] .scn-switch-track { border-style: dashed; border-color: var(--control-edge); background: var(--surface); }
.scn-switch[aria-checked="false"] .scn-switch-knob { left: 3px; background: var(--text-dim); }
.scn-switch[aria-checked="false"] .scn-switch-word { color: var(--text-dim); }
.scn-switch:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: var(--r); }
.scn-event-edit { margin-top: 2px; }
.scn-event-edit > summary {
  display: inline-flex; align-items: center; min-height: 44px; list-style: none; cursor: pointer;
  color: var(--text); font-weight: 700; font-size: 0.92rem; text-decoration: underline 3px var(--link-line); text-underline-offset: 0.3em;
}
.scn-event-edit > summary::-webkit-details-marker { display: none; }
.scn-event-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; padding: 6px 0 4px; }
.scn-event-fields .scn-field { margin-bottom: 10px; }
.scn-event-fields .scn-field > span { font-size: 0.88rem; }
.scn-event-fields input { min-height: 44px; padding: 6px 10px; box-shadow: none; }
.scn-event-fields .scn-hint, .scn-event-fields .text-button { grid-column: 1 / -1; justify-self: start; }

/* Ready to run: what will run, each with Change. */
.scn-review { margin: 0 0 22px; padding: 4px 16px; border: var(--ol) solid var(--edge); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--pop) var(--pop) 0 var(--edge); }
.scn-review > div { display: flex; align-items: baseline; gap: 16px; padding: 12px 0; border-bottom: var(--ol-thin) solid var(--divider); }
.scn-review > div:last-child { border-bottom: 0; }
.scn-review dt { flex: none; width: 5.5rem; color: var(--text-dim); font: 700 max(12px, 0.76rem)/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.scn-review dd { display: flex; flex: 1; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.scn-review dd > span { min-width: 0; }
.scn-review dd small { display: block; margin-top: 2px; color: var(--text-dim); font-weight: 500; font-size: 0.9rem; line-height: 1.45; }
.scn-review .lead-text { flex: none; margin: -10px 0; font-size: 0.9rem; }

/* Compare the futures: one sentence, the part to watch, one calm chart, the rest one tap away. */
.scn-sentence { margin: 0 0 18px; font: 800 clamp(1.15rem, 2.3vw, 1.4rem)/1.35 var(--display); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.scn-sentence:focus { outline: none; }
.scn-sentence:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; border-radius: 4px; }
.scn-watch, .scn-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 18px; }
.scn-watch-label { color: var(--text-dim); font: 700 max(12px, 0.76rem)/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.scn-chip {
  min-height: 44px; padding: 0 16px; border: var(--ol-thin) solid var(--control-edge); border-radius: var(--pill);
  color: var(--text); background: var(--surface); box-shadow: var(--pop-sm) var(--pop-sm) 0 var(--edge);
  font: 700 0.95rem/1.2 var(--display); cursor: pointer; transition: transform var(--t-press) var(--ease), box-shadow var(--t-press) var(--ease);
}
.scn-chip:is([aria-checked="true"], [aria-pressed="true"]) { border-color: var(--edge); color: var(--on-picked); background: var(--picked); font-weight: 800; transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--edge); }
.scn-chip:is([aria-checked="true"], [aria-pressed="true"])::before { content: "✓ "; }
.scn-run .futures { padding: 16px 16px 14px; border: var(--ol) solid var(--edge); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--pop) var(--pop) 0 var(--edge); }
.scn-next { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin: 22px 0 6px; }

/* Optional depth: a text link that opens. */
.scn-more { margin: 18px 0 0; }
.scn-more > summary {
  display: inline-flex; align-items: center; gap: 0.5em; min-height: 44px; list-style: none; cursor: pointer;
  color: var(--text); font-weight: 700; text-decoration: underline 3px var(--link-line); text-underline-offset: 0.3em;
}
.scn-more > summary::-webkit-details-marker { display: none; }
.scn-more > summary::after { content: "+"; display: inline-grid; place-items: center; width: 1.4em; height: 1.4em; border: var(--ol-thin) solid var(--control-edge); border-radius: 50%; font-weight: 800; line-height: 1; text-decoration: none; }
.scn-more[open] > summary::after { content: "–"; }
.scn-more > summary:hover { text-decoration-thickness: 5px; }
.scn-more-body { margin-top: 12px; padding: 16px; border: var(--ol-thin) solid var(--control-edge); border-radius: var(--r); background: var(--surface); }
.scn-more-body > :last-child { margin-bottom: 0; }
.scn-more-body ul { margin: 0; padding-left: 1.2rem; }
.scn-notice { margin: 0 0 18px; }
.scn-numbers { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.scn-numbers th, .scn-numbers td { padding: 8px 6px; border-bottom: var(--ol-thin) solid var(--divider); text-align: right; }
.scn-numbers thead th { color: var(--text-dim); font: 700 max(12px, 0.72rem)/1.3 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.scn-numbers th:first-child { text-align: left; }
.scn-numbers tbody tr:last-child :is(th, td) { border-bottom: 0; }
.scn-realism { display: grid; gap: 4px; }
.scn-setting { padding: 10px 0; border-top: var(--ol-thin) solid var(--divider); }
.scn-realism > .scn-hint:first-child + .scn-setting { border-top: 0; }
.scn-check { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 800; cursor: pointer; }
.scn-range { display: grid; grid-template-columns: minmax(6rem, auto) minmax(0, 1fr) 4rem; align-items: center; gap: 12px; min-height: 44px; color: var(--text-dim); font-size: 0.92rem; }
.scn-range input { width: 100%; min-height: 44px; }
.scn-range output { color: var(--text); font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
.scn-realism .scn-field { margin: 8px 0 6px; }
.scn-realism .scn-field > span { font-size: 0.92rem; }
.scn-seed { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0 14px; }
.scn-seed .scn-field { flex: 1 1 12rem; }
.scn-seed .quiet-action { margin-bottom: 6px; }

/* The built-in card example: its own full view, given the Lab's roles and type (its layout stays its own). */
.scn[data-wide] { width: min(1180px, 100% - 32px); }
.scn-legacy { overflow-x: auto; padding: 12px 0; border: var(--ol) solid var(--edge); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--pop) var(--pop) 0 var(--edge); }

/* The helper ("Help with this scenario"): a drawer, as the Lab's. */
.scn-helper { margin-top: 40px; }
.scn-helper-drawer { margin: 0; padding: 0; border: 0; background: transparent; }
.scn-helper-drawer > summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0 16px;
  border: var(--ol) solid var(--edge); border-radius: var(--r-lg); color: var(--text); background: var(--surface);
  box-shadow: var(--pop) var(--pop) 0 var(--edge); font-weight: 800; font-size: 1.05rem; list-style: none; cursor: pointer;
}
.scn-helper-drawer > summary::-webkit-details-marker { display: none; }
.scn-helper-drawer > summary::after { content: "+"; display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; border: var(--ol-thin) solid var(--control-edge); border-radius: 50%; font-weight: 800; }
.scn-helper-drawer[open] > summary::after { content: "–"; }
.scn-helper-drawer[open] > summary { box-shadow: var(--pop-lg) var(--pop-lg) 0 var(--edge); }
.scn-helper-drawer > :not(summary) { margin-top: 14px; }
.scn-helper-drawer > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
/* Inside the drawer, the Lab planner's parts (lab-discovery.css); the Ask stays a quiet sticker, the step keeps the lime. */
.scn-helper-drawer .lab-assist { color: var(--text); background: var(--surface); border: var(--ol-thin) solid var(--control-edge); border-radius: var(--r); font: 500 1rem/1.5 var(--display); }
.scn-helper-drawer .lab-assist .la-eyebrow { color: var(--text-dim); font: 700 max(12px, 0.76rem)/1.3 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.scn-helper-drawer .lab-assist h3 { font: 800 1.25rem/1.2 var(--display); letter-spacing: -0.02em; }
.scn-helper-drawer .lab-assist :is(input:not([type=checkbox]), textarea, select) { border: var(--ol) solid var(--control-edge); border-radius: var(--r); color: var(--text); background: var(--surface); font-weight: 600; }
.scn-helper-drawer .lab-assist input[type=checkbox] { accent-color: var(--text); }
.scn-helper-drawer .lab-assist button { border: var(--ol) solid var(--control-edge); border-radius: var(--pill); color: var(--text); background: var(--surface); box-shadow: var(--pop-sm) var(--pop-sm) 0 var(--edge); font-weight: 800; }
.scn-helper-drawer .lab-assist button:hover:not(:disabled) { border-color: var(--control-edge); }
.scn-helper-drawer .lab-assist [type=submit], .scn-helper-drawer .lab-assist button[type=submit]:is(:hover, :focus-visible):not(:disabled) { border-color: var(--edge); color: var(--text); background: var(--surface); }
.scn-helper-drawer .lab-assist button:disabled { border-style: dashed; color: var(--text-dim); box-shadow: none; opacity: 1; }
.scn-helper-drawer .lab-assist :is(details, article) { border-color: var(--divider); }
.scn-helper-drawer .lab-assist :is(.la-status, .la-confirm) { border-color: var(--control-edge); }
.scn-helper-drawer :is(.lab-assist, .lab-workspace) :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.scn-helper-drawer .lab-workspace { --lw-blue: var(--text-dim); --lw-ink: var(--text); --lw-bg: var(--surface); border-color: var(--control-edge); border-top-color: var(--control-edge); border-radius: var(--r-lg); font-family: var(--display); }
.scn-helper-drawer .lab-workspace :is(input, textarea, select) { border: var(--ol) solid var(--control-edge); border-radius: var(--r); color: var(--text); background: var(--surface); }
.scn-helper-drawer .lab-workspace :is(button, .lw-link) { border: var(--ol) solid var(--control-edge); border-radius: var(--pill); color: var(--text); background: var(--surface); box-shadow: var(--pop-sm) var(--pop-sm) 0 var(--edge); font-family: var(--display); font-weight: 800; }
.scn-helper-drawer .lab-workspace :is([data-lw-review], [data-lw-active]) { border-left-color: var(--picked); background: var(--bg); }
.scn-helper-drawer .lab-workspace [data-lw-status] { color: var(--text-dim); }
.scn-helper-drawer .lab-workspace :is(details, article, .lw-result-grid article, [data-lw-note-options] label) { border-color: var(--divider); background: transparent; }
.scn-helper-drawer .lab-workspace :is(small, .lw-result-grid dt) { color: var(--text-dim); }
.scn-helper-drawer .lab-workspace .lw-result-grid h5 { font-family: var(--display); }

/* A Desk review round: one quiet card above the step; its Send is a quiet sticker (the step keeps the lime). */
.scn-desk-return {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
  width: min(46rem, 100% - 32px); margin: 16px auto 0; padding: 12px 16px;
  border: var(--ol) solid var(--edge); border-radius: var(--r); color: var(--text); background: var(--surface); box-shadow: var(--pop) var(--pop) 0 var(--edge);
}
.scn-desk-return > div:first-child { display: grid; gap: 3px; min-width: 0; flex: 1 1 18rem; }
.scn-desk-return span { color: var(--text-dim); font-size: 0.92rem; overflow-wrap: anywhere; }
.scn-desk-return[data-outcome="rejected"] span, .scn-desk-return[data-outcome="error"] span { color: var(--text); font-weight: 700; }
.scn-desk-return[data-outcome="rejected"], .scn-desk-return[data-outcome="error"] { border-color: var(--danger); }
.scn-desk-return .actions { display: flex; gap: 10px; }
.scn-desk-return button {
  min-height: 44px; padding: 0 16px; border: var(--ol-thin) solid var(--control-edge); border-radius: var(--pill);
  color: var(--text); background: var(--surface); box-shadow: var(--pop-sm) var(--pop-sm) 0 var(--edge); font: 800 0.95rem/1 var(--display); cursor: pointer;
}
.scn-desk-return button:disabled { border-style: dashed; color: var(--text-dim); box-shadow: none; cursor: progress; }

/* The Lab's course bar (course-handoff.css draws it in an older look): the Lab's card, its "i" and its way back. */
.scn .course-task-guide {
  margin: 0 0 22px; padding: 4px 8px 4px 16px;
  border: var(--ol) solid var(--edge); border-radius: var(--r); color: var(--text); background: var(--surface);
  box-shadow: var(--pop) var(--pop) 0 var(--edge); font: 500 0.95rem/1.45 var(--display);
}
.scn .course-task-guide__heading { background: transparent; }
.scn .course-task-guide__line strong { color: var(--text); font-weight: 800; }
.scn .course-task-guide__title, .scn .course-task-guide--lab .course-task-guide__line .course-task-guide__title { color: var(--text-dim); font-weight: 600; }
.scn .course-task-guide__back {
  min-height: 44px; padding: 0 0.6rem; border: 0; color: var(--text); background: transparent; box-shadow: none;
  font: 700 0.95rem/1.2 var(--display); text-decoration: none;
}
.scn .course-task-guide__back:hover { transform: none; box-shadow: none; text-decoration: underline 3px var(--link-line); text-underline-offset: 0.3em; background: transparent; }
.scn .course-task-guide__back:focus-visible, .scn .course-task-guide__more:focus-visible, .scn .course-task-guide__toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; background: transparent; }
.scn .course-task-guide__more { color: var(--text); }
.scn .course-task-guide__more > span {
  width: 32px; height: 32px; border: var(--ol-thin) solid var(--control-edge); color: var(--text); background: var(--surface);
  box-shadow: var(--pop-sm) var(--pop-sm) 0 var(--edge); font: 800 1rem/1 var(--display); font-style: normal;
}
.scn .course-task-guide__more[aria-expanded="true"] > span { border-color: var(--edge); color: var(--on-picked); background: var(--picked); }
.scn .course-task-guide__body, .scn .course-task-guide--lab .course-task-guide__body { border-top: var(--ol-thin) solid var(--divider); color: var(--text); }
.scn :is(.course-task-guide__detail, .course-task-guide__count, .course-task-guide__audience, .course-task-guide__label) { color: var(--text-dim); font-size: 0.9rem; }
.scn :is(.course-task-guide__testing, .course-task-guide__note, .course-task-guide--lab .course-task-guide__note, .course-task-guide__notes label) { color: var(--text); font-size: 0.95rem; }
.scn .course-task-guide__status { color: var(--text); font-weight: 700; }
.scn .course-task-guide__notes summary, .scn .course-task-guide__toggle { color: var(--text); background: transparent; border-color: var(--control-edge); }
.scn .course-task-guide textarea {
  border: var(--ol-thin) solid var(--control-edge); border-radius: var(--r); color: var(--text); background: var(--bg); font: 600 0.95rem/1.4 var(--display);
}
.scn .course-task-guide a:not(.course-task-guide__back) { color: var(--text); }
[data-ui-icon] { color: inherit; }

/* The standalone simulators' names for their colours, read from the Lab's roles: the built-in card example (and a
   shared model's page) wear the Lab's look without a second palette. */
html[data-lab] {
  --brand-1: var(--text-dim); --brand-2: var(--text-dim); --brand-3: var(--text); --brand-4: var(--text); --brand-5: var(--text); --brand-core: var(--text);
  --brand-accent: var(--text); --brand-accent-hover: var(--text); --brand-accent-solid: var(--surface); --brand-accent-solid-hover: var(--surface);
  --brand-on-accent: var(--text); --brand-accent-soft: transparent; --brand-accent-border: var(--control-edge);
  --ok: var(--text); --ok-soft: transparent; --danger-soft: transparent;
  --font-brand: var(--display); --radius-brand-sm: var(--r); --radius-brand-md: var(--r);
  --focus-ring-color: var(--focus); --sim-accent: var(--text);
}
html[data-lab] .sim-root, html[data-lab] .scn-legacy {
  --sim-bg-page: var(--surface); --sim-bg-card: var(--bg); --sim-bg-input: var(--surface);
  --sim-text-primary: var(--text); --sim-text-secondary: var(--text); --sim-text-muted: var(--text-dim); --sim-text-legend: var(--text-dim);
  --sim-border: var(--control-edge); --sim-grid: var(--divider); --sim-chart-bg: var(--surface);
  --sim-marker-bg: var(--surface); --sim-marker-border: var(--control-edge); --sim-marker-line: var(--text);
  --sim-shadow: transparent; --sim-tick-text: var(--text-dim); --sim-pointer-active: var(--text); --sim-pointer-inactive: var(--text-dim);
}
html[data-lab] .scn-legacy, html[data-lab] .sim-root { color: var(--text); font-family: var(--display); }
html[data-lab] .scn-legacy :is(h1, h2, h3, h4, h5, p, li, td, th, label, span, div, b, text) { font-family: var(--display); }
html[data-lab] .scn-legacy :is(code, pre, .slidertext) { font-family: var(--mono); }
html[data-lab] :is(.scn-legacy, .sim-root) .btn { min-height: 44px; border: var(--ol-thin) solid var(--control-edge); border-radius: var(--pill); color: var(--text); background: var(--surface); box-shadow: var(--pop-sm) var(--pop-sm) 0 var(--edge); font: 800 0.9rem/1 var(--display); }
html[data-lab] :is(.scn-legacy, .sim-root) :is(.btn-primary, .btn-accent) { border-color: var(--control-edge); color: var(--text); background: var(--surface); }
html[data-lab] :is(.scn-legacy, .sim-root) .chip { border: var(--ol-thin) solid var(--control-edge); color: var(--text); background: var(--surface); box-shadow: none; font-family: var(--display); }
html[data-lab] .banner { border: var(--ol-thin) solid var(--control-edge); border-radius: var(--r); color: var(--text); background: var(--surface); font-family: var(--display); }
html[data-lab] .banner-error { border-color: var(--danger); }
html[data-lab] .scn-legacy select { min-height: 44px; padding: 0 12px; border: var(--ol-thin) solid var(--control-edge); border-radius: var(--r); color: var(--text); background: var(--surface); font: 700 0.95rem/1 var(--display); }
html[data-lab] .scn-legacy .scn-note { margin: 0 16px; border: 0; padding: 4px 0; }
html[data-lab] .scn-legacy a { color: var(--text); text-decoration: underline 3px var(--link-line); text-underline-offset: 0.3em; }

/* A phone: the steps keep their numbers and their short names; pairs stack; nothing runs off the side. */
@media (max-width: 639px) {
  .site-header { min-height: 62px; }
  .scn { padding-top: 16px; }
  .scn-steps { gap: 6px; }
  .scn-steps button { flex-direction: column; justify-content: center; gap: 2px; min-height: 56px; padding: 4px 2px; font-size: 0.8rem; text-align: center; }
  .scn-step-long { display: none; }
  .scn-step-short { display: inline; }
  .scn-row, .scn-event-fields { grid-template-columns: 1fr; }
  .scn-actions { flex-wrap: wrap; }
  .scn-actions .primary-action { flex: 1 1 auto; padding: 0 16px; }
  .scn-actions-end { flex: 1 1 100%; }
  .scn-review > div { flex-wrap: wrap; gap: 4px 12px; }
  .scn-review dt { width: auto; flex-basis: 100%; }
  .scn-choice { min-height: 64px; padding: 12px 14px; gap: 10px; }
  .scn-card { padding: 14px 14px 4px; }
  .scn-run .futures { padding: 12px 10px 10px; }
  .scn-event { gap: 8px; padding: 10px; }
  .scn-range { grid-template-columns: minmax(0, 1fr) 3.5rem; }
  .scn-range > span { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .scn-steps button, .scn-choice, .scn-chip, .scn-switch-track, .scn-switch-knob { transition: none; }
  .scn-steps button, .scn-choice, .scn-chip { transform: none !important; }
}
