/* Decision Lab Research Atlas — shared academic design system. */
@font-face { font-family: "Crimson Pro"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/crimson-pro/crimson-pro-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Crimson Pro"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/crimson-pro/crimson-pro-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Crimson Pro"; font-style: italic; font-weight: 400; font-display: swap; src: url("../vendor/fonts/crimson-pro/crimson-pro-latin-ext-400-italic.woff2") format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Crimson Pro"; font-style: italic; font-weight: 400; font-display: swap; src: url("../vendor/fonts/crimson-pro/crimson-pro-latin-400-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Crimson Pro"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/crimson-pro/crimson-pro-latin-ext-500-normal.woff2") format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Crimson Pro"; font-style: normal; font-weight: 500; font-display: swap; src: url("../vendor/fonts/crimson-pro/crimson-pro-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Crimson Pro"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/fonts/crimson-pro/crimson-pro-latin-ext-600-normal.woff2") format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Crimson Pro"; font-style: normal; font-weight: 600; font-display: swap; src: url("../vendor/fonts/crimson-pro/crimson-pro-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Crimson Pro"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/fonts/crimson-pro/crimson-pro-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Crimson Pro"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/fonts/crimson-pro/crimson-pro-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 400; font-display: swap; src: url("../vendor/fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: 400; font-display: swap; src: url("../vendor/fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-ext-400-italic.woff2") format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: 400; font-display: swap; src: url("../vendor/fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-400-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: normal; font-weight: 700; font-display: swap; src: url("../vendor/fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: 700; font-display: swap; src: url("../vendor/fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-ext-700-italic.woff2") format("woff2"); unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20AB, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Atkinson Hyperlegible"; font-style: italic; font-weight: 700; font-display: swap; src: url("../vendor/fonts/atkinson-hyperlegible/atkinson-hyperlegible-latin-700-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  --ink: #0B2B52;
  --accent: #0E5EA8;
  --accent-soft: #E5EDF5;
  --paper: #F3F5F6;
  --paper-raised: #FBFCFC;
  --text: #18242E;
  --muted: #4D5C68;
  --rule: #CBD3D9;
  --rule-strong: #9EADB8;
  --danger: #87343A;
  --warm: #80452E;
  --ok: #205F43;
  --on-ink: #FFFFFF;
  --warn-bg: #F4ECE5;
  --warn-border: #DDC7B7;
  --error-bg: #F5E7E8;
  --error-border: #DFC1C4;
  --info-border: #BCD0E2;
  --schedule: #D5DCE8;
  --shadow: 0 1px 2px rgba(11, 43, 82, 0.07);
  --font-serif: "Crimson Pro", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Songti TC", "Songti SC", "Hiragino Mincho ProN", serif;
  --font-sans: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, "PingFang TC", "PingFang SC", "Hiragino Sans", sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --measure: 70ch;
  --widget: 66rem;
  --nav-h: 4rem;
  --focus: 3px solid var(--accent);
  --chart-robust: #0E7490;
  --chart-naive: #B45309;
  --chart-adverse: #BE123C;
  --chart-reference: #334155;
  --chart-muted: #64748B;
  --chart-rule: #94A3B8;
  --chart-ok: #047857;
  --hud-border: rgba(148, 163, 184, 0.24);
  --hud-glass: rgba(251, 252, 252, 0.88);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #C4D9ED;
  --accent: #86B9E8;
  --accent-soft: #1C2D3B;
  --paper: #10171D;
  --paper-raised: #172129;
  --text: #E4EBEF;
  --muted: #AAB8C2;
  --rule: #34434E;
  --rule-strong: #526572;
  --danger: #F0A8AD;
  --warm: #E0AE91;
  --ok: #8AC7A6;
  --on-ink: #10202D;
  --warn-bg: #342820;
  --warn-border: #684D3B;
  --error-bg: #352126;
  --error-border: #70434A;
  --info-border: #36566F;
  --schedule: #40515F;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.22);
  --chart-robust: #22D3EE;
  --chart-naive: #FBBF24;
  --chart-adverse: #FB7185;
  --chart-reference: #CBD5E1;
  --chart-muted: #94A3B8;
  --chart-rule: #64748B;
  --chart-ok: #34D399;
  --hud-border: rgba(255, 255, 255, 0.12);
  --hud-glass: rgba(8, 15, 25, 0.88);
}

* { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--text);
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 1.7;
  scroll-padding-top: calc(var(--nav-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}
a:hover { color: var(--ink); }

:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 20;
  background: var(--ink);
  color: var(--on-ink);
  padding: 0.3rem 0.6rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
}
.skip-link:focus { top: 0.5rem; }

/* —— Sticky essay / site nav —— */
.lab-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  height: var(--nav-h);
  padding: 0 1.25rem;
  background: var(--paper-raised);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}
.lab-nav a { color: var(--ink); text-decoration: none; }
.lab-nav a:hover { color: var(--accent); text-decoration: underline; }
.lab-nav .brand { font-weight: 600; color: var(--ink); }
.lab-nav .title {
  text-align: center;
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42rem;
}
.lab-nav .pager {
  justify-self: end;
  display: flex;
  gap: 0.9rem;
  color: var(--muted);
}
.lab-nav .pager .disabled,
.lab-nav .pager span[aria-disabled="true"] {
  color: var(--muted);
  cursor: default;
  text-decoration: none;
}

/* —— Layout —— */
.page {
  width: min(var(--measure), calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 2.4rem 0 4rem;
}
.page-index { padding-top: 2.8rem; }

.breakout {
  width: min(var(--widget), calc(100vw - 2rem));
  margin-left: calc(50% - min(var(--widget), calc(100vw - 2rem)) / 2);
  margin-right: calc(50% - min(var(--widget), calc(100vw - 2rem)) / 2);
}

/* —— Type —— */
h1, h2, h3 {
  font-family: var(--font-serif);
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.2;
  text-wrap: balance;
}
.card-meta, .project-meta, .solver-note, .hint, .caption { overflow-wrap: anywhere; }
button, summary, input, select { touch-action: manipulation; }
button, summary, input, select { -webkit-tap-highlight-color: rgb(14 94 168 / 0.18); }
h1 { font-size: 2.15rem; margin: 0 0 0.4rem; }
h2 { font-size: 1.35rem; margin: 2.4rem 0 0.7rem; }
h3 { font-size: 1.08rem; margin: 1.6rem 0 0.5rem; }
.gloss {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 0.85rem;
}
.standfirst {
  font-size: 1.12rem;
  color: var(--ink);
  margin: 0 0 1rem;
  line-height: 1.5;
}
/* Language switcher under the sticky nav */
.lang-switch {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem 0.9rem;
  padding: 0.35rem 1.25rem 0.45rem;
  background: var(--paper-raised);
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-sans);
  font-size: 0.78rem;
}
.lang-switch a,
.lang-switch span {
  color: var(--muted);
  text-decoration: none;
}
.lang-switch a:hover { color: var(--accent); text-decoration: underline; }
.lang-switch a[aria-current="page"] {
  color: var(--ink);
  font-weight: 600;
}
.lang-switch [aria-disabled="true"] {
  color: var(--rule-strong);
  cursor: default;
}

.abstract, .abstract-zh {
  font-size: 0.95rem;
  color: var(--text);
  background: var(--paper-raised);
  border-left: 3px solid var(--accent);
  padding: 0.7rem 0.95rem;
  margin: 0 0 1.25rem;
  line-height: 1.65;
}
.abstract-en { margin: 0 0 1.4rem; }
.kicker {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.55rem;
  font-weight: 600;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1.5rem;
  padding: 0;
  list-style: none;
  font-family: var(--font-sans);
  font-size: 0.75rem;
}
.tags li {
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  padding: 0.12rem 0.6rem;
  color: var(--muted);
}
p { margin: 0 0 1rem; }
ul, ol { margin: 0 0 1rem; padding-left: 1.2rem; }
li { margin: 0 0 0.25rem; }
figcaption, .caption {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.4rem 0 0;
  line-height: 1.45;
}
.katex { font-size: 1.05em; }
.katex-display { max-width: 100%; overflow-x: auto; overflow-y: hidden; }
code, .mono {
  font-family: var(--font-mono);
  font-size: 0.86em;
}

/* —— Research Atlas project registers —— */
.section-label {
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 2.2rem 0 0.75rem;
  font-weight: 600;
  border-top: 1px solid var(--rule);
  padding-top: 1.1rem;
}
.project-register { display: grid; border-top: 1px solid var(--rule); }
.project-row {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1.5fr) minmax(0, 1.2fr) auto;
  gap: 0.4rem 1rem;
  align-items: center;
  min-height: 64px;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
  color: inherit;
  text-decoration: none;
}
.project-row > h2, .project-row > h3 { grid-column: 2; margin: 0; font-size: 1.06rem; }
.project-row .hook { grid-column: 3; margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.45; }
.project-meta {
  grid-column: 4;
  display: grid;
  justify-items: end;
  gap: 0.15rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--muted);
  text-align: right;
}
.atlas-cover {
  position: relative;
  grid-column: 1;
  grid-row: 1;
  display: block;
  width: 5rem;
  aspect-ratio: 8 / 5;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  pointer-events: none;
  user-select: none;
}
.atlas-cover-canvas, .atlas-cover-fallback {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.atlas-cover [hidden] { display: none; }
.atlas-cover-fallback .route-main { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.atlas-cover-fallback .route-branch { fill: none; stroke: var(--muted); stroke-width: 2; stroke-dasharray: 5 4; }
.atlas-cover-fallback .decision-node { fill: var(--accent); }
details.atlas-details { margin: 1rem 0; border-block: 1px solid var(--rule); }
details.atlas-details > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  cursor: pointer;
}
details.atlas-details[open] > summary { border-bottom: 1px solid var(--rule); }
.atlas-details .atlas-canvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 16 / 9;
}
.atlas-details .atlas-fallback { width: 100%; max-width: 100%; height: auto; }
a.project-row:hover h3 { color: var(--accent); }
a.project-row:focus-visible { outline: var(--focus); outline-offset: 4px; }
.status { font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; font-size: 0.6875rem; }
.status-available { color: var(--ok); }
.status-next { color: var(--accent); }
.status-wave, .status-later, .status-planned, .status-finale { color: var(--muted); }
.project-row.is-inactive { opacity: 0.72; }

