@font-face {
  font-family: "Rajdhani";
  font-weight: 500;
  src: url("/static/fonts/rajdhani-500.woff2") format("woff2");
}
@font-face {
  font-family: "Rajdhani";
  font-weight: 600;
  src: url("/static/fonts/rajdhani-600.woff2") format("woff2");
}
@font-face {
  font-family: "Rajdhani";
  font-weight: 700;
  src: url("/static/fonts/rajdhani-700.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 400;
  src: url("/static/fonts/jbmono-400.woff2") format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-weight: 700;
  src: url("/static/fonts/jbmono-700.woff2") format("woff2");
}

/* Canonical values live in ui/src/tokens.ts; applyTokens() re-affirms them
   on :root at boot. These declarations are the pre-boot / no-JS fallback —
   keep them in sync with tokens.ts. */
:root {
  --void: #07090D;
  --panel: #0D1220;
  --panel-hi: #111A30;
  --grid-line: #1B2438;
  --grid-line-hi: #2A3A5C;
  --signal: #21E6C1;
  --flux: #FF3E8A;
  --warn: #FFB13D;
  --crit: #FF4747;
  --dim: #5A6B8C;
  --fg: #C8D6F0;
  --fg-bright: #E8EDF6;
  --pin-0: #7EC8FF;
  --pin-1: #FFB13D;
  --pin-2: #C77EFF;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 14px;
  --space-lg: 20px;
  --space-xl: 28px;
  --font-display: "Rajdhani", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  --t-fast: 140ms;
  --t-base: 240ms;
  --t-slow: 340ms;
  --t-breathe: 6000ms;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--void);
  color: var(--fg);
  font-family: var(--font-display);
  overflow-x: hidden;
}

.hidden { display: none !important; }
.signal { color: var(--signal); }
.warn { color: var(--warn); }
.crit { color: var(--crit); }
.dim { color: var(--dim); }
.record { color: var(--flux); }

/* ── global header ─────────────────────────────────────────────────── */

.global-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--grid-line);
  background: var(--panel);
  position: sticky;
  top: 0;
  z-index: 40;
}

.gh-left { display: flex; align-items: center; gap: 18px; }

.wordmark {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 4px;
  color: var(--signal);
}

.mode-tabs { display: flex; gap: 2px; }

.mode-tab {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--dim);
  background: none;
  border: 1px solid var(--grid-line);
  padding: 4px 14px;
  cursor: pointer;
}
.mode-tab.active { color: var(--signal); border-color: var(--signal); }

.gh-center { display: flex; gap: 28px; }
/* fixed slots: live numbers must not push their neighbors around */
.gh-stat { display: flex; flex-direction: column; align-items: flex-end; min-width: 84px; }
.gh-units, .gh-jobs {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: 18px;
}

.gh-right { display: flex; align-items: center; gap: 16px; }
.gh-clock {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.streak-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--signal);
  border: 1px solid var(--signal);
  padding: 2px 8px;
}
.streak-badge.shattered {
  color: var(--crit);
  border-color: var(--crit);
  animation: shatter 0.5s steps(4);
}
@keyframes shatter {
  25% { transform: translate(-3px, 2px) rotate(-2deg); }
  50% { transform: translate(3px, -1px) rotate(1.5deg); }
  75% { transform: translate(-2px, -2px); }
}

.record-ticker {
  position: absolute;
  left: 0; right: 0; top: 100%;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--flux);
  background: var(--panel);
  border-bottom: 1px solid var(--flux);
  padding: 4px;
  animation: ticker-shimmer 1s linear;
}
@keyframes ticker-shimmer {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.8); }
}

/* ── ingest layout: job wall + docked log rail ─────────────────────── */

.ingest-wrap {
  display: flex;
  align-items: flex-start;
}
.ingest-wrap > .masonry {
  flex: 1;
  min-width: 0;
}

/* collapsed = the live card exactly as it was, minus the cell grid;
   it keeps its slot in the wall, just shorter */
.job-panel.collapsed { animation: none; }
.job-panel.collapsed .grid-wrap { display: none; }

