/* Tokens — own palette (light + dark), informed by the sibling piece's
   calm, restrained, document-like discipline. Independent values. */
.lab-shell {
  color-scheme: light;
  --surface-1: #fbfbfa;
  --page: #f7f7f5;
  --text-primary: #0c0c0c;
  --text-secondary: #4f4f4c;
  --text-muted: #6d6c67;
  --gridline: #dfded6;
  --baseline: #c1c0b5;
  --border: rgba(12, 12, 12, 0.11);
  --accent: #1f6f4e;
  --accent-ink: #ffffff;
  --btn-bg: #16543a;
  --good: #146b2f;
  --warning-bg: #fbf0d6;
  --warning-ink: #7a5300;
  --serious-bg: #fce3d3;
  --serious-ink: #8a3c10;
  --critical-bg: #f8dcdc;
  --critical-ink: #8a1f1f;
  --card-shadow: 0 1px 2px rgba(12, 12, 12, 0.06), 0 1px 1px rgba(12, 12, 12, 0.04);
  --decision-bg: #eaf3ee;
  --decision-border: #16543a;
  --leadership-informed-bg: #eaf3ee;
  --leadership-informed-border: #16543a;
  --leadership-uninformed-bg: #fbf0d6;
  --leadership-uninformed-border: #8a5300;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .lab-shell {
    color-scheme: dark;
    --surface-1: #1a1a18;
    --page: #0d0d0c;
    --text-primary: #ffffff;
    --text-secondary: #c2c1b8;
    --text-muted: #9b9a92;
    --gridline: #2b2b28;
    --baseline: #38372f;
    --border: rgba(255, 255, 255, 0.11);
    --accent: #4bb583;
    --accent-ink: #05130c;
    --btn-bg: #2f8f61;
    --good: #4bb583;
    --warning-bg: #3a2f10;
    --warning-ink: #fab531;
    --serious-bg: #3a2013;
    --serious-ink: #ec8a5a;
    --critical-bg: #3a1414;
    --critical-ink: #e8a3a3;
    --decision-bg: #12231a;
    --decision-border: #4bb583;
    --leadership-informed-bg: #12231a;
    --leadership-informed-border: #4bb583;
    --leadership-uninformed-bg: #3a2f10;
    --leadership-uninformed-border: #fab531;
  }
}
:root[data-theme="dark"] .lab-shell {
  color-scheme: dark;
  --surface-1: #1a1a18;
  --page: #0d0d0c;
  --text-primary: #ffffff;
  --text-secondary: #c2c1b8;
  --text-muted: #9b9a92;
  --gridline: #2b2b28;
  --baseline: #38372f;
  --border: rgba(255, 255, 255, 0.11);
  --accent: #4bb583;
  --accent-ink: #05130c;
  --btn-bg: #2f8f61;
  --good: #4bb583;
  --warning-bg: #3a2f10;
  --warning-ink: #fab531;
  --serious-bg: #3a2013;
  --serious-ink: #ec8a5a;
  --critical-bg: #3a1414;
  --critical-ink: #e8a3a3;
  --decision-bg: #12231a;
  --decision-border: #4bb583;
  --leadership-informed-bg: #12231a;
  --leadership-informed-border: #4bb583;
  --leadership-uninformed-bg: #3a2f10;
  --leadership-uninformed-border: #fab531;
}

.lab-shell,
.lab-shell * { box-sizing: border-box; }

.lab-shell {
  color: var(--text-primary);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
}

#app {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 16px 64px;
}

@media (max-width: 640px) {
  #app { padding: 16px 12px 48px; }
}

.lab-shell a { color: var(--accent); }

/* ---------------------------------------------------------------------------
   Collision guard. The page imports the site's global.css for the shared
   header/footer, but global's generic component classes (.eyebrow, .btn-primary,
   .btn-secondary) share names with this module AND resolve --accent-ink to #fff
   inside .lab-shell — turning eyebrows white and button-hover backgrounds white.
   Re-assert this module's intended styling, scoped to .lab-shell so it wins on
   specificity regardless of stylesheet load order.
   --------------------------------------------------------------------------- */