/* —— Research Atlas figure plates —— */
.atlas-panel {
  margin: 1.5rem 0 2rem;
  padding: 1rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
  box-shadow: var(--shadow);
}
.atlas-panel.breakout, .sandbox.breakout { margin-left: calc(50% - min(var(--widget), calc(100vw - 2rem)) / 2); margin-right: calc(50% - min(var(--widget), calc(100vw - 2rem)) / 2); }
.atlas-summary { margin: 0 0 0.8rem; color: var(--muted); font-family: var(--font-sans); font-size: 0.88rem; line-height: 1.5; }
.atlas-selection { margin: 0.55rem 0 0; color: var(--ink); font-family: var(--font-sans); font-size: 0.82rem; }
.atlas-branches { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.55rem; }
.atlas-branches button {
  min-height: 44px;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  cursor: pointer;
}
.atlas-branches button:hover, .atlas-branches button:focus-visible { border-color: var(--accent); color: var(--accent); }
.atlas-canvas { width: 100%; min-height: 18rem; aspect-ratio: 16 / 7; }
.atlas-canvas:empty { display: none; }
.atlas-fallback { display: block; width: 100%; height: auto; background: var(--paper); border: 1px solid var(--rule); }
.atlas-fallback .route-main { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; }
.atlas-fallback .route-branch { fill: none; stroke: var(--muted); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 8 7; }
.atlas-fallback .decision-node { fill: var(--accent); }
.atlas-fallback .weather-cell { fill: var(--accent-soft); stroke: var(--warm); stroke-width: 2; }
.atlas-fallback text { fill: var(--muted); font-family: var(--font-sans); font-size: 14px; }
@media (max-width: 48rem) {
  .project-row { grid-template-columns: 4.5rem minmax(0, 1fr) auto; gap: 0.25rem 0.75rem; }
  .atlas-cover { grid-column: 1; grid-row: 1 / span 2; width: 4.5rem; align-self: center; }
  .project-row > h2, .project-row > h3 { grid-column: 2; grid-row: 1; }
  .project-row .hook { grid-column: 2 / -1; grid-row: 2; }
  .project-meta { grid-column: 3; grid-row: 1; }
  .atlas-panel { padding: 0.65rem; }
  .atlas-canvas { min-height: 14rem; }
  .atlas-details .atlas-canvas { min-height: 0; aspect-ratio: 4 / 3; }
}