.fold-btn, .remove-btn { flex-shrink: 0; padding: 1px 6px; }
.remove-btn:hover, .clear-btn:hover { color: var(--crit); border-color: var(--crit); }

.log-rail {
  width: 320px;
  flex-shrink: 0;
  position: sticky;
  top: 62px;
  height: calc(100vh - 76px);
  margin: 14px 14px 0 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--grid-line);
}

.log-filter { flex: 1; min-width: 0; }
/* the rail hugs the right screen edge: anchor its menu right, not left */
.log-filter .gr-select-menu { left: auto; right: 0; }

.log-stream {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0;
  padding: 8px 12px;
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.5;
  color: var(--dim);
  background: rgba(0, 0, 0, 0.25);
  /* never truncate: lines wrap with hard breaks at the window edge */
  white-space: pre-wrap;
  word-break: break-all;
}
.log-stream::-webkit-scrollbar { width: 4px; }
.log-stream::-webkit-scrollbar-thumb { background: var(--grid-line); }

.log-tag { color: #5A6B8C; }
.log-ts { color: #3D4A66; }

/* live-feed entrance: each new line rises in, slightly staggered */
.log-line { display: block; }
.log-new { animation: log-in 0.32s cubic-bezier(0.2, 0.7, 0.3, 1) backwards; }
@keyframes log-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .log-new { animation: none; }
}

.log-burger {
  display: none;
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 60;
  padding: 8px 14px;
  background: var(--panel);
}
.log-close { display: none; }

@media (max-width: 900px) {
  .log-rail {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    height: auto;
    width: min(340px, 86vw);
    margin: 0;
    z-index: 70;
    transform: translateX(105%);
    transition: transform 0.25s ease;
    box-shadow: -12px 0 32px rgba(0, 0, 0, 0.5);
  }
  .log-rail.open { transform: none; }
  .log-burger { display: block; }
  .log-close { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  .log-rail { transition: none; }
}

/* ── masonry & panels ──────────────────────────────────────────────── */

.masonry {
  display: grid;
  /* min card width keeps readouts + time range legible; on screens
     narrower than the minimum, cards take the full viewport instead */
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  grid-auto-flow: dense;
  gap: 14px;
  padding: 14px;
  align-items: start;
}

.job-panel {
  animation: breathe var(--t-breathe) ease-in-out infinite;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--grid-line);
  position: relative;
  animation: breathe var(--t-breathe) ease-in-out infinite;
}
/* a faint CRT wash: top vignette over every panel including the WebGL
   canvases, so the whole surface reads as a live display */
.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background:
    radial-gradient(130% 130% at 50% 0%, transparent 62%, rgba(0, 0, 0, 0.4) 100%);
  opacity: 0.3;
}
.panel:hover {
  box-shadow: 0 0 0 1px var(--grid-line-hi), 0 0 26px rgba(33, 230, 193, 0.07);
}
/* settled = at rest, not disabled: stop the breathing, barely dim */
.panel.settled { animation: none; opacity: 0.96; }

/* failed / partial / abandoned cards carry no border accent: the state
   reads from the progress, ETA, and status values in their designated color */
.job-panel.failed, .job-panel.partial, .job-panel.abandoned { animation: none; }
.job-panel.abandoned { opacity: 0.85; }

@keyframes breathe {
  0%, 100% { border-color: var(--grid-line); }
  50% { border-color: var(--grid-line-hi); }
}

/* ── shared fx (driven by anim.ts) ─────────────────────────────────── */

.panel-body { min-width: 0; }

/* entrance: a scanline wipe with a brief horizontal jitter */
.fx-glitch-in { animation: fx-glitch-in var(--t-slow) cubic-bezier(0.2, 1, 0.3, 1); }
@keyframes fx-glitch-in {
  0% { opacity: 0; transform: translateY(-8px); clip-path: inset(0 0 100% 0); }
  45% { opacity: 1; clip-path: inset(0 0 0 0); }
  60% { transform: translateX(2px); }
  75% { transform: translateX(-1px); }
  100% { transform: none; }
}

.fx-flash { animation: fx-flash 0.4s ease-out; }
@keyframes fx-flash {
  0% { filter: brightness(2.1); }
  100% { filter: brightness(1); }
}

