:root {
  --paper: #f6f2ed;
  --surface: #fffdfb;
  --plum: #39284c;
  --deep: #2e213d;
  --violet: #654588;
  --pale: #f1eaf7;
  --lavender: #e7dcf0;
  --ink: #302834;
  --muted: #665c6c;
  --quiet: #766979;
  --line: #e4dbe4;
  --control-line: #bba8c4;
  --green: #426850;
  --navy: var(--plum);
  --blue: var(--violet);
  --gutter: clamp(16px, 3.5vw, 50px);
  --serif: Georgia, "Times New Roman", serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --shadow: 0 10px 30px rgba(46, 33, 61, .055);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-synthesis: none;
  color: var(--ink);
  background: var(--paper);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-bottom: 90px; }
body { margin: 0; font-size: 14px; line-height: 1.55; }
button, select, input { font: inherit; }
a { color: var(--violet); text-underline-offset: 3px; }
button, select, input[type="number"] {
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--control-line);
  border-radius: 7px;
  color: var(--plum);
  background: var(--surface);
}
button {
  padding: 9px 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .16s, border-color .16s;
}
button:hover:enabled { border-color: var(--violet); background: var(--pale); }
button:disabled { opacity: .49; cursor: default; }
select, input[type="number"] { padding: 8px 10px; }
input[type="radio"], input[type="range"] { accent-color: var(--violet); }
:where(button, a, select, input, .log-scroll):focus-visible {
  outline: 3px solid #9371b6;
  outline-offset: 3px;
}
.primary {
  border-color: var(--plum);
  background: var(--plum);
  color: #fff;
}
.primary:hover:enabled { background: var(--violet); }
.text-button {
  padding-inline: 4px;
  border-color: transparent;
  background: transparent;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.text-button:hover:enabled { border-color: transparent; }

.site-header {
  background: rgba(255, 253, 251, .83);
  border-bottom: 1px solid var(--line);
}
.site-header-inner, .intro, .scope-bar, .workspace, .page-footer {
  width: calc(100% - var(--gutter) - var(--gutter));
  max-width: 1460px;
  margin-inline: auto;
}
.site-header-inner {
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 23px;
  padding-block: 9px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--plum);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .13em;
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--plum);
  color: #fff;
  font: 21px/1 var(--serif);
}
.brand-divider { color: var(--quiet); font-weight: 400; }
.header-note {
  border-left: 1px solid var(--line);
  padding-left: 22px;
  color: var(--muted);
  font-size: 12px;
}
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 13px; }
.header-actions button { min-height: 36px; font-size: 12px; }
#open-design span { margin-left: 5px; color: var(--violet); }

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, .85fr);
  align-items: center;
  gap: clamp(24px, 5vw, 82px);
  padding-block: 23px 17px;
}
.kicker, .micro, .stage-kicker {
  color: var(--violet);
  font-size: 10px;
  line-height: 1.45;
  font-weight: 750;
  letter-spacing: .125em;
  text-transform: uppercase;
}
.kicker { margin: 0 0 7px; }
.intro-copy .kicker { display: flex; align-items: center; gap: 9px; }
.intro-copy .kicker::before { content: ""; width: 25px; height: 1px; background: var(--violet); }
h1 {
  margin: 0;
  color: var(--deep);
  font: 400 clamp(41px, 5vw, 73px)/.99 var(--serif);
  letter-spacing: -.062em;
}
.subtitle { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.research-question { padding: 3px 0 4px 16px; border-left: 2px solid var(--control-line); }
.research-question .micro { margin: 0 0 6px; }
.intro-note {
  max-width: 25ch;
  margin: 0;
  color: var(--plum);
  font: 400 clamp(21px, 2.45vw, 34px)/1.17 var(--serif);
  letter-spacing: -.025em;
}
.scope-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 251, .62);
  font-size: 12px;
}
.scope-label { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; color: var(--plum); white-space: nowrap; }
.scope-detail { padding: 2px 6px; border-radius: 4px; background: var(--pale); color: var(--plum); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--violet); }