/* —— Sandbox —— */
.sandbox {
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.1rem 1.2rem;
  margin: 1.1rem 0 1.4rem;
  box-shadow: var(--shadow);
}
.sandbox-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  margin-bottom: 0.8rem;
}
.sandbox-header h3 { margin: 0; }
.solver-note {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}
.controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.85rem 1.1rem;
  margin-bottom: 1rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
}
.control { display: flex; flex-direction: column; gap: 0.28rem; color: var(--ink); }
.control .row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.control output {
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 600;
  color: var(--ink);
  min-width: 2.4rem;
}
.control input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
.control select, .control button {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
}
.control button:disabled,
.control select:disabled,
.control input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.control .hint { color: var(--muted); font-size: 0.75rem; }
.banner {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  padding: 0.6rem 0.75rem;
  border-radius: 4px;
  margin: 0 0 0.8rem;
}
.banner-warn { background: var(--warn-bg); color: var(--warm); border: 1px solid var(--warn-border); }
.banner-error { background: var(--error-bg); color: var(--danger); border: 1px solid var(--error-border); }
.banner-info { background: var(--accent-soft); color: var(--ink); border: 1px solid var(--info-border); }

.reading {
  font-size: 1rem;
  border-left: 3px solid var(--accent);
  padding: 0.55rem 0.9rem;
  margin: 0 0 1rem;
  background: var(--accent-soft);
  color: var(--ink);
}

