/* AlterEgo Operator Plane — app-level rules. TOKEN COLORS ONLY (AC-DSG-003):
   every color here is var(--*) from design-system.css or the exact rgba() string
   of a token from that file. Stream-scene imagery is exempt per the AC but still
   uses tokens. */

.shell-nav-collapsed .sidenav .nav-item span.txt,
.shell-nav-collapsed .sidenav .mark .txt,
.shell-nav-collapsed .sidenav .nav-group { display: none; }
.shell-nav-collapsed { grid-template-columns: 64px minmax(0, 1fr); }

/* ---------- charts ---------- */
.chart-host { position: relative; }
.chart-host svg.chart { display: block; width: 100%; height: auto; cursor: crosshair; }
.chart-cursor { stroke: var(--line-2); stroke-width: 1; }
.chart-focus-dot { fill: var(--text-1); stroke: var(--bg-0); stroke-width: 1.5; }
.chart-readout {
  font-family: var(--mono); font-size: 0.6875rem; color: var(--text-2);
  display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; min-height: 1.1em;
}
.chart-readout .ro { white-space: nowrap; }
.chart-readout .ro b { color: var(--text-1); font-weight: 600; }
.chart-readout .ro-time { color: var(--text-3); margin-right: auto; }
.anno-symbol { cursor: pointer; font-family: var(--mono); }
.anno:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.stale-veil {
  position: absolute; inset: 0; border-radius: var(--r-ctl);
  background: var(--stale); opacity: 0.08; pointer-events: none;
}
.stale-badge-wrap { position: absolute; top: 8px; right: 8px; }
.hatch-band { pointer-events: none; }

/* ---------- state line / tiers ---------- */
.state-line .state-text { margin: 0; font-size: 0.9375rem; color: var(--text-1); }
.t3-stack > * { margin-top: var(--gap); }

/* ---------- stream scenes ---------- */
.scene-grid-lines { stroke: var(--line-1); }
.scene-reticle { stroke: var(--accent); opacity: 0.85; fill: none; }
.scene-box { stroke: var(--accent); fill: none; stroke-dasharray: 4 3; }
.scene-text { fill: var(--text-2); font-family: var(--mono); }
.scene-entity { fill: var(--accent-soft); stroke: var(--accent); }
.scene-good { stroke: var(--good); fill: none; }
.scene-warn { stroke: var(--warn); fill: none; }
.scan-sweep { fill: var(--accent); opacity: 0.10; }

/* ---------- layer chips row (below frames) ---------- */
.layer-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.layer-row .layer-chip { position: static; }

/* ---------- timeline ---------- */
.timeline .seg.kind-recommended { border: 1px dashed var(--info); color: var(--info); }
.timeline .seg.kind-selected { background: var(--accent); opacity: 0.9; color: var(--accent); }
.timeline .seg.kind-executed { background: var(--good); opacity: 0.85; color: var(--good); }
.timeline .seg.kind-cancelled { background: var(--bad); opacity: 0.32; color: var(--bad); }
.timeline .seg.kind-revised { border: 1px solid var(--warn); color: var(--warn); }
.timeline .seg.kind-expired { border: 1px solid var(--stale); color: var(--stale); }
.timeline .seg.kind-expected { border: 1px dashed var(--good); color: var(--good); }
.timeline .seg.kind-observed { background: var(--good); opacity: 0.45; color: var(--good); }
.timeline .seg { overflow: hidden; font-size: 0; }
.timeline .lane.clickable { cursor: pointer; }
.timeline .lane.clickable:hover .track { border-color: var(--line-2); }

