@charset "UTF-8";

:root {
  --paper: #f2efdf;
  --paper-light: #fbf9ef;
  --ink: #183f35;
  --muted: #646d60;
  --line: #c9cebc;
  --control-line: #78856b;
  --lime: #d4e56a;
  --red: #943a39;
  --wash: #e9edcf;
  --warning: #f4e8dc;
  --font: Arial, Helvetica, sans-serif;
  --scale: 1;
  --shadow: 0 8px 28px #183f3510;
  color-scheme: light;
  font-size: calc(100% * var(--scale));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-block: 1.25rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font); font-size: 1rem; line-height: 1.6; }
button, input, select, textarea { font: inherit; max-width: 100%; color: var(--ink); border-radius: 0; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; min-height: 44px; min-width: 44px; overflow-wrap: anywhere; }
button:disabled { cursor: not-allowed; }
button, summary { touch-action: manipulation; }
a { color: inherit; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
input, select, textarea { min-width: 0; }
summary { cursor: pointer; min-height: 44px; }
:where(button, a, summary, input, textarea, select, [tabindex]):focus-visible { outline: 3px solid var(--red); outline-offset: 4px; }
:where(h1, h2, h3, section, div)[tabindex="-1"]:focus { outline: 3px solid var(--red); outline-offset: 6px; }
:where(h1, h2, h3, section, input, select, textarea, summary, [tabindex]) { scroll-margin-block: 1.5rem; }
.skip-link { position: absolute; left: 14px; top: -120px; z-index: 100; background: var(--ink); color: white; padding: 12px; min-height: 44px; }
.skip-link:focus { top: 10px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* The shell remains quiet; essential status and navigation labels stay readable. */
.topbar { min-height: 104px; padding: 20px 3.2%; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--ink); gap: 24px; }
.brand { text-decoration: none; display: flex; gap: 13px; align-items: center; flex-shrink: 0; font-weight: 900; font-size: .875rem; letter-spacing: .06em; line-height: 1.1; }
.brand-mark { position: relative; display: grid; place-items: center; width: 45px; height: 52px; font-size: 48px; border-right: 1px solid var(--ink); padding-right: 10px; line-height: 1; }
.brand-mark span { position: absolute; right: 7px; top: 15px; background: var(--paper); font-size: 22px; }
.brand-edition { display: block; font-size: .875rem; font-weight: 500; letter-spacing: .04em; margin-top: 7px; }
.header-tools { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; min-width: 0; }
.tool-button { border: 1px solid var(--ink); background: transparent; font-size: .875rem; font-weight: 700; padding: 10px 13px; min-height: 44px; white-space: nowrap; }
.tool-button:hover { background: var(--ink); color: var(--paper); }
.save-status { display: block; flex: 0 1 17rem; max-width: 20rem; font-size: .875rem; line-height: 1.45; color: var(--muted); margin-right: 8px; overflow-wrap: anywhere; }
.save-status::before { content: ''; width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #456d44; margin-right: 7px; }
.save-status.error { color: var(--red); background: var(--warning); border: 1px solid var(--red); padding: 9px 11px; font-weight: 700; }
.save-status.error::before { background: var(--red); }
.workspace { display: grid; grid-template-columns: 260px minmax(0, 1fr); max-width: 1600px; margin: 0 auto; }
.route-panel { padding: 30px 22px 36px 28px; border-right: 1px solid var(--ink); position: sticky; top: 0; align-self: start; max-height: 100vh; max-height: 100dvh; overflow: auto; scrollbar-width: thin; }
.route-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.eyebrow { text-transform: uppercase; letter-spacing: .1em; font-size: .875rem; font-weight: 800; line-height: 1.5; }
.edition-stamp { font-family: monospace; font-size: .875rem; color: var(--red); border: 1px solid var(--red); padding: 4px 6px; text-align: center; line-height: 1.3; }
.route-intro { font-family: Georgia, serif; font-size: 1.15rem; line-height: 1.4; margin: 22px 0 25px; }
.route-chapter { font-size: .875rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 22px 0 7px; }
.route-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; min-height: 44px; text-align: left; background: none; border: 0; padding: 9px 3px; font-size: .875rem; line-height: 1.4; position: relative; }
.route-number { flex: 0 0 28px; width: 28px; height: 28px; border: 1px solid var(--control-line); background: var(--paper); display: grid; place-items: center; font-size: .875rem; font-family: monospace; }
.route-name { padding-top: 3px; min-width: 0; overflow-wrap: anywhere; }
.route-item.current { font-weight: 800; }
.route-item.current .route-number { background: var(--lime); border-color: var(--ink); }
.route-item.done .route-number { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.route-item:disabled { opacity: .6; }
.route-check, .route-complete { font-size: .875rem; }
.route-progress { margin: 24px 0; font-size: .875rem; color: var(--muted); }
progress { display: block; width: 100%; height: 5px; margin-top: 9px; appearance: none; border: 0; background: var(--line); }
progress::-webkit-progress-bar { background: var(--line); }
progress::-webkit-progress-value { background: var(--ink); }
progress::-moz-progress-bar { background: var(--ink); }
.plain-button { border: 0; background: transparent; text-decoration: underline; text-underline-offset: 4px; padding: 9px 0; font-size: .875rem; min-height: 44px; }
.instructor-entry { font-size: .875rem; }
.route-credit { font-size: .875rem; line-height: 1.6; margin-top: 24px; color: var(--muted); }

.main-panel { min-width: 0; padding: 36px clamp(24px, 4.5vw, 72px) 56px; }
.stage-topline { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; border-bottom: 1px solid var(--line); padding-bottom: 14px; margin-bottom: 22px; }
.stage-location { font-family: monospace; font-size: .875rem; letter-spacing: .03em; }
.stage-duration { font-size: .875rem; color: var(--muted); }
.stage-title { font-family: Georgia, 'Times New Roman', serif; font-weight: 400; line-height: 1.07; font-size: clamp(2.35rem, 4.7vw, 4.7rem); letter-spacing: -.045em; margin: 12px 0 24px; max-width: 1000px; text-wrap: balance; overflow-wrap: break-word; }
.intro-stage .stage-title { font-size: clamp(2.8rem, 6vw, 5.4rem); line-height: 1.02; letter-spacing: -.045em; }
.hero-kicker { display: flex; align-items: center; gap: 12px; }
.hero-kicker::before { content: ''; flex: 0 0 26px; width: 26px; height: 8px; background: var(--red); transform: rotate(-12deg); }
.stage-body { max-width: 54rem; font-size: 1rem; line-height: 1.75; overflow-wrap: break-word; }
.stage-body p { margin: 0 0 1.1em; }
.stage-body p:first-child { font-size: 1.08rem; line-height: 1.65; }
.stage-body h2 { font-size: 1.25rem; margin: 26px 0 10px; }
.stage-body h3 { font-size: 1.0625rem; margin: 22px 0 8px; }
.stage-body blockquote { margin: 22px 0; padding: 15px 20px; border-left: 4px solid var(--red); background: var(--paper-light); font-family: Georgia, serif; font-size: 1.2rem; }
.stage-body ul, .stage-body ol { padding-left: 24px; }
.stage-body li { margin: 7px 0; }
.creator-line { font-family: monospace; font-size: .875rem; color: var(--muted); margin: 12px 0 20px; }

/* One conceptual cover; genuine photographs retain their full frames. */
.concept-art { margin: 24px 0; border-block: 1px solid var(--line); background: var(--paper-light); }
.concept-art img { display: block; width: 100%; height: auto; max-height: 300px; object-fit: contain; }
.concept-art figcaption { padding: 12px 14px; font-size: .875rem; line-height: 1.6; color: var(--muted); }
.case-photo { margin: 28px 0; border: 1px solid var(--line); background: var(--paper-light); padding: 8px; }
.case-photo img { display: block; width: 100%; max-height: 410px; object-fit: contain; background: #e4e5d6; }
.photo-placeholder { display: none; min-height: 145px; padding: 28px; text-align: center; border: 1px dashed var(--control-line); font-size: 1rem; }
.photo-placeholder.visible { display: block; }
.case-photo figcaption { font-size: .875rem; line-height: 1.6; padding: 12px 8px 5px; color: var(--muted); overflow-wrap: anywhere; }
.case-photo .photo-caption { display: block; color: var(--ink); margin-bottom: 6px; font-size: 1rem; }
.case-photo figcaption a { display: inline-block; min-height: 44px; padding-block: 9px; vertical-align: middle; }
/* Retain a compact fallback if an older saved page supplies the former banner. */
.hero-art { margin: 24px 0; background: var(--ink); color: var(--paper); padding: 22px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: center; }
.hero-art-label { font-family: monospace; font-size: .875rem; color: var(--lime); }
.hero-art-question { font-family: Georgia, serif; font-size: 1.85rem; line-height: 1.15; margin-top: 10px; }
.hero-route { display: flex; flex-wrap: wrap; justify-content: space-around; gap: 14px; }
.hero-node { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: .875rem; font-family: monospace; }
.hero-node span { height: 32px; width: 32px; border: 1px solid var(--lime); border-radius: 50%; display: grid; place-items: center; color: var(--lime); }

.section-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; margin: 30px 0 16px; gap: 8px 16px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.section-heading h2 { font-size: .875rem; letter-spacing: .1em; text-transform: uppercase; margin: 0; }
.section-heading span { font-size: .875rem; color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.evidence-card { min-width: 0; border: 1px solid var(--ink); background: var(--paper-light); align-self: start; box-shadow: 3px 3px 0 #183f3512; }
.evidence-card summary { list-style: none; padding: 20px; min-height: 124px; position: relative; }
.evidence-card summary::-webkit-details-marker { display: none; }
.card-code { display: block; font-family: monospace; font-size: .875rem; letter-spacing: .03em; color: var(--red); margin-bottom: 12px; padding-right: 24px; }
.card-title { display: block; font-family: Georgia, serif; font-size: 1.4rem; line-height: 1.25; max-width: calc(100% - 24px); }
.card-open-label { display: block; font-size: .875rem; color: var(--muted); margin-top: 12px; }
.card-arrow { position: absolute; right: 17px; top: 18px; font-size: 1.25rem; }
.evidence-card[open] .card-arrow { transform: rotate(90deg); }
.evidence-card[open] summary { background: var(--wash); min-height: auto; border-bottom: 1px solid var(--line); }
.card-body { font-size: 1rem; line-height: 1.7; padding: 20px; overflow-wrap: anywhere; }
.card-body p { margin: 0 0 14px; }
.card-body p:last-child { margin-bottom: 0; }
.card-body h3 { font-size: 1.0625rem; }
.card-body .data, .data-number { font-family: Georgia, serif; font-size: 2.3rem; color: var(--red); line-height: 1.2; }
.card-body .note { font-size: .875rem; color: var(--muted); }
.card-sources { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 14px; margin-top: 16px; border-top: 1px solid var(--line); }
.source-pill { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; max-width: 100%; font-size: .875rem; text-decoration: none; border: 1px solid var(--control-line); padding: 8px 10px; line-height: 1.5; overflow-wrap: anywhere; }
.source-pill:hover { background: var(--ink); color: var(--paper); }
.card-opened summary .card-code::after { content: ' / OPENED'; color: var(--ink); }
.source-boundary { font-size: .875rem; color: var(--muted); line-height: 1.6; margin: 8px 0 0; flex-basis: 100%; }

.task-section { margin-top: 32px; }
.task { background: var(--paper-light); border: 1px solid var(--line); margin: 20px 0; padding: 24px; position: relative; min-width: 0; }
.task-label { font-family: monospace; font-size: .875rem; letter-spacing: .04em; color: var(--red); display: block; margin-bottom: 10px; }
.task-prompt { font-size: 1.0625rem; line-height: 1.5; margin: 0 0 16px; font-weight: 700; }
.task-help { font-size: .875rem; color: var(--muted); margin: -4px 0 16px; line-height: 1.65; }
.task fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.option { display: flex; align-items: flex-start; gap: 12px; padding: 12px 13px; border: 1px solid var(--control-line); margin: 10px 0; cursor: pointer; min-height: 48px; font-size: 1rem; line-height: 1.55; background: var(--paper); }
.option:has(input:checked) { border-color: var(--ink); background: var(--wash); box-shadow: inset 3px 0 0 var(--ink); }
.option input { margin: 3px 0 0; flex-shrink: 0; accent-color: var(--ink); width: 20px; height: 20px; }
.option span { min-width: 0; overflow-wrap: anywhere; }
.task textarea { display: block; resize: vertical; min-height: 160px; width: 100%; padding: 13px 15px; border: 1px solid var(--ink); background: #fffef9; line-height: 1.7; font-size: 1rem; color: var(--ink); }
.task-meta { font-size: .875rem; color: var(--muted); margin-top: 9px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 14px; }
.check-button { font-size: .875rem; font-weight: 700; background: var(--paper-light); border: 1px solid var(--ink); padding: 11px 16px; margin-top: 16px; min-height: 44px; }
.check-button:hover { background: var(--ink); color: var(--paper); }
.task.saved { border-left: 3px solid var(--ink); }
.draft-status { font-size: .875rem; line-height: 1.55; border-left: 3px solid var(--control-line); background: var(--paper); padding: 10px 12px; margin: 12px 0 0; }
.task.saved .draft-status { border-color: var(--ink); background: var(--wash); }
.draft-status.pending, .draft-status.needs-check { border-color: var(--red); }
.task-feedback { background: var(--wash); border-left: 3px solid var(--ink); padding: 14px 16px; font-size: 1rem; line-height: 1.65; margin-top: 16px; }
.task-feedback.retry { background: var(--warning); border-color: var(--red); }
.task-feedback p { margin: 0 0 9px; }
.task-feedback p:last-child { margin-bottom: 0; }
.task-feedback strong { font-weight: 800; }
.task-incomplete { outline: 2px solid var(--red); outline-offset: 3px; }
[aria-invalid="true"] { border-color: var(--red); }
.confidence-wrap { display: flex; gap: 16px; align-items: center; }
.confidence-wrap input { flex: 1 1 auto; width: 100%; accent-color: var(--ink); min-height: 44px; }
.confidence-value { font-family: Georgia, serif; font-size: 2rem; min-width: 4.5rem; text-align: right; }
.confidence-labels { display: flex; justify-content: space-between; gap: 12px; font-size: .875rem; color: var(--muted); }
.chain-slot { display: flex; align-items: center; gap: 12px; margin: 12px 0; }
.chain-slot span { border: 1px solid var(--ink); width: 32px; height: 32px; display: grid; place-items: center; font-family: monospace; font-size: .875rem; flex-shrink: 0; }
.chain-slot select { width: 100%; min-height: 44px; background: var(--paper); border: 1px solid var(--control-line); padding: 11px; font-size: 1rem; color: var(--ink); }
.stage-closing { padding: 20px 0; font-size: 1rem; line-height: 1.75; }
.stage-closing p { margin: 0 0 12px; }
.stage-actions { margin-top: 28px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; padding-top: 22px; border-top: 1px solid var(--ink); }
.next-button { border: 1px solid var(--ink); background: var(--ink); color: var(--paper); padding: 12px 20px; min-height: 48px; font-size: 1rem; font-weight: 700; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.next-button:hover { background: var(--lime); color: var(--ink); }
.next-button .arrow { font-size: 1.3rem; line-height: 1; }
.previous-button { background: none; border: 0; text-decoration: underline; text-underline-offset: 4px; font-size: .875rem; padding: 10px 0; }
.completion-note { font-size: .875rem; color: var(--muted); max-width: 65ch; margin-top: 14px; }
.stage-error { background: var(--warning); color: var(--red); font-size: 1rem; padding: 14px; border: 1px solid var(--red); margin-top: 20px; }
.demo-banner { font-family: monospace; font-size: .875rem; line-height: 1.5; border: 1px solid var(--red); color: var(--red); padding: 12px 14px; margin-bottom: 22px; }

/* Optional references and inquiry support remain in document flow. */
.reference-panel, .task-support, .self-audit, .after-attempt, .inquiry-panel, .mechanism-model, .evidence-matrix, .pause-point { min-width: 0; max-width: 100%; background: var(--paper-light); border: 1px solid var(--line); margin: 20px 0; padding: 18px 20px; font-size: 1rem; line-height: 1.65; overflow-wrap: anywhere; }
.reference-panel, .task-support { background: var(--paper); }
:where(details).reference-panel, :where(details).task-support, :where(details).self-audit, :where(details).after-attempt { padding: 0; }
.reference-panel > summary, .task-support > summary, .self-audit > summary, .after-attempt > summary { padding: 12px 16px; min-height: 48px; font-size: 1rem; font-weight: 700; }
:where(details).reference-panel > :not(summary), :where(details).task-support > :not(summary), :where(details).self-audit > :not(summary), :where(details).after-attempt > :not(summary) { margin-left: 16px; margin-right: 16px; }
:where(details).reference-panel > :last-child, :where(details).task-support > :last-child, :where(details).self-audit > :last-child, :where(details).after-attempt > :last-child { margin-bottom: 16px; }
:where(details).reference-panel > table, :where(details).task-support > table, :where(details).self-audit > table, :where(details).after-attempt > table { width: calc(100% - 32px); }
.reference-panel p, .task-support p, .self-audit p, .after-attempt p, .inquiry-panel p, .mechanism-model p, .evidence-matrix p, .pause-point p { margin: 10px 0 0; }
.reference-panel h2, .reference-panel h3, .inquiry-panel h2, .inquiry-panel h3 { font-size: 1.125rem; margin: 12px 0; }
.reference-panel .card-body { padding: 16px; }
.reference-panel details + details { border-top: 1px solid var(--line); }
.reference-panel details > summary { padding: 12px 0; }
.task-support ul, .self-audit ul, .after-attempt ul { padding-left: 24px; }
.inquiry-panel, .mechanism-model { border-color: var(--ink); }
.inquiry-panel fieldset { min-width: 0; border: 0; padding: 0; margin: 12px 0; }
.inquiry-panel legend { font-weight: 700; }
.inquiry-panel button { border: 1px solid var(--ink); background: var(--ink); color: var(--paper); padding: 10px 14px; font-size: 1rem; }
.inquiry-panel button:hover { background: var(--lime); color: var(--ink); }
.inquiry-panel button:disabled { background: var(--paper); color: var(--muted); border-color: var(--control-line); }
.inquiry-status { font-size: .875rem; line-height: 1.55; margin: 12px 0; border-left: 3px solid var(--red); padding: 10px 12px; background: var(--paper); }
.requirements-summary, #stage-requirements { font-size: .875rem; line-height: 1.6; margin: 22px 0 16px; padding: 14px 16px; background: var(--paper-light); border: 1px solid var(--line); }
.requirements-status { font-size: .875rem; margin: 0; }
.requirements-summary ul, #stage-requirements ul { padding-left: 22px; margin: 8px 0 0; }
.pause-point { border-left: 4px solid var(--ink); background: var(--wash); }
.mechanism-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; list-style: decimal; padding-left: 24px !important; margin: 18px 0 0; }
.mechanism-steps > li { position: relative; min-width: 0; border-top: 2px solid var(--ink); padding: 12px 0 0; font-size: 1rem; line-height: 1.6; margin: 0; }
.mechanism-steps > li + li { border-top-style: dashed; }
#persistence-alert, .persistence-alert { border: 1px solid var(--red); border-left-width: 4px; background: var(--warning); padding: 16px; margin: 0 0 24px; font-size: 1rem; line-height: 1.6; overflow-wrap: anywhere; }
#persistence-alert:empty, .persistence-alert:empty { display: none; }
.persistence-message { margin: 0 0 12px; }
#persistence-alert button, .persistence-alert button { min-height: 44px; border: 1px solid var(--ink); background: var(--paper-light); color: var(--ink); padding: 10px 13px; margin: 4px 8px 4px 0; font-size: .875rem; }
#persistence-alert button:hover, .persistence-alert button:hover { background: var(--ink); color: var(--paper); }
.migration-notice { background: var(--wash); border-left: 3px solid var(--ink); margin: 18px 0; padding: 14px 16px; font-size: .875rem; line-height: 1.6; }
.migration-notice p { margin: 0; }

/* Exact data stays semantic; only genuinely wide tables scroll locally. */
.stage-body table, .card-body table, .reference-panel table, .report-stage table, .data-table, .skills-table { border-collapse: collapse; width: 100%; table-layout: fixed; font-size: 1rem; margin: 18px 0; }
:where(.stage-body, .card-body, .reference-panel, .report-stage) :is(th, td), .data-table th, .data-table td, .skills-table th, .skills-table td { padding: 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
:where(.stage-body, .card-body, .reference-panel, .report-stage) thead th, .data-table thead th, .skills-table thead th { background: var(--ink); color: var(--paper); }
:where(.stage-body, .card-body, .reference-panel, .report-stage) tbody th, .data-table tbody th { background: var(--paper); color: var(--ink); font-weight: 700; }
caption { caption-side: top; text-align: left; font-size: .875rem; font-weight: 700; line-height: 1.6; color: var(--ink); padding-bottom: 10px; }
.table-wrap, .body-table-wrap, .data-table-wrap { display: block; max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; margin: 18px 0; padding: 2px 2px 10px; }
.table-wrap > table, .body-table-wrap > table, .data-table-wrap > table { margin: 0; }
.table-wrap .outcome-ledger, .table-wrap table.evidence-matrix { min-width: 34rem; }
.outcome-ledger th:first-child { width: 26%; }
.outcome-ledger th:nth-child(2) { width: 24%; }
.data-chart { border-block: 1px solid var(--line); padding: 16px 0; margin: 18px 0; font-size: 1rem; }
.data-chart > div:not(.chart-scale):not(.chart-axis) { display: grid; grid-template-columns: minmax(3rem, auto) minmax(0, 1fr) minmax(3.5rem, auto); align-items: center; gap: 10px; margin: 12px 0; }
.data-chart strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-chart meter { display: block; width: 100%; min-width: 0; height: 1.4rem; appearance: none; -webkit-appearance: none; background: var(--paper); border: 1px solid var(--control-line); border-radius: 0; }
.data-chart meter::-webkit-meter-bar { background: var(--paper); border: 0; border-radius: 0; box-shadow: none; }
.data-chart meter::-webkit-meter-optimum-value { background: var(--ink); border-radius: 0; }
.data-chart meter::-moz-meter-bar { background: var(--ink); border-radius: 0; }
.chart-scale, .chart-axis { font-size: .875rem; line-height: 1.5; color: var(--muted); }
.chart-axis { display: flex; justify-content: space-between; gap: 8px; }

.site-footer { padding: 22px 3.2%; border-top: 1px solid var(--ink); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 22px; font-size: .875rem; letter-spacing: .02em; }
.site-footer button { font-size: .875rem; letter-spacing: 0; }
.loading-state { padding: 36px 0; }
.loading-state h1 { font-family: Georgia, serif; font-weight: 400; font-size: clamp(2.5rem, 7vw, 4rem); letter-spacing: -.04em; line-height: 1.08; }
dialog { width: min(960px, 94vw); max-width: 94vw; max-height: 90vh; max-height: 90dvh; border: 1px solid var(--ink); background: var(--paper-light); color: var(--ink); padding: 0; box-shadow: 0 20px 100px #0005; overflow: auto; overscroll-behavior: contain; scroll-padding-block: 8rem 1.5rem; }
dialog::backdrop { background: #10271bd0; backdrop-filter: blur(3px); }
.modal-head { padding: 20px 26px; border-bottom: 1px solid var(--ink); display: flex; justify-content: space-between; gap: 16px; align-items: center; position: sticky; top: 0; background: var(--paper-light); z-index: 2; }
.modal-head h2 { font-family: Georgia, serif; font-size: 1.7rem; font-weight: 400; line-height: 1.2; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.close-modal { border: 1px solid var(--ink); background: transparent; font-size: 1.6rem; width: 44px; height: 44px; min-width: 44px; padding: 0; line-height: 1; flex-shrink: 0; }
#modal-body { padding: 24px 26px; min-width: 0; overflow-wrap: anywhere; }
#modal-body :where(input, select, textarea, summary, button, [tabindex]) { scroll-margin-block-start: 8rem; }
.modal-copy { font-size: 1rem; line-height: 1.75; }
.modal-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 18px 0; }
.modal-buttons button, .modal-button { background: var(--ink); color: var(--paper); border: 1px solid var(--ink); padding: 11px 16px; font-size: .875rem; min-height: 44px; }
.modal-button.secondary { background: transparent; color: var(--ink); }
.modal-control { display: block; min-height: 44px; padding-block: 8px; margin: 14px 0; font-size: 1rem; }
.modal-control select, .modal-control input[type="password"], .modal-control input[type="text"] { display: block; width: 100%; min-height: 44px; padding: 10px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); margin-top: 7px; font-size: 1rem; }
.modal-control input[type="checkbox"] { accent-color: var(--ink); width: 20px; height: 20px; margin: 0 9px 0 0; vertical-align: middle; }
.file-control { display: block; max-width: 100%; border: 1px dashed var(--ink); padding: 16px; font-size: 1rem; margin: 22px 0; }
.file-control input { width: 100%; min-height: 44px; margin-top: 12px; font-size: 1rem; }
.file-control input::file-selector-button { font: inherit; min-height: 44px; padding: 9px 12px; margin-right: 10px; background: var(--paper); color: var(--ink); border: 1px solid var(--ink); border-radius: 0; }
.modal-notice { font-size: 1rem; background: var(--wash); padding: 14px; margin: 16px 0; }
.modal-notice.error { background: var(--warning); color: var(--red); }
.source-entry { font-size: 1rem; border-top: 1px solid var(--line); padding: 16px 0; overflow-wrap: anywhere; }
.source-entry p { margin: 5px 0; }
.source-id { font-family: monospace; font-size: .875rem; color: var(--red); }
.source-url { font-size: .875rem; color: var(--muted); }
.report-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 22px; }
.report-toolbar label { font-size: .875rem; flex: 1 1 14rem; min-width: 0; }
.report-toolbar select { padding: 10px; min-height: 44px; width: 100%; max-width: 100%; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); display: block; margin-top: 6px; font-size: 1rem; }
.report-title { font-family: Georgia, serif; font-size: 1.9rem; font-weight: 400; line-height: 1.2; }
.report-meta { font-size: .875rem; color: var(--muted); }
.report-stage { margin: 24px 0; border-top: 1px solid var(--line); padding-top: 17px; }
.report-stage h3 { font-family: Georgia, serif; font-size: 1.4rem; line-height: 1.25; }
.report-stage h4 { font-size: 1rem; margin-bottom: 8px; }
.report-stage p, .report-stage li { font-size: 1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.report-stage .report-answer { padding: 12px 14px; background: var(--paper); border-left: 2px solid var(--ink); }
.report-status { font-size: .875rem !important; color: var(--muted); }
.history-answer { border-left-style: dashed !important; }
.skills-table { font-size: .875rem; }
.danger-zone { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 30px; }
.danger-button { border: 1px solid var(--red); color: var(--red); padding: 11px 14px; font-size: .875rem; background: transparent; min-height: 44px; }
#print-root { display: none; }
.contrast { --paper: #fff; --paper-light: #fff; --ink: #001a0e; --muted: #334436; --line: #53684c; --control-line: #53684c; --lime: #dcf965; --red: #871a1a; --wash: #f1f7da; --warning: #fff0e5; }
.font-serif { --font: Georgia, 'Times New Roman', serif; }
.font-mono { --font: 'Courier New', monospace; }
.reduce-motion, .reduce-motion * { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

@media (min-width: 1500px) {
  .workspace { grid-template-columns: 285px minmax(0, 1fr); }
  .route-panel { padding-left: 36px; padding-right: 28px; }
}
@media (max-width: 1100px) {
  .topbar { gap: 18px; }
  .header-tools { max-width: 38rem; }
  .save-status { flex-basis: 100%; max-width: none; margin-right: 0; text-align: right; }
  .workspace { grid-template-columns: 225px minmax(0, 1fr); }
  .route-panel { padding-left: 20px; padding-right: 16px; }
  .main-panel { padding: 30px 26px 44px; }
  .card-grid { grid-template-columns: minmax(0, 1fr); }
  .hero-art { grid-template-columns: minmax(0, 1fr); }
  .hero-route { justify-content: flex-start; gap: 24px; }
}
@media (max-width: 730px) {
  .topbar { padding: 16px 20px; min-height: 0; align-items: flex-start; flex-wrap: wrap; gap: 14px; }
  .brand-mark { width: 39px; height: 48px; font-size: 42px; }
  .brand { gap: 10px; }
  .brand-edition { margin-top: 5px; }
  .header-tools { justify-content: flex-start; gap: 8px; width: 100%; max-width: none; }
  .save-status { flex-basis: 100%; width: 100%; max-width: none; text-align: left; }
  .save-status.error { display: block; }
  .tool-button { font-size: .875rem; padding: 10px 12px; min-height: 44px; }
  .workspace { display: block; }
  .route-panel { position: static; max-height: none; padding: 12px 20px; border-right: 0; border-bottom: 1px solid var(--ink); }
  .route-heading, .route-intro, .route-credit, .instructor-entry { display: none; }
  #route { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; padding: 6px 5px 10px; scroll-padding-inline: 8px; }
  .route-chapter { display: none; }
  .route-item { flex: 0 0 auto; width: auto; min-width: 44px; min-height: 44px; padding: 6px; align-items: center; gap: 8px; border: 1px solid transparent; }
  .route-item.current { background: var(--paper-light); border-color: var(--ink); }
  .route-name { display: none; padding-top: 0; font-size: .875rem; max-width: 13rem; }
  .route-item.current .route-name, .route-item:focus-visible .route-name { display: block; }
  .route-number { width: 30px; height: 30px; flex-basis: 30px; }
  .route-progress { display: grid; grid-template-columns: minmax(0, 1fr) 5rem; align-items: center; gap: 12px; margin: 8px 0 2px; }
  .route-progress progress { margin: 0; }
  .main-panel { padding: 24px 20px 40px; }
  .stage-topline { margin-bottom: 18px; padding-bottom: 12px; }
  .stage-title { font-size: clamp(2rem, 7.5vw, 2.65rem); letter-spacing: -.035em; }
  .intro-stage .stage-title { font-size: clamp(2.6rem, 9vw, 3.4rem); margin-bottom: 22px; }
  .stage-body, .stage-body p:first-child { font-size: 1rem; }
  .section-heading { margin-top: 26px; }
  .evidence-card summary { padding: 18px 16px; min-height: 116px; }
  .card-title { font-size: 1.35rem; }
  .card-body { padding: 18px 16px; }
  .task { padding: 20px 16px; }
  .task textarea { min-height: 180px; padding: 12px; }
  .stage-actions { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: stretch; }
  .stage-actions button { width: 100%; }
  .previous-button { text-align: left; }
  .next-button { padding: 13px 16px; gap: 16px; }
  .concept-art { margin: 20px 0; }
  .concept-art img { max-height: 190px; }
  .concept-art figcaption { padding: 10px 12px; }
  .case-photo { margin: 24px 0; }
  .case-photo figcaption { padding-left: 4px; padding-right: 4px; }
  .hero-art { padding: 20px; }
  .hero-art-question { font-size: 1.6rem; }
  .mechanism-steps { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .reference-panel, .task-support, .self-audit, .after-attempt, .inquiry-panel, .mechanism-model, .evidence-matrix, .pause-point { padding: 16px; }
  :where(details).reference-panel, :where(details).task-support, :where(details).self-audit, :where(details).after-attempt { padding: 0; }
  .table-wrap .outcome-ledger, .table-wrap table.evidence-matrix { min-width: 32rem; }
  :where(.stage-body, .card-body, .reference-panel, .report-stage) :is(th, td), .data-table th, .data-table td, .skills-table th, .skills-table td { padding: 9px 8px; }
  .site-footer { padding: 18px 20px; gap: 10px; }
  .site-footer span:nth-child(2) { display: none; }
  .modal-head { padding: 16px; }
  .modal-head h2 { font-size: 1.5rem; }
  #modal-body { padding: 20px 16px; }
  .report-toolbar button { width: 100%; }
  .modal-buttons button { flex: 1 1 12rem; }
  #persistence-alert button, .persistence-alert button { display: block; width: 100%; margin: 10px 0 0; }
}
@media (max-width: 390px) {
  .topbar, .route-panel { padding-left: 16px; padding-right: 16px; }
  .main-panel { padding-left: 16px; padding-right: 16px; }
  .tool-button { padding: 10px; }
  .route-name { max-width: 11rem; }
  .data-table th, .data-table td { padding: 8px 6px; }
  .file-control { padding: 12px; }
}
@media (forced-colors: active) {
  :where(button, a, summary, input, textarea, select, [tabindex]):focus-visible { outline-color: Highlight; }
  .option:has(input:checked), .route-item.current { outline: 2px solid Highlight; outline-offset: -2px; }
  .route-item.done .route-number, .route-item.current .route-number { border-width: 2px; }
}
@media print {
  @page { margin: 18mm 17mm; }
  :root { font-size: 11pt; }
  body { font: 11pt/1.55 Arial, sans-serif; background: white !important; color: black !important; }
  .topbar, .site-footer, dialog, .skip-link, #announcement, .route-panel { display: none !important; }
  .workspace { display: block !important; }
  .main-panel { padding: 0; }
  #print-root { display: none !important; color: black; background: white; }
  body[data-quest-print="ready"] .workspace { display: none !important; }
  body[data-quest-print="ready"] #print-root { display: block !important; }
  #print-root .report-stage { break-inside: auto; border-color: #bbb; }
  #print-root h1 { font: 27pt/1.1 Georgia, serif; }
  #print-root h2 { font: 19pt/1.15 Georgia, serif; }
  #print-root h3 { font-size: 14pt; break-after: avoid; }
  #print-root h4 { font-size: 11pt; break-after: avoid; }
  #print-root p, #print-root li { font-size: 11pt; white-space: pre-wrap; overflow-wrap: anywhere; }
  #print-root .report-answer { background: white; border-left: 2px solid #555; padding: 6pt 10pt; }
  #print-root .report-meta, #print-root .report-status, #print-root .source-url { font-size: 10.5pt !important; color: #333; }
  #print-root .source-entry { font-size: 10.5pt; break-inside: avoid; }
  #print-root a { color: black; text-decoration: underline; }
  #print-root .demo-banner { color: black; border-color: black; }
  #print-root .report-stage h3 { margin-bottom: 10pt; }
  #print-root .table-wrap, #print-root .body-table-wrap, #print-root .data-table-wrap { overflow: visible; padding: 0; }
  #print-root table, #print-root .outcome-ledger { width: 100%; min-width: 0; font-size: 10.5pt; }
  #print-root th, #print-root td { color: black; background: white; border-color: #999; padding: 5pt; }
  #print-root thead { display: table-header-group; }
  #print-root tr { break-inside: avoid; }
  #print-root caption { color: black; font-size: 10.5pt; }
  #print-root .reference-panel, #print-root .mechanism-model, #print-root .evidence-matrix { color: black; background: white; }
}

/* Vocabulary support works with native hover, keyboard and touch. */
.glossary-term{display:inline;border:0;border-bottom:1px dotted currentColor;border-radius:2px;background:transparent;color:inherit;font:inherit;line-height:inherit;padding:2px 1px;min-height:24px;min-width:24px;cursor:help;text-align:inherit}.glossary-term:hover,.glossary-term:focus-visible{background:#e4edb5;outline:2px solid #183f35;outline-offset:2px}.definition-entry{border-bottom:1px solid #bec8bf;padding:8px 0}.definition-entry h3{text-transform:capitalize}.definition-entry p{font-size:16px;line-height:1.6}
@media(max-width:700px){.header-tools{flex-wrap:wrap}.route-name{display:block!important;font-size:14px}.route-item{min-width:140px}.route-panel nav{overflow-x:auto}}

/* Evidence lookup leaves the investigation and its draft in place. */
.evidence-search input { display: block; width: 100%; min-height: 44px; margin-top: 7px; padding: 10px 12px; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); font-size: max(16px, 1rem); }
.evidence-lookup-results { display: grid; gap: 16px; font-size: max(16px, 1rem); }
.evidence-lookup-results .evidence-card summary { min-height: 44px; padding: 16px; font-size: max(16px, 1rem); }
.evidence-lookup-results .card-code { margin-bottom: 8px; }
.evidence-lookup-results .card-title { font-size: 1.25rem; }
.evidence-lookup-results .card-body { font-size: max(16px, 1rem); }
.task-checklist { margin: 0 0 16px; font-size: max(16px, 1rem); line-height: 1.6; }
.task-checklist p { margin: 0 0 8px; }
.task-checklist ul { margin: 0; padding-left: 24px; }
.task-checklist li + li { margin-top: 6px; }

#quest-use-mode{background:#f8f7ee;color:#183f35;border-bottom:1px solid #183f35;padding:12px clamp(18px,3vw,42px);font:15px/1.5 system-ui,sans-serif}#quest-use-mode .quest-use-row{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}.quest-use-title{font-weight:650}.quest-use-choice{display:flex;border:1px solid #183f35}.quest-use-choice button{font:650 15px/1.4 system-ui,sans-serif;border:0;background:transparent;color:#183f35;padding:11px 20px;cursor:pointer;min-height:44px}.quest-use-choice button+button{border-left:1px solid #183f35}.quest-use-choice button[aria-pressed="true"]{background:#e7e9d0;box-shadow:inset 0 -3px #183f35}.quest-use-choice button:focus-visible{outline:3px solid #b43522;outline-offset:3px}#quest-use-mode p{margin:8px 0 0;font-size:14px;max-width:1000px}@media(max-width:550px){#quest-use-mode .quest-use-row{display:block}.quest-use-choice{margin-top:10px;width:max-content;max-width:100%}.quest-use-choice button{padding:10px 16px}}@media print{#quest-use-mode{display:none!important}}