.figures { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.15rem; }
.figure-block { margin: 0; min-width: 0; }
.chart svg { display: block; width: 100%; height: auto; }
.chart .tick, .chart .label {
  font-family: var(--font-sans);
  font-size: 11px;
  fill: var(--muted);
  font-variant-numeric: tabular-nums lining-nums;
}
.chart .axis { stroke: var(--rule-strong); stroke-width: 1; }
.tabular, table.results, .gantt {
  font-family: var(--font-sans);
  font-variant-numeric: tabular-nums lining-nums;
}
table.results {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  margin: 0.2rem 0 0.4rem;
}
table.results th, table.results td {
  text-align: right;
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid var(--rule);
  color: var(--text);
}
table.results th:first-child, table.results td:first-child { text-align: left; color: var(--ink); }
table.results th { font-weight: 600; color: var(--ink); }

.gantt-wrap { overflow-x: auto; }
.gantt { width: 100%; border-collapse: collapse; font-size: 0.72rem; }
.gantt th, .gantt td { border: 1px solid var(--rule); padding: 0; height: 1.15rem; }
.gantt th { background: transparent; font-weight: 500; color: var(--muted); text-align: center; }
.gantt .flight { padding: 0 0.35rem; text-align: left; white-space: nowrap; color: var(--ink); font-weight: 500; }
.gantt .cell { position: relative; min-width: 2.2rem; }
.gantt .fill { position: absolute; inset: 2px; border-radius: 2px; }
.gantt .sched { background: var(--schedule); }
.gantt .ground { background: var(--accent); }
.gantt .air { background: var(--warm); }
.gantt .div { background: repeating-linear-gradient(135deg, #C9C3B8, #C9C3B8 3px, #E8E2D8 3px, #E8E2D8 6px); }
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem 1.1rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0.35rem 0 0;
}
.legend i {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 2px;
  margin-right: 0.3rem;
  vertical-align: -1px;
}

.objectives { margin: 0 0 1.2rem; padding-left: 1.15rem; }
.note-list { font-size: 0.95rem; }
.refs { list-style: none; padding: 0; }
.refs li { padding-left: 1.4rem; text-indent: -1.4rem; margin-bottom: 0.6rem; }

footer.lab-footer {
  border-top: 1px solid var(--rule);
  margin-top: 3rem;
  padding: 1.2rem 0 0;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}
footer.lab-footer strong { color: var(--ink); font-weight: 600; }

/* Research Atlas shell, controls, and contained data views. */
main [id] { scroll-margin-top: calc(var(--nav-h) + 1rem); }
.lab-nav .pager { align-items: center; min-width: 0; }
.theme-toggle {
  min-width: 44px;
  min-height: 44px;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  background: var(--paper-raised);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }
.lang-switch.is-enhanced {
  position: relative;
  display: block;
  min-height: 44px;
  padding: 0 1.25rem;
}
.language-menu { position: relative; width: max-content; max-width: 100%; margin-left: auto; }
.language-menu summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.25rem 0 0.75rem;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.language-menu summary::-webkit-details-marker { display: none; }
.language-options {
  position: absolute;
  top: calc(100% - 1px);
  right: 0;
  z-index: 30;
  min-width: 12rem;
  padding: 0.35rem;
  background: var(--paper-raised);
  border: 1px solid var(--rule);
  box-shadow: var(--shadow);
}
.language-options a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 0.65rem;
}
.language-options a[aria-current="page"] { color: var(--ink); font-weight: 700; }
.table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; }
.table-scroll:focus-visible { outline: var(--focus); outline-offset: 2px; }
.chart { width: 100%; min-width: 0; max-width: 100%; margin-inline: 0; overflow-x: auto; overscroll-behavior-inline: contain; }
.control select { max-width: 100%; min-height: 44px; text-overflow: ellipsis; }
.control input[type="range"] { min-height: 44px; margin: 0; }
.control input[type="checkbox"] { width: 1.1rem; height: 1.1rem; margin: 0; flex: 0 0 auto; accent-color: var(--accent); }
.control label:has(input[type="checkbox"]) { display: flex; align-items: center; gap: 0.55rem; min-height: 44px; }
.control .row { min-height: 44px; }