.lab-shell .eyebrow { color: var(--text-muted); }
.lab-shell .btn-primary {
  background: var(--btn-bg);
  color: var(--accent-ink);
  border: none;
}
.lab-shell .btn-primary:hover:not(:disabled),
.lab-shell .btn-primary:focus-visible:not(:disabled) {
  background: var(--good);
  color: var(--accent-ink);
}
.lab-shell .btn-secondary {
  background: none;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.lab-shell .btn-secondary:hover,
.lab-shell .btn-secondary:focus-visible {
  background: color-mix(in srgb, var(--decision-bg) 45%, transparent);
  color: var(--text-primary);
  border-color: var(--accent);
}

.eyebrow {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0 0 6px;
}

#app h1 { font-size: 1.6rem; margin: 0 0 12px; scroll-margin-top: 88px; }
#app h2 { font-size: 1.25rem; margin: 0 0 8px; }

.role-intro {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  margin-bottom: 20px;
  box-shadow: var(--card-shadow);
}
.role-intro p { margin: 0; font-size: 1.02rem; }

section.block { margin-bottom: 28px; }

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 0 0 10px;
}

/* Cards (evidence / expandable panels) */
.card-list { display: flex; flex-direction: column; gap: 10px; }

.card {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.card-toggle {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font: inherit;
  color: inherit;
}

.card-toggle:focus-visible,
#app button:focus-visible,
#app input:focus-visible,
#app textarea:focus-visible,
#app select:focus-visible,
#app [tabindex]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.card-toggle-title { display: flex; flex-direction: column; gap: 3px; }
.card-toggle-title strong { font-size: 1rem; }

.tier-tag {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
}

.chevron { flex-shrink: 0; transition: transform 0.15s ease; color: var(--text-muted); }
.card[data-open="true"] .chevron { transform: rotate(180deg); }

.card-body { padding: 0 16px 16px; color: var(--text-secondary); font-size: 0.96rem; }
.card-body[hidden] { display: none; }

.inspected-mark { font-size: 0.72rem; color: var(--good); font-weight: 600; }

/* Stat tiles (Live Telemetry) */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (max-width: 520px) { .stat-grid { grid-template-columns: 1fr; } }

.stat-tile { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--card-shadow); padding: 14px 16px; }
.stat-tile .card-toggle { padding: 0; margin-bottom: 6px; }

.stat-values { display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; margin: 4px 0 6px; }
.stat-start { color: var(--text-muted); font-size: 0.92rem; }
.stat-arrow { color: var(--text-muted); }
.stat-now { font-size: 1.25rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.status-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 0.76rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.status-warning { background: var(--warning-bg); color: var(--warning-ink); }
.status-serious { background: var(--serious-bg); color: var(--serious-ink); }
.status-critical { background: var(--critical-bg); color: var(--critical-ink); }

.stat-body { margin-top: 8px; color: var(--text-secondary); font-size: 0.92rem; }

.countdown-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin: 0 0 10px;
}

/* Operational Stream — rows, never a chat/messenger UI */
.stream-list { display: flex; flex-direction: column; gap: 8px; }

.stream-row {
  background: var(--surface-1);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 10px 12px;
  box-shadow: var(--card-shadow);
}

.stream-row-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 3px;
}

.stream-role { font-weight: 700; font-size: 0.85rem; }
.stream-time { font-size: 0.76rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.stream-text { margin: 0; color: var(--text-secondary); }

.stream-row-enter { animation: streamEnter 280ms ease-out; }
@keyframes streamEnter {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .stream-row-enter { animation: none; }
}

.investigate-response { border-left-color: var(--good); }

/* Decision options */
.options-list { display: flex; flex-direction: column; gap: 10px; }

.option {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface-1);
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.option[aria-pressed="true"] { border-color: var(--accent); }
.option strong { display: block; margin-bottom: 4px; }
.option p { margin: 0; color: var(--text-secondary); font-size: 0.94rem; }

.option-limitation-note {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  background: var(--surface-1);
  border-left: 3px solid var(--text-muted);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 0 0 14px;
}

.confirm-row { margin-top: 16px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.intro-actions { justify-content: flex-start; }

.btn-primary { background: var(--btn-bg); color: var(--accent-ink); border: none; border-radius: 8px; padding: 12px 22px; font-size: 1rem; font-weight: 600; cursor: pointer; }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary { background: none; color: var(--text-secondary); border: 1px solid var(--border); border-radius: 8px; padding: 12px 20px; font-size: 1rem; font-weight: 600; cursor: pointer; }

/* Debrief / Retrospective */
.debrief-section { border-top: 1px solid var(--gridline); padding-top: 16px; margin-top: 16px; }
.debrief-section:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }

.risk-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
@media (max-width: 560px) { .risk-pair { grid-template-columns: 1fr; } }

.risk-card { border-radius: 8px; padding: 10px 12px; font-size: 0.92rem; border: 1px solid var(--border); }
.risk-card .label { font-size: 0.72rem; text-transform: uppercase; font-weight: 700; color: var(--text-muted); margin-bottom: 4px; }

footer.secondary-link { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--gridline); font-size: 0.85rem; color: var(--text-muted); }