.workspace {
  margin-top: 18px;
  margin-bottom: 74px;
  display: grid;
  grid-template-columns: minmax(0, 1.72fr) minmax(320px, 1fr);
  align-items: start;
  gap: 14px 19px;
}
.run-status {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px 9px;
  color: var(--muted);
  font-size: 12px;
}
.balance-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  padding: 4px 9px;
  border: 1px solid #d5c4e3;
  border-radius: 999px;
  background: var(--pale);
  color: var(--plum);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.balance-pill strong, .balance-pill b { color: var(--violet); }
.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 50px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  border-radius: 11px 11px 0 0;
  background: #fbf7fb;
}
.panel-heading h2 { margin: 0; color: var(--plum); font-size: 14px; font-weight: 700; }
.panel-heading .micro { text-align: right; }
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
  padding-inline: 20px;
  border-bottom: 1px solid var(--line);
}
.steps span {
  padding: 9px 0 8px;
  border-bottom: 2px solid transparent;
  color: var(--quiet);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.steps b { margin-left: 4px; font-size: 11px; font-weight: 650; }
.steps .active { border-color: var(--violet); color: var(--plum); }

.stage { min-height: 480px; padding: clamp(19px, 2.5vw, 32px); }
.stage-kicker { margin: 0 0 7px; }
.stage h2 {
  margin: 0 0 12px;
  color: var(--plum);
  font: 400 clamp(24px, 2.5vw, 34px)/1.12 var(--serif);
  letter-spacing: -.028em;
}
.stage h3 { margin: 0 0 9px; color: var(--plum); font-size: 15px; font-weight: 700; }
.body-note { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.setup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.setup-grid label { display: block; min-width: 0; color: var(--plum); font-size: 12px; font-weight: 650; }
.setup-grid .full { grid-column: 1 / -1; }
.setup-grid select { display: block; width: 100%; margin-top: 5px; font-size: 13px; font-weight: 450; }
.helper, .fine { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.setup-actions, .actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px 12px; margin-top: 17px; }
.setup-actions span, .actions .subtle { color: var(--muted); font-size: 12px; }
.actions .primary { min-width: 105px; margin-left: auto; }
.design-note, .study-note {
  margin: 17px 0 0;
  padding: 11px 12px;
  border-left: 2px solid var(--control-line);
  background: #faf6fa;
  color: var(--muted);
  font-size: 12px;
}
.design-note b, .study-note b, .study-note strong { color: var(--plum); }
.mode-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 152px), 1fr));
  gap: 8px;
  min-inline-size: 0;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
}
.mode-picker legend { margin-bottom: 6px; color: var(--plum); font-size: 12px; font-weight: 700; }
.mode-picker label {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  min-width: 0;
  min-height: 55px;
  padding: 9px 10px;
  border: 1px solid var(--control-line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--plum);
  cursor: pointer;
}
.mode-picker input[type="radio"] { flex: 0 0 auto; margin: 3px 0 0; }
.mode-picker label:hover, .mode-picker label:has(input:checked) { background: var(--pale); border-color: var(--violet); }
.mode-picker label:has(input:focus-visible) { outline: 2px solid #9371b6; outline-offset: 2px; }
.mode-picker label b, .mode-picker label strong { display: block; color: var(--plum); }
.mode-picker label small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.45; }

.story { margin: 0 0 17px; color: var(--ink); font: 18px/1.65 var(--serif); }
.condition-strip { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 15px; }
.tag {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #faf6fa;
  color: var(--plum);
  font-size: 11px;
}
.options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 11px 0 16px;
}
.option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 47px;
  padding: 8px 11px;
  text-align: left;
}
.option .letter {
  flex: 0 0 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 1px solid var(--control-line);
  border-radius: 4px;
  font: 12px/1 var(--mono);
}
.option.selected, .option[aria-pressed="true"] {
  border-color: var(--violet);
  background: var(--pale);
  box-shadow: inset 3px 0 var(--violet);
}
.option.selected .letter, .option[aria-pressed="true"] .letter {
  border-color: var(--violet);
  background: var(--violet);
  color: #fff;
}
.advice-box {
  margin-top: 14px;
  padding: 11px 13px;
  border: 1px solid #d9c9e5;
  border-left: 3px solid var(--violet);
  border-radius: 6px;
  background: var(--pale);
}
.advice-box h3 { margin: 0 0 4px; font-size: 13px; }
.advice-box p { margin: 0; font-size: 13px; }
.advice-box .helper { margin-top: 5px; font-size: 11px; }
.selection-feedback { min-height: 16px; margin: 8px 0 0; color: var(--muted); font-size: 12px; }