@media (prefers-reduced-motion: no-preference) {
  a, button, summary, input, select { transition: color 160ms, background-color 160ms, border-color 160ms; }
}

@media (max-width: 60rem) {
  .chart svg { min-width: 44rem; }
  .table-scroll table.results { min-width: 38rem; }
}

@media (max-width: 48rem) {
  html { font-size: 17px; }
  h1 { font-size: 1.9rem; }
  .lab-nav { grid-template-columns: minmax(0, 1fr) auto; height: var(--nav-h); padding: 0 0.75rem; gap: 0.4rem; }
  .lab-nav .title { display: none; }
  .lab-nav .pager { gap: 0.35rem; }
  .lab-nav .pager a { display: inline-block; max-width: 7rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lang-switch, .lang-switch.is-enhanced { padding-left: 0.75rem; padding-right: 0.75rem; }
  .page { width: calc(100% - 1.6rem); padding-top: 2rem; }
  .controls { grid-template-columns: minmax(0, 1fr); }
  .sandbox { padding: 0.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.sandbox.breakout {
  margin-left: calc(50% - min(var(--widget), calc(100vw - 2rem)) / 2);
  margin-right: calc(50% - min(var(--widget), calc(100vw - 2rem)) / 2);
}

/* PROVISIC_OS progressive shell. Static navigation and article content remain usable without it. */
:root { --os-hud-h: 3.25rem; --os-accent: var(--chart-robust); --os-ok: var(--ok); }
html { scroll-padding-top: calc(var(--nav-h) + var(--os-hud-h) + 1rem); }
main [id] { scroll-margin-top: calc(var(--nav-h) + var(--os-hud-h) + 1rem); }
:root[data-theme="dark"] {
  --os-accent: #00f0ff;
  --os-ok: #10b981;
  --paper: #080D14;
  --paper-raised: #0D1520;
  --text: #E2E8F0;
  --muted: #94A3B8;
  --ink: #C9D8E8;
  --rule: rgba(255, 255, 255, 0.12);
  --rule-strong: rgba(255, 255, 255, 0.22);
}
:root[data-theme="dark"] body {
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.025) 1px, transparent 1px);
  background-size: 32px 32px;
}
.os-hud {
  position: sticky;
  top: var(--nav-h);
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--os-hud-h);
  padding: 0.35rem 1.25rem;
  border-bottom: 1px solid var(--hud-border);
  background: var(--hud-glass);
  backdrop-filter: blur(14px);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.055em;
}
:root[data-theme="dark"] .os-hud {
  border-bottom-color: #00f0ff;
  box-shadow: inset 0 -1px 0 #10b981, 0 10px 28px rgba(0, 240, 255, 0.12);
}
:root[data-theme="dark"] .os-hud::before {
  content: "";
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0.5rem #10b981, 0 0 1rem #00f0ff;
}
.os-breadcrumbs, .os-hud-actions { display: flex; align-items: center; gap: 0.65rem; min-width: 0; }
.os-breadcrumbs { flex-wrap: wrap; }
.os-os-brand { color: var(--chart-robust); font-weight: 700; text-decoration: none; }
.os-os-brand, .os-crumb-link { display: inline-flex; align-items: center; min-height: 44px; }
.os-crumb-link, .os-hud-link { color: var(--muted); text-decoration: none; white-space: nowrap; }
.os-crumb-link:hover, .os-hud-link:hover { color: var(--ink); }
.os-crumb-separator { color: var(--rule-strong); }
.os-current-module { color: var(--ink); overflow-wrap: anywhere; }
.os-hud-link, .os-command-open, .os-theme-toggle, .os-verification, .os-module-switcher summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.3rem 0.5rem;
}
.os-command-open, .os-theme-toggle, .os-share-state, .os-preset-buttons button {
  border: 1px solid var(--hud-border);
  border-radius: 3px;
  background: var(--paper-raised);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.os-command-open:hover, .os-theme-toggle:hover, .os-share-state:hover, .os-preset-buttons button:hover { border-color: var(--os-accent); }
.os-theme-toggle { white-space: nowrap; }
.os-theme-toggle[aria-pressed="true"] { border-color: var(--os-accent); color: var(--os-accent); }
.os-verification {
  flex: none;
  border: 1px solid var(--hud-border);
  border-radius: 3px;
  color: var(--os-ok);
  background: var(--paper-raised);
  text-decoration: none;
  white-space: nowrap;
}
.os-verification:hover, .os-verification:focus-visible { border-color: var(--os-ok); color: var(--os-ok); }
:root[data-theme="dark"] .os-verification {
  border-color: rgba(16, 185, 129, 0.55);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.16), inset 0 0 12px rgba(0, 240, 255, 0.05);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.42);
}
.os-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;
}
.os-module-switcher { position: relative; }
.os-module-switcher summary { color: var(--muted); cursor: pointer; list-style: none; }
.os-module-switcher summary::-webkit-details-marker { display: none; }
.os-module-options {
  position: absolute;
  right: 0;
  top: calc(100% - 1px);
  z-index: 40;
  width: min(25rem, calc(100vw - 2rem));
  padding: 0.4rem;
  border: 1px solid var(--hud-border);
  background: var(--paper-raised);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}