.trust-statement, .capability-statement, .lifecycle-map {
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 8px 0 20px;
  font-size: 0.95rem;
}

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Author masthead */
.masthead { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 1px solid var(--gridline); }
.masthead-name { font-weight: 700; font-size: 0.95rem; }
.masthead-role { font-size: 0.85rem; color: var(--text-muted); }

/* Stepper: The Commitment -> The Gate -> The Launch -> Retrospective */
.stepper { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 0.8rem; color: var(--text-muted); margin-bottom: 20px; }
.step-current { color: var(--text-primary); font-weight: 700; }
.step-sep { color: var(--text-muted); }

/* Intro */
.positioning { font-size: 1.1rem; font-weight: 600; margin: 0 0 8px; }

.thesis-block {
  background: var(--decision-bg);
  border: 2px solid var(--decision-border);
  border-radius: 10px;
  padding: 14px 16px;
  margin: 14px 0;
}
.thesis-line { margin: 0 0 8px; font-weight: 600; }
.thesis-line:last-child { margin-bottom: 0; }
.thesis-secondary { font-weight: 500; color: var(--text-secondary); }
.thesis-block-closing { margin-top: 6px; }

.causal-explanation {
  background: var(--surface-1);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 12px 14px;
  margin: 4px 0 20px;
  font-size: 0.96rem;
  color: var(--text-secondary);
}

.locked-choice-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 700; margin: 0 0 6px; }

.locked-choice-card { background: var(--surface-1); border: 2px solid var(--accent); border-radius: 10px; padding: 14px 16px; }
.locked-choice-card strong { display: block; margin-bottom: 4px; }
.locked-choice-card p { margin: 0; color: var(--text-secondary); font-size: 0.94rem; }

/* Author approach */
.approach-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (max-width: 560px) { .approach-grid { grid-template-columns: 1fr; } }

.approach-item { background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; }
.approach-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-weight: 700; margin-bottom: 4px; }
.approach-text { font-size: 0.92rem; color: var(--text-secondary); }

.author-default { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; }
.author-default-caption { font-size: 0.78rem; color: var(--text-muted); font-style: italic; margin: 0 0 8px; }
.author-default-statement { font-weight: 600; margin: 0 0 10px; }
.author-default p { font-size: 0.92rem; color: var(--text-secondary); margin: 0 0 8px; }
.author-default p:last-child { margin-bottom: 0; }
.author-default-statement-ref { font-style: italic; color: var(--text-secondary); font-weight: 400; }

/* Decision brief */
.brief-grid { display: flex; flex-direction: column; gap: 8px; }
.brief-row { display: grid; grid-template-columns: 150px 1fr; gap: 10px; font-size: 0.92rem; border-bottom: 1px solid var(--gridline); padding-bottom: 8px; }
.brief-row:last-child { border-bottom: none; padding-bottom: 0; }
.brief-label { font-weight: 700; color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; }
.brief-text { color: var(--text-secondary); }
@media (max-width: 560px) { .brief-row { grid-template-columns: 1fr; gap: 2px; } }

.author-summary-caption { font-size: 0.85rem; color: var(--text-muted); font-style: italic; margin: 0 0 12px; }

/* Release Context / Evidence */
.context-notes p { color: var(--text-secondary); margin: 0 0 10px; }
.context-notes p:last-child { margin-bottom: 0; }

.source-limitation { font-size: 0.88rem; color: var(--text-muted); margin: 0; }

