:root {
  --graphite: #17232d;
  --graphite-raised: #22313c;
  --paper: #f2f2ee;
  --surface: #fbfbf8;
  --ink: #14202a;
  --muted: #52616d;
  --line: #c8ced1;
  --line-dark: #7d8991;
  --cobalt: #0b56b5;
  --cobalt-dark: #073e83;
  --cobalt-pale: #dbe9f8;
  --amber: #d6a329;
  --amber-pale: #f4e8c6;
  --success: #18704a;
  --warning: #955908;
  --error: #973127;
}

* { box-sizing: border-box; }
html { background: var(--paper); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, select { font: inherit; }
button, a, select, input { -webkit-tap-highlight-color: transparent; }
a { color: var(--cobalt-dark); }
:is(a, button, select, input, summary):focus-visible { outline: 3px solid var(--cobalt-dark); outline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin-top: 0; }
h1, h2, h3 { text-wrap: balance; }
h1 { margin-bottom: .8rem; font-size: 2.6rem; line-height: 1.03; letter-spacing: -.035em; }
h2 { margin-bottom: .65rem; font-size: 1.45rem; line-height: 1.15; letter-spacing: -.025em; }
h3 { font-size: 1rem; }

.utility-header { min-height: 4.5rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: .8rem clamp(1.25rem, 4vw, 4rem); background: var(--graphite); color: white; }
.identity { display: flex; align-items: center; gap: .8rem; color: inherit; text-decoration: none; }
.identity-mark { width: 2.35rem; height: 2.35rem; display: grid; place-items: center; background: var(--cobalt-pale); color: var(--graphite); font-size: 1.15rem; font-weight: 900; }
.identity strong, .identity small { display: block; }
.identity strong { line-height: 1.1; }
.identity small { margin-top: .15rem; color: #bfcbd2; font-size: .75rem; }
.status { flex: 0 0 auto; display: flex; align-items: center; gap: .55rem; margin: 0; color: #d7dfe3; font-size: .76rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }
.status-mark { width: .65rem; height: .65rem; border-radius: 50%; background: var(--warning); }
.status-ready .status-mark { background: #47bd83; }
.status-unavailable .status-mark { border-radius: 2px; background: #f07b70; }

.briefing { width: min(100%, 90rem); margin: auto; padding: 2.5rem clamp(1.25rem, 4vw, 4rem) 5rem; }
.page-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 3rem; padding-bottom: 2rem; border-bottom: 1px solid var(--line-dark); }
.page-header > div > p:last-child { max-width: 64ch; margin-bottom: 0; color: var(--muted); font-size: 1.05rem; }
.context-label { margin-bottom: .45rem; color: var(--cobalt); font-size: .73rem; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.snapshot-meta { display: grid; grid-template-columns: repeat(3, auto); gap: 0; margin: 0; border-top: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark); }
.snapshot-meta div { min-width: 8.5rem; padding: .75rem 1rem; border-left: 1px solid var(--line); }
.snapshot-meta div:last-child { border-right: 1px solid var(--line); }
.snapshot-meta dt { color: var(--muted); font-size: .7rem; font-weight: 750; text-transform: uppercase; }
.snapshot-meta dd { margin: .2rem 0 0; font-size: .86rem; font-weight: 750; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(19rem, .65fr); gap: 1.5rem; padding: 2rem 0 3rem; border-bottom: 1px solid var(--line-dark); }
.scenario-board { min-width: 0; padding: 1.6rem; background: var(--surface); box-shadow: 0 .7rem 1.8rem rgba(20, 32, 42, .09); }
.board-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.4rem; }
.board-heading h2 { margin-bottom: 0; }
.board-heading > p { max-width: 22rem; margin: 0; color: var(--muted); font-size: .82rem; text-align: right; }
.lens-controls { display: grid; grid-template-columns: minmax(9rem, 1fr) minmax(9rem, 1fr) auto auto; align-items: end; gap: .8rem; padding-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.lens label { color: var(--muted); font-size: .76rem; font-weight: 750; }
.lens select { width: 100%; min-height: 2.75rem; margin-top: .35rem; padding: .55rem 2.2rem .55rem .75rem; border: 1px solid var(--line-dark); border-radius: .35rem; background: white; color: var(--ink); }
.lens select:hover { border-color: var(--cobalt); }
.apply, .copy-summary { min-height: 2.75rem; border: 0; border-radius: .35rem; background: var(--cobalt); color: white; font-weight: 800; cursor: pointer; }
.apply { padding: .55rem .9rem; }
.apply:hover, .copy-summary:hover { background: var(--cobalt-dark); }
.reset { min-height: 2.75rem; display: inline-flex; align-items: center; padding: .55rem .4rem; color: var(--muted); font-size: .82rem; font-weight: 750; }
.noscript-note { margin: .8rem 0 0; color: var(--warning); font-size: .82rem; }

.signal-stack { padding: .3rem 0; }
.signal { display: grid; grid-template-columns: minmax(15rem, .72fr) minmax(16rem, 1fr); align-items: center; gap: 2rem; padding: 1.25rem 0; }
.signal + .signal { border-top: 1px solid var(--line); }
.signal-copy > p { margin-bottom: .3rem; color: var(--muted); font-size: .76rem; font-weight: 750; }
.signal-copy strong { display: block; font-size: 2.5rem; font-variant-numeric: tabular-nums; letter-spacing: -.04em; line-height: 1; }
.signal-copy > span { display: block; margin-top: .35rem; color: var(--muted); font-size: .83rem; }
.signal-copy b { color: var(--ink); }
.comparison-track { height: .62rem; overflow: hidden; background: #d8dddf; }
.comparison-track span { height: 100%; display: block; min-width: .35rem; background: var(--cobalt); transition: width 220ms cubic-bezier(.16, 1, .3, 1); }
.signal-resolution .comparison-track span { background: var(--amber); }
.signal-comparison p { margin: .5rem 0 0; color: var(--muted); font-size: .82rem; }
.signal-comparison small { display: block; margin-top: .35rem; color: #6f4c05; font-weight: 700; }
.meeting-question { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 1.25rem; padding: 1rem; background: var(--cobalt-pale); color: #173958; }
.meeting-question > span { font-size: .74rem; font-weight: 850; text-transform: uppercase; }
.meeting-question strong { font-size: .98rem; line-height: 1.4; }

.readiness { min-width: 0; padding: 1.6rem; background: var(--graphite); color: white; box-shadow: .45rem .55rem 0 var(--amber); }
.readiness .context-label { color: #9dc5f1; }
.readiness-heading > p:last-child { margin-bottom: 1.3rem; color: #cbd6dc; font-size: .85rem; }
.readiness fieldset { display: grid; gap: .65rem; margin: 0; padding: 0; border: 0; }
.readiness label { display: grid; grid-template-columns: 1.1rem minmax(0, 1fr); align-items: start; gap: .65rem; padding: .65rem 0; border-top: 1px solid #41515c; color: #e7ecef; font-size: .87rem; cursor: pointer; }
.readiness input { width: 1rem; height: 1rem; margin: .15rem 0 0; accent-color: #8bbcf2; }
.readiness :is(button, input):focus-visible { outline-color: #a8d2ff; }
.readiness-progress { height: .42rem; margin-top: 1.25rem; background: #42515b; }
.readiness-progress span { width: 0; height: 100%; display: block; background: var(--amber); transition: width 220ms cubic-bezier(.16, 1, .3, 1); }
.readiness-state { min-height: 4.3rem; margin: .65rem 0 1rem; color: #cbd6dc; font-size: .83rem; }
.readiness-state strong { display: block; color: white; }
.copy-summary { width: 100%; padding: .55rem .8rem; background: white; color: var(--graphite); }
.copy-summary:hover { background: var(--cobalt-pale); color: var(--graphite); }
.copy-status { min-height: 1.2rem; margin: .5rem 0 0; color: #b9c7ce; font-size: .75rem; text-align: center; }

.intake, .reference { padding: 3rem 0; border-bottom: 1px solid var(--line-dark); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 1.4rem; }
.section-heading h2 { margin-bottom: 0; }
.section-heading > p { max-width: 22rem; margin: 0; color: var(--muted); font-size: .84rem; text-align: right; }
.intake-summary { display: grid; grid-template-columns: .7fr .7fr .8fr 1.8fr; border-top: 1px solid var(--line-dark); border-bottom: 1px solid var(--line-dark); }
.intake-summary p { margin: 0; padding: .75rem 1rem; border-left: 1px solid var(--line); }
.intake-summary p:last-child { border-right: 1px solid var(--line); }
.intake-summary span, .intake-summary strong { display: block; }
.intake-summary span { color: var(--muted); font-size: .7rem; font-weight: 750; text-transform: uppercase; }
.intake-summary strong { margin-top: .15rem; font-size: .94rem; font-variant-numeric: tabular-nums; }
.plot-shell { height: 17rem; display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: .6rem; margin-top: 1.5rem; }
.y-axis { display: flex; flex-direction: column; justify-content: space-between; padding: .1rem 0 1.7rem; color: var(--muted); font-size: .68rem; text-align: right; }
.plot { min-width: 0; position: relative; padding-bottom: 1.7rem; border-bottom: 1px solid var(--line-dark); background: linear-gradient(to bottom, transparent calc(50% - .5px), #d9ddde calc(50% - .5px), #d9ddde calc(50% + .5px), transparent calc(50% + .5px)); }
.bars { height: 100%; display: flex; align-items: end; gap: 2px; margin: 0; padding: 0; list-style: none; }
.bars li { min-width: 2px; flex: 1 1 0; opacity: .22; transition: height 180ms cubic-bezier(.16, 1, .3, 1), opacity 180ms ease-out; }
.bars li span { width: 100%; height: 100%; display: block; background: var(--cobalt); }
.bars li.is-selected { opacity: 1; }
.average-line { position: absolute; z-index: 2; top: calc(100% - 1.7rem - var(--average-height)); right: 0; left: 0; border-top: 2px solid var(--amber); pointer-events: none; }
.average-line b { position: absolute; right: 0; bottom: .2rem; padding: .12rem .3rem; background: var(--paper); color: #704b00; font-size: .68rem; }
.x-axis { position: absolute; right: 0; bottom: 0; left: 0; display: flex; justify-content: space-between; background: var(--paper); color: var(--muted); font-size: .68rem; }
.figure-note { margin: .85rem 0 0 2.8rem; color: var(--muted); font-size: .8rem; }
.legend-swatch { width: .7rem; height: .7rem; display: inline-block; margin-right: .35rem; background: var(--cobalt); vertical-align: -.05rem; }

.reference-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); }
.reference-grid h3 { margin-bottom: .5rem; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: .65rem .55rem; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-size: .73rem; }
td:last-child, th:last-child { text-align: right; }
tbody tr { transition: background-color 150ms ease-out; }
tbody tr.is-selected { background: var(--cobalt-pale); font-weight: 800; }

.evidence-notes { display: grid; grid-template-columns: minmax(13rem, .65fr) minmax(0, 1.35fr); gap: 4rem; padding: 3rem 0 0; }
.evidence-notes h2 { max-width: 18ch; }
.notes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 2rem; }
.notes-grid p { margin: 0; color: var(--muted); font-size: .87rem; }
.notes-grid strong { color: var(--ink); }

.recovery { max-width: 48rem; margin-top: 3rem; padding: 2rem; background: var(--cobalt-pale); }
.recovery h2 { max-width: 25ch; font-size: 2rem; }
.recovery > p { max-width: 65ch; color: #2c4054; }
.retry { min-height: 2.75rem; display: inline-flex; align-items: center; margin: .5rem 0 1.5rem; padding: .5rem 1rem; border-radius: .35rem; background: var(--cobalt); color: white; font-weight: 800; text-decoration: none; }
.retry:hover { background: var(--cobalt-dark); }
details { padding-top: 1rem; border-top: 1px solid #aebfce; }
summary { cursor: pointer; font-weight: 750; }
code { overflow-wrap: anywhere; }
details code { display: block; margin-top: 1rem; padding: 1rem; background: var(--graphite); color: white; white-space: normal; }
.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; }

@media (max-width: 72rem) {
  .page-header { grid-template-columns: 1fr; gap: 1.5rem; }
  .snapshot-meta { width: fit-content; }
  .workspace { grid-template-columns: 1fr; }
  .readiness { display: grid; grid-template-columns: minmax(12rem, .7fr) minmax(18rem, 1fr); gap: 0 2rem; }
  .readiness fieldset { grid-template-columns: 1fr 1fr; }
  .readiness-progress, .readiness-state, .copy-summary, .copy-status { grid-column: 2; }
}

@media (max-width: 48rem) {
  h1 { font-size: 2.1rem; }
  .utility-header { min-height: 4rem; padding: .7rem 1rem; }
  .identity small { display: none; }
  .status { font-size: .67rem; }
  .briefing { padding: 1.5rem 1rem 3rem; }
  .page-header { padding-bottom: 1.5rem; }
  .snapshot-meta { width: 100%; grid-template-columns: 1fr 1fr; }
  .snapshot-meta div { min-width: 0; padding: .6rem .7rem; }
  .snapshot-meta div:nth-child(3) { grid-column: 1 / -1; border-top: 1px solid var(--line); }
  .scenario-board, .readiness { padding: 1.15rem; }
  .board-heading, .section-heading { display: block; }
  .board-heading > p, .section-heading > p { margin-top: .5rem; text-align: left; }
  .lens-controls { grid-template-columns: 1fr 1fr; }
  .apply { width: 100%; }
  .reset { justify-content: center; }
  .signal { grid-template-columns: 1fr; gap: .8rem; }
  .meeting-question { grid-template-columns: 1fr; gap: .35rem; }
  .readiness { display: block; }
  .readiness fieldset { display: grid; grid-template-columns: 1fr; }
  .intake, .reference { padding: 2.4rem 0; }
  .intake-summary { grid-template-columns: 1fr 1fr; }
  .intake-summary p:nth-child(3) { border-top: 1px solid var(--line); }
  .intake-summary p:nth-child(4) { border-top: 1px solid var(--line); }
  .plot-shell { height: 13rem; grid-template-columns: 1.7rem minmax(0, 1fr); }
  .x-axis span:nth-child(2) { display: none; }
  .figure-note { margin-left: 2.3rem; }
  .reference-grid, .evidence-notes, .notes-grid { grid-template-columns: 1fr; }
  .reference-grid { gap: 2.5rem; }
  .evidence-notes { gap: 1rem; }
  .evidence-notes h2 { max-width: none; }
  .recovery { padding: 1.4rem; }
}

@media print {
  .utility-header { background: white; color: var(--ink); border-bottom: 2px solid var(--ink); }
  .identity small, .status { color: var(--ink); }
  .briefing { width: 100%; padding: 1rem 0; }
  .workspace { grid-template-columns: 1fr; }
  .scenario-board, .readiness { box-shadow: none; }
  .readiness { background: white; color: var(--ink); border: 1px solid var(--ink); }
  .readiness-heading > p:last-child, .readiness label, .readiness-state { color: var(--ink); }
  .copy-summary, .copy-status, .apply, .reset { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