.fx-pulse { animation: fx-pulse 0.45s ease-out; }
@keyframes fx-pulse {
  0%, 100% { transform: scale(1); }
  35% { transform: scale(1.04); }
}

.fx-glow {
  box-shadow: 0 0 0 1px var(--signal), 0 0 18px rgba(33, 230, 193, 0.25);
  border-color: var(--signal) !important;
}

/* a light band sweeping across a surface (records, settles) */
.fx-sweep { position: relative; overflow: hidden; }
.fx-sweep::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg, transparent 42%, rgba(33, 230, 193, 0.18) 50%, transparent 58%);
  transform: translateX(-120%);
  animation: fx-sweep 0.8s ease-out;
  pointer-events: none;
}
@keyframes fx-sweep { to { transform: translateX(120%); } }

@media (prefers-reduced-motion: reduce) {
  .fx-glitch-in, .fx-flash, .fx-pulse, .fx-sweep::after { animation: none; }
}

.panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-bottom: 1px solid var(--grid-line);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--dim);
  text-transform: uppercase;
}
.hdr-mode { color: var(--signal); white-space: nowrap; }
/* per-card status badge: empty while running, DONE / FAILED after */
.hdr-status { white-space: nowrap; letter-spacing: 2px; }
.hdr-status:empty { display: none; }
/* the job id truncates first; the time range must never overflow */
.hdr-job {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hdr-clock {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.job-title {
  padding: 8px 12px 0;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: 1px;
}

.readouts {
  display: flex;
  gap: 20px;
  padding: 6px 12px 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}

/* predetermined slots so changing digits never bounce the row */
.readout-pct { min-width: 152px; }
.readout-eta { min-width: 132px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2.5px;
  color: var(--dim);
}

.value-xl {
  font-size: 42px;
  font-weight: 700;
  line-height: 1;
  color: var(--signal);
  font-variant-numeric: tabular-nums;
}
.value-xl.crit { color: var(--crit); }
.value-xl.warn { color: var(--warn); }

.value-lg {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

/* ── cell grid ─────────────────────────────────────────────────────── */

.grid-wrap {
  position: relative;
  margin: 0 12px;
  line-height: 0;
}

.cell-canvas { display: block; width: 100%; }

.gl-fallback {
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--crit);
  font-family: var(--font-mono);
}

/* ── inspector tooltip ─────────────────────────────────────────────── */

.inspector {
  position: fixed;
  z-index: 100;
  background: var(--void);
  border: 1px solid var(--signal);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.5;
  padding: 8px 12px;
  white-space: pre;
  pointer-events: none;
  box-shadow: 0 0 18px rgba(33, 230, 193, 0.15);
}

.mono-note { font-family: var(--font-mono); font-size: 10px; }

/* ── SIMULATE view ─────────────────────────────────────────────────── */

.sim-view {
  padding: 14px;
  display: grid;
  grid-template-columns: 280px minmax(420px, 1fr) 400px;
  gap: 14px;
  align-items: start;
}
@media (max-width: 1280px) {
  .sim-view { grid-template-columns: 280px 1fr; }
  .sim-side { grid-column: 1 / -1; }
}

.rack-body { padding: 10px 12px; }

.lever-block { margin-bottom: 14px; }
.lever-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.lever-name {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--fg);
}
.lever-name.dim-sub { color: var(--dim); font-size: 10px; }
.lever-bounds {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--dim);
}
.lever-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}
.lever-slider {
  flex: 1;
  appearance: none;
  height: 3px;
  background: var(--grid-line);
  outline: none;
}
.lever-slider::-webkit-slider-thumb {
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--signal);
  border: none;
  cursor: ew-resize;
}
.lever-value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--signal);
  min-width: 52px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.curve-editor {
  width: 100%;
  height: 56px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--grid-line);
  margin-top: 4px;
}
.curve-path {
  fill: none;
  stroke: var(--signal);
  stroke-width: 1.5;
}
.curve-dot {
  fill: var(--signal);
  cursor: ns-resize;
}

