/* Institutional simulator skin. The scene keeps its geometry and interactions. */
:root {
  --sim-blue: #006bfb;
  --sim-blue-dark: #004fbf;
  --sim-ink: #182537;
  --sim-muted: #536479;
  --sim-line: #dce4ee;
  --sim-paper: #fff;
  --sim-canvas: #f2f6fb;
  --sim-soft: #edf4ff;
  --sim-rail: 332px;
}
html, body {
  color-scheme: light;
  background: var(--sim-paper);
  color: var(--sim-ink);
  font: 16px/1.5 PPNeueMontreal, Inter, Arial, sans-serif;
}
body { overflow-x: hidden; }
button, input, select, textarea { font-family: inherit; }
button {
  min-height: 40px;
  border-color: var(--sim-line);
  border-radius: 8px;
  color: var(--sim-ink);
  font-size: 14px;
  line-height: 1.3;
  box-shadow: none;
  touch-action: manipulation;
}
button:hover { background: var(--sim-soft); border-color: #adcafa; }
button:disabled { opacity: .55; }
button b { color: var(--sim-blue-dark); background: #e1edff; }
a { color: var(--sim-blue-dark); }
p, small { color: var(--sim-muted); }
small { font-size: 12px; line-height: 1.5; }
button:focus-visible, a:focus-visible, input:focus-visible,
textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--sim-blue);
  outline-offset: 3px;
}
button.primary, .flight-mode .mission-hud .primary {
  min-height: 44px;
  color: #fff;
  background: var(--sim-blue);
  border-color: var(--sim-blue);
  box-shadow: none;
}
button.primary:hover, .flight-mode .mission-hud .primary:hover {
  background: var(--sim-blue-dark);
  border-color: var(--sim-blue-dark);
}
button.selected { color: var(--sim-blue-dark); background: var(--sim-soft); border-color: #b9d3fb; }
.eyebrow, .subtle-label {
  color: var(--sim-blue-dark);
  font: 600 11px/1.5 PPNeueMontreal, Inter, Arial, sans-serif;
  letter-spacing: .07em;
}
#app {
  min-height: 100dvh;
  height: auto;
  grid-template-rows: 68px minmax(660px, calc(100dvh - 188px)) 40px 80px;
  overflow: visible;
}
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--sim-line);
  box-shadow: none;
  padding: 0 24px;
  gap: 18px;
}
.brand { color: var(--sim-ink); }
.brand img { width: 152px; height: 40px; }
.brand small { display: none; }
.brand:hover img, .brand:focus-visible img { filter: none; transform: none; }
.views { gap: 2px; }
.views button { min-height: 42px; padding: 10px 12px; font-size: 14px; letter-spacing: 0; }
.views button.selected { background: var(--sim-soft); border-color: transparent; color: var(--sim-blue-dark); }
.top-tools { gap: 8px; }
.top-tools select { min-height: 40px; background: #f5f7fa; color: var(--sim-ink); border: 1px solid var(--sim-line); font-size: 14px; padding: 8px; border-radius: 8px; }
.top-tools .icon-button { min-width: 40px; min-height: 40px; color: var(--sim-muted); }
.autoplay-button {
  min-height: 42px;
  padding: 10px 14px;
  color: var(--sim-blue-dark);
  background: var(--sim-soft);
  border-color: transparent;
  font: 600 14px/1.3 PPNeueMontreal, Inter, Arial, sans-serif;
  letter-spacing: 0;
  box-shadow: none;
}
.autoplay-button:hover, .autoplay-button[aria-pressed="true"] { background: #dfeaff; }
.simulation-label { color: var(--sim-muted); font: 11px/1.5 PPNeueMontreal, Inter, Arial, sans-serif; letter-spacing: .05em; }
.simulation-label i, .activity-title i { background: var(--sim-blue); box-shadow: none; }

/* The controls occupy their own column; none of the scientific nodes sits behind it. */
.world, .world.flight-mode { background: var(--sim-canvas); }
.world:after, .flight-mode:after { display: none; }
.world.flight-mode {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sim-rail);
  grid-template-rows: 88px auto minmax(170px, 1fr);
  align-items: start;
}
.world.flight-mode:before {
  content: '';
  display: block;
  position: absolute;
  inset: 0 0 0 auto;
  width: var(--sim-rail);
  background: #fff;
  border-left: 1px solid var(--sim-line);
  mask-image: none;
  pointer-events: none;
  z-index: 0;
}
.flight-mode #flight-host { inset: 0 var(--sim-rail) 0 0; }
.world-heading, .flight-mode .world-heading { left: 24px; top: 22px; right: auto; max-width: 380px; }
.world-heading h1, .flight-mode .world-heading h1 { color: var(--sim-ink); font-size: clamp(23px, 2vw, 30px); line-height: 1.13; font-weight: 400; margin: 6px 0 8px; }
.world-heading p, .flight-mode .world-heading p { color: var(--sim-muted); font-size: 14px; line-height: 1.45; max-width: 340px; margin-bottom: 0; }
.understanding-links { margin-top: 10px; }
.understanding-links button, .understanding-links a { min-height: 40px; padding: 9px 12px; background: #fff; color: var(--sim-blue-dark); border-color: var(--sim-line); font-size: 14px; }
.clock, .flight-mode .clock {
  position: relative;
  inset: auto;
  grid-column: 2;
  grid-row: 1;
  margin: 15px 20px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 8px;
  text-align: left;
}
.clock > span { color: var(--sim-muted); font: 11px/1.4 PPNeueMontreal, Inter, Arial, sans-serif; letter-spacing: .04em; }
.clock > strong { color: var(--sim-ink); font: 22px/1.2 PPNeueMontreal, Inter, Arial, sans-serif; font-variant-numeric: tabular-nums; margin: 0; grid-column: 1; grid-row: 2; }
.time-controls { grid-column: 2; grid-row: 1 / 3; gap: 3px; }
.time-controls button { min-height: 40px; min-width: 34px; padding: 6px; color: var(--sim-muted); background: #f7f9fc; border-color: transparent; border-radius: 6px; font-size: 13px; }
.time-controls button.selected { color: var(--sim-blue-dark); background: var(--sim-soft); border-color: #c7daf9; }
.mission-hud, .flight-mode .mission-hud {
  position: relative;
  top: auto !important;
  right: auto;
  bottom: auto;
  left: auto;
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  width: auto;
  margin: 0 20px 16px;
  padding: 0 0 18px;
  background: #fff;
  border: 0;
  border-bottom: 1px solid var(--sim-line);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}
.mission-hud > .eyebrow { font-size: 11px; }
.mission-hud h2, .flight-mode .mission-hud h2 { color: var(--sim-ink); font-size: 22px; line-height: 1.18; margin: 7px 0 8px; font-weight: 400; }
.mission-hud p, .flight-mode .mission-hud p { display: block; color: var(--sim-muted); font-size: 14px; line-height: 1.5; margin: 0 0 13px; }
.mission-progress { display: flex; color: var(--sim-muted); font: 11px/1.5 PPNeueMontreal, Inter, Arial, sans-serif; }
.mission-progress strong { color: var(--sim-ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.mission-track { display: block; height: 4px; margin: 7px 0 14px; background: #e8eef6; }
.mission-track i { background: var(--sim-blue); box-shadow: none; }
.mission-hud .primary, .flight-mode .mission-hud .primary { width: 100%; font-size: 14px; padding: 10px 14px; }
.mission-hud .secondary-link, .flight-mode .mission-hud .secondary-link { display: block; width: 100%; margin: 6px 0 0; min-height: 40px; padding: 8px; color: var(--sim-blue-dark); background: #fff; border-color: transparent; font-size: 13px; }
.signal-console {
  position: relative;
  inset: auto;
  grid-column: 2;
  grid-row: 3;
  align-self: stretch;
  width: auto;
  min-height: 0;
  max-height: none;
  margin: 0 20px 18px;
  padding: 0;
  color: var(--sim-ink);
  background: #fff;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}
.signal-console:before, .demo-caption:before { display: none; }
.signal-console-head .eyebrow, .signal-console-head strong { color: var(--sim-blue-dark); font-size: 12px; }
.signal-console-head strong { font-family: inherit; font-weight: 600; }
.radar-dot, .demo-caption-head i { background: var(--sim-blue); box-shadow: none; animation: none; }
.signal-console > p { display: block; color: var(--sim-muted); font-size: 13px; line-height: 1.4; margin: 7px 0 12px; }
.signal-console > small { display: block; font: 11px/1.4 PPNeueMontreal, Inter, Arial, sans-serif; color: var(--sim-muted); margin-top: 9px; }
.signal-cards { min-height: 0; grid-template-columns: 1fr; gap: 10px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c2d2e6 transparent; }
.signal-card, .signal-card[data-kind="1"], .signal-card[data-kind="2"], .signal-card[data-kind="3"] { min-width: 0; min-height: 0; padding: 12px; background: #f7f9fc; border: 1px solid var(--sim-line); border-radius: 10px; box-shadow: none; }
.signal-card.focused { background: var(--sim-soft); border-color: #82b3fb; box-shadow: none; }
.signal-card-top { color: var(--sim-muted); font: 11px/1.4 PPNeueMontreal, Inter, Arial, sans-serif; letter-spacing: .03em; }
.signal-card-top span { color: var(--sim-muted); }
.signal-card-top b { color: var(--sim-blue-dark); font: 600 11px/1.4 PPNeueMontreal, Inter, Arial, sans-serif; }
.signal-card p { display: block; overflow: visible; color: var(--sim-ink); font-size: 14px; line-height: 1.45; margin: 8px 0 6px; -webkit-line-clamp: unset; }
.signal-card small { display: block; color: var(--sim-muted); font-size: 11px; line-height: 1.4; }
.signal-route { gap: 6px; margin-top: 10px; }
.signal-route select { min-height: 40px; min-width: 0; background: #fff; color: var(--sim-ink); border: 1px solid #cbd8e8; font-size: 13px; border-radius: 7px; padding: 8px; }
.signal-route button { min-height: 44px; min-width: 44px; flex: 0 0 44px; padding: 8px 10px; color: #fff; background: var(--sim-blue); border-color: var(--sim-blue); font-size: 13px; box-shadow: none; }
.signal-route button:is(:hover,:focus-visible) { background: var(--sim-blue-dark); outline-color: var(--sim-blue); }
.signal-empty { color: var(--sim-muted); background: #f7f9fc; border: 1px solid var(--sim-line); border-radius: 8px; padding: 14px; font-size: 14px; line-height: 1.5; }

/* Map affordances use the same paper surfaces as the reader and catalogue. */
.flight-labels button, .flight-labels .elucenia-node,
.flight-labels .elucenia-node[data-entity="core"], .flight-labels .elucenia-node[data-entity="exchange"] {
  color: var(--sim-ink);
  background: transparent;
  border: 0;
  min-height: 44px;
  padding: 10px 7px;
  font-size: 12px;
  line-height: 1.3;
  border-radius: 8px;
  text-shadow: none;
  box-shadow: none;
  animation: none;
}
.flight-labels .elucenia-node { isolation: isolate; gap: 4px; max-width: 160px; }
.flight-labels .elucenia-node:before,
.flight-labels .elucenia-node[data-entity="exchange"]:before { content: ''; display: block; position: absolute; inset: 7px 0; z-index: -1; background: #ffffffe8; border: 1px solid #d0ddeb; border-radius: 6px; pointer-events: none; box-shadow: none; animation: none; }
.flight-labels button.selected, .flight-labels .elucenia-node:is(:hover,:focus-visible) { background: transparent; color: var(--sim-blue-dark); box-shadow: none; }
.flight-labels .elucenia-node:is(.selected,:hover,:focus-visible):before { background: #eaf2ff; border-color: #82b3fb; }
.flight-labels .elucenia-node[data-entity="exchange"]:after { display: none; }
.flight-mode .flight-labels [data-entity="exchange"] { left: auto !important; right: 20px; top: 20px !important; width: auto; max-width: 165px; min-height: 44px; }
.flight-labels .elucenia-node-mark,
.flight-labels .elucenia-node[data-entity="core"] .elucenia-node-mark,
.flight-labels .elucenia-node[data-entity="exchange"] .elucenia-node-mark,
.flight-labels [data-entity="program:heart"] .elucenia-node-mark { width: 17px; height: 17px; background: var(--sim-blue); filter: none; animation: none; }
.flight-labels .elucenia-node[data-entity^="program:"] { width: 44px; height: 44px; min-height: 44px; background: #fff; border-color: #b8cce8; padding: 8px; }
.flight-labels .elucenia-node[data-entity^="program:"]:before { display: none; }
.flight-labels [data-entity^="program:"] .elucenia-node-name { color: var(--sim-ink); background: #fff; border-color: var(--sim-line); font-size: 13px; padding: 8px 11px; }
.flight-signal-beacon, .flight-signal-beacon[data-kind="1"], .flight-signal-beacon[data-kind="2"], .flight-signal-beacon[data-kind="3"] { width: 44px; height: 44px; min-height: 44px; background: var(--sim-blue); color: #fff; border: 2px solid #fff; box-shadow: 0 0 0 2px #b6d3fb; animation: none; font: 600 12px/1 PPNeueMontreal, Inter, Arial, sans-serif; padding: 0; }
.flight-signal-beacon i { display: none; }
.flight-signal-beacon b { color: #fff; background: transparent; margin: 0; padding: 0; }
.flight-signal-beacon:is(:hover,:focus-visible) { background: var(--sim-blue-dark); outline-color: var(--sim-blue); transform: translate(-50%, -50%) scale(1.05); }
.geo-entity { width: 44px; height: 44px; min-height: 44px; display: grid; place-items: center; }
.geo-entity i, .legend-roles i, .entity-directory i, .entity-emblem { background: #fff; color: var(--sim-blue-dark); border-color: #a9c8f3; box-shadow: none; font: 600 11px/1 PPNeueMontreal, Inter, Arial, sans-serif; }
.geo-entity i { width: 24px; height: 24px; font-size: 10px; }
.geo-entity > span { left: 42px; color: var(--sim-ink); background: #fff; border-color: var(--sim-blue); padding: 10px 12px; border-radius: 5px; font-size: 13px; }
.geo-entity[data-geo="physician-br"] > span { right: 42px; }
.geo-entity small { color: var(--sim-muted); font-size: 12px; }
.flight-mode .flight-camera-controls { right: 20px; left: auto; top: auto; bottom: 18px; flex-direction: row; gap: 6px; }
.flight-camera-controls button, .zoom-controls button { width: 42px; height: 42px; min-height: 42px; background: #fff; color: var(--sim-blue-dark); border-color: #cbd8e8; box-shadow: none; }
.flight-mode .flight-status, #app[data-demo="true"] .flight-mode .flight-status { left: 250px; right: 174px; bottom: 24px; color: var(--sim-muted); background: #f2f6fbee; border-radius: 6px; padding: 6px 8px; font: 12px/1.4 PPNeueMontreal, Inter, Arial, sans-serif; text-shadow: none; }
.flight-mode .flight-journey, .flight-mode:has(#flight-host[data-journey=false]) .flight-journey { left: 20px; right: auto; top: auto !important; bottom: 18px; width: 214px; max-width: calc(100% - 40px); background: #fff; border: 1px solid #cbd8e8; border-radius: 9px; box-shadow: none; }
.flight-mode .flight-journey[open] { left: 20px; top: auto !important; bottom: 18px; width: 340px; max-width: calc(100% - 40px); z-index: 9; }
.flight-mode .flight-journey summary { min-height: 42px; padding: 11px 13px; color: var(--sim-blue-dark); font: 14px/1.4 PPNeueMontreal, Inter, Arial, sans-serif; letter-spacing: 0; }
.flight-mode .flight-journey > div { min-height: 0; max-height: min(460px, 55dvh); padding: 0 16px 16px; }
.flight-journey label, .flight-journey p, .flight-journey ol { color: var(--sim-muted); font-size: 14px; }
.flight-journey select { min-height: 44px; color: var(--sim-ink); background: #fff; border-color: #cbd8e8; border-radius: 7px; }
.flight-journey h3 { color: var(--sim-ink); font-size: 21px; }
.journey-mission { background: var(--sim-soft); color: var(--sim-blue-dark); border: 0; border-radius: 7px; font-size: 13px; }
.journey-contribution { background: #f7f9fc; border-left-color: var(--sim-blue); padding: 12px; border-radius: 0 7px 7px 0; }
.journey-contribution strong { color: var(--sim-blue-dark); font-size: 11px; }
.journey-contribution p { color: var(--sim-muted); font-size: 14px; }
.journey-actions button { font-size: 14px; min-height: 40px; }
.map-node { color: var(--sim-ink); }
.map-node strong { text-shadow: none; }
.map-node small { color: var(--sim-muted); }

/* Entry and automated narration share a compact reading surface. */
.entry { padding: 34px; background: linear-gradient(90deg, #f2f6fb 0%, #f2f6fbf2 27%, #f2f6fb30 65%, transparent); }
.entry-copy { max-width: 430px; padding: 26px; background: #fff; border: 1px solid var(--sim-line); border-radius: 16px; }
.entry h2 { color: var(--sim-ink); font-size: clamp(32px, 3.2vw, 48px); line-height: 1.05; margin: 15px 0 16px; }
.entry p { font-size: 16px; line-height: 1.55; color: var(--sim-muted); }
.entry-rule { border-color: var(--sim-line); padding-top: 15px; margin-top: 18px; gap: 12px; }
.entry-rule span { color: var(--sim-blue); font: 15px/1.5 PPNeueMontreal, Inter, Arial, sans-serif; }
.entry-rule > span { display: none; }
.entry-rule p { color: var(--sim-muted); font-size: 14px; }
.entry-actions { gap: 8px; margin: 20px 0 0; display: grid; }
.entry button, .entry-actions .secondary-link { width: 100%; min-height: 44px; margin: 0; padding: 11px 14px; font-size: 15px; }
.entry-actions .secondary-link { color: var(--sim-blue-dark); background: #fff; border-color: #cbd8e8; }
.entry small { font-size: 12px; line-height: 1.5; color: var(--sim-muted); margin-top: 16px; max-width: none; }
.world:has(.entry:not([hidden])) .clock { visibility: hidden; }
.demo-caption, .flight-mode .demo-caption {
  position: relative;
  inset: auto;
  grid-column: 2;
  grid-row: 2 / 4;
  align-self: start;
  width: auto;
  max-width: none;
  margin: 0 20px 20px;
  padding: 20px 0;
  background: #fff;
  border: 0;
  border-top: 1px solid var(--sim-line);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}
.demo-caption-head, .demo-caption-head strong { color: var(--sim-blue-dark); font: 600 11px/1.5 PPNeueMontreal, Inter, Arial, sans-serif; letter-spacing: .02em; }
.demo-caption h2 { color: var(--sim-ink); font-size: 24px; line-height: 1.15; font-weight: 400; margin: 16px 0 12px; }
.demo-caption p { color: var(--sim-muted); font-size: 16px; line-height: 1.55; margin-bottom: 20px; }
.demo-caption small { color: var(--sim-muted); font-size: 12px; line-height: 1.5; margin-top: 14px; }
.demo-progress { background: #e1e9f4; height: 4px; border-radius: 3px; overflow: hidden; }
.demo-progress i { background: var(--sim-blue); box-shadow: none; }
.event-callout, #toast { background: #fff; color: var(--sim-ink); border: 1px solid #b7d0f4; border-radius: 10px; box-shadow: 0 5px 24px #18345612; font-size: 14px; line-height: 1.5; }
.event-callout { top: 100px; right: calc(var(--sim-rail) + 20px); }
#toast { max-width: min(520px, calc(100% - 32px)); top: 16px; }

/* Quiet status strip and consistent, readable counters. */
.activity-strip { padding: 0 24px; gap: 16px; background: #f8fafc; border-color: var(--sim-line); font-size: 13px; }
.activity-title { font: 600 11px/1.4 PPNeueMontreal, Inter, Arial, sans-serif; color: var(--sim-muted); letter-spacing: .04em; }
.activity-strip p { color: var(--sim-muted); }
.activity-strip button { min-height: 40px; color: var(--sim-blue-dark); font-size: 13px; }
.bottom-bar { background: #fff; border-top: 0; padding: 12px 24px; gap: 24px; }
.program-button, .program-button.selected { width: auto; min-width: 148px; min-height: 52px; padding: 8px 12px; background: #fff; color: var(--sim-ink); border-color: transparent; }
.program-button:before { display: none; }
.program-button strong { font-size: 15px; font-weight: 600; }
.program-button span { font: 12px/1.4 PPNeueMontreal, Inter, Arial, sans-serif; color: var(--sim-muted); margin-top: 3px; }
.program-button .busy-dot { background: var(--sim-blue); }
.metrics { gap: clamp(22px, 3vw, 50px); }
.metrics strong, .metrics button strong { color: var(--sim-ink); font: 26px/1.15 PPNeueMontreal, Inter, Arial, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.metrics strong span { color: var(--sim-muted); font-size: 16px; }
.metrics span { color: var(--sim-muted); font-size: 12px; margin-top: 3px; max-width: none; }
.metrics button { min-height: 52px; padding: 0 7px; border-radius: 7px; }
.all-programs { min-height: 48px; border-left: 1px solid var(--sim-line); color: var(--sim-blue-dark); padding-left: 24px; }
.all-programs strong { font: 600 13px/1.3 PPNeueMontreal, Inter, Arial, sans-serif !important; letter-spacing: .03em; }
.all-programs span:nth-child(2) { color: var(--sim-muted); font-size: 12px; }

/* All drawer states use a readable paper background, including less common review states. */
dialog { color: var(--sim-ink); background: #fff; border: 1px solid var(--sim-line); border-radius: 16px; padding: 26px; max-height: calc(100dvh - 32px); box-shadow: 0 20px 70px #17294326; }
dialog::backdrop { background: #243a5366; backdrop-filter: none; }
#drawer { width: 520px; max-width: calc(100vw - 32px); margin: auto 16px auto auto; }
#drawer.wide { max-width: calc(100vw - 32px); }
.drawer-head { margin-bottom: 24px; }
.drawer-head button { min-width: 40px; min-height: 40px; color: var(--sim-muted); }
#drawer h2 { color: var(--sim-ink); font-size: 31px; line-height: 1.15; }
#drawer h3, #drawer strong { color: var(--sim-ink); }
#drawer p, #drawer .hierarchy p, #drawer .guide-body p { color: var(--sim-muted); font-size: 15px !important; line-height: 1.6; }
#drawer small { color: var(--sim-muted); font-size: 12px; line-height: 1.5; }
#drawer a { color: var(--sim-blue-dark); }
#drawer button { min-height: 40px; font-size: 14px; }
#drawer .primary { min-height: 44px; font-size: 15px !important; }
#drawer .secondary-link { color: var(--sim-blue-dark); background: #fff; border-color: var(--sim-line); font-size: 14px; }
#drawer input, #drawer select, #drawer textarea { color: var(--sim-ink); background: #fff; border: 1px solid #b9c9dc; border-radius: 7px; min-height: 42px; font-size: 16px; accent-color: var(--sim-blue); }
#drawer textarea { line-height: 1.5; padding: 12px; }
#drawer input[type="checkbox"] { min-height: 20px; }
#drawer label { color: var(--sim-ink); font-size: 14px; }
#drawer :is(.status-row, .requirement, .worker-row, .review-item, .event-row, .settings-row, .future-item, .understanding-section, .hierarchy-branches, .hierarchy-leads details, .hierarchy-programs article) { border-color: var(--sim-line); }
#drawer :is(.platform-grid article, .briefing-pillar, .lens-grid button, .lens-source, .knowledge-item, .hierarchy-node, .hierarchy-node.human, .hierarchy-node.future, .hierarchy-core, .hierarchy-planned, .area-guide, .source-list a, .program-grid button) { color: var(--sim-ink); background: #f8fafc; border: 1px solid var(--sim-line); border-radius: 10px; box-shadow: none; }
#drawer :is(.knowledge-verdict, .principle-note, .journey-contribution) { background: var(--sim-soft); color: var(--sim-blue-dark); border-color: var(--sim-blue); }
#drawer :is(.review-tags span, .knowledge-rail span, .discovery-flow span, .drawer-leads button) { color: var(--sim-blue-dark); background: var(--sim-soft); border-color: #cfdef5; border-radius: 6px; font: 13px/1.4 PPNeueMontreal, Inter, Arial, sans-serif; }
#drawer :is(.platform-grid b, .lens-grid b, .worker-row .number, .worker-row b, .event-row time, .event-row strong, .hierarchy-programs .program-title, .briefing-pillar > span, .guide-current > span, .guide-boundary > span) { color: var(--sim-blue-dark); font-family: inherit; }
#drawer :is(.entity-directory button, .docs-open) { border-color: var(--sim-line); border-radius: 8px; }
#drawer .drawer-leads button.selected { background: #dceaff; border-color: #99bff6; color: var(--sim-blue-dark); }
#drawer .status-row, #drawer .worker-row, #drawer .event-row, #drawer .future-item { font-size: 14px; }
#drawer .status-row strong { color: var(--sim-blue-dark); }
#drawer .hierarchy-node:after, #drawer .future-network, #drawer .future-network i, #drawer .knowledge-rail { border-color: #c9d8eb; }
#drawer .hierarchy-programs ol, #drawer .future-network, #drawer .tech-mini, #drawer .tech-mini .ok { color: var(--sim-muted); }
#drawer .worker-track { background: #e1e8f2; }
#drawer .worker-track i { background: var(--sim-blue); }
#architecture { background: #fff; }
#architecture header { border-bottom: 1px solid var(--sim-line); }
#architecture iframe { background: #fff; }
.sim-help-steps, .sim-resource-links { display: grid; gap: 12px; margin: 24px 0; }
.sim-help-steps article, .sim-resource-links a { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 14px; padding: 18px; background: #f7f9fc; border: 1px solid var(--sim-line); border-radius: 10px; }
.sim-help-steps article > span, .sim-resource-links a > span { color: var(--sim-blue-dark); font-size: 13px; padding-top: 2px; font-variant-numeric: tabular-nums; }
.sim-help-steps h3, .sim-resource-links h3 { font-size: 18px; margin: 0 0 6px; line-height: 1.25; }
.sim-help-steps p, .sim-resource-links p { margin: 0; }
.sim-resource-links a { transition: background .15s, border-color .15s; }
.sim-resource-links a:hover { background: var(--sim-soft); border-color: #a8c8f8; }
#drawer .sim-resource-links h3 { color: var(--sim-blue-dark); }
.sim-map-help { padding: 14px 0; border-top: 1px solid var(--sim-line); border-bottom: 1px solid var(--sim-line); }
#drawer-content > a.secondary-link { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px; border: 1px solid var(--sim-line); border-radius: 8px; }

/* Tablet: a full-width map, then two clear work panels. */
@media (max-width: 1100px) {
  #app { grid-template-rows: 112px auto 40px auto; }
  .topbar { padding: 10px 20px 6px; flex-wrap: wrap; align-content: space-between; gap: 4px 12px; }
  .brand { height: 40px; }
  .views { order: 3; width: 100%; justify-content: center; }
  .views button { padding: 10px 16px; }
  .top-tools { margin-left: auto; }
  .simulation-label, #sound { display: none; }
  .flight-mode .world-caption { display: flex; position: absolute; left: 16px; right: auto; top: 342px; bottom: auto; z-index: 6; max-width: calc(100% - 32px); gap: 10px; padding: 5px 8px; color: #34465c; background: rgba(255,255,255,.96); border: 1px solid #c9d8eb; border-radius: 5px; font-size: 11px; pointer-events: none; }
  .world.flight-mode { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 500px auto; align-items: stretch; overflow: visible; }
  .world.flight-mode:before { display: none; }
  .flight-mode #flight-host { inset: 0 0 auto; width: 100%; height: 500px; }
  .flight-mode .world-heading { left: 20px; top: 20px; max-width: 360px; }
  .flight-mode .world-heading p { display: block; }
  .clock, .flight-mode .clock { position: absolute; top: 20px; right: 20px; left: auto; bottom: auto; width: 280px; margin: 0; padding: 10px 12px; background: #fff; border: 1px solid var(--sim-line); border-radius: 10px; }
  .flight-mode .flight-labels [data-entity="exchange"] { right: 20px; top: 96px !important; }
  .mission-hud, .flight-mode .mission-hud { grid-column: 1; grid-row: 2; align-self: stretch; margin: 0; padding: 22px 24px; border-bottom: 0; border-top: 1px solid var(--sim-line); }
  .signal-console { grid-column: 2; grid-row: 2; margin: 0; padding: 22px 24px; max-height: 380px; min-height: 0; border-top: 1px solid var(--sim-line); border-left: 1px solid var(--sim-line); }
  .signal-cards { grid-template-columns: 1fr; }
  .flight-mode .demo-caption { grid-column: 1 / -1; grid-row: 2; margin: 0; padding: 24px; border-top: 1px solid var(--sim-line); }
  .demo-caption p { max-width: 70ch; }
  .entry { padding: 24px; min-height: 500px; }
  .entry-copy { max-width: 400px; padding: 24px; }
  .entry h2 { font-size: 36px; }
  .entry p { font-size: 15px; margin-bottom: 12px; }
  .entry-rule { margin-top: 12px; padding-top: 12px; }
  .entry small { margin-top: 12px; }
  .event-callout { top: 160px; right: 20px; }
  .bottom-bar { min-height: 86px; padding: 12px 20px; gap: 20px; }
  .metrics { gap: 24px; }
  .metrics span { font-size: 12px; max-width: 100px; }
  .all-programs { display: none; }
}

/* Phone: keep the map touchable and put every action in normal reading order. */
@media (max-width: 760px) {
  #app { min-height: 100dvh; grid-template-rows: 108px auto 44px auto; }
  .topbar { padding: 8px 12px 4px; gap: 2px 8px; }
  .brand { height: 40px; }
  .brand img { width: 120px; height: 36px; }
  .top-tools { gap: 5px; }
  .top-tools select { min-width: 49px; padding: 8px 5px; font-size: 13px; }
  .top-tools #settings { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; width: 36px; padding: 5px; }
  .autoplay-button { font-size: 13px; padding: 10px; }
  .views { order: 3; justify-content: space-between; gap: 0; }
  .views button { font-size: 13px; padding: 9px 7px; min-height: 42px; }
  .views button b { font-size: 11px; margin-left: 3px; }
  .world.flight-mode { grid-template-columns: minmax(0, 1fr); grid-template-rows: 440px auto auto; }
  .flight-mode #flight-host { height: 440px; }
  .flight-mode .world-caption { top: 282px; }
  .flight-mode .world-heading { left: 16px; top: 18px; right: 190px; max-width: none; }
  .flight-mode .world-heading h1 { font-size: 21px; line-height: 1.12; margin: 6px 0 8px; }
  .flight-mode .world-heading p { display: none; }
  .world-heading .eyebrow { font-size: 10px; letter-spacing: .03em; }
  .understanding-links { margin-top: 8px; }
  .understanding-links button, .understanding-links a { padding: 9px 10px; font-size: 13px; }
  .clock, .flight-mode .clock { top: 18px; right: 12px; width: 169px; padding: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; border: 0; background: none; }
  .clock > span { display: none; }
  .clock > strong { font-size: 21px; padding-right: 3px; }
  .time-controls { gap: 3px; }
  .time-controls button { min-width: 40px; min-height: 40px; background: #fff; padding: 6px; }
  .time-controls button[data-speed="2"] { display: inline-block; }
  .flight-mode .flight-labels [data-entity="exchange"] { top: 105px !important; right: 12px; max-width: 145px; font-size: 12px; }
  .flight-mode .flight-camera-controls { top: auto; bottom: 16px; right: 12px; gap: 4px; }
  .flight-camera-controls button { width: 40px; height: 40px; min-height: 40px; }
  .flight-mode .flight-journey, .flight-mode:has(#flight-host[data-journey=false]) .flight-journey { left: 12px; right: auto; bottom: 16px; width: 190px; max-width: calc(100% - 156px); }
  .flight-mode .flight-journey summary { font-size: 13px; padding: 11px 10px; }
  .flight-mode .flight-journey[open] { left: 12px; right: 12px; top: auto !important; bottom: 16px; width: auto; max-width: none; }
  .flight-mode .flight-journey > div { max-height: 300px; }
  .flight-mode:has(.flight-journey[open]) .mission-hud { display: block; }
  .flight-mode .flight-status, #app[data-demo="true"] .flight-mode .flight-status { display: block; left: 16px; right: 16px; bottom: 68px; max-width: none; font-size: 12px; }
  .flight-mode .mission-hud { grid-column: 1; grid-row: 2; padding: 22px 18px 18px; }
  .mission-hud h2, .flight-mode .mission-hud h2 { font-size: 23px; }
  .mission-hud p, .flight-mode .mission-hud p { display: block; font-size: 15px; }
  .mission-hud .primary, .flight-mode .mission-hud .primary { min-height: 44px; font-size: 15px; }
  .mission-hud .secondary-link, .flight-mode .mission-hud .secondary-link { display: block; margin-left: 0; font-size: 14px; }
  .signal-console { grid-column: 1; grid-row: 3; padding: 20px 18px 22px; max-height: none; border-left: 0; }
  .signal-console > p, .signal-console > small { display: block; }
  .signal-console > p { font-size: 14px; }
  .signal-cards { display: grid; grid-template-columns: 1fr; overflow: visible; }
  .signal-card { min-width: 0; min-height: 0; padding: 14px; }
  .signal-card p { display: block; font-size: 15px; overflow: visible; -webkit-line-clamp: unset; }
  .signal-card small { display: block; font-size: 12px; }
  .signal-route select { font-size: 16px; }
  .signal-route button { font-size: 14px; min-height: 44px; }
  .flight-mode .demo-caption { grid-column: 1; grid-row: 2 / 4; padding: 24px 18px; }
  .demo-caption-head { font-size: 12px; }
  .demo-caption h2 { font-size: 26px; margin: 14px 0 10px; }
  .demo-caption p { font-size: 16px; line-height: 1.55; }
  .demo-caption small { font-size: 12px; }
  .entry { padding: 16px; min-height: 440px; background: #f2f6fbeb; }
  .entry-copy { width: 100%; max-width: 440px; margin: auto; padding: 22px; }
  .entry h2 { font-size: 32px; margin: 12px 0; }
  .entry p { font-size: 15px; line-height: 1.5; }
  .entry-rule { margin-top: 12px; }
  .entry-rule p { font-size: 14px; }
  .entry-actions { margin-top: 16px; }
  .entry small { font-size: 12px; }
  .world:has(.entry:not([hidden])) { min-height: 570px; }
  .entry:not([hidden]) { min-height: 570px; }
  .activity-strip { padding: 0 14px; gap: 10px; }
  .activity-title { font-size: 10px; }
  .activity-strip p, .activity-strip button { font-size: 12px; }
  .bottom-bar { display: flex; flex-wrap: wrap; padding: 12px 18px 18px; gap: 10px; }
  .program-switcher { width: 100%; }
  .program-button { padding: 4px 0; min-height: 42px; }
  .program-button strong { font-size: 14px; }
  .program-button span { font-size: 12px; }
  .bottom-bar .metrics { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .metrics > div, .metrics > button { min-width: 0; }
  .metrics button { padding: 0; }
  .metrics strong, .metrics button strong { font-size: 24px; }
  .metrics span { font-size: 11px; line-height: 1.4; max-width: none; }
  .bottom-bar .all-programs { display: none; }
  #drawer, #drawer.wide { width: calc(100vw - 24px); max-width: none; padding: 22px; margin: auto; max-height: calc(100dvh - 24px); }
  #drawer h2 { font-size: 28px; }
  #drawer .platform-grid, #drawer .detail-grid, #drawer .briefing-pillars, #drawer .lens-grid { grid-template-columns: 1fr; }
  #drawer .settings-row { flex-wrap: wrap; }
  #drawer .settings-row select { max-width: 100%; }
  .event-callout { top: 145px; right: 12px; max-width: calc(100% - 24px); }
}
@media (max-width: 380px) {
  .brand img { width: 106px; }
  .top-tools { gap: 3px; }
  .autoplay-button { font-size: 12px; padding-inline: 8px; }
  .views button { font-size: 12px; padding-inline: 5px; }
  .flight-mode .flight-journey summary { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
/* Hidden runtime panels must never consume a grid track or cover the scene. */
[hidden] { display: none !important; }