/* ---------- terminal (steering + cli-tui: opencode TUI idiom) ---------- */
.term-shell {
  background: var(--bg-0); border: 1px solid var(--line-2); border-radius: var(--r-panel);
  overflow: hidden; font-family: var(--mono); font-size: 0.8125rem;
}
.term-windowbar {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  background: var(--bg-1); border-bottom: 1px solid var(--line-1);
}
.term-windowbar .wdot { width: 11px; height: 11px; border-radius: 50%; border: 1px solid var(--line-2); }
.term-windowbar .wdot.r { background: var(--bad); }
.term-windowbar .wdot.y { background: var(--warn); }
.term-windowbar .wdot.g { background: var(--good); }
.term-windowbar .title { margin-left: 10px; color: var(--text-3); font-size: 0.6875rem; }
.term-windowbar .freshness { margin-left: auto; }
.term-mission {
  margin: 12px 14px; border: 1px solid var(--line-2); border-radius: var(--r-ctl);
  padding: 10px 14px; background: var(--bg-1); color: var(--text-2);
  display: flex; gap: 14px 22px; flex-wrap: wrap; align-items: baseline;
}
.term-mission .task { color: var(--text-1); font-weight: 600; }
.term-mission .estop-btn { margin-left: auto; }
.term-transcript { padding: 4px 14px 14px; max-height: 46vh; overflow-y: auto; }
.tui-bubble {
  border-left: 2px solid var(--good); padding: 4px 12px; margin: 10px 0;
  color: var(--text-1); background: var(--bg-1); border-radius: 0 var(--r-ctl) var(--r-ctl) 0;
}
.tui-ack { margin: 10px 0; color: var(--text-2); }
.tui-ack .tool { color: var(--text-1); }
.tui-ack .tool .star { color: var(--violet); }
.tui-ack .result { color: var(--text-3); padding-left: 18px; }
.tui-spinner { color: var(--accent); }
.term-editor {
  display: flex; align-items: center; gap: 10px; margin: 0 14px 8px;
  border: 1px solid var(--line-2); border-radius: var(--r-ctl); padding: 10px 14px;
  background: var(--bg-0);
}
.term-editor .caret { display: inline-block; width: 9px; height: 1.1rem; background: var(--accent); }
.term-editor input { background: transparent; border: 0; outline: none; color: var(--text-1); flex: 1; font: inherit; }
.term-status { padding: 0 14px 8px; color: var(--text-3); font-size: 0.6875rem; display: flex; gap: 12px; flex-wrap: wrap; }
.term-hintbar {
  padding: 7px 14px; border-top: 1px solid var(--line-1); color: var(--text-3);
  font-size: 0.6875rem; display: flex; gap: 14px; flex-wrap: wrap; background: var(--bg-1);
}
.term-hintbar b { color: var(--text-2); font-weight: 600; }
.estop-btn {
  font: 700 0.75rem var(--mono); letter-spacing: 0.08em; color: var(--text-1);
  background: var(--bad); border: 1px solid var(--bad); border-radius: var(--r-ctl);
  padding: 6px 14px; cursor: pointer;
}
.estop-btn:hover { filter: brightness(1.15); }
.estop-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.estop-state {
  display: inline-flex; align-items: center; gap: 8px; font: 600 0.6875rem var(--mono);
  border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 3px 10px; color: var(--text-2);
}
.estop-state.acked { color: var(--bad); border-color: var(--bad); }
.estop-state.stopped { color: var(--text-3); border-color: var(--stale); }
.palette {
  position: absolute; inset: 0; background: rgba(11,14,18,0.70); display: grid;
  place-items: start center; padding-top: 12vh; z-index: 50;
}
.palette .box {
  width: min(560px, 92vw); background: var(--bg-3); border: 1px solid var(--line-2);
  border-radius: var(--r-panel); overflow: hidden;
}
.palette input {
  width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line-1);
  outline: none; color: var(--text-1); font: inherit; padding: 12px 16px;
}
.palette .cmd { display: flex; gap: 10px; padding: 9px 16px; cursor: pointer; color: var(--text-2); }
.palette .cmd:hover, .palette .cmd.on { background: var(--bg-2); color: var(--text-1); }
.palette .cmd .hint { margin-left: auto; color: var(--text-3); font-size: 0.6875rem; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(460px, 94vw); background: var(--bg-1); border: 1px solid var(--line-1);
  border-radius: var(--r-panel); padding: 28px; display: flex; flex-direction: column; gap: 14px;
}
.google-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--bg-2); color: var(--text-1); border: 1px solid var(--line-2);
  border-radius: var(--r-ctl); padding: 10px 16px; font-weight: 600; cursor: pointer;
}
.google-btn:hover { border-color: var(--accent); }
.dev-id { display: flex; justify-content: space-between; gap: 8px; align-items: center;
  border: 1px solid var(--line-1); border-radius: var(--r-ctl); padding: 8px 12px; }

/* ---------- responsive (AC-DSG-021): single column <= 1080px, nav collapses ---------- */
@media (max-width: 1080px) {
  .shell { grid-template-columns: 1fr; }
  .sidenav {
    position: fixed; inset: 0 auto 0 0; width: 240px; transform: translateX(-100%);
    transition: transform 160ms ease; z-index: 60;
  }
  .shell.nav-open .sidenav { transform: none; }
  .main { padding: 16px; }
  .stream-grid { grid-template-columns: 1fr; }
}

/* ---------- fold-tight (fleet dashboard 1440x900 fold budget, AC-DSG-009;
   mirrors the normative page-local compression rules, tokens only) ---------- */
.fold-tight .topbar { margin-bottom: 10px; }
.fold-tight .state-line { padding: 6px 14px; margin-bottom: 8px; }
.fold-tight .state-line p { font-size: 0.8125rem; line-height: 1.35; }
.fold-tight .scorecards { gap: 8px; margin-bottom: 10px; }
.fold-tight .scorecard { padding: 5px 10px 2px; gap: 1px; max-height: 86px; }
.fold-tight .scorecard .k { font-size: 0.5625rem; }
.fold-tight .scorecard .d { font-size: 0.6rem; }
.fold-tight .scorecard .v { font-size: 1.0625rem; }
.fold-tight .scorecard .sparkline { height: 14px; }
.fold-tight .filters { margin-bottom: 10px; }
.fold-tight .stream-grid { gap: 12px; }
.fold-tight .stream-frame { aspect-ratio: 16/7.6; }
.fold-tight .stream-body { padding: 7px 12px; gap: 4px; }
.fold-tight .hero-zone { margin-bottom: 10px; }
.fold-tight .hero-zone .panel { padding: 12px 14px; }
.fold-tight .hero-zone .panel-head { margin-bottom: 6px; }

/* fresh class coloring on chips (current/delayed/stale) */
.freshness.f-delayed { color: var(--warn); border-color: rgba(245,192,68,0.35); }
.freshness.f-stale { color: var(--stale); border-color: rgba(122,108,93,0.45); }
.freshness.f-current { color: var(--good); border-color: rgba(61,220,151,0.35); }