.os-module-option { display: flex; align-items: center; min-height: 44px; padding: 0.45rem 0.6rem; color: var(--text); text-decoration: none; }
.os-module-option:hover, .os-module-option[aria-current="page"] { background: var(--accent-soft); color: var(--chart-robust); }
.os-command-dialog {
  width: min(44rem, calc(100vw - 2rem));
  max-height: min(44rem, calc(100dvh - 2rem));
  padding: 0;
  border: 1px solid var(--hud-border);
  border-radius: 6px;
  background: var(--paper-raised);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
  font-family: var(--font-mono);
}
.os-command-dialog::backdrop { background: rgba(2, 6, 12, 0.78); backdrop-filter: blur(5px); }
.os-command-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.8rem 1rem; border-bottom: 1px solid var(--hud-border); }
.os-command-header h2 { margin: 0; color: var(--chart-robust); font: 600 0.78rem/1.4 var(--font-mono); letter-spacing: 0.06em; }
.os-command-close { min-width: 44px; min-height: 44px; border: 1px solid var(--hud-border); background: transparent; color: var(--muted); cursor: pointer; }
.os-command-search { width: calc(100% - 2rem); min-height: 48px; margin: 0.8rem 1rem; padding: 0.6rem 0.75rem; border: 1px solid var(--rule-strong); background: var(--paper); color: var(--text); font: 0.85rem var(--font-mono); }
.os-command-list { max-height: 50dvh; overflow-y: auto; padding: 0 0.5rem 0.6rem; }
.os-command-item { display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%; min-height: 44px; padding: 0.55rem 0.65rem; border: 0; background: transparent; color: var(--text); text-align: left; text-decoration: none; font: 0.76rem/1.45 var(--font-mono); cursor: pointer; }
.os-command-item:hover, .os-command-item:focus-visible { background: var(--accent-soft); }
.os-command-tag { flex: none; color: var(--muted); font-size: 0.6875rem; }
.os-command-empty { padding: 1rem; color: var(--muted); }
.sandbox-header { flex-wrap: wrap; }
.os-share-state { min-height: 44px; padding: 0.45rem 0.65rem; font-family: var(--font-mono); font-size: 0.6875rem; }
.os-share-state[hidden], .os-presets[hidden] { display: none !important; }
.os-presets { margin: 0 0 1rem; padding: 0.75rem; border: 1px solid var(--hud-border); background: var(--accent-soft); }
.os-presets h4 { margin: 0 0 0.55rem; color: var(--ink); font: 600 0.7rem var(--font-mono); letter-spacing: 0.06em; }
.os-presets p { margin: 0.55rem 0 0; color: var(--muted); font: 0.75rem/1.5 var(--font-sans); }
.os-preset-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.os-preset-buttons button { min-height: 48px; padding: 0.45rem; font: 0.6875rem/1.45 var(--font-mono); }
.os-preset-buttons button[aria-pressed="true"] { border-color: var(--chart-robust); color: var(--chart-robust); }
.os-toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 100; max-width: min(28rem, calc(100vw - 2rem)); padding: 0.7rem 0.9rem; border: 1px solid var(--chart-robust); background: var(--paper-raised); color: var(--text); font: 0.72rem/1.5 var(--font-mono); opacity: 0; transform: translateY(0.5rem); pointer-events: none; }
.os-toast.is-visible { opacity: 1; transform: none; }
.os-clipboard-fallback { position: fixed; left: -9999px; top: 0; }
.os-clipboard-fallback.is-visible { left: 1rem; top: auto; bottom: 1rem; z-index: 101; width: calc(100vw - 2rem); min-height: 4rem; background: var(--paper-raised); color: var(--text); }
.mission-brief { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin: 1.25rem 0; border: 1px solid var(--hud-border); background: var(--hud-border); }
.mission-brief > div { padding: 0.85rem; background: var(--hud-glass); }
.mission-brief dt { color: var(--chart-robust); font: 600 0.6875rem var(--font-mono); letter-spacing: 0.06em; }
.mission-brief dd { margin: 0.35rem 0 0; color: var(--text); font: 0.86rem/1.55 var(--font-sans); }
.formulation-drawer { margin: 1.25rem 0; border: 1px solid var(--hud-border); background: var(--hud-glass); }
.formulation-drawer > summary { min-height: 48px; padding: 0.75rem 1rem; color: var(--chart-robust); font: 600 0.7rem var(--font-mono); cursor: pointer; }
.formulation-drawer > .formulation-content { padding: 0 1rem 1rem; }
.exploration-loop { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; margin: 2.5rem 0 1rem; }
.exploration-loop a { min-height: 64px; padding: 0.85rem; border: 1px solid var(--hud-border); background: var(--hud-glass); color: var(--text); text-decoration: none; font: 0.74rem/1.5 var(--font-mono); }
.exploration-loop a:hover { border-color: var(--chart-robust); color: var(--chart-robust); }
.metric-num, .control-val, .control output, output, .beacon-coords, .solver-note, .reading, .atlas-selection { font-variant-numeric: tabular-nums lining-nums; }

@media (max-width: 70rem) {
  :root { --os-hud-h: 5.5rem; }
  .os-hud { align-items: flex-start; flex-direction: column; gap: 0.2rem; }
  .os-hud-actions { width: 100%; overflow-x: auto; }
  .os-preset-buttons { grid-template-columns: 1fr; }
}
@media (max-width: 48rem) {
  :root { --os-hud-h: 5.5rem; }
  .os-hud { padding-inline: 0.75rem; }
  .os-breadcrumbs { gap: 0.4rem; }
  .os-current-module { width: 100%; }
  .os-hud-actions { gap: 0.25rem; }
  .os-hud-link { font-size: 0.6875rem; }
  .mission-brief, .exploration-loop { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .os-toast { transform: none; }
}