.heat-strip {
  display: flex;
  height: 4px;
  margin-top: 3px;
}
.heat-strip span {
  flex: 1;
  background: var(--flux);
}

.seed-btn {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--signal);
  background: none;
  border: 1px solid var(--signal);
  padding: 8px;
  cursor: pointer;
  margin: 8px 0 16px;
}
.seed-btn:hover { background: rgba(33, 230, 193, 0.08); }

.exo-head { margin: 10px 0 6px; }
.exo-block { margin-bottom: 10px; opacity: 0.55; }
.exo-spark {
  width: 100%;
  height: 32px;
  display: block;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--grid-line);
  margin-top: 2px;
}
.exo-path {
  fill: none;
  stroke: var(--dim);
  stroke-width: 1.2;
}

/* ── trajectory theater ────────────────────────────────────────────── */

.theater { min-height: 300px; }

.odometer-block {
  padding: 10px 14px 6px;
  display: flex;
  flex-direction: column;
}
.odometer { color: var(--signal); }
.odometer.crit { color: var(--crit); }
.odo-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--dim);
  margin-top: 2px;
}

.theater-stack {
  position: relative;
  margin: 6px 12px 12px;
}
.theater-canvas { display: block; width: 100%; }
.theater-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.chart-header {
  position: absolute;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--grid-line);
  padding-top: 2px;
}
.chart-name {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--dim);
}
.chart-value {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--signal);
  font-variant-numeric: tabular-nums;
}
.chart-value.crit { color: var(--crit); }

/* ── frontier map ──────────────────────────────────────────────────── */


.frontier-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px 4px;
}

.axis-select { max-width: 150px; }
.axis-select .gr-select-btn { color: var(--signal); }

.frontier-wrap {
  position: relative;
  margin: 4px 12px 12px;
}
.frontier-canvas { display: block; width: 100%; }

.axis-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--dim);
  pointer-events: none;
}
.axis-x { bottom: 4px; right: 8px; }
.axis-y { top: 4px; left: 8px; }

.anomaly-line {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--warn);
  border-top: 1px solid var(--grid-line);
  padding: 6px 12px;
}

/* ── shared small buttons ──────────────────────────────────────────── */

.gr-btn {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--dim);
  background: none;
  border: 1px solid var(--grid-line);
  padding: 2px 8px;
  cursor: pointer;
}
.gr-btn:hover { color: var(--signal); border-color: var(--signal); }
.gr-btn.active { color: var(--signal); border-color: var(--signal); }

/* ── confirm dialog ────────────────────────────────────────────────── */

.gr-btn.danger:hover { color: var(--crit); border-color: var(--crit); }

.gr-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(7, 9, 13, 0.72);
  backdrop-filter: blur(2px);
  animation: modal-fade 0.14s ease-out;
}
.gr-modal-overlay.closing {
  animation: modal-fade 0.12s ease-in reverse forwards;
  pointer-events: none;
}

@keyframes modal-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.gr-modal {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--grid-line);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  padding: 14px 16px 16px;
  animation: modal-pop 0.16s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.gr-modal-overlay.closing .gr-modal { animation: none; }

@keyframes modal-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to { opacity: 1; transform: none; }
}

.gr-modal-title {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 2.5px;
  color: var(--warn);
  border-bottom: 1px solid var(--grid-line);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.gr-modal-message {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--fg);
  word-break: break-word;
  margin-bottom: 14px;
}

.gr-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.gr-modal-actions .gr-btn { padding: 5px 14px; }

@media (prefers-reduced-motion: reduce) {
  .gr-modal-overlay, .gr-modal { animation: none; }
}

/* ── custom dropdown ───────────────────────────────────────────────── */

.gr-select { position: relative; }

.gr-select-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--dim);
  background: var(--void);
  border: 1px solid var(--grid-line);
  padding: 3px 6px;
  cursor: pointer;
  text-align: left;
}
.gr-select-btn:hover, .gr-select.open .gr-select-btn {
  color: var(--signal);
  border-color: var(--signal);
}

.gr-select-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gr-select-caret { flex-shrink: 0; }
.gr-select.open .gr-select-caret { transform: scaleY(-1); }

