@font-face {
  font-family: Geist;
  src: url("/geist.ttf");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: Geist;
  src: url("/geist-semibold.ttf");
  font-weight: 600;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --bg: #000408;
  --panel: #02070d;
  --ink: #c8e0ea;
  --muted: #5887a0;
  --line: #123042;
  --cyan: #72d6ff;
  --warm: #ffb83e;
  --mono: "SFMono-Regular", Consolas, monospace;
  background: var(--bg);
  color: var(--ink);
  font:
    400 12px/16px Geist,
    sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
select,
input {
  font: inherit;
}
[hidden] {
  display: none !important;
}
h1,
h2,
h3,
p {
  margin: 0;
  text-wrap: pretty;
}
h1,
h2,
h3 {
  font-weight: 400;
  text-wrap: balance;
}
button,
select,
input[type="number"] {
  border: 1px solid #1c4a60;
  border-radius: 0;
  padding: 8px;
  background: #030c13;
  color: #a8d6e9;
  font: 400 12px/16px var(--mono);
  cursor: pointer;
  transition:
    background-color 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
button:hover,
select:hover {
  background: #092033;
  border-color: #54c1ed;
}
button:active {
  transform: translateY(1px);
}
button:disabled,
select:disabled {
  opacity: 0.4;
  cursor: default;
}
button:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible,
a:focus-visible,
canvas:focus-visible {
  outline: 2px solid var(--warm);
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}
.skip {
  position: absolute;
  left: -10000px;
}
.skip:focus {
  left: 8px;
  top: 8px;
  background: #092033;
  z-index: 100;
  padding: 8px;
}
.rail-toggle {
  display: none;
}
.laboratory {
  height: calc(100dvh - 24px);
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}
#controls {
  background: #01060b;
  border: 1px solid var(--line);
  border-top: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #154158 #000408;
}
.navigation-card {
  position: sticky;
  top: 0;
  z-index: 3;
  background: #000408;
  padding: 12px;
  border: 1px solid var(--line);
  margin: -1px;
}
.navigation-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.navigation-heading h1 {
  color: #5ea7ca;
  font-size: 12px;
  line-height: 16px;
  max-width: 144px;
}
.navigation-heading > span {
  font: 400 12px/16px var(--mono);
  color: #7bc2dc;
  white-space: nowrap;
}
#navigation-preview {
  width: 100%;
  height: 192px;
  display: block;
  margin: 8px 0;
  background: #000408;
}
.navigation-key {
  display: flex;
  gap: 8px;
  color: #5e9cb8;
  font:
    400 12px/16px Geist,
    sans-serif;
}
.navigation-key span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.navigation-key span:last-child {
  margin-left: auto;
  font-size: 12px;
}
.navigation-key i {
  width: 4px;
  height: 4px;
  display: inline-block;
}
.map-agent {
  background: #fff;
}
.map-plan {
  background: #d0d2ff;
}
.control-section {
  padding: 12px;
  border: 1px solid var(--line);
  margin: -1px;
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.section-heading h2,
.instrument-metrics h2 {
  color: #5c9dc0;
  font-size: 12px;
  line-height: 16px;
}
.signal {
  width: 4px;
  height: 4px;
  display: block;
  background: #55c2e7;
}
label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: #5e9ab9;
  font-size: 12px;
  line-height: 16px;
  min-width: 0;
}
.control-section > label {
  margin: 8px 0;
}
.control-section select,
.control-section input[type="number"] {
  width: 100%;
  min-width: 0;
}
.primary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  color: #77eaff;
  border-color: #247495;
  background: #031821;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.06em;
}
.primary:hover {
  background: #0b3445;
  border-color: #83e1ff;
}
#solve {
  margin-top: 12px;
  color: #d5faff;
  border-color: #2c92b1;
  background: #062531;
}
.source-note {
  margin-top: 8px;
  color: #6ca0b7;
  font-size: 12px;
  line-height: 16px;
}
.advanced {
  margin-top: 8px;
}
summary {
  font-size: 12px;
  line-height: 20px;
  color: #6098b2;
  cursor: pointer;
  list-style-position: inside;
}
summary:hover {
  color: #a6e5fd;
}
.advanced > div {
  display: grid;
  gap: 12px;
  margin: 12px 0;
}
.quiet {
  width: 100%;
  text-align: left;
  color: #97cadd;
}
.instrument-metrics > dl {
  margin: 8px 0 0;
  display: grid;
  gap: 8px;
}
.instrument-metrics dl > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.instrument-metrics dt {
  color: #55849b;
  font:
    400 12px/16px Geist,
    sans-serif;
}
.instrument-metrics dd {
  margin: 0;
  color: #38d7fb;
  font: 400 12px/16px var(--mono);
}
.instrument-metrics dl > div:nth-child(3) dd {
  color: #ffd13a;
}
.decision-receipt {
  margin: 8px 0 0;
  display: grid;
  gap: 8px;
}
.decision-receipt > div {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 8px;
}
.decision-receipt dt {
  color: #52839b;
}
.decision-receipt dd {
  margin: 0;
  color: #b0d7e5;
  font-size: 12px;
  line-height: 16px;
  overflow-wrap: anywhere;
}
.memory-stats {
  display: flex;
  gap: 16px;
  margin: 12px 0;
}
.memory-stats > div {
  display: grid;
  gap: 4px;
}
.memory-stats b {
  font: 400 18px/28px var(--mono);
  color: #5ed6fc;
}
.memory-stats span {
  color: #5587a1;
  font-size: 12px;
}
.archive-tools > label {
  margin-top: 12px;
}
.check {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.check input {
  margin: 0;
  accent-color: #29bce6;
}
.mask {
  padding: 0;
  border: 0;
  display: flex;
  gap: 16px;
}
.mask legend {
  color: #5792ad;
  font-size: 12px;
  margin-bottom: 8px;
}
.selection-section,
.about {
  padding: 12px;
  border: 1px solid var(--line);
  margin: -1px;
}
.selection-source {
  color: #7cddfc;
  margin-top: 8px;
  font: 400 12px/16px var(--mono);
}
#selection-detail,
.about p {
  color: #739cb1;
  font-size: 12px;
  line-height: 20px;
  margin-top: 8px;
}
#selection-values {
  margin: 8px 0;
}
#selection-values > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
#selection-values dt {
  color: #5487a2;
}
#selection-values dd {
  margin: 0;
  color: #a6d7ed;
}
.workspace {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(280px, 0.9fr);
  grid-template-rows: minmax(0, 1fr) 160px;
  position: relative;
  overflow: hidden;
  background: #000408;
}
#memory-panel {
  grid-column: 1;
  grid-row: 1;
}
#hierarchy-panel {
  grid-column: 2;
  grid-row: 1;
}
.view-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 64px minmax(0, 1fr) 40px 24px;
  border: 1px solid var(--line);
  margin: -1px 0 0 -1px;
  background: #000408;
}
#memory-panel {
  grid-template-rows: 64px minmax(0, 1fr) 32px 24px;
}
.view-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  gap: 8px;
  border: 1px solid #0d2534;
  margin: -1px;
  background: #01070e;
}
.eyebrow {
  font: 400 12px/16px var(--mono);
  color: #477d9a;
  text-transform: uppercase;
}
.view-heading h2 {
  font:
    400 16px/24px Geist,
    sans-serif;
  color: #d2e8ee;
}
.view-heading h2 > span:not(#task-view-name) {
  display: block;
  font: 400 12px/16px var(--mono);
  color: #4d92b0;
}
.view-tools {
  display: flex;
  gap: 4px;
  align-items: center;
}
.view-tools select {
  border: 0;
  padding: 4px;
  background: transparent;
  color: #71c7ea;
  font-size: 12px;
}
.view-menu {
  position: relative;
}
.view-menu > summary {
  list-style: none;
  font-size: 20px;
  line-height: 28px;
  padding: 0 4px;
}
.view-menu > summary::-webkit-details-marker {
  display: none;
}
.view-menu > div {
  position: absolute;
  top: 32px;
  right: 0;
  min-width: 160px;
  z-index: 30;
  background: #010c16;
  border: 1px solid #21506a;
  padding: 8px;
  display: grid;
  gap: 4px;
}
.view-menu button {
  border: 0;
  text-align: left;
  background: #010c16;
  color: #75b9d8;
  font-size: 12px;
}
.frame-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
}
iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #000408;
}
#episode-field {
  position: absolute;
  inset: 0;
}
#episode-field canvas {
  width: 100%;
  height: 100%;
  display: block;
}
#episode-field .spatial-toolbar {
  display: none;
}
#episode-readout {
  top: 12px;
  left: 16px;
}
.loading {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 24px;
  background: #000408;
  color: #5eaccb;
  font: 400 12px/16px var(--mono);
  z-index: 5;
}
.skeleton {
  width: 60%;
  height: 144px;
  border: 1px solid #153b53;
  transform: skewY(-12deg);
}
.playback {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid #0b2636;
  margin: -1px;
}
.playback input {
  flex: 1;
  min-width: 24px;
  accent-color: #30b8e9;
  height: 4px;
}
.play {
  font: 400 12px/16px var(--mono);
  padding: 4px;
  border: 0;
  background: transparent;
  color: #83e4ff;
  min-width: 56px;
}
.playback > span {
  font: 400 12px/16px var(--mono);
  color: #65a6c0;
  white-space: nowrap;
}
.view-foot,
.memory-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  color: #4f8ba6;
  font:
    400 12px/16px Geist,
    sans-serif;
}
.key {
  display: flex;
  align-items: center;
  gap: 8px;
}
.key i {
  width: 4px;
  height: 4px;
}
.gold {
  background: #fff26c;
}
.cyan {
  background: #39c5fb;
}
.rust {
  background: #f77844;
}
.memory-caption #memory-busy {
  display: none;
}
.instrument-legend {
  position: absolute;
  right: 16px;
  top: 12px;
  width: 80px;
  background: #00070cde;
  border: 1px solid #15384b;
  padding: 8px;
  z-index: 3;
  pointer-events: none;
}
.instrument-legend h3 {
  font:
    400 12px/16px Geist,
    sans-serif;
  color: #76bddd;
  margin-bottom: 8px;
}
.scale-wrap {
  display: flex;
  gap: 8px;
}
.spectrum {
  width: 12px;
  height: 144px;
  background: linear-gradient(
    to top,
    #10239f 0%,
    #0071e1 20%,
    #00dbda 40%,
    #58eb49 60%,
    #ffdf19 80%,
    #ff3c09 100%
  );
}
.scale-values {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  color: #a2d5e7;
  font: 400 12px/16px var(--mono);
}
.scale-values span {
  font:
    400 12px/16px Geist,
    sans-serif;
  max-width: 32px;
  color: #3c7898;
}
.scale-values b {
  font-weight: 400;
}
.instrument-legend > p {
  font:
    400 12px/16px Geist,
    sans-serif;
  color: #396d88;
  margin-top: 8px;
}
.diagnostic-strip {
  grid-column: 1/-1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  background: #000408;
  border: 1px solid var(--line);
  min-height: 0;
}
.diagnostic-strip figure {
  margin: 0;
  border: 1px solid #143043;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: 24px minmax(0, 1fr);
  background: #010912;
}
.diagnostic-strip figcaption {
  padding: 4px 8px;
  color: #5b9abb;
  font:
    400 12px/16px Geist,
    sans-serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.diagnostic-strip canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.instrument-footer {
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 12px;
  border: 1px solid #173446;
  color: #3e7e9d;
  background: #000408;
  font: 400 12px/16px var(--mono);
}
.instrument-footer span:first-child {
  color: #6dba8a;
}
.dashboard-error {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 180px;
  z-index: 80;
  padding: 12px;
  background: #211509;
  border: 1px solid #a8732e;
  color: #ffcf83;
  font-size: 12px;
}
.workspace[data-layout="memory"],
.workspace[data-layout="hierarchy"] {
  grid-template-columns: 1fr;
}
.workspace[data-layout="memory"] #hierarchy-panel,
.workspace[data-layout="hierarchy"] #memory-panel {
  display: none;
}
.workspace[data-layout="hierarchy"] #hierarchy-panel {
  grid-column: 1;
}
@media (max-width: 1350px) {
  .laboratory {
    grid-template-columns: 224px minmax(0, 1fr);
  }
  #navigation-preview {
    height: 176px;
  }
  .workspace {
    grid-template-columns: minmax(0, 1.7fr) minmax(256px, 0.9fr);
  }
  .view-heading {
    padding: 8px 12px;
  }
  .view-heading h2 {
    font-size: 14px;
    line-height: 20px;
  }
  .view-tools select {
    max-width: 128px;
  }
  .view-foot > .key {
    display: none;
  }
  .view-foot,
  .memory-caption {
    font-size: 12px;
  }
  .diagnostic-strip figcaption {
    padding: 4px;
    font-size: 12px;
  }
  .instrument-legend {
    right: 8px;
    width: 72px;
  }
  .spectrum {
    height: 112px;
  }
}
@media (max-width: 900px) {
  .laboratory {
    grid-template-columns: 216px minmax(0, 1fr);
  }
  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(420px, 1.5fr) minmax(320px, 1fr) 144px;
    overflow-y: auto;
  }
  #memory-panel {
    grid-row: 1;
    grid-column: 1;
  }
  #hierarchy-panel {
    grid-row: 2;
    grid-column: 1;
  }
  .diagnostic-strip {
    grid-row: 3;
    min-height: 144px;
    grid-template-columns: repeat(5, minmax(128px, 1fr));
    overflow-x: auto;
  }
  .workspace[data-layout="memory"],
  .workspace[data-layout="hierarchy"] {
    grid-template-rows: minmax(0, 1fr) 144px;
  }
  .workspace[data-layout="hierarchy"] #hierarchy-panel {
    grid-row: 1;
  }
  .workspace[data-layout="memory"] .diagnostic-strip,
  .workspace[data-layout="hierarchy"] .diagnostic-strip {
    grid-row: 2;
  }
  .instrument-footer span:nth-child(3) {
    display: none;
  }
}
@media (max-width: 600px) {
  .rail-toggle {
    display: block;
    position: fixed;
    right: 12px;
    bottom: 36px;
    z-index: 70;
    padding: 8px 12px;
    box-shadow: 0 0 0 4px #000a;
  }
  .laboratory {
    height: calc(100dvh - 24px);
    grid-template-columns: 1fr;
  }
  #controls {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 24px;
    width: min(90vw, 320px);
    z-index: 60;
    background: #00070d;
  }
  .controls-open #controls {
    display: block;
  }
  #navigation-preview {
    height: 224px;
  }
  .workspace {
    grid-template-rows: 520px 420px 152px;
  }
  .view-panel {
    grid-template-rows: 64px minmax(0, 1fr) 40px 24px;
  }
  .instrument-footer {
    font-size: 12px;
    gap: 4px;
    padding: 0 4px;
  }
  .instrument-footer span:nth-child(2) {
    display: none;
  }
  .instrument-legend {
    width: 64px;
    right: 8px;
    padding: 4px;
  }
  .instrument-legend h3,
  .scale-values,
  .instrument-legend p {
    font-size: 12px;
  }
  .spectrum {
    height: 96px;
  }
  .view-heading h2 > span:not(#task-view-name) {
    display: none;
  }
  .view-tools select {
    max-width: 128px;
  }
  .diagnostic-strip {
    min-height: 152px;
  }
  .memory-caption {
    font-size: 12px;
  }
  .instrument-footer #instrument-clock {
    margin-left: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  button,
  select {
    transition: none;
  }
}