/* Diegetic evidence entries — a role speaking, not a schema card */
.evidence-entry { padding: 14px 16px; }
.evidence-entry-muted { opacity: 0.82; }
.evidence-header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.evidence-speaker { font-weight: 700; font-size: 0.92rem; }
.evidence-system-note { font-size: 0.78rem; color: var(--text-muted); }
.evidence-quote { margin: 0; font-size: 1rem; color: var(--text-primary); }
.evidence-quote-pending { color: var(--text-muted); font-style: italic; font-size: 0.94rem; }
.evidence-detail-toggle { padding: 10px 0 0; font-size: 0.85rem; color: var(--text-secondary); font-weight: 600; }
.evidence-detail-body { padding: 0; margin-top: 8px; }

/* The one genuine contradiction — compact, visually adjacent, two lines */
.contradiction-block {
  background: var(--surface-1);
  border: 2px solid var(--critical-ink);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 10px;
}
.contradiction-title { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 700; color: var(--critical-ink); margin: 0 0 8px; }
.contradiction-note { font-size: 0.88rem; color: var(--text-secondary); margin: 8px 0 0; }

/* Reveal: coverage synthesis + first-person reflective read */
.coverage-synthesis { font-size: 0.98rem; color: var(--text-secondary); background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin: 0 0 14px; }

.recommendation-card { background: var(--surface-1); border: 2px solid var(--accent); border-radius: 10px; padding: 16px 18px; }
.recommendation-caption { font-size: 0.78rem; color: var(--text-muted); font-style: italic; margin: 0 0 10px; }
.recommendation-posture { font-size: 1.02rem; margin: 0 0 8px; }
.recommendation-card p { margin: 0 0 10px; }
.recommendation-card p:last-child { margin-bottom: 0; }
.recommendation-subhead { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 700; color: var(--text-muted); margin: 16px 0 8px; }

/* Brief Leadership — shown only after the decision locks */
.brief-rationale { font-size: 0.92rem; color: var(--text-secondary); font-style: italic; margin: 0 0 14px; }

/* Tension Map (The Commitment) */
.tension-map { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.tension-row { display: grid; grid-template-columns: 160px 1fr; gap: 12px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; box-shadow: var(--card-shadow); }
@media (max-width: 560px) { .tension-row { grid-template-columns: 1fr; gap: 4px; } }
.tension-role { font-weight: 700; font-size: 0.9rem; color: var(--text-primary); }
.tension-body p { margin: 0 0 4px; font-size: 0.92rem; color: var(--text-secondary); }
.tension-body p:last-child { margin-bottom: 0; }
.tension-want { color: var(--text-primary); }
.tension-line { font-weight: 700; font-size: 1rem; margin: 4px 0 0; padding: 12px 14px; background: var(--decision-bg); border: 2px solid var(--decision-border); border-radius: 10px; }

.condition-list, .limitation-list { margin: 0; padding-left: 20px; font-size: 0.92rem; color: var(--text-secondary); }
.condition-list li, .limitation-list li { margin-bottom: 6px; }
.condition-list li:last-child, .limitation-list li:last-child { margin-bottom: 0; }

/* Final Accountable Decision */
.decision-help { font-size: 0.9rem; color: var(--text-muted); margin: 0 0 12px; }

.condition-list-input { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.condition-row { display: flex; align-items: flex-start; gap: 10px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; cursor: pointer; font-size: 0.94rem; }
.condition-row input[type="checkbox"] { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; }

.override-reason { width: 100%; font: inherit; color: inherit; background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; margin: 10px 0; resize: vertical; }

.evidence-request-list { display: flex; flex-direction: column; gap: 10px; }
.evidence-request-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.evidence-request-result { background: var(--surface-1); border-left: 3px solid var(--accent); border-radius: 6px; padding: 12px 14px; font-size: 0.92rem; }
.evidence-request-result p { margin: 0 0 6px; }
.evidence-request-result p:last-child { margin-bottom: 0; }

.final-decision-card ul { margin: 6px 0 0; padding-left: 20px; }

.updated-recommendation-block .quoted-comm { margin-top: 10px; color: var(--text-secondary); }

/* Decision Comparison */
.comparison-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 12px; }
@media (max-width: 560px) { .comparison-grid { grid-template-columns: 1fr; } }
.comparison-cell { background: var(--surface-1); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; text-align: center; }
.comparison-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted); font-weight: 700; margin-bottom: 4px; }
.comparison-value { font-weight: 700; font-size: 0.98rem; }
.comparison-relationship { font-size: 0.94rem; color: var(--text-secondary); margin: 0 0 10px; }
.comparison-verdict { font-weight: 700; font-size: 1rem; margin: 0 0 4px; }