.gr-select-menu {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  min-width: 100%;
  max-width: min(420px, 80vw);
  max-height: 260px;
  overflow-y: auto;
  z-index: 90;
  background: var(--void);
  border: 1px solid var(--signal);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}
.gr-select-menu::-webkit-scrollbar { width: 4px; }
.gr-select-menu::-webkit-scrollbar-thumb { background: var(--grid-line); }

.gr-select-option {
  display: block;
  width: 100%;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.5px;
  color: var(--dim);
  background: none;
  border: none;
  border-bottom: 1px solid var(--grid-line);
  padding: 5px 8px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gr-select-option:last-child { border-bottom: none; }
.gr-select-option:hover { color: var(--signal); background: rgba(33, 230, 193, 0.08); }
.gr-select-option.selected { color: var(--signal); }
.gr-select-option.selected::before { content: "\u25b8 "; }

/* ── compare tray + scrubber ───────────────────────────────────────── */


.scrub-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 6px;
}
.scrubber {
  flex: 1;
  accent-color: var(--signal);
  height: 3px;
}
.scrub-t { color: var(--dim); min-width: 42px; text-align: right; }

.compare-tray { padding: 6px 12px 12px; overflow-x: auto; }
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 10px;
}
.compare-table th, .compare-table td {
  text-align: right;
  padding: 3px 6px;
  border-bottom: 1px solid var(--grid-line);
  white-space: nowrap;
}
.compare-table td:first-child { text-align: left; }
.compare-table th { text-align: left; vertical-align: top; }
.compare-table .signal { color: var(--signal); }
.pin-chip {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 4px;
}
.pin-name { color: var(--fg-bright); margin-right: 4px; }
.pin-pull, .pin-drop { margin-left: 4px; }

/* ── causal graph ──────────────────────────────────────────────────── */

.graph-wrap { padding: 8px 12px; overflow-x: auto; }
.graph-svg { width: 100%; min-height: 140px; display: block; }

.graph-edge {
  stroke: var(--dim);
  stroke-opacity: 0.25;
}
.graph-node { cursor: pointer; }
.graph-node circle { fill: var(--dim); }
.graph-node.graph-law circle { fill: var(--signal); }
.graph-node.graph-lever circle { fill: var(--flux); }
.graph-node.graph-exogenous circle { fill: var(--warn); opacity: 0.7; }
.graph-node.selected circle { stroke: var(--fg-bright); stroke-width: 1.5px; }
.graph-node text {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.5px;
  fill: var(--dim);
}
.graph-node.selected text, .graph-node:hover text { fill: var(--signal); }

.graph-expr {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--signal);
  border-top: 1px solid var(--grid-line);
  padding: 8px 12px;
  margin: 0;
  white-space: pre-wrap;
}
.graph-expr.dim { color: var(--dim); }

/* ── sim side column ───────────────────────────────────────────────── */

.sim-side { display: flex; flex-direction: column; gap: 14px; }

.mute-btn { margin-right: 10px; }

/* ── responsive: phones ────────────────────────────────────────────── */

@media (max-width: 900px) {
  .sim-view { grid-template-columns: 1fr; padding: 10px; gap: 10px; }
  .sim-side { grid-column: auto; }
}

@media (max-width: 640px) {
  .global-header { gap: 8px; padding: 8px 10px; flex-wrap: wrap; }
  .wordmark { font-size: 15px; letter-spacing: 2px; }
  .gh-center { display: none; }
  .gh-right { gap: 8px; }
  .mode-tab { padding: 4px 10px; }

  .masonry { padding: 8px; gap: 10px; }
  .job-title { font-size: 15px; }
  .value-xl { font-size: 32px; }
  .value-lg { font-size: 15px; }
  .readouts { gap: 14px; }
  .readout-pct { min-width: 118px; }
  .readout-eta { min-width: 110px; }

  .theater-stack, .frontier-wrap { touch-action: pan-y; }
  .compare-table { font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .panel, .job-panel { animation: none; }
  .record-ticker { animation: none; }
  .streak-badge.shattered { animation: none; }
}