.diagnostic-strip figure:last-child {
  grid-template-rows: 24px minmax(0, 1fr) 18px;
}
.diagnostic-key {
  display: flex;
  justify-content: center;
  gap: 8px;
  font: 10px/14px var(--mono);
  color: #77a4bc;
}
.diagnostic-key span:before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--key);
  margin-right: 3px;
}

/* Lifecycle channels match the source-bound 3D planes. */
.lifecycle-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 12px;
  color: var(--muted, #8b969d);
  font-size: 12px;
  line-height: 16px;
}
.lifecycle-key span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.lifecycle-key i {
  width: 6px;
  height: 6px;
  display: inline-block;
}
.lifecycle-key .cold {
  background: #27529a;
}
.lifecycle-key .hot {
  background: #50ccdf;
}
.lifecycle-key .recovered {
  background: #f1c86d;
}
.lifecycle-key .retired {
  background: #a58ac9;
}
#lifecycle-reference,
#lifecycle-archive {
  overflow-wrap: anywhere;
}

#replay-curve {
  width: 100%;
  height: 128px;
  display: block;
  margin: 8px 0;
}
#replay-source {
  overflow-wrap: anywhere;
}

/* Categorical lifecycle legend; deliberately separate from the returns scale. */
.memory-state-legend {
  position: absolute;
  z-index: 3;
  right: 16px;
  top: 48px;
  width: 256px;
  max-width: calc(100% - 32px);
  padding: 12px;
  background: #000000eb;
  border: 1px solid #244052;
  pointer-events: none;
  color: #c2dbe5;
  font: 400 12px/16px var(--mono);
}
.memory-state-legend h3 {
  margin: 0 0 12px;
  font: inherit;
  color: #94b8c9;
}
.memory-state-legend dl {
  margin: 0;
}
.memory-state-legend dl > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  margin-bottom: 12px;
}
.memory-state-legend dt {
  display: flex;
  align-items: center;
  gap: 8px;
}
.memory-state-legend dd {
  margin: 0;
  color: #e7f4f8;
}
.memory-state-legend small {
  grid-column: 1/-1;
  padding-left: 16px;
  font:
    400 12px/16px Geist,
    sans-serif;
  color: #7d9aa9;
}
.memory-state-legend i {
  width: 8px;
  height: 8px;
  display: inline-block;
  flex: none;
}
.cloud-dormant {
  background: #5577df;
}
.cloud-active {
  background: #50ccdf;
}
.cloud-recovered {
  background: #f1c86d;
}
.memory-state-legend .cloud-returned {
  background: transparent;
  border: 1px solid #fff;
  border-radius: 50%;
}
.memory-state-legend p {
  margin: 0;
  color: #7d9aa9;
  font:
    400 12px/16px Geist,
    sans-serif;
}
@media (max-width: 600px) {
  .memory-state-legend {
    top: auto;
    bottom: 40px;
    right: 8px;
    width: calc(100% - 16px);
    max-width: none;
    padding: 8px;
  }
  .memory-state-legend h3 {
    margin-bottom: 8px;
  }
  .memory-state-legend dl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .memory-state-legend dl > div {
    margin: 0;
  }
  .memory-state-legend small {
    display: none;
  }
  .memory-state-legend p {
    margin-top: 8px;
  }
}
