@font-face {
  font-family: "ScriptBots Sans";
  src: url("./assets/fonts/inter-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "ScriptBots Mono";
  src: url("./assets/fonts/mono-latin.woff2") format("woff2");
  font-weight: 100 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  color-scheme: dark;
  --ink: #e6efe8;
  --muted: #a2b5a8;
  --green: #4ade80;
  --cold: #6bb7eb;
  --warm: #ffc36f;
  --hot: #ed9892;
  --page: #030a05;
  --panel: #06110a;
  --lift: rgb(255 255 255 / .05);
  --line: rgb(187 247 208 / .13);
  --edge: rgb(187 247 208 / .17);
  --sans: "ScriptBots Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "ScriptBots Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-family: var(--sans);
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  background: var(--page);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
h1, h2, h3, h4, h5, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, select, input { color: inherit; font: inherit; }
button, select {
  min-height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--lift);
  padding: 0 11px; cursor: pointer; white-space: nowrap; font-weight: 500;
  transition: background-color .18s, border-color .18s, color .18s;
}
button:enabled:hover, select:enabled:hover { background: rgb(255 255 255 / .1); border-color: rgb(187 247 208 / .28); }
button:disabled, select:disabled { color: #c4d2c8a6; opacity: .6; cursor: default; }
button[aria-pressed="true"], button[aria-selected="true"] { background: rgb(74 222 128 / .17); color: #f2fff6; border-color: rgb(74 222 128 / .5); }
button[aria-pressed="true"]:enabled:hover, button[aria-selected="true"]:enabled:hover { background: rgb(74 222 128 / .24); border-color: rgb(74 222 128 / .62); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: fixed; inset: 10px auto auto 10px; z-index: 9; padding: 12px; background: var(--panel); transform: translateY(-160%); }
.skip:focus { transform: none; }
.simulator { height: 100dvh; overflow: hidden; font-size: 14px; }
.play-document { height: 100%; }

/* The field is a size container: its HUD is laid out for the room the field has, whether that is the
   homepage frame, the full window, or the standalone workbench. */
.field {
  --gutter: clamp(9px, 1vw, 18px);
  --top: var(--gutter);
  --dock-reserved: 105px;
  --bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px));
  container: field / size;
  position: relative; isolation: isolate; width: 100%; height: 100%; overflow: hidden;
  background: #0b1a10;
  font-size: 14px;
}
.simulator .field, .field[data-expanded="true"] { --top: calc(var(--gutter) + env(safe-area-inset-top, 0px)); }
.field[data-expanded="true"] { position: fixed; inset: 0; z-index: 100; width: auto; height: auto; }
html.field-expanded, html.field-expanded body { overflow: hidden; overscroll-behavior: none; }
.viewport { position: absolute; inset: 0; background: radial-gradient(ellipse at 62% 20%, #4f6f5c, #19301f 70%); }
.field:not([data-renderer]) .viewport { background: #0b1a10 url("./media/field.webp") center / cover; }
#world-panel { position: absolute; inset: 0; pointer-events: none; }
#world-panel .floating { pointer-events: auto; }
#scene { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#scene:active { cursor: grabbing; }
#scene:focus-visible { outline-offset: -4px; }
.scene-message {
  position: absolute; inset: 45% auto auto 50%; translate: -50% -50%; width: min(84%, 430px); padding: 26px; text-align: center;
  background: rgb(4 12 7 / .9); border: 1px solid var(--edge); border-radius: 18px; box-shadow: 0 24px 60px -20px #000;
}
#scene-title { font-weight: 700; font-size: 1.4rem; letter-spacing: -.025em; margin-bottom: 8px; }
#scene-detail { color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
#fast-forward-title { font-weight: 700; font-size: 1.4rem; margin-bottom: 8px; }
#fast-forward-generation { margin-top: 12px; color: #8fd9a8; font-variant-numeric: tabular-nums; }
.field[data-fast-forward="true"] :is(#scene, #world-panel, #camera-menu) { visibility: hidden; }
.field[data-fast-forward="true"] .view-tools { display: none; }
.field[data-fast-forward="true"] .viewport { background: radial-gradient(ellipse at 52% 28%, #244635, #0b1a10 72%); }
.field[data-fast-forward="true"]:not([data-panel="world"]) #fast-forward-message { visibility: hidden; }

/* Glass over moving content: an edge, a top light, and the field behind it. */
.floating {
  border: 1px solid var(--edge); border-radius: 16px;
  background: linear-gradient(180deg, rgb(255 255 255 / .035), rgb(255 255 255 / 0) 42%), rgb(5 13 8 / .92);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .05), 0 18px 48px -18px rgb(0 0 0 / .75);
}
@media (hover: hover) and (pointer: fine) {
  .floating {
    background: linear-gradient(180deg, rgb(255 255 255 / .035), rgb(255 255 255 / 0) 42%), rgb(5 13 8 / .8);
    -webkit-backdrop-filter: blur(14px) saturate(1.3);
    backdrop-filter: blur(14px) saturate(1.3);
  }
}

/* The instrument bar: what this is, and the way to give it the whole window. */
.field-bar {
  position: absolute; z-index: 4; inset: var(--top) var(--gutter) auto auto;
  display: flex; align-items: center; gap: 8px; pointer-events: none;
}
.field-badge {
  display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 12px;
  border: 1px solid rgb(255 255 255 / .12); border-radius: 99px; background: rgb(0 0 0 / .58);
  font: 500 10px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: #d1fae5; white-space: nowrap;
}
.field-badge i { width: 6px; height: 6px; border-radius: 50%; background: #b49863; }
.field:has(#status[data-tone="live"]) .field-badge i { background: var(--green); box-shadow: 0 0 8px var(--green); animation: live-pulse 2.2s ease-in-out infinite; }
.field:has(#status[data-tone="error"]) .field-badge i { background: var(--hot); }
@keyframes live-pulse { 50% { opacity: .35; } }
.expand {
  pointer-events: auto; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 13px 0 11px;
  border: 1px solid rgb(255 255 255 / .16); border-radius: 12px; background: rgb(0 0 0 / .58); color: #fff; font-size: .8rem; font-weight: 600;
}
.expand:enabled:hover { background: rgb(0 0 0 / .72); border-color: rgb(74 222 128 / .6); color: #dcfce7; }
.expand svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.expand .icon-close, .field[data-expanded="true"] .expand .icon-open { display: none; }
.field[data-expanded="true"] .expand .icon-close { display: block; }
@media (hover: hover) and (pointer: fine) {
  .field-badge, .expand { -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
}
.simulator .expand { display: none; }
.field:not([data-panel="world"]) .field-badge { display: none; }
.field:not([data-panel="world"]) .field-bar { top: calc(var(--top) + 7px); right: calc(var(--gutter) + 7px); }
.field:not([data-panel="world"]) #expand-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.field:not([data-panel="world"]) .expand { padding-inline: 11px; }
.home .work-heading { padding-inline-end: 52px; }

.micro, .population-pulse h4, .diet-census h4 {
  font: 600 10px/1.3 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #8fd9a8;
}
.specimen, .specimen-placeholder {
  position: absolute; inset: var(--top) auto auto var(--gutter);
  width: min(30rem, 40cqw); max-height: calc(100% - var(--dock-reserved) - 2 * var(--gutter) - var(--top) - env(safe-area-inset-bottom, 0px));
  overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #3f7a55 transparent;
  padding: clamp(12px, 1.25vw, 18px);
}
.specimen { container: specimen / inline-size; }
.specimen-placeholder { width: min(20rem, 38cqw); }
.specimen-placeholder h3, .specimen-header h3, .work-heading h3 { font-size: clamp(1.3rem, 1.9vw, 1.75rem); font-weight: 750; letter-spacing: -.035em; color: #fff; }
.specimen-placeholder p, .specimen-place { color: var(--muted); margin-top: 6px; line-height: 1.45; }
.specimen-placeholder button { margin-top: 12px; }
.keys { display: flex; flex-wrap: wrap; gap: 5px 10px; margin: 9px 0 0; padding: 0; list-style: none; font-size: .74rem; color: var(--muted); }
.keys li { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.keys kbd { padding: 1px 5px; border: 1px solid var(--line); border-radius: 5px; background: rgb(255 255 255 / .05); font: 600 .66rem/1.5 var(--mono); color: var(--ink); }
.touch-help { display: none; }
.population-pulse { margin-top: 14px; }
.population-pulse h4, .diet-census h4 { margin-bottom: 7px; }
.population-bars { height: 32px; display: flex; gap: 2px; align-items: end; }
.population-bars span { flex: 1; min-width: 0; background: linear-gradient(#4ade80, #22a35a); border-radius: 2px; }
.population-bars span:last-child { background: var(--warm); }
.diet-census { margin-top: 14px; }
.diet-track { background: rgb(255 255 255 / .08); display: flex; height: 5px; overflow: hidden; border-radius: 4px; }
.diet-track span { background: var(--warm); }
.diet-track span:nth-child(2) { background: var(--cold); }
.diet-track span:nth-child(3) { background: var(--green); }
.diet-census dl { display: flex; justify-content: space-between; gap: 3px; margin: 6px 0 0; font-size: .68rem; color: var(--muted); }
.diet-census dd { margin: 2px 0 0; color: var(--ink); font: 500 .78rem var(--mono); }
.specimen-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.specimen-buttons { display: flex; gap: 5px; align-items: center; }
#specimen-expand, #camera-menu { display: none; }
.specimen-header h3 { border-left: 3px solid var(--green); border-radius: 2px; padding-left: 10px; }
.specimen-place { margin-bottom: 9px; font-size: .83rem; }
.vital-grid, .sample-stats { display: grid; gap: 5px; }
.vital-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.vital-grid > div { display: grid; gap: 3px; min-width: 0; min-height: 56px; padding: 7px 8px; border: 1px solid rgb(187 247 208 / .08); border-radius: 10px; background: rgb(255 255 255 / .035); align-content: start; }
.vital-grid label, .vital-grid span, .sample-stats dt, .instrument-caption { color: var(--muted); text-transform: uppercase; font: 600 9.5px/1.3 var(--mono); letter-spacing: .08em; }
.vital-grid output { font-size: 1.25rem; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: #fff; }
meter { width: 100%; height: 7px; accent-color: var(--green); }
meter::-webkit-meter-bar { background: rgb(255 255 255 / .08); border: 0; border-radius: 4px; }
meter::-webkit-meter-optimum-value { background: var(--green); border-radius: 4px; }
#energy::-webkit-meter-optimum-value { background: var(--warm); }
.instrument-caption { margin-top: 10px; color: #8fd9a8; }
.instrument-caption small { text-transform: none; font: 400 .68rem var(--sans); letter-spacing: 0; color: var(--muted); margin-left: 4px; }
.sample-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 6px 0 8px; }
.sample-stats dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.specimen-action { display: grid; grid-template-columns: minmax(80px, .8fr) minmax(0, 2fr); gap: 10px; }
.specimen-action h4, .minimap figcaption { font-size: .7rem; color: var(--muted); font-weight: 550; margin-bottom: 4px; }
.minimap { margin: 0; }
.minimap div { position: relative; overflow: hidden; border: 1px solid rgb(187 247 208 / .2); border-radius: 6px; }
.minimap canvas { width: 100%; display: block; }
#map-marker { position: absolute; width: 10px; height: 8px; translate: -50% -50%; clip-path: polygon(0 0, 100% 50%, 0 100%); background: #dcfce7; filter: drop-shadow(0 0 2px black); }
.signals { display: grid; gap: 3px; }
.signal { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) 2.28rem; gap: 5px; align-items: center; min-width: 0; font-size: .72rem; }
.signal span { overflow-wrap: anywhere; }
.signal output { text-align: right; font-variant-numeric: tabular-nums; }
#actions .signal meter::-webkit-meter-optimum-value { background: var(--warm); }
#wheel-requests { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 6px 0; }
#wheel-requests .signal, .signal-grid .signal { grid-template-columns: minmax(0, 1fr) auto; gap: 1px 3px; }
#wheel-requests .signal meter, .signal-grid .signal meter { grid-row: 2; grid-column: 1 / -1; }
.eye-heading { display: flex; align-items: center; gap: 7px; color: var(--muted); margin: 8px 0 4px; font-size: .68rem; }
.eye-heading h4 { font-size: .72rem; color: var(--ink); font-weight: 600; }
.eye-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.eye-grid > div { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 3px; background: rgb(74 222 128 / .07); border: 1px solid rgb(187 247 208 / .08); border-radius: 8px; padding: 5px; font: .67rem var(--mono); }
.eye-grid canvas { width: 34px; height: 34px; justify-self: center; }
.eye-grid meter { grid-column: 1 / -1; }
.signal-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px 8px; margin: 6px 0 8px; }
#sensors { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.specimen details { border-top: 1px solid var(--line); margin: 9px 0 7px; }
.specimen summary { padding: 8px 0; cursor: pointer; color: var(--muted); font-size: .75rem; }
.ruled-data { margin: 0 0 8px; font-size: .75rem; }
.ruled-data > div { display: flex; justify-content: space-between; gap: 9px; padding: 6px 0; border-top: 1px solid var(--line); }
.ruled-data dd { margin: 0; color: var(--muted); }
.brain-activity { display: grid; gap: 6px; margin: 6px 0 0; }
.brain-activity:empty { display: none; }
.brain-activity p, .brain-activity h5 { font-size: .72rem; color: var(--muted); }
.activations { display: flex; gap: 1px; height: 24px; }
.activations span { flex: 1; position: relative; border-radius: 2px; background: linear-gradient(#173222 49%, #4f8a63 50%, #173222 53%); }
.activations span::before { content: ""; position: absolute; inset: auto 0 50%; height: var(--level); border-radius: 2px 2px 0 0; background: #e0b366; }
.activations span[data-sign="negative"]::before { inset: 50% 0 auto; border-radius: 0 0 2px 2px; background: #5fa8dc; }
.specimen-scales { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 9px; color: var(--muted); font-size: .72rem; }
.spectrum { position: relative; margin-top: 5px; height: 5px; border-radius: 3px; background: linear-gradient(90deg, #a25753, #b5a35c, #5da366); }
#temperature-spectrum { background: linear-gradient(90deg, #528fbe, #93b6a7, #d87d4d); }
.spectrum[data-sampled]::after { content: ""; position: absolute; inset: -2px auto -2px var(--sample); width: 5px; border-radius: 2px; translate: -50% 0; background: #ecfdf3; }

/* The console. */
.dock {
  position: absolute; z-index: 3; inset: auto var(--gutter) var(--bottom);
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px;
  padding: 9px 10px 9px 14px; border-radius: 18px;
}
.dock-world { flex: 1 1 155px; min-width: 0; }
.dock-title, .dock-scene { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 10px; }
.dock-title h2 { font-size: 1.05rem; font-weight: 750; letter-spacing: -.025em; color: #fff; }
.dock-scene { color: var(--muted); font-size: .74rem; margin-top: 2px; }
.dock-scene > span + span::before { content: "·"; margin-right: 10px; color: rgb(187 247 208 / .35); }
.state { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px 2px 7px; border-radius: 99px; background: rgb(255 255 255 / .05); font-size: .72rem; color: var(--muted); }
.state i { width: 6px; height: 6px; border-radius: 50%; background: #b49863; }
.state[data-tone="live"] { color: #bbf7d0; background: rgb(74 222 128 / .1); }
.state[data-tone="live"] i { background: var(--green); box-shadow: 0 0 7px var(--green); }
.state[data-tone="error"] { color: #fecaca; background: rgb(237 152 146 / .12); }
.state[data-tone="error"] i { background: var(--hot); }
.telemetry { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 5px 0 0; color: var(--muted); }
.telemetry > div { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.telemetry dt { font: 600 9.5px var(--mono); letter-spacing: .12em; text-transform: uppercase; }
.telemetry dd { margin: 0; color: #fff; font: 500 .8rem var(--mono); font-variant-numeric: tabular-nums; }
.playback, .view-tools, .tabs, .dock-end, .inline-actions, .segments { display: flex; gap: 5px; align-items: center; }
.inline-actions, .segments { flex-wrap: wrap; }
#preset-name {
  min-width: min(100%, 12rem); max-width: 100%; min-height: 38px;
  border: 1px solid var(--line); border-radius: 8px; background: rgb(255 255 255 / .04); padding: 6px 8px;
}
.view-tools, .tabs { gap: 2px; padding: 3px; border: 1px solid rgb(187 247 208 / .08); border-radius: 13px; background: rgb(0 0 0 / .3); }
.view-tools button, .tabs button { border-color: transparent; background: none; color: var(--muted); }
.view-tools button:enabled:not([aria-pressed="true"]):hover, .tabs button:enabled:not([aria-selected="true"]):hover { background: rgb(255 255 255 / .06); border-color: transparent; color: #fff; }
.view-tools button[aria-pressed="true"], .tabs button[aria-selected="true"] { background: rgb(74 222 128 / .17); border-color: rgb(74 222 128 / .45); color: #fff; }
.dock-end { margin-left: auto; }
.run { min-width: 72px; background: #22c55e; border-color: #22c55e; color: #03190b; font-weight: 700; }
.run:enabled:hover { background: var(--green); border-color: var(--green); color: #03190b; }
.site-back { color: var(--muted); padding: 4px 4px; font-size: .74rem; white-space: nowrap; }
.site-back:hover { color: #fff; }
.home .site-back { display: none; }

.work-panel {
  position: absolute; inset: var(--top) var(--gutter) calc(var(--bottom) + var(--dock-reserved) + var(--gutter));
  overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #3f7a55 transparent;
  padding: clamp(14px, 1.4vw, 23px); border: 1px solid var(--edge); border-radius: 18px;
  background: linear-gradient(180deg, rgb(255 255 255 / .03), rgb(255 255 255 / 0) 120px), #040c07;
}
.work-heading, .observatory-controls { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 15px; }
.work-heading { margin-bottom: 14px; }
.work-heading h3 { margin-bottom: 3px; }
.subtle { font-size: .82rem; line-height: 1.45; color: var(--muted); overflow-wrap: anywhere; }
.census { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px 25px; margin: 0 0 15px; }
.census > div { display: flex; gap: 6px; align-items: baseline; }
.census dt { color: var(--muted); font-size: .86rem; }
.census dd { margin: 0; font: 600 1.06rem var(--mono); font-variant-numeric: tabular-nums; color: var(--green); }
#obs-reserve { color: var(--warm); }
#obs-separation { color: var(--cold); }
.observatory-grid, .lab-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
.instrument { min-width: 0; padding: clamp(11px, 1.2vw, 18px); border: 1px solid rgb(187 247 208 / .08); border-radius: 14px; background: rgb(255 255 255 / .03); }
.instrument.wide { grid-column: 1 / -1; }
.instrument-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 9px; min-height: 30px; }
.instrument-heading h4 { font-size: clamp(1.05rem, 1.5vw, 1.4rem); font-weight: 700; letter-spacing: -.025em; color: #fff; }
.instrument button { min-height: 32px; }
.cohort-table table { width: calc(100% + 6px); margin: 0 -3px 7px; table-layout: fixed; border-spacing: 3px 5px; font-size: .78rem; }
.cohort-table th { text-align: center; font-weight: 500; color: var(--muted); overflow-wrap: anywhere; }
.cohort-table th:first-child { width: 18%; text-align: left; color: var(--ink); }
.cohort-table th:nth-child(2) { width: 12%; }
.cohort-table thead th { padding-block: 4px; }
.cohort-table td:nth-child(2) { text-align: center; color: var(--muted); }
.cohort-table td button { position: relative; width: 100%; height: 37px; padding: 0 2px 4px; border-radius: 7px; font-size: inherit; }
.cohort-table td button i { position: absolute; bottom: 4px; left: 50%; width: var(--width); height: 3px; background: var(--green); }
.cohort-table td button i[data-rank="lower"] { translate: -100% 0; background: #b8a5ed; }
.cohort-histogram { display: grid; grid-template-columns: repeat(var(--bins, 12), minmax(0, 1fr)); gap: 4px; height: clamp(120px, 18cqh, 216px); }
.cohort-histogram button { display: flex; align-items: end; padding: 0; border-radius: 5px; overflow: hidden; }
.cohort-histogram i { width: 50%; background: var(--green); }
.cohort-histogram i + i { background: var(--cold); }
.cohort-values { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 1rem; margin: 7px 0; color: var(--green); }
#cohort-rest-value { color: var(--cold); }
#cohort-scale { margin-bottom: 5px; }
.cohort-method { margin-top: 9px; }
.distribution-scale { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .72rem; margin-top: 5px; }
.comparison-meter { margin-top: 9px; display: grid; gap: 4px; color: var(--muted); font-size: .78rem; }
#cohort-overlap::-webkit-meter-optimum-value { background: var(--cold); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 10px; color: var(--muted); font: .72rem var(--mono); }
.chart-legend span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 5px; border-radius: 50%; background: var(--key); }
.legend-life { --key: var(--green); }
.legend-birth { --key: var(--cold); }
.legend-death { --key: var(--hot); }
.history-windows, .atlas-metrics { margin-bottom: 9px; }
.trend-plot { height: clamp(150px, 39cqh, 425px); margin-top: 8px; }
#trend { width: 100%; height: 100%; display: block; }
#trend-cursor, #study-cursor { display: block; width: 100%; margin: 8px 0; accent-color: var(--green); }
.atlas-cells, .condition-cells { display: grid; gap: 4px; margin-bottom: 7px; }
.atlas-cells { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.condition-cells { grid-template-columns: repeat(8, minmax(0, 1fr)); margin-top: 7px; }
.atlas-cells button, .condition-cells button { min-width: 0; min-height: 29px; padding: 0; border-radius: 5px; border: 1px solid rgb(187 247 208 / .14); background: color-mix(in srgb, var(--tile, #65c58a) var(--level, 0%), #0e2116); font: .64rem var(--mono); }
.atlas-cells button[aria-pressed="true"], .cohort-histogram button[aria-pressed="true"] { outline: 1px solid #86efac; }
.atlas-detail { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.atlas-detail p { flex: 1 1 12rem; }
.generation-mix { display: flex; min-height: 9px; gap: 2px; overflow: hidden; border-radius: 4px; }
.generation-mix span { background: var(--key); }
.generation-legend { margin: 8px 0 10px; }
.generation-history { display: flex; gap: 2px; height: 76px; border-bottom: 1px solid var(--line); }
.generation-history > div { display: flex; flex: 1; flex-direction: column-reverse; min-width: 0; }
.generation-history span { flex: 0 0 auto; background: var(--key); }
#follow-generation { margin: 8px 0; }
#lineage-coverage { margin: 6px 0; }
.observations { padding: 0; margin: 0; list-style: none; }
.observations > li { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 5px 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: .83rem; }
.methods { max-width: 65rem; }
.methods dt { min-width: 10rem; }
.methods dd { flex: 1; }
.lab-grid .instrument { display: flex; flex-direction: column; align-items: start; gap: 8px; }
.lab-grid .instrument-heading { margin: 0; }
.lab-grid label, .study-result label { font-size: .8rem; color: var(--muted); }
.lab-grid select { max-width: 100%; }
.secondary-action { background: rgb(74 222 128 / .14); border-color: rgb(74 222 128 / .4); color: #f2fff6; }
.event-history { margin-top: 10px; }
.experiment-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); gap: 8px; align-items: end; margin: 11px 0; }
.experiment-form label { display: grid; gap: 4px; min-width: 0; color: var(--muted); font-size: .76rem; }
.experiment-form input, .experiment-form select { min-width: 0; width: 100%; min-height: 38px; border: 1px solid var(--line); border-radius: 8px; background: rgb(255 255 255 / .04); padding: 6px 8px; }
.experiment-form .inline-actions { grid-column: 1 / -1; }
.lab-receipt { padding: 9px 10px; border-radius: 10px; border: 1px solid rgb(74 222 128 / .2); background: rgb(74 222 128 / .08); margin-top: 9px; font-size: .83rem; }
.lab-receipt[data-tone="error"] { border-color: #965b53; background: rgb(237 152 146 / .08); color: #ffd6ce; }
.study-result { margin: 10px 0; border-top: 1px solid var(--line); padding-top: 9px; }
.study-result table { width: 100%; border-collapse: collapse; margin: 8px 0; font: .72rem var(--mono); }
.study-result th, .study-result td { text-align: right; border-bottom: 1px solid var(--line); padding: 6px 2px; }
.study-result th:first-child, .study-result td:first-child { text-align: left; }
.study-result [data-direction="up"] { color: var(--green); }
.study-result [data-direction="down"] { color: var(--warm); }
#timeline-source { margin-bottom: 7px; }
#timeline li { justify-content: start; }
#timeline time { font: .72rem var(--mono); color: var(--cold); }

/* Plain pages: licenses and not found. */
.wrap { width: min(1380px, calc(100% - 36px)); margin-inline: auto; }
.mast { padding-block: 18px; border-bottom: 1px solid var(--line); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.03em; }
.wordmark img { display: block; width: 24px; height: 24px; border-radius: 6px; }
.legal { padding-block: 48px; }
.legal h1 { margin-bottom: 18px; font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 800; letter-spacing: -.045em; }
.legal p, .legal ul { max-width: 73ch; line-height: 1.65; color: #c5d3c9; }
.legal li { margin-block: 6px; }
.legal a { color: #86efac; text-decoration: underline; text-underline-offset: .2em; }

/* ---------- The HUD fits the field it is in ---------- */
/* Below full-window desktop widths the camera presets fold into one Camera menu, shown as a row of the console. */
@container field (max-width: 1319px) {
  #camera-menu { display: inline-block; }
  .field:not([data-camera-open="true"]) .view-tools { display: none; }
  .view-tools { order: 5; flex-basis: 100%; flex-wrap: wrap; justify-content: center; }
}
@container field (max-width: 999px) {
  .dock-world { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 12px; }
  .dock-scene, .telemetry { margin: 0; }
  .specimen { width: min(400px, 46cqw); }
}
@container field (max-width: 820px) {
  .work-panel { padding: 12px; }
  .observatory-grid, .lab-grid { grid-template-columns: minmax(0, 1fr); }
  .cohort-histogram { height: 160px; }
}
@container field (max-width: 620px) {
  .viewport, #world-panel, .work-panel, .dock, .field-bar { font-size: 13px; }
  .dock { gap: 5px 6px; padding: 8px; border-radius: 16px; }
  .dock-world { column-gap: 6px; row-gap: 3px; }
  .dock-title h2 { font-size: .98rem; }
  .dock-scene { display: none; }
  .telemetry { gap: 7px; }
  .state { font-size: .66rem; padding-inline: 6px; }
  .telemetry dt { font-size: 8.5px; letter-spacing: .08em; }
  .telemetry dd { font-size: .72rem; }
  .dock button, .dock select { min-height: 41px; padding-inline: 7px; font-size: .77rem; }
  .dock .run { min-width: 58px; }
  .playback, .view-tools, .dock-end { gap: 4px; }
  .view-tools, .dock-end { flex-basis: 100%; }
  #camera-menu { margin-left: auto; }
  .playback { width: 100%; flex-wrap: wrap; }
  .view-tools {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, .7fr) minmax(0, .9fr) minmax(0, 1fr);
    order: 0;
  }
  .view-tools button { min-width: 0; padding-inline: 2px; }
  .desktop-camera-label { display: none; }
  .dock-end { justify-content: space-between; }
  .site-back { font-size: .69rem; }
  .field-badge { display: none; }
  .expand { width: 40px; padding: 0; justify-content: center; }
  #expand-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .view-tools, .tabs { padding: 0; border: 0; background: none; }
  .view-tools button, .tabs button { background: var(--lift); border-color: var(--line); color: var(--ink); }
  .specimen-placeholder { width: auto; max-width: calc(100% - 2 * var(--gutter) - 48px); display: flex; align-items: center; gap: 9px; padding: 5px 6px 5px 10px; border-radius: 14px; }
  .specimen-placeholder :is(h3, .touch-help, .population-pulse, .diet-census) { display: none; }
  .specimen-placeholder p, .specimen-placeholder button { margin: 0; }
  .specimen-placeholder button { min-height: 34px; font-size: .72rem; padding-inline: 7px; }
  .specimen {
    inset: auto var(--gutter) calc(var(--bottom) + var(--dock-reserved) + var(--gutter));
    width: auto; max-height: 54cqh; padding: 9px 10px;
  }
  .specimen-header h3 { font-size: 1.13rem; }
  .specimen-header button { min-height: 39px; padding-inline: 9px; font-size: .77rem; }
  .specimen-place { margin-block: 2px 6px; font-size: .76rem; }
  .vital-grid > div { min-height: 0; padding: 5px 6px; }
  .vital-grid output { font-size: 1.02rem; }
  #specimen-expand { display: inline-block; }
  .specimen[data-expanded="false"] #specimen-details { display: none; }
  #sensors, .signal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .desktop-help { display: none; }
  .home .work-heading { padding-inline-end: 46px; }
  .work-heading, .observatory-controls { gap: 6px; }
  .work-heading { margin-bottom: 9px; }
  .observatory-controls button { padding-inline: 6px; min-height: 34px; font-size: .7rem; }
  .census { gap: 3px 9px; margin-bottom: 8px; }
  .census dt, .census dd { font-size: .76rem; }
  .cohort-table table { font-size: .68rem; }
  .cohort-table th:first-child { width: 19%; }
  .cohort-table td button { height: 34px; min-height: 34px; }
  .instrument-heading button { font-size: .72rem; }
  .atlas-cells, .condition-cells { gap: 2px; }
  .methods .ruled-data > div { display: grid; }
}
@container specimen (max-width: 460px) {
  #sensors, .signal-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .vital-grid label, .vital-grid span { font-size: 9px; letter-spacing: .04em; }
  .vital-grid > div { padding-inline: 7px; }
}
@container field (max-height: 540px) {
  .dock { padding-block: 5px; gap: 4px 8px; }
  .specimen-placeholder { padding: 9px; }
  .specimen { max-height: 44cqh; }
}
@media (hover: none) and (pointer: coarse) {
  .desktop-help { display: none; }
  .touch-help { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .field:has(#status[data-tone="live"]) .field-badge i { animation: none; }
  button, select { transition: none; }
}
