:root {
  color-scheme: light;
  --bg: #f5f3e9;
  --paper: #fffdf6;
  --ink: #202d22;
  --muted: #586357;
  --line: #e3e1d3;
  --forest: #235b44;
  --teal: #25755d;
  --amber: #aa582d;
  --red: #9d4237;
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, select, input { font: inherit; }
button, select { color: var(--ink); }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
a { color: var(--forest); }
:focus-visible { outline: 2px solid #348668; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h2 { font-size: 20px; font-weight: 720; letter-spacing: -.045em; line-height: 1.12; }
h3 { font-size: 16px; letter-spacing: -.025em; line-height: 1.2; }
fieldset { padding: 0; border: 0; margin: 0; min-width: 0; }
legend { padding: 0; }
.shell { width: min(1420px, calc(100% - 80px)); margin-inline: auto; }
.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; }
.site-header { border-bottom: 1px solid #e3e0d2; background: #f9f7ee; }
.header-inner { min-height: 64px; display: flex; align-items: center; gap: 40px; }
.brand { display: inline-flex; text-decoration: none; color: var(--ink); align-items: center; gap: 9px; font-size: 19px; font-weight: 760; letter-spacing: -.065em; }
.brand small { display: block; font-size: 8px; font-weight: 760; letter-spacing: .19em; color: var(--forest); margin-top: -4px; }
.header-inner nav { display: flex; gap: 25px; align-items: center; }
.header-inner nav a { text-decoration: none; color: var(--muted); font-weight: 600; font-size: 12px; }
.header-inner nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
.header-status { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--forest); font-weight: 650; padding: 6px 10px; border: 1px solid #d8e3d6; border-radius: 100px; background: #edf2e7; white-space: nowrap; }
.header-status i, .sensor i, .controller-label i { display: inline-block; border-radius: 50%; width: 6px; height: 6px; background: #52906d; flex: 0 0 auto; }
.intro { padding: 34px 0 30px; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 20px; }
.eyebrow, .section-kicker { font-size: 10px; font-weight: 770; letter-spacing: .12em; color: #4b6653; }
.eyebrow { display: flex; gap: 8px; align-items: center; }
.eyebrow-rule { height: 1px; width: 20px; background: #7d9977; }
.separator { color: #818877; }
.intro h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(36px, 5.1vw, 73px); font-weight: 500; line-height: 1.01; letter-spacing: -.065em; margin: 8px 0 10px; }
.intro p { color: var(--muted); font-size: clamp(13px, 1.2vw, 16px); max-width: 600px; }
.intro-note { min-width: 195px; border-left: 1px solid #d8d7c8; padding: 5px 0 3px 16px; }
.intro-note strong { display: block; font-family: Georgia, serif; font-size: 17px; font-weight: 500; line-height: 1.16; margin: 5px 0; }
.intro-note > span { font-size: 10px; color: var(--muted); }
.experiment { display: grid; grid-template-columns: 247px minmax(0, 1fr); gap: 16px; align-items: stretch; scroll-margin-top: 14px; }
.paper { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: 0 2px 2px #3c40290a; }
.controls { padding: 16px; }
.section-kicker { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.section-index { display: inline-grid; place-items: center; border-radius: 5px; background: #e9eee1; color: #416449; width: 22px; height: 17px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.controls h2 { margin-bottom: 17px; }
.controls legend, .range-control label { font-weight: 710; font-size: 12px; }
.scenario-list { display: grid; gap: 6px; margin-top: 8px; }
.scenario { position: relative; display: block; cursor: pointer; }
.scenario input { position: absolute; top: 50%; left: 11px; transform: translateY(-50%); margin: 0; accent-color: var(--forest); }
.scenario span { display: flex; align-items: center; justify-content: space-between; gap: 4px; font-size: 12px; padding: 7px 9px 7px 32px; min-height: 34px; border: 1px solid var(--line); border-radius: 8px; font-weight: 650; }
.scenario input:checked + span { border-color: #9db99f; background: #edf2e7; color: #234a36; }
.scenario input:focus-visible + span { outline: 2px solid #348668; outline-offset: 2px; }
.scenario small { color: #50725a; font-size: 9px; letter-spacing: .025em; }
.control-hint { color: var(--muted); font-size: 11px; line-height: 1.44; }
#scenario-description { min-height: 45px; margin: 9px 0 10px; }
.range-control { padding: 9px 0 10px; border-top: 1px solid #eeebdf; }
.range-control label { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.range-control output { font-size: 10px; font-weight: 720; color: var(--forest); background: #eaf0e6; border-radius: 4px; padding: 2px 5px; white-space: nowrap; }
input[type=range] { width: 100%; margin: 6px 0 0; accent-color: var(--forest); cursor: pointer; height: 16px; }
.range-ends { display: flex; justify-content: space-between; gap: 3px; color: var(--muted); font-size: 9px; }
.faults { border-top: 1px solid #eeebdf; padding-top: 10px; margin-top: 8px; }
.faults legend { float: left; margin-bottom: 5px; }
.fault-buttons { clear: both; display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 7px; }
.fault-buttons button { background: #f9f5e8; border: 1px solid #e8dec7; border-radius: 6px; padding: 5px 7px; min-height: 30px; font-size: 10px; font-weight: 720; color: #714d30; flex: 1; white-space: nowrap; }
.fault-buttons button:hover:not(:disabled) { background: #f1e5cb; }
.field-card { height: 100%; padding: 15px; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.sensor-list { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.sensor { display: inline-flex; align-items: center; gap: 5px; color: #37543b; font-size: 10px; font-weight: 660; background: #eff3e9; border: 1px solid #e2eadb; border-radius: 100px; padding: 4px 7px; white-space: nowrap; }
.sensor.degraded { background: #f6ecda; border-color: #eddec2; color: #86522e; }
.sensor.degraded i { background: #c4823c; }
.field-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.tile { min-width: 0; border: 1px solid var(--line); border-radius: 11px; background: #f9f7ee; overflow: hidden; }
.tile-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; gap: 6px; min-height: 51px; }
.controller-label { display: flex; gap: 4px; align-items: center; font-size: 8px; font-weight: 780; letter-spacing: .11em; color: var(--forest); margin-bottom: 3px; }
.baseline .controller-label { color: #97502e; }
.baseline .controller-label i { background: #b76a40; }
.mode { padding: 4px 6px; font-size: 9px; font-weight: 800; letter-spacing: .08em; border-radius: 5px; white-space: nowrap; }
.mode.drive { color: #255740; background: #e0ecdf; }
.mode.slow { color: #845316; background: #f6e6c3; }
.mode.stop, .mode.breach { color: #993e32; background: #f8ded8; }
.mode.done { color: #34515d; background: #e0ebec; }
.field-viewport { background: #63734e; overflow: hidden; }
.field-viewport canvas { display: block; width: 100%; height: clamp(245px, 26vw, 340px); }
.tile-data { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 6px 8px; min-height: 42px; }
.tile-data span { min-width: 0; padding-left: 7px; }
.tile-data span + span { border-left: 1px solid #e6e2d4; }
.tile-data small { display: block; font-size: 8px; color: var(--muted); }
.tile-data strong { display: block; font-size: 12px; font-weight: 740; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tile-data strong.negative { color: var(--red); }
.field-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 13px; min-height: 34px; padding: 4px 0; font-size: 10px; color: var(--muted); }
.field-legend > * { display: inline-flex; gap: 4px; align-items: center; }
.field-legend label { cursor: pointer; }
.field-legend input { accent-color: var(--forest); margin: 0 2px 0 0; width: 12px; height: 12px; }
.legend-line { width: 14px; border-top: 1px dashed #777761; }
.legend-trail { width: 13px; border-top: 2px solid #338269; }
.legend-band { width: 12px; height: 7px; background: #cadfc4; border: 1px solid #8eaf8b; border-radius: 2px; }
.decision { display: flex; align-items: center; gap: 8px; background: #f0f3e9; color: #244b39; border: 1px solid #e1e9dc; border-radius: 8px; padding: 7px 8px; min-height: 43px; }
.decision-icon { display: grid; place-items: center; width: 23px; height: 23px; flex: 0 0 23px; border-radius: 6px; background: #dfe9db; font-weight: 800; }
.decision strong { font-size: 11px; }
.decision p { font-size: 10px; color: #4c6655; line-height: 1.3; }
.decision:has(.phase[data-mode=STOP]) { background: #f7ece6; border-color: #efded3; }
.phase { margin-left: auto; text-align: right; color: #526254; font-size: 9px; white-space: nowrap; }
.playback { display: grid; grid-template-columns: auto minmax(90px, 1fr) auto; align-items: center; gap: 11px; margin-top: 9px; }
.playback-actions { display: flex; gap: 4px; }
.primary, .square, .secondary, select { border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; background: #f9f7ed; min-height: 33px; font-size: 11px; font-weight: 720; }
.primary { background: var(--forest); color: white; border-color: var(--forest); min-width: 113px; }
.primary:hover { background: #1a4835; }
.square { min-width: 32px; font-size: 15px; padding-inline: 5px; }
.step-button { font-size: 13px; }
.square:hover, .secondary:hover { background: #ebe9dc; }
.timeline { display: grid; grid-template-columns: minmax(35px, 1fr) auto; align-items: center; gap: 6px; }
.timeline input { margin: 0; }
#time-value { font-size: 9px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.play-speed select { padding-inline: 4px; }
.analysis-grid { display: grid; grid-template-columns: minmax(0, 1.38fr) minmax(0, 1fr); gap: 16px; margin: 16px 0 0; }
.telemetry-card, .results-card { padding: 15px; }
.chart-key { display: flex; gap: 8px 13px; flex-wrap: wrap; color: var(--muted); font-size: 10px; }
.chart-key span { display: inline-flex; align-items: center; gap: 5px; }
.chart-key i { width: 12px; display: inline-block; }
.base-key { border-top: 2px dashed #b76939; }
.aware-key { border-top: 2px solid #25755d; }
.fault-key { height: 7px; background: #ecdcb5; border-radius: 2px; }
#telemetry { display: block; width: 100%; }
table { width: 100%; border-collapse: collapse; font-size: 11px; }
th, td { padding: 7px 4px; text-align: left; border-bottom: 1px solid #eeebdf; }
th:first-child { padding-left: 0; }
th:not(:first-child), td { text-align: right; }
td { font-variant-numeric: tabular-nums; font-weight: 680; }
tbody th { color: var(--muted); font-weight: 620; }
.base-text { color: var(--amber); }
.aware-text { color: var(--teal); }
.results-card .control-hint { margin: 8px 0; }
.secondary { color: var(--forest); }
.research { padding: 36px 0; scroll-margin-top: 10px; }
.research h2 { font: 500 clamp(25px, 4vw, 45px)/1.1 Georgia, serif; letter-spacing: -.045em; margin: 7px 0 8px; }
.research > p { color: var(--muted); max-width: 730px; font-size: 13px; }
.research-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; margin: 18px 0; }
.research-grid article { padding-top: 9px; border-top: 1px solid #d8d9c8; }
.research-grid article > span { color: #4e6a55; font-size: 9px; font-weight: 770; letter-spacing: .09em; }
.research-grid h3 { margin: 5px 0; }
.research-grid p { color: var(--muted); font-size: 12px; }
.proposal-link { font-weight: 710; font-size: 12px; text-underline-offset: 3px; }
.site-footer { padding: 13px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.site-footer .shell { display: flex; justify-content: space-between; gap: 10px; }
@media (max-width: 1040px) {
  .shell { width: calc(100% - 38px); }
  .experiment { grid-template-columns: 217px minmax(0, 1fr); gap: 11px; }
  .controls { padding: 12px; }
  .field-card { padding: 12px; }
  .field-viewport canvas { height: clamp(235px, 30vw, 320px); }
  .phase { display: none; }
  .analysis-grid { gap: 11px; }
}
@media (max-width: 760px) {
  .shell { width: calc(100% - 24px); }
  .header-inner { min-height: 56px; gap: 16px; }
  .header-inner nav { gap: 13px; }
  .intro { padding: 24px 0 18px; }
  .intro-note { display: none; }
  .experiment { grid-template-columns: minmax(0, 1fr); }
  .controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 12px; align-items: start; }
  .controls > .section-kicker, .controls > h2, .controls > fieldset:first-of-type, #scenario-description, .faults { grid-column: 1 / -1; }
  .controls h2 { margin: 0; }
  .controls .section-kicker { margin: 0; }
  .scenario-list { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 4px; }
  #scenario-description { min-height: 0; margin: 1px 0 0; }
  .range-control { padding: 5px 0; }
  .faults { margin-top: 0; padding-top: 6px; }
  .fault-buttons { margin-bottom: 4px; }
  .fault-buttons button { flex: 0 1 auto; }
  .field-viewport canvas { height: clamp(206px, 41vw, 295px); }
  .analysis-grid { grid-template-columns: 1fr; }
}
@media (max-width: 455px) {
  .header-inner nav { display: none; }
  .intro h1 { font-size: 36px; }
  .intro p { font-size: 13px; }
  .card-top { align-items: flex-start; flex-wrap: wrap; }
  .sensor-list { justify-content: flex-start; }
  .field-tiles { grid-template-columns: 1fr; }
  .field-viewport canvas { height: 235px; }
  .playback { gap: 6px; }
  .timeline { grid-template-columns: 1fr; gap: 1px; }
  .timeline input { width: 100%; }
  .research-grid { grid-template-columns: 1fr; gap: 12px; }
  .site-footer .shell { flex-direction: column; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
.milestones { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 23px; margin-top: 6px; }
.milestones .milestone-label { font-size: 9px; color: var(--muted); padding-right: 3px; }
.milestones button { font-size: 9px; color: #4d654f; font-weight: 650; border: 1px solid #e2e5d7; border-radius: 5px; background: #f3f4e9; padding: 2px 5px; }
.milestones button:hover { background: #e3ebdf; }
.geometry { margin-top: 12px; padding: 8px; border: 1px solid #e6e6d7; border-radius: 7px; background: #f5f5eb; }
.geometry-title { display: block; color: #4e6a55; font-size: 9px; font-weight: 770; letter-spacing: .09em; margin-bottom: 2px; }
#geometry-text { display: block; color: var(--muted); font-size: 10px; }
@media (max-width: 760px) { .geometry { grid-column: 1 / -1; margin-top: 1px; } }
#export-dialog { width: min(580px, calc(100% - 24px)); border: 1px solid var(--line); border-radius: 13px; padding: 18px; color: var(--ink); background: var(--paper); }
#export-dialog::backdrop { background: #202d226b; }
#csv-preview { display: block; width: 100%; margin: 9px 0; padding: 7px; border: 1px solid var(--line); border-radius: 6px; background: #f5f3e9; color: var(--ink); resize: vertical; font: 11px/1.4 ui-monospace, monospace; }
.export-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.export-actions a { display: inline-grid; place-items: center; text-decoration: none; }

/* The scene and its readouts share an instrument-panel palette. */
:root {
  color-scheme: dark;
  --bg: #0a1514;
  --paper: #12211f;
  --ink: #ecf4ed;
  --muted: #a4b9b2;
  --line: #2b403a;
  --forest: #75e0b7;
  --teal: #6be5b5;
  --amber: #f0bd70;
  --red: #ff9586;
  background: radial-gradient(ellipse at 80% -20%, #1c3c32, transparent 48%), var(--bg);
}
:focus-visible { outline-color: #87efc3; }
.shell { width: min(1480px, calc(100% - 64px)); }
.site-header { border-color: #283b36; background: #0d1917; }
.header-inner { min-height: 58px; }
.brand small { color: #a7bfb4; }
.brand small b { color: #79e6bc; margin-left: 2px; }
.header-status { background: #142b24; border-color: #25483b; color: #a8efd2; }
.header-status i, .sensor i, .controller-label i { background: #70d9a9; }
.intro { padding-top: 26px; padding-bottom: 24px; }
.eyebrow, .section-kicker { color: #86b8a5; }
.eyebrow-rule { background: #69bd9d; }
.separator { color: #6c9285; }
.intro h1 { color: #f5f7ec; font-size: clamp(36px, 5vw, 70px); line-height: 1.03; }
.intro h1 em { color: #9af0c8; font-weight: inherit; }
.intro-note { border-color: #345047; }
.intro-note strong { color: #e0eee4; }
.paper { box-shadow: 0 10px 28px #02080732; }
.section-index { color: #a2e9c9; background: #244037; }
.controls { background: #10201d; }
.scenario span { background: #152522; }
.scenario input:checked + span { background: #244338; color: #c3f5dc; border-color: #437c65; }
.scenario input:focus-visible + span { outline-color: #87efc3; }
.range-control, .faults { border-color: #294038; }
.range-control output { background: #244137; color: #a6e7c8; }
.fault-buttons button { background: #312923; border-color: #51402d; color: #f0c286; }
.fault-buttons button:hover:not(:disabled) { background: #4b3828; }
.geometry { background: #182925; border-color: #29453b; }
.geometry-title { color: #90c9b3; }
.field-card { padding: 13px; background: #11201d; }
.sensor { color: #bce2cd; background: #20352b; border-color: #31483b; }
.sensor.degraded { color: #f3c685; background: #3b2d20; border-color: #63492e; }
.sensor.degraded i { background: #eda951; }
.field-card > .playback { margin: 0 0 9px; }
.scene-tools { display: flex; gap: 12px; align-items: center; margin: 0 0 9px; padding: 6px; border: 1px solid #2b403a; background: #0d1a17; border-radius: 9px; }
.scene-group { display: flex; gap: 6px; align-items: center; }
.scene-label { color: #9eb8ad; font-size: 8px; font-weight: 790; letter-spacing: .11em; margin-left: 3px; }
.segmented { display: inline-flex; gap: 2px; }
.segmented button { padding: 5px 7px; font-size: 10px; border-radius: 5px; border: 1px solid transparent; background: transparent; color: #adc0b7; font-weight: 680; }
.segmented button:hover:not(:disabled) { color: #e3fbec; background: #213832; }
.segmented button[aria-pressed="true"] { color: #caf7de; background: #244238; border-color: #355d4f; }
.screen-button { margin-left: auto; min-height: 26px; padding: 1px 7px; }
.tile { background: #142622; }
.tile-head { background: #162825; }
.baseline .controller-label { color: #edb970; }
.baseline .controller-label i { background: #e7a858; }
.mode.drive { color: #a3f0c9; background: #25503d; }
.mode.slow { color: #ffd28a; background: #543e25; }
.mode.stop, .mode.breach { color: #ffc2b9; background: #5b302c; }
.mode.done { color: #bee9f5; background: #2a4750; }
.field-viewport { position: relative; background: #192821; }
.field-viewport canvas { height: clamp(310px, 31vw, 425px); touch-action: none; cursor: grab; }
.field-viewport canvas[data-orbit-dragging="true"] { cursor: grabbing; }
.field-viewport canvas:focus-visible { outline-offset: -3px; }
.field-viewport canvas[data-renderer="2d"] { cursor: default; touch-action: auto; }
.scene-corner, .scene-meter { position: absolute; pointer-events: none; color: #e2f3e9; background: #0c201bd9; border: 1px solid #8dc6ad55; border-radius: 5px; font: 650 9px/1.2 ui-monospace, monospace; letter-spacing: .055em; padding: 4px 6px; }
.scene-corner { top: 8px; left: 8px; }
.scene-meter { bottom: 8px; right: 8px; color: #e4f7ea; }
.tile-data span + span { border-color: #354942; }
.field-tiles[data-layout="aware"], .field-tiles[data-layout="base"] { grid-template-columns: minmax(0, 1fr); }
.field-tiles[data-layout="aware"] .baseline, .field-tiles[data-layout="base"] .adaptive { display: none; }
.field-tiles[data-layout="aware"] canvas, .field-tiles[data-layout="base"] canvas { height: clamp(320px, 36vw, 510px); }
.orbit-hint { margin-left: auto; color: #a6c3b7; }
.legend-line { border-color: #e4e9cc; }
.legend-trail { border-color: #68e5b0; }
.legend-band { background: #42685b; border-color: #75dfaf; }
.decision { background: #1a342c; border-color: #2c5144; color: #b2efd3; }
.decision-icon { color: #b9ffdd; background: #285244; }
.decision p, .phase { color: #aecbbf; }
.decision:has(.phase[data-mode=STOP]) { background: #352925; border-color: #5a4036; }
.decision:has(.phase[data-mode=STOP]) .decision-icon { background: #603c33; color: #ffd0c1; }
.primary, .square, .secondary, select { background: #192d27; border-color: #364d43; color: #d5ebe0; }
.primary { background: #8ce8bd; color: #10261c; border-color: #8ce8bd; }
.primary:hover { background: #b2f4d4; }
.square:hover, .secondary:hover { background: #274237; }
.base-key { border-color: #edb35e; }
.aware-key { border-color: #52dfb3; }
.fault-key { background: #85623a; }
th, td { border-color: #2a4039; }
.research-grid article { border-color: #365049; }
.research-grid article > span { color: #9dcdb8; }
.site-footer { background: #0c1916; }
.milestones button { color: #bddfce; border-color: #344e43; background: #1b3029; }
.milestones button:hover { background: #284c3e; }
#export-dialog::backdrop { background: #04100be0; }
#csv-preview { background: #0c1b17; }
#field-stage:fullscreen { width: 100%; height: 100%; overflow: auto; padding: 14px max(12px, calc((100vw - 1520px) / 2)); }
#field-stage:fullscreen .field-viewport canvas { height: max(275px, calc(100dvh - 310px)); }
@media (max-width: 1040px) {
  .shell { width: calc(100% - 36px); }
  .field-viewport canvas { height: clamp(258px, 31vw, 365px); }
}
@media (max-width: 760px) {
  .shell { width: calc(100% - 24px); }
  .scene-tools { flex-wrap: wrap; gap: 6px; }
  .field-viewport canvas { height: clamp(220px, 39vw, 320px); }
  .intro { padding-top: 20px; padding-bottom: 17px; }
}
@media (max-width: 455px) {
  .field-viewport canvas { height: 255px; }
  .field-tiles[data-layout="aware"] canvas, .field-tiles[data-layout="base"] canvas { height: 330px; }
  .orbit-hint { width: 100%; margin: 2px 0 0; }
}