.scenario-disclosure { font-size: 0.85rem; color: var(--text-muted); margin: 10px 0 4px; }
.link-back { background: none; border: none; color: var(--text-secondary); font: inherit; font-size: 0.9rem; cursor: pointer; padding: 4px 0; margin-bottom: 16px; text-decoration: underline; }

.decision-panel { margin-top: 24px; background: var(--decision-bg); border: 2px solid var(--decision-border); border-radius: 12px; padding: 20px 20px 4px; }
.decision-panel > .block:last-child, .decision-panel > section.block:last-child { margin-bottom: 12px; }

.divergence-note { font-size: 0.9rem; font-style: italic; color: var(--text-secondary); background: var(--surface-1); border-left: 3px solid var(--text-muted); border-radius: 6px; padding: 10px 12px; margin: 0 0 16px; }

.reference-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.reference-chip { background: var(--surface-1); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: 0.85rem; font-weight: 600; cursor: pointer; color: var(--text-primary); }
.reference-chip[aria-expanded="true"] { border-color: var(--accent); }
.reference-chip-detail { margin-top: 8px; background: var(--surface-1); border-left: 3px solid var(--accent); border-radius: 6px; padding: 10px 12px; font-size: 0.9rem; }
.reference-chip-detail[hidden] { display: none; }
.reference-chip-detail .evidence-quote { font-size: 0.94rem; }

.detail-toggle { margin-top: 8px; font-size: 0.85rem; }
.detail-toggle summary { cursor: pointer; color: var(--text-secondary); font-weight: 600; }
.detail-toggle p { margin: 6px 0 0; color: var(--text-secondary); font-size: 0.9rem; }

.contradiction-compare { margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; font-size: 0.92rem; }
.contradiction-claim-line { margin: 0; color: var(--text-secondary); }

.launch-continuity-caption { font-size: 0.85rem; color: var(--text-muted); margin: 0 0 10px; }
.launch-continuity-block .brief-grid { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; box-shadow: var(--card-shadow); }

.operate-coordination { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--gridline); }
.operate-subheading { font-weight: 700; font-size: 0.92rem; margin: 0 0 8px; }

/* --- Roles reference (Commitment) ----------------------------------------- */
.roles-reference { margin: 0 0 24px; background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 4px 16px 16px; }
.roles-reference summary { cursor: pointer; padding: 12px 0; font-weight: 700; font-size: 0.95rem; }
.roles-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 6px; }
@media (max-width: 560px) { .roles-grid { grid-template-columns: 1fr; } }
.role-card { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: var(--page); }
.role-card strong { display: block; margin-bottom: 6px; }
.role-card p { margin: 0 0 4px; font-size: 0.88rem; color: var(--text-secondary); }
.role-card p:last-child { margin-bottom: 0; }

/* Leadership response */
.leadership-response { border-radius: 8px; padding: 14px 16px; font-size: 0.95rem; border: 2px solid; }
.leadership-informed { background: var(--leadership-informed-bg); border-color: var(--leadership-informed-border); }
.leadership-uninformed { background: var(--leadership-uninformed-bg); border-color: var(--leadership-uninformed-border); }

/* --- Retrospective: causal chain ------------------------------------------- */
.chain-list { list-style: none; margin: 0; padding: 0; position: relative; }
.chain-item { display: flex; gap: 14px; padding: 0 0 18px 0; position: relative; }
.chain-item:last-child { padding-bottom: 0; }
.chain-item::before {
  content: "";
  position: absolute;
  left: 13px;
  top: 28px;
  bottom: 0;
  width: 2px;
  background: var(--gridline);
}
.chain-item:last-child::before { display: none; }
.chain-index {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--decision-bg);
  border: 2px solid var(--decision-border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.chain-body { flex: 1; min-width: 0; padding-top: 3px; }
.chain-label { font-weight: 700; font-size: 0.86rem; margin: 0 0 4px; }
.chain-text { margin: 0; font-size: 0.92rem; color: var(--text-secondary); }

.hidden-fact-list { margin: 0; padding-left: 20px; font-size: 0.9rem; color: var(--text-secondary); }
.hidden-fact-list li { margin-bottom: 6px; }
.hidden-fact-list li:last-child { margin-bottom: 0; }

.author-update-example { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; margin: 14px 0; }

.preview-banner {
  background: var(--warning-bg);
  color: var(--warning-ink);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.9rem;
  margin: 0 0 20px;
}

.share-textarea {
  width: 100%;
  font: inherit;
  font-size: 0.9rem;
  color: var(--text-primary);
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  resize: vertical;
}

/* Three-decision interaction model. */
.scenario-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem 1.5rem;
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-1);
}