.choice-guide {
  margin: 10px 0;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbf7fb;
  color: var(--muted);
  font-size: 12px;
}
.choice-guide strong, .choice-guide b { color: var(--plum); }
.confidence-scale {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 4px;
  min-inline-size: 0;
  margin: 9px 0 14px;
  padding: 0;
  border: 0;
}
.confidence-scale legend { margin-bottom: 7px; color: var(--plum); font-size: 13px; font-weight: 700; }
.confidence-scale label {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 39px;
  padding: 4px 0;
  border: 1px solid var(--control-line);
  border-radius: 6px;
  color: var(--plum);
  background: var(--surface);
  font-size: 11px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}
.confidence-scale input[type="radio"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.confidence-scale label:hover, .confidence-scale label:has(input:checked) { background: var(--pale); border-color: var(--violet); }
.confidence-scale label:has(input:focus-visible) { outline: 2px solid #9371b6; outline-offset: 2px; }
.confidence-scale input[type="number"] { grid-column: 1 / -1; width: min(100%, 110px); }
.confidence-scale input[type="range"] { grid-column: 1 / -1; width: 100%; }
.confidence-scale > p, .confidence-scale > .helper { grid-column: 1 / -1; }
.confidence-anchors {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
}
.trial-progress > span { display: block; }
.design-table { min-width: 560px; }
.design-table th:first-child { width: 19%; overflow-wrap: normal; }
.trial-progress { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
progress.trial-progress, .trial-progress progress {
  display: block;
  width: 100%;
  height: 7px;
  overflow: hidden;
  margin: 6px 0 0;
  border: 0;
  border-radius: 999px;
  background: var(--lavender);
  accent-color: var(--violet);
}
progress.trial-progress::-webkit-progress-bar, .trial-progress progress::-webkit-progress-bar { background: var(--lavender); }
progress.trial-progress::-webkit-progress-value, .trial-progress progress::-webkit-progress-value { background: var(--violet); border-radius: 999px; }
progress.trial-progress::-moz-progress-bar, .trial-progress progress::-moz-progress-bar { background: var(--violet); border-radius: 999px; }
.decision-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}
.decision-rail > * {
  flex: 1 1 106px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbf8fb;
  color: var(--muted);
  font-size: 11px;
}
.decision-rail :is(.active, .current, [aria-current="step"], [data-state="current"]) {
  border-color: var(--violet);
  background: var(--pale);
  color: var(--plum);
}
.group-banner {
  margin: 10px 0 15px;
  padding: 11px 13px;
  border: 1px solid #d9cbe4;
  border-left: 3px solid var(--violet);
  border-radius: 7px;
  background: var(--pale);
  color: var(--plum);
}
.group-banner :is(h3, p) { margin: 0; }
.group-banner p + p { margin-top: 4px; }
.block-break { padding: clamp(15px, 2vw, 24px); border: 1px solid var(--line); border-radius: 9px; background: #faf6fa; }
.block-map { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; margin-block: 12px; }
.block-map > * {
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}
.block-map > :is(h3, h4, .full) { grid-column: 1 / -1; }
.block-map :is(b, strong) { display: block; color: var(--plum); font-size: 12px; }
.block-map :is(.current, .active, [aria-current="true"], [aria-current="step"]) { border-color: var(--violet); background: var(--pale); }
.block-map :is(.done, .completed) { border-color: #b6c7b7; background: #edf4ee; }

.summary dl, .interpretation dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  gap: 6px 12px;
  margin: 12px 0;
  font-size: 12px;
}
.summary dt, .interpretation dt { color: var(--muted); }
.summary dd, .interpretation dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.explanation { color: var(--muted); font-size: 12px; }
.candidate {
  margin: 13px 0;
  padding: 10px 12px;
  border: 1px solid #dbcee7;
  border-radius: 7px;
  background: var(--pale);
  font-size: 12px;
}
.candidate strong { display: block; margin-top: 3px; color: var(--plum); }

.recording { position: sticky; top: 14px; }
.recording .panel-heading { border-color: var(--deep); background: var(--deep); }
.recording .panel-heading h2 { color: #fff; }
.live-label {
  padding: 3px 6px;
  border: 1px solid #aa94b7;
  border-radius: 999px;
  color: #f2e8f7;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: .07em;
  white-space: nowrap;
}
.clock-area { padding: 13px 19px 12px; border-bottom: 1px solid var(--line); background: #faf6fb; }
.clock {
  margin: 3px 0;
  color: var(--plum);
  font: 400 clamp(34px, 4vw, 52px)/1.05 var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.07em;
}
.clock-area p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.log-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 18px; }
.log-heading h3 { margin: 0; color: var(--plum); font-size: 13px; font-weight: 700; }
.log-heading button { min-height: 33px; font-size: 11px; }
.log-scroll { height: 236px; margin: 0 10px 9px; overflow: auto; scrollbar-width: thin; }
.event-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.event-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  text-align: left;
  font-size: 10px;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.event-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.event-table td:first-child { width: 85px; white-space: nowrap; font: 11px/1.6 var(--mono); }
.event-table td strong { color: var(--plum); font-size: 11px; overflow-wrap: anywhere; }
.event-table td small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; }
.event-table tr.latest { background: var(--pale); box-shadow: inset 2px 0 var(--violet); }
.empty-log { max-width: 28ch; margin: 0 auto; padding: 30px 4px; color: var(--quiet); text-align: center; font-size: 12px; }
.interval-card, .marker-card, .interpretation { padding: 12px 18px; border-top: 1px solid var(--line); }
.interval-card { border-radius: 0 0 11px 11px; background: #faf7fb; }
.interval-card h3, .marker-card h3, .interpretation h3 { margin: 0 0 4px; color: var(--plum); font-size: 12px; font-weight: 700; }
.interval-card p, .interpretation p { margin: 0; color: var(--muted); font-size: 12px; }
.interval-card b { color: var(--plum); }
.pause-notice, #storage-warning { padding: 8px 18px; background: #faf1e5; color: #6d4d26; font-size: 11px; }
.pause-notice b { display: block; }
#storage-warning { padding: 10px var(--gutter) 70px; }
.marker-card { background: #fcf8fc; }
.marker-card h3 span { color: var(--muted); font-weight: 500; }
.marker-card > p { margin: 7px 0; color: var(--plum); font: 11px/1.5 var(--mono); overflow-wrap: anywhere; }
.erp-axis { position: relative; height: 34px; margin-top: 29px; border-top: 1px solid var(--control-line); color: var(--muted); font: 10px/1.4 var(--mono); }
.erp-axis .zero, .axis-end { position: absolute; top: -20px; }
.erp-axis .zero { left: 0; }
.axis-end { right: 0; }
.erp-window {
  position: absolute;
  top: -10px;
  left: 37.5%;
  width: 25%;
  border: 1px solid var(--control-line);
  border-radius: 3px;
  background: var(--lavender);
  color: var(--plum);
  text-align: center;
  line-height: 23px;
  font-size: 9px;
  white-space: nowrap;
}
.marker-card .fine { margin: 0; color: var(--muted); font: 11px/1.5 system-ui, sans-serif; }

.probe-display {
  min-height: 200px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #faf6fb;
}
.probe-word { min-height: 55px; color: var(--plum); font: 42px/1.25 var(--serif); text-align: center; }
.probe-word.target { padding-inline: 15px; border-radius: 5px; background: var(--lavender); color: var(--deep); font-weight: 700; }
.probe-status { margin: 12px 0 0; color: var(--muted); font-size: 11px; text-align: center; }
.sequence { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 5px 11px; color: var(--muted); font-size: 12px; }
.sequence b { color: var(--plum); }
.probe-note { margin-top: 12px; color: var(--muted); font-size: 12px; }

.replay-toolbar {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px 11px;
  margin: 10px 0 13px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf7fb;
}
.replay-toolbar .primary { margin-left: 0; }
.replay-toolbar label { display: grid; min-width: 0; gap: 4px; color: var(--plum); font-size: 11px; font-weight: 650; }
.replay-toolbar select { max-width: 100%; }
.replay-table-wrap { max-height: 390px; margin-top: 12px; overflow: auto; border: 1px solid var(--line); border-radius: 7px; }
.replay-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.replay-table th { position: sticky; top: 0; padding: 7px 9px; background: #f6eff8; color: var(--plum); text-align: left; }
.replay-table td { padding: 6px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
.replay-table button { min-height: 30px; padding: 2px 5px; border-color: transparent; background: transparent; text-align: left; font-size: 11px; }
.replay-table tr.inspected { background: var(--pale); }
.event-detail { margin: 12px 0; padding: 12px; border: 1px solid #dbcee7; border-radius: 7px; background: #faf6fa; }
.event-detail h3 { font-size: 13px; }
.event-detail p { margin: 4px 0; font-size: 12px; }
.measure-card { padding: 14px 0; border-top: 1px solid var(--line); }
.measure-card h3 { font-size: 14px; }
.measure-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.measure-item { padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: #fbf7fb; font-size: 12px; }
.measure-item span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.measure-item b { color: var(--plum); font-weight: 650; }

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 8px 18px;
  margin-top: 18px;
  margin-bottom: 80px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.floating-clock {
  position: fixed;
  z-index: 10;
  right: max(12px, var(--gutter));
  bottom: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100vw - 24px);
  padding: 6px 9px;
  border: 1px solid #5b486c;
  border-radius: 8px;
  background: var(--deep);
  color: #fff;
  box-shadow: 0 5px 16px rgba(46, 33, 61, .2);
}
.floating-clock span { color: #e5d8ee; font-size: 8px; letter-spacing: .07em; }
.floating-clock b { display: block; color: #fff; font-size: 9px; font-weight: 650; }
.floating-clock time { font: 16px/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.recovery { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.recovery button { margin-top: 6px; font-size: 12px; }

dialog {
  width: min(480px, calc(100% - 32px));
  max-height: 85vh;
  padding: 22px;
  overflow: auto;
  border: 1px solid var(--control-line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 18px 70px rgba(31, 18, 43, .21);
}
dialog::backdrop { background: rgba(39, 24, 53, .55); }
dialog h2 { margin: 0 0 9px; color: var(--plum); font: 29px/1.13 var(--serif); }
dialog p { color: var(--muted); font-size: 13px; }
#design-dialog { width: min(810px, calc(100% - 32px)); padding: 0; }
.dialog-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px 17px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.dialog-heading h2, .dialog-heading form { margin: 0; }
.dialog-heading .kicker { margin-bottom: 4px; }
#design-content { padding: 15px 20px 20px; }
#design-content h3 { color: var(--plum); }
#design-content table { width: 100%; border-collapse: collapse; font-size: 12px; }
#design-content :is(th, td) { padding: 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
noscript { display: block; padding: 14px var(--gutter); color: var(--plum); }

@media (max-width: 1060px) {
  .workspace { grid-template-columns: minmax(0, 1.4fr) minmax(294px, 1fr); gap: 11px 13px; }
  .header-note { display: none; }
  .panel-heading, .steps { padding-inline: 15px; }
}
@media (max-width: 775px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .recording { position: static; }
  .stage { min-height: 0; }
  .intro { gap: 19px; padding-block: 22px 19px; }
  .intro-note { font-size: 21px; }
  .log-scroll { height: 210px; }
}
@media (max-width: 560px) {
  .site-header-inner { min-height: 58px; flex-wrap: wrap; gap: 6px 9px; }
  .brand { gap: 6px; font-size: 11px; }
  .brand-mark { width: 28px; height: 28px; font-size: 18px; }
  .header-actions { gap: 5px; }
  .header-actions button { padding-inline: 6px; font-size: 11px; }
  #open-design span { display: none; }
  .intro { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .research-question { padding-left: 10px; }
  .intro-note { max-width: none; }
  .workspace { margin-top: 13px; }
  .panel-heading { min-height: 43px; }
  .panel-heading h2 { font-size: 13px; }
  .stage { padding: 16px; }
  .story { font-size: 17px; }
  .confidence-scale { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .confidence-scale label { min-height: 42px; }
  .block-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-footer { flex-direction: column; }
  .dialog-heading, #design-content { padding-inline: 14px; }
}
@media (max-width: 360px) {
  .setup-grid, .options, .measure-grid { grid-template-columns: minmax(0, 1fr); }
  .steps { padding-inline: 11px; }
  .steps b { margin-left: 2px; }
  .actions .primary { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