.scenario-toolbar p {
  display: grid;
  gap: 0.2rem;
  margin: 0;
}

.scenario-toolbar-label,
.scenario-card-kicker {
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.scenario-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
  padding: 0;
  list-style: none;
}

.scenario-card-item {
  display: flex;
}

.scenario-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 0.75rem;
  width: 100%;
  min-height: 16rem;
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-1);
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.scenario-card:hover,
.scenario-card:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 24px 56px -40px rgba(0, 0, 0, 0.58);
}

.scenario-card:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent);
  outline-offset: 3px;
}

.scenario-card-title {
  font: 600 1.35rem/1.2 Georgia, serif;
  letter-spacing: -0.02em;
}

.scenario-card-description {
  color: var(--text-secondary);
  line-height: 1.55;
}

.scenario-card-action {
  align-self: end;
  color: var(--accent);
  font-weight: 750;
}

.purpose-lead {
  max-width: 58rem;
  color: var(--text-secondary);
  font-size: 1.02rem;
}

.decision-count,
.brief-feedback {
  color: var(--text-secondary);
}

.compact-evidence {
  display: grid;
  gap: 0.75rem;
}

.compact-evidence .evidence-entry {
  border-left: 2px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--surface-1);
}

.consequence-first {
  margin-bottom: 1rem;
}

.coordination-note {
  padding: 0.9rem 1rem;
  border-left: 2px solid var(--accent);
  background: var(--surface-1);
  color: var(--text-secondary);
}

.peer-comparison {
  border-color: color-mix(in srgb, var(--accent) 38%, var(--border));
}

.brief-choice-list {
  display: grid;
  gap: 0.7rem;
}

.brief-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: start;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-1);
  cursor: pointer;
}

.brief-choice:focus-within,
.brief-choice:hover {
  border-color: var(--accent);
}

.brief-choice input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.18rem;
  accent-color: var(--accent);
}

.brief-choice strong,
.brief-choice small {
  display: block;
}

.brief-choice small {
  margin-top: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.87rem;
  line-height: 1.45;
}

.brief-selection-summary {
  display: grid;
  gap: 0.75rem;
  padding-left: 1.25rem;
}

.end-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
}

.end-actions a {
  text-decoration: none;
}

/* Editorial operations revision: visual only; scenario logic and content stay isolated. */
.lab-shell {
  --surface-1: #fbfaf6;
  --page: #f3f1ea;
  --text-primary: #171b18;
  --text-secondary: #3d4842;
  --text-muted: #5c665e;
  --gridline: #d4d0c5;
  --baseline: #a8b2ab;
  --border: rgba(23, 27, 24, 0.15);
  --accent: #08776d;
  --accent-ink: #ffffff;
  --btn-bg: #08776d;
  --card-shadow: 0 1px 0 rgba(23, 27, 24, 0.05), 0 18px 48px -38px rgba(23, 27, 24, 0.45);
  --decision-bg: #d8ebe7;
  --decision-border: #08776d;
  --leadership-informed-bg: #d8ebe7;
  --leadership-informed-border: #08776d;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .lab-shell {
    --surface-1: #18201b;
    --page: #111713;
    --text-primary: #f0f3ed;
    --text-secondary: #c4cec7;
    --text-muted: #91a098;
    --gridline: #344039;
    --baseline: #526159;
    --border: rgba(240, 243, 237, 0.14);
    --accent: #61cbbb;
    --accent-ink: #071612;
    --btn-bg: #61cbbb;
    --card-shadow: 0 22px 52px -38px rgba(0, 0, 0, 0.9);
    --decision-bg: #173b35;
    --decision-border: #61cbbb;
    --leadership-informed-bg: #173b35;
    --leadership-informed-border: #61cbbb;
  }
}

:root[data-theme="light"] .lab-shell {
  --surface-1: #fbfaf6;
  --page: #f3f1ea;
  --text-primary: #171b18;
  --text-secondary: #3d4842;
  --text-muted: #5c665e;
  --gridline: #d4d0c5;
  --baseline: #a8b2ab;
  --border: rgba(23, 27, 24, 0.15);
  --accent: #08776d;
  --accent-ink: #ffffff;
  --btn-bg: #08776d;
  --card-shadow: 0 1px 0 rgba(23, 27, 24, 0.05), 0 18px 48px -38px rgba(23, 27, 24, 0.45);
  --decision-bg: #d8ebe7;
  --decision-border: #08776d;
  --leadership-informed-bg: #d8ebe7;
  --leadership-informed-border: #08776d;
}

:root[data-theme="dark"] .lab-shell {
  --surface-1: #18201b;
  --page: #111713;
  --text-primary: #f0f3ed;
  --text-secondary: #c4cec7;
  --text-muted: #91a098;
  --gridline: #344039;
  --baseline: #526159;
  --border: rgba(240, 243, 237, 0.14);
  --accent: #61cbbb;
  --accent-ink: #071612;
  --btn-bg: #61cbbb;
  --card-shadow: 0 22px 52px -38px rgba(0, 0, 0, 0.9);
  --decision-bg: #173b35;
  --decision-border: #61cbbb;
  --leadership-informed-bg: #173b35;
  --leadership-informed-border: #61cbbb;
}

.lab-shell {
  background:
    radial-gradient(circle at 12% 5%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 30rem),
    var(--page);
  border-radius: 0 0 18px 18px;
}

#app {
  max-width: 860px;
  padding-top: clamp(2rem, 5vw, 4rem);
}

#app > header:first-child,
.role-intro {
  position: relative;
  padding: clamp(1.2rem, 3vw, 2rem);
  border-radius: 14px;
  border-color: color-mix(in srgb, var(--accent) 32%, var(--border));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--decision-bg) 55%, transparent), transparent 55%),
    var(--surface-1);
}

section.block {
  margin-bottom: clamp(2rem, 6vw, 4rem);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--gridline);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.section-title::before {
  content: "";
  width: 1.8rem;
  height: 2px;
  background: var(--accent);
}

.card,
.stat-tile,
.tension-row,
.approach-item,
.author-default,
.trust-statement,
.capability-statement,
.lifecycle-map,
.roles-reference,
.author-update-example,
.launch-continuity-block .brief-grid {
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.card:hover,
.stat-tile:hover,
.tension-row:hover {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
  box-shadow: 0 24px 56px -40px rgba(0, 0, 0, 0.58);
  transform: translateY(-2px);
}

.card-toggle,
.option,
.condition-row,
.reference-chip,
.btn-primary,
.btn-secondary {
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.card-toggle:hover,
.card-toggle:focus-visible {
  background: color-mix(in srgb, var(--decision-bg) 40%, transparent);
}

.option {
  border-radius: 12px;
}

.option:hover,
.option:focus-visible,
.condition-row:hover,
.condition-row:focus-within {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
}

.btn-primary,
.btn-secondary {
  border-radius: 999px;
}

.btn-primary:hover:not(:disabled),
.btn-primary:focus-visible:not(:disabled),
.btn-secondary:hover,
.btn-secondary:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
}

.decision-panel,
.thesis-block,
.tension-line,
.recommendation-card {
  border-radius: 14px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--decision-bg) 72%, transparent), transparent 72%),
    var(--surface-1);
}

.stepper {
  gap: 0;
  padding: 0.7rem 0;
  border-top: 1px solid var(--gridline);
  border-bottom: 1px solid var(--gridline);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.stepper > * {
  margin-right: 0.55rem;
}

.step-current {
  color: var(--accent);
}

.stream-row {
  border-left-width: 2px;
  border-radius: 0 10px 10px 0;
  box-shadow: none;
}

.status-badge,
.reference-chip {
  border-radius: 4px;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

@media (max-width: 42rem) {
  body::before {
    background-size: 100% 6rem, 4rem 100%;
  }

  #app {
    padding-inline: 0.75rem;
  }

  .scenario-picker {
    grid-template-columns: 1fr;
  }

  .scenario-card {
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .stat-tile,
  .tension-row,
  .card-toggle,
  .option,
  .condition-row,
  .reference-chip,
  .btn-primary,
  .btn-secondary,
  .scenario-card {
    transform: none !important;
    transition: none !important;
  }
}
