/* ============================================================
   Octo — Supervisor console. HUD command-center aesthetic:
   deep-space ink, bioluminescent glass, Orbitron/JetBrains Mono.
   Dark default, light via prefers-color-scheme.
   ============================================================ */

/* Self-hosted — no CDN calls at runtime (see docs/COMMAND-CENTER-VISION.md
   §6 "What stays the same: No CDNs"). Single static instance per family is
   enough here: Orbitron only ever appears bold/black in this UI, JetBrains
   Mono only ever appears at body weight — browsers faux-weight the rest,
   which is imperceptible at the sizes this UI uses them at. */
@font-face {
  font-family: "Orbitron";
  src: url("/fonts/orbitron.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/jetbrains-mono.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  /* ink / surfaces — deepened toward true black for more contrast on the glow */
  --bg:        #05070c;
  --bg-glow-1: rgba(139,124,255,.13);
  --bg-glow-2: rgba(34,211,197,.09);
  --surface:   #0e111a;
  --surface-2: #131725;
  --raise:     #171d2e;
  --border:    #202638;
  --border-2:  #2c3450;
  --text:      #eef1fb;
  --muted:     #93a0c2;
  --faint:     #576088;

  /* accents — octopus violet → bioluminescent teal, pushed more saturated */
  --accent:    #8f7bff;
  --accent-2:  #22e6d4;
  --accent-ink:#05070c;
  --accent-soft: rgba(143,123,255,.16);
  --accent-line: rgba(143,123,255,.45);

  /* status */
  --live:      #35e0a1;
  --active:    #5aa8ff;
  --paused:    #ffb648;
  --dormant:   #8792a8;
  --archived:  #566079;
  --external:  #566079;
  --danger:    #ff4d6a;
  --danger-soft: rgba(255,77,106,.14);

  /* ambient glow — Command Center Vision §5, tone shifts with fleet health */
  --glow-active:   rgba(143,123,255,.20);
  --glow-live:     rgba(53,224,161,.16);
  --glow-pulse:    rgba(255,182,72,.24);
  --glow-critical: rgba(255,77,106,.26);

  /* agent identity colors — Command Center Vision §5 */
  --agent-octo:  #8f7bff;
  --agent-dev:   #35e0a1;
  --agent-mark:  #5aa8ff;
  --agent-sally: #ffb648;
  --agent-dan:   #ff4d6a;

  /* HUD instrumentation — grid lines, scan sweeps, targeting brackets */
  --grid-line:    rgba(143,123,255,.06);
  --grid-line-2:  rgba(34,230,212,.04);
  --hud-bracket:  rgba(143,123,255,.35);
  --scan-line:    rgba(34,230,212,.55);

  /* type scale / rhythm */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --r-sm: 8px; --r: 12px; --r-lg: 18px; --r-pill: 999px;
  --display: "Orbitron", var(--mono);
  --sans: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 40px -14px rgba(0,0,0,.85);
  --glow-shadow: 0 0 0 1px var(--border), 0 0 32px -8px var(--accent-soft);
  --nav-h: 62px;
  --ticker-h: 40px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg:        #eef1f7;
    --bg-glow-1: rgba(124,108,255,.16);
    --bg-glow-2: rgba(34,180,170,.12);
    --surface:   #ffffff;
    --surface-2: #f5f7fb;
    --raise:     #ffffff;
    --border:    #dee3ee;
    --border-2:  #cfd6e6;
    --text:      #1a1f2e;
    --muted:     #5a6379;
    --faint:     #8a93a8;
    --accent:    #6d5cff;
    --accent-2:  #0fae9f;
    --accent-ink:#ffffff;
    --accent-soft: rgba(109,92,255,.10);
    --accent-line: rgba(109,92,255,.32);
    --dormant:   #79839b;
    --archived:  #9aa3b8;
    --external:  #9aa3b8;
    --grid-line:   rgba(109,92,255,.05);
    --grid-line-2: rgba(15,174,159,.04);
    --hud-bracket: rgba(109,92,255,.28);
    --scan-line:   rgba(15,174,159,.4);
    --shadow: 0 1px 2px rgba(20,30,60,.06), 0 12px 30px -16px rgba(20,30,60,.20);
    --glow-shadow: 0 0 0 1px var(--border), 0 0 24px -10px var(--accent-soft);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  overflow-x: hidden;
  letter-spacing: -.005em;
}
/* Layered atmosphere: parallax radial glows (health-reactive) + a faint HUD
   grid + a slow diagonal scan sweep + film grain. All CSS, all compositor-
   only (opacity/background-position/transform), so this stays cheap on the
   2-CPU box the vision doc calls out — no canvas, no JS animation loop. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(60% 45% at 82% -5%, var(--bg-glow-1), transparent 70%),
    radial-gradient(55% 40% at 0% 100%, var(--bg-glow-2), transparent 70%),
    radial-gradient(50% 38% at 50% 8%, var(--fleet-glow, transparent), transparent 72%);
  transition: background 2s ease;
}
body::after {
  content: "";
  position: fixed; inset: -2px; z-index: -2; pointer-events: none;
  opacity: .55;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(var(--grid-line-2) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line-2) 1px, transparent 1px);
  background-size: 88px 88px, 88px 88px, 22px 22px, 22px 22px;
  mask-image: radial-gradient(120% 90% at 50% 0%, #000 40%, transparent 92%);
  animation: gridDrift 90s linear infinite;
}
@keyframes gridDrift { from { background-position: 0 0, 0 0, 0 0, 0 0; } to { background-position: 88px 88px, 88px 88px, -22px 22px, 22px -22px; } }
.scan-sweep {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden;
}
.scan-sweep::before {
  content: "";
  position: absolute; left: -50%; top: -120%; width: 220%; height: 60%;
  background: linear-gradient(180deg, transparent, var(--scan-line) 48%, transparent);
  opacity: .05;
  animation: scanSweep 11s ease-in-out infinite;
  transform: rotate(6deg);
}
@keyframes scanSweep { 0% { top: -120%; } 55% { top: 120%; } 100% { top: 120%; } }
.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: .035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
/* Ambient fleet-health glow (docs §1.2) — app.js sets --fleet-glow on <body> from /api/fleet's
   summary.health. Green = quiet, amber = something waiting, red = something broken. */
body.health-green  { --fleet-glow: var(--glow-live); }
body.health-amber   { --fleet-glow: var(--glow-pulse); }
body.health-red      { --fleet-glow: var(--glow-critical); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
::selection { background: var(--accent-soft); }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
*::-webkit-scrollbar { height: 8px; width: 8px; }
*::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; }

/* ============================================================ BOOT SEQUENCE
   First-paint reactor-core power-up (index.html's inert #boot markup — JS
   replaces it the instant the session check resolves, so on a normal
   connection this is on screen for well under the "First paint: <200ms"
   budget the vision doc sets, not an artificial delay). Same visual
   language reused at smaller scale for the login mark and the Cmd+K
   loading state, so the "reactor" reads as one recurring signature, not a
   one-off splash. */
.boot-screen {
  position: fixed; inset: 0; z-index: 300;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s5);
  background: var(--bg); overflow: hidden;
}
.boot-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(55% 55% at 50% 45%, #000 0%, transparent 78%);
  animation: gridDrift 30s linear infinite;
}
.boot-core { position: relative; width: 168px; height: 168px; display: grid; place-items: center; }
.boot-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.boot-ring-track { fill: none; stroke: var(--border-2); stroke-width: 1.25; opacity: .7; }
.boot-ring-sweep {
  fill: none; stroke: var(--accent-2); stroke-width: 2.5; stroke-linecap: round;
  stroke-dasharray: 24 100; transform-origin: 100px 100px;
  animation: ringSpin 2.4s linear infinite;
  filter: drop-shadow(0 0 7px var(--accent-2));
}
.boot-ring-sweep--rev { stroke: var(--accent); stroke-dasharray: 18 100; animation: ringSpinRev 3.1s linear infinite; filter: drop-shadow(0 0 7px var(--accent)); }
.boot-ring-tick { fill: none; stroke: var(--faint); stroke-width: 1.5; stroke-dasharray: 1.4 4.6; opacity: .55; transform-origin: 100px 100px; animation: ringSpin 90s linear infinite; }
@keyframes ringSpin { to { transform: rotate(360deg); } }
@keyframes ringSpinRev { to { transform: rotate(-360deg); } }
.boot-glyph {
  font-size: 38px; z-index: 1; line-height: 1;
  filter: drop-shadow(0 0 20px var(--accent-soft));
  animation: coreIdle 1.8s ease-in-out infinite;
}
.boot-word {
  font-family: var(--display); font-weight: 800; font-size: clamp(22px, 6vw, 30px);
  letter-spacing: .22em; text-transform: uppercase;
  background: linear-gradient(105deg, var(--accent) 10%, var(--accent-2) 55%, var(--accent) 100%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheenDrift 3s ease-in-out infinite;
}
.boot-status {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--faint); animation: statusBlink 1.7s ease-in-out infinite; min-height: 1em;
}
@keyframes statusBlink { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.boot-bar { width: 180px; height: 2px; border-radius: 99px; background: var(--surface-2); overflow: hidden; position: relative; }
.boot-bar span {
  position: absolute; inset: 0 auto 0 0; width: 45%; border-radius: 99px;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent);
  animation: bootBarSweep 1.3s ease-in-out infinite;
}
@keyframes bootBarSweep { from { transform: translateX(-120%); } to { transform: translateX(320%); } }
.boot-screen.boot-out { animation: bootOut .5s cubic-bezier(.4,0,1,1) forwards; }
@keyframes bootOut { to { opacity: 0; filter: blur(6px); transform: scale(1.03); } }

/* ============================================================ LAYOUT */
#root { min-height: 100vh; }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s3); padding: 12px var(--s4);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 var(--accent-line);
}
.main {
  padding: var(--s5) var(--s4);
  padding-bottom: calc(var(--nav-h) + var(--ticker-h) + var(--s6));
  max-width: 1220px; margin: 0 auto;
  animation: viewIn .42s cubic-bezier(.16,.8,.24,1);
}
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); filter: blur(3px); } to { opacity: 1; transform: none; filter: blur(0); } }

/* wordmark — Orbitron display face, animated gradient sheen + pulsing core dot */
.wordmark { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: -.01em; font-size: 19px; }
.wordmark .mark {
  font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  background: linear-gradient(105deg, var(--accent) 10%, var(--accent-2) 55%, var(--accent) 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: sheenDrift 7s ease-in-out infinite;
}
@keyframes sheenDrift { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
.wordmark .octo-emoji {
  font-size: 16px; -webkit-text-fill-color: initial;
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--accent) 30%, transparent), var(--surface-2) 70%);
  box-shadow: inset 0 0 0 1px var(--border-2), 0 0 18px -4px var(--accent-soft);
  animation: coreIdle 3.2s ease-in-out infinite;
}
@keyframes coreIdle { 0%,100% { box-shadow: inset 0 0 0 1px var(--border-2), 0 0 14px -6px var(--accent-soft); } 50% { box-shadow: inset 0 0 0 1px var(--accent-line), 0 0 22px -4px var(--accent-soft); } }
.topbar .ctx { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }

/* bottom nav (mobile) */
.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: var(--nav-h);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--faint); font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  position: relative; transition: color .18s;
}
.bottomnav a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.9; }
.bottomnav a.on { color: var(--accent); }
.bottomnav a.on::before {
  content: ""; position: absolute; top: 0; width: 26px; height: 3px; border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

@media (min-width: 900px) {
  #root { display: grid; grid-template-columns: 250px 1fr; }
  .sidebar {
    display: flex; flex-direction: column; gap: var(--s2);
    position: sticky; top: 0; height: 100vh; padding: var(--s5) var(--s4);
    border-right: 1px solid var(--border);
    background: linear-gradient(180deg, var(--surface), var(--bg) 88%);
  }
  .sidebar::after {
    content: ""; position: absolute; top: 0; right: -1px; bottom: 0; width: 1px;
    background: linear-gradient(180deg, transparent, var(--accent-line) 15%, var(--accent-line) 85%, transparent);
    opacity: .6;
  }
  .sidebar .wordmark { font-size: 22px; margin-bottom: var(--s5); padding-left: 4px; }
  .sidebar nav { display: flex; flex-direction: column; gap: 3px; }
  .sidebar nav a {
    display: flex; align-items: center; gap: var(--s3);
    padding: 11px 12px; border-radius: var(--r-sm);
    color: var(--muted); font-weight: 600; font-size: 13.5px;
    text-transform: uppercase; letter-spacing: .05em;
    border: 1px solid transparent;
    position: relative;
    transition: background .16s, color .16s, border-color .16s;
  }
  .sidebar nav a svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.9; flex: none; }
  .sidebar nav a:hover { background: var(--surface-2); color: var(--text); }
  .sidebar nav a.on {
    background: linear-gradient(90deg, var(--accent-soft), transparent);
    color: var(--text); border-color: var(--accent-line);
    box-shadow: inset 3px 0 0 var(--accent), 0 0 20px -10px var(--accent-soft);
  }
  .sidebar nav a.on svg { stroke: var(--accent-2); filter: drop-shadow(0 0 5px var(--accent-soft)); }
  .sidebar nav a.on::after {
    content: ""; position: absolute; right: 10px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px;
    border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 8px 1px var(--accent-2);
    animation: heartbeat 1400ms ease-in-out infinite;
  }
  .sidebar .sb-foot { margin-top: auto; color: var(--faint); font-size: 11px; line-height: 1.6; font-family: var(--mono); letter-spacing: .02em; }
  .topbar { display: none; }
  .bottomnav { display: none; }
  .main { padding: var(--s6) var(--s6); padding-bottom: calc(var(--ticker-h) + var(--s6)); }

  /* fleet mini-roster, sidebar footer (docs §4 Phase 1: "Fleet status sidebar") */
  .sb-fleet { display: flex; flex-direction: column; gap: 4px; margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--border); }
  .sb-fleet-head { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 6px; }
  .sb-fleet-head .eyebrow { font-size: 10px; }
  .sb-fleet-summary { font-size: 10.5px; font-weight: 700; color: var(--faint); }
}

/* ============================================================ PRIMITIVES */
.page-head { margin-bottom: var(--s5); position: relative; }
.page-head h1 {
  font-family: var(--display); font-weight: 700; text-transform: uppercase;
  font-size: clamp(22px, 6vw, 32px); letter-spacing: .01em; margin: 0 0 6px;
  background: linear-gradient(105deg, var(--text) 40%, var(--accent-2) 130%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.page-head p { margin: 0; color: var(--muted); font-size: 13.5px; font-family: var(--mono); }
.eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--accent-2); font-family: var(--mono); }
.section-gap { margin-top: var(--s6); }

/* Cards: glass panel + targeting-reticle corner brackets that light up on hover/focus —
   the single most repeated motif in this UI, carrying most of the "HUD" identity. */
.card {
  background: linear-gradient(165deg, var(--surface), var(--surface-2) 120%);
  border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow);
  position: relative;
  transition: border-color .22s, box-shadow .22s, transform .22s;
}
.card::before, .card::after {
  content: ""; position: absolute; width: 12px; height: 12px; pointer-events: none;
  border: 1.5px solid var(--hud-bracket); opacity: 0; transition: opacity .25s;
}
.card::before { top: -1px; left: -1px; border-right: none; border-bottom: none; border-radius: 4px 0 0 0; }
.card::after { bottom: -1px; right: -1px; border-left: none; border-top: none; border-radius: 0 0 4px 0; }
.card:hover { border-color: var(--border-2); box-shadow: var(--glow-shadow); }
.card:hover::before, .card:hover::after { opacity: 1; }
.card:has(a:focus-visible), .card:has(button:focus-visible) { border-color: var(--accent-line); }
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: var(--r-pill);
  font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  font-family: var(--mono);
  background: var(--surface-2); border: 1px solid var(--border-2); color: var(--muted);
  white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.pill.live     { color: var(--live);     border-color: color-mix(in srgb, var(--live) 40%, var(--border)); background: color-mix(in srgb, var(--live) 12%, transparent); }
.pill.active   { color: var(--active);   border-color: color-mix(in srgb, var(--active) 40%, var(--border)); background: color-mix(in srgb, var(--active) 12%, transparent); }
.pill.paused   { color: var(--paused);   border-color: color-mix(in srgb, var(--paused) 40%, var(--border)); background: color-mix(in srgb, var(--paused) 12%, transparent); }
.pill.dormant  { color: var(--dormant); }
.pill.archived,.pill.external-clone { color: var(--archived); opacity: .82; }
.pill.in_progress { color: var(--active); border-color: color-mix(in srgb, var(--active) 40%, var(--border)); background: color-mix(in srgb, var(--active) 12%, transparent); }
.pill.planned  { color: var(--muted); }
.pill.waiting_input,.pill.waiting { color: var(--paused); border-color: color-mix(in srgb, var(--paused) 40%, var(--border)); background: color-mix(in srgb, var(--paused) 12%, transparent); }
.pill.working  { color: var(--live);    border-color: color-mix(in srgb, var(--live) 40%, var(--border)); background: color-mix(in srgb, var(--live) 12%, transparent); }
.pill.idle     { color: var(--muted); }
.pill.offline  { color: var(--faint); opacity: .75; }

/* heartbeat pulse — bioluminescent glow for anything actively "alive" (docs §1.2) */
.heartbeat { animation: heartbeat 1000ms ease-in-out infinite; }
@keyframes heartbeat { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.pulse-dot { position: relative; }
.pulse-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  background: currentColor; opacity: .35; animation: pulseRing 1600ms ease-out infinite;
}
@keyframes pulseRing { 0% { transform: scale(.5); opacity: .5; } 100% { transform: scale(1.9); opacity: 0; } }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 650; letter-spacing: .01em;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid var(--accent-line);
}
.chip.plain { background: var(--surface-2); color: var(--muted); border-color: var(--border-2); }
.chip::before { content: ""; width: 5px; height: 5px; border-radius: 1px; background: currentColor; transform: rotate(45deg); }

.stat-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent); }
.muted { color: var(--muted); } .faint { color: var(--faint); }
.mono { font-family: var(--mono); }
.danger-text { color: var(--danger); }

/* ============================================================ SYSTEM STRIP */
.sys-strip {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3);
  padding: var(--s4); margin-bottom: var(--s5);
}
@media (min-width: 620px) { .sys-strip { grid-template-columns: repeat(4, 1fr); } }
.sys-metric { display: flex; flex-direction: column; gap: 6px; }
.sys-metric .lbl { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.sys-metric .val { font-size: 19px; font-weight: 750; letter-spacing: -.02em; }
.sys-metric .val small { font-size: 12px; font-weight: 600; color: var(--muted); }
.meter { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.meter.warn > span { background: linear-gradient(90deg, var(--paused), #ff8a4c); }
.meter.crit > span { background: linear-gradient(90deg, var(--danger), #ff8a4c); }
.svc-row { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s3); align-items: center; padding-top: var(--s2); border-top: 1px solid var(--border); }
.svc { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--muted); }
.svc-check { margin-left: auto; font-size: 11.5px; color: var(--faint); font-weight: 600; }

/* ============================================================ OVERVIEW */
.cat { margin-bottom: var(--s3); }
.cat-head {
  display: flex; align-items: center; gap: var(--s3); width: 100%;
  padding: 10px 4px; background: none; border: none; color: var(--text);
  text-align: left;
}
.cat-head .caret, .back-link svg {
  width: 16px; height: 16px; flex: 0 0 16px;
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.cat-head .caret { transition: transform .2s; color: var(--faint); display: inline-flex; }
.cat-head[aria-expanded="false"] .caret { transform: rotate(-90deg); }
.cat-head h2 { font-size: 15px; font-weight: 750; letter-spacing: -.01em; margin: 0; }
.cat-head .count { font-size: 12px; font-weight: 700; color: var(--faint); background: var(--surface-2); border-radius: 99px; padding: 1px 8px; }
.cat-head .rule { flex: 1; height: 1px; background: var(--border); }
.cat-body { display: grid; grid-template-columns: 1fr; gap: var(--s3); padding-top: var(--s2); }
@media (min-width: 560px) { .cat-body { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .cat-body { grid-template-columns: repeat(3, 1fr); } }
.cat-body[hidden] { display: none; }

.proj-card {
  display: flex; flex-direction: column; gap: 10px; padding: var(--s4);
  position: relative; overflow: hidden; transition: transform .16s, border-color .16s;
}
.proj-card::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent); opacity: .0; transition: opacity .16s;
}
.proj-card:hover { transform: translateY(-2px); border-color: var(--border-2); }
.proj-card:hover::after { opacity: .8; }
.pc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s2); }
.pc-name { font-size: 15px; font-weight: 750; letter-spacing: -.015em; }
.pc-client { font-size: 12px; color: var(--faint); margin-top: 1px; }
.pc-desc { font-size: 12.5px; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pc-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-top: auto; }
/* health score (docs §4 Phase 1: freshness + activity + status, computed client-side from data
   /api/overview already returns — no new endpoint needed for this one) */
.pc-health { display: flex; align-items: center; gap: 6px; }
.pc-health .hb-track { width: 40px; height: 4px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.pc-health .hb-fill { display: block; height: 100%; border-radius: 99px; }
.pc-health .hb-fill.good { background: linear-gradient(90deg, var(--live), var(--accent-2)); }
.pc-health .hb-fill.ok   { background: linear-gradient(90deg, var(--paused), #ff8a4c); }
.pc-health .hb-fill.bad  { background: var(--danger); }
.pc-health .hb-val { font-size: 10.5px; font-weight: 700; color: var(--faint); }
.pc-commit { font-size: 11.5px; font-weight: 600; color: var(--faint); }
.pc-commit.stale { color: var(--danger); }
.spark { display: block; }

/* ============================================================ PROJECT DETAIL */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 600; margin-bottom: var(--s4); }
.back-link:hover { color: var(--text); }
.detail-head { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s5); }
.detail-head .row { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.meta-grid { display: grid; grid-template-columns: 1fr; gap: var(--s2); }
@media (min-width: 620px) { .meta-grid { grid-template-columns: 1fr 1fr; } }
.meta-item { padding: var(--s3) var(--s4); }
.meta-item .k { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); margin-bottom: 3px; }
.meta-item .v { font-size: 13px; color: var(--text); line-height: 1.5; word-break: break-word; }
.meta-item .v a { color: var(--accent); font-weight: 600; }

.grid-2 { display: grid; grid-template-columns: 1fr; gap: var(--s4); }
@media (min-width: 860px) { .grid-2 { grid-template-columns: 1.15fr .85fr; align-items: start; } }
.panel { padding: var(--s4); }
.panel h3 { font-size: 14px; font-weight: 750; margin: 0 0 var(--s4); letter-spacing: -.01em; display: flex; align-items: center; gap: var(--s2); }
.panel h3 .badge { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 99px; padding: 2px 9px; }
.panel h3 .badge.dirty { color: var(--paused); border-color: color-mix(in srgb, var(--paused) 40%, var(--border)); }

/* timeline */
.timeline { position: relative; padding-left: var(--s5); }
.timeline::before { content: ""; position: absolute; left: 6px; top: 4px; bottom: 4px; width: 2px; background: linear-gradient(180deg, var(--accent), var(--accent-2)); opacity: .5; }
.tl-item { position: relative; padding-bottom: var(--s4); }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before { content: ""; position: absolute; left: calc(-1 * var(--s5) + 1px); top: 4px; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.tl-date { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--accent); font-family: var(--mono); }
.tl-title { font-size: 13px; color: var(--text); margin-top: 2px; line-height: 1.45; }

/* checklist */
.checklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checklist li { display: flex; gap: 10px; font-size: 13px; color: var(--text); line-height: 1.45; }
.checklist li .box { flex: none; width: 16px; height: 16px; margin-top: 1px; border-radius: 5px; border: 1.5px solid var(--border-2); }

/* callout */
.callout { display: flex; gap: 10px; padding: 11px 13px; border-radius: var(--r-sm); font-size: 12.5px; line-height: 1.5;
  background: color-mix(in srgb, var(--paused) 10%, transparent); border: 1px solid color-mix(in srgb, var(--paused) 30%, var(--border)); color: color-mix(in srgb, var(--paused) 82%, var(--text)); }
.callout .ic { flex: none; }
.callouts { display: flex; flex-direction: column; gap: var(--s2); }

/* commits */
.commit-list { display: flex; flex-direction: column; }
.commit { display: grid; grid-template-columns: auto 1fr; gap: var(--s3); padding: 9px 0; border-bottom: 1px solid var(--border); align-items: start; }
.commit:last-child { border-bottom: none; }
.commit .hash { font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 2px 6px; height: fit-content; }
.commit .cmsg { font-size: 12.5px; color: var(--text); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; }
.commit .cdate { font-size: 11px; color: var(--faint); margin-top: 2px; }

/* bar chart */
.barchart { width: 100%; height: auto; display: block; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ============================================================ PLAN */
.northstar { padding: var(--s5); margin-bottom: var(--s5); position: relative; overflow: hidden;
  border-color: var(--accent-line); }
.northstar::before { content: ""; position: absolute; inset: 0; background: radial-gradient(70% 120% at 90% 0%, var(--accent-soft), transparent 60%); pointer-events: none; }
.northstar .eyebrow { margin-bottom: var(--s2); }
.northstar p { font-size: clamp(15px, 4.5vw, 20px); font-weight: 650; letter-spacing: -.01em; margin: 0; line-height: 1.4; }

.waiting-box { padding: var(--s4); margin-bottom: var(--s5); border-color: color-mix(in srgb, var(--paused) 34%, var(--border)); background: color-mix(in srgb, var(--paused) 7%, var(--surface)); }
.waiting-box h3 { font-size: 13px; font-weight: 750; color: var(--paused); margin: 0 0 var(--s3); display: flex; align-items: center; gap: 8px; }
.waiting-box ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.waiting-box li { display: flex; gap: 9px; font-size: 12.5px; line-height: 1.45; color: var(--text); }
.waiting-box li::before { content: ""; flex: none; width: 6px; height: 6px; margin-top: 6px; border-radius: 50%; background: var(--paused); }

.weeks { display: grid; grid-template-columns: 1fr; gap: var(--s4); }
@media (min-width: 720px) { .weeks { grid-template-columns: 1fr 1fr; } }
.week { padding: var(--s4); }
.week .wk-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); margin-bottom: 4px; }
.week .wk-num { font-size: 13px; font-weight: 800; letter-spacing: -.01em; }
.week .wk-theme { font-size: 12px; color: var(--muted); margin-bottom: var(--s4); line-height: 1.4; }
.wk-item { display: flex; flex-direction: column; gap: 6px; padding: 11px 0; border-top: 1px solid var(--border); }
.wk-item .wi-top { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.wk-item .wi-title { font-size: 12.5px; color: var(--text); line-height: 1.45; }

/* agenda */
.agenda { display: flex; flex-direction: column; gap: var(--s2); }
.agenda-day { margin-top: var(--s4); }
.agenda-day .day-h { font-size: 12px; font-weight: 750; color: var(--accent); letter-spacing: .02em; margin: 0 0 var(--s2); position: sticky; }
.agenda-item { display: grid; grid-template-columns: 78px 1fr; gap: var(--s3); padding: 11px var(--s4); align-items: start; }
.agenda-item .time { font-family: var(--mono); font-size: 11.5px; font-weight: 600; color: var(--muted); }
.agenda-item .a-body { display: flex; flex-direction: column; gap: 5px; }
.agenda-item .a-task { font-size: 12.5px; color: var(--text); line-height: 1.4; }

/* ============================================================ BOARD */
.board-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * var(--s4)); padding: 0 var(--s4) var(--s4); }
@media (min-width: 900px) { .board-wrap { margin: 0; padding: 0 0 var(--s4); } }
.board { display: flex; gap: var(--s3); min-width: min-content; align-items: flex-start; }
.column { flex: 0 0 82vw; max-width: 320px; display: flex; flex-direction: column; }
@media (min-width: 560px) { .column { flex-basis: 300px; } }
.col-head { display: flex; align-items: center; gap: var(--s2); padding: 0 4px var(--s3); }
.col-head .ct { font-size: 13px; font-weight: 750; letter-spacing: -.01em; }
.col-head .cn { font-size: 11px; font-weight: 700; color: var(--faint); background: var(--surface-2); border-radius: 99px; padding: 1px 8px; }
.col-body { display: flex; flex-direction: column; gap: 10px; min-height: 40px; padding: 4px; border-radius: var(--r); transition: background .15s; }
.col-body.drop-on { background: var(--accent-soft); outline: 1.5px dashed var(--accent-line); }

.kcard { padding: 12px; position: relative; cursor: grab; }
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: .45; }
.kcard .kc-top { display: flex; align-items: center; gap: var(--s2); margin-bottom: 7px; }
.kcard .kc-title { font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.4; }
.kcard .kc-notes { font-size: 12px; color: var(--muted); line-height: 1.45; margin-top: 7px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.kcard .kc-notes.open { -webkit-line-clamp: unset; }
.kcard .menu-btn { margin-left: auto; flex: none; width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font-size: 15px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.kcard .menu-btn:hover { color: var(--text); border-color: var(--border-2); }

.move-menu { position: absolute; z-index: 30; background: var(--raise); border: 1px solid var(--border-2); border-radius: var(--r-sm); box-shadow: 0 12px 34px -10px rgba(0,0,0,.7); padding: 5px; min-width: 170px; }
.move-menu .mm-lbl { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); padding: 6px 9px 4px; }
.move-menu button { display: block; width: 100%; text-align: left; padding: 8px 9px; border: none; background: none; color: var(--text); font-size: 12.5px; font-weight: 600; border-radius: 6px; }
.move-menu button:hover:not([disabled]) { background: var(--accent-soft); color: var(--accent); }
.move-menu button[disabled] { color: var(--faint); }

/* ============================================================ BRAIN */
.brain-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); margin-bottom: var(--s5); }
@media (min-width: 620px) { .brain-stats { grid-template-columns: repeat(5, 1fr); } }
.bstat { padding: var(--s4); display: flex; flex-direction: column; gap: 3px; }
.bstat .n { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.bstat .t { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.bstat.user .n { color: var(--accent); }
.bstat.feedback .n { color: var(--paused); }
.bstat.project .n { color: var(--active); }
.bstat.reference .n { color: var(--accent-2); }

.mem-group { margin-bottom: var(--s5); }
.mem-group > h3 { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 var(--s3); display: flex; align-items: center; gap: 8px; }
.mem-group > h3 .swatch { width: 9px; height: 9px; border-radius: 3px; }
.mem-list { display: flex; flex-direction: column; gap: var(--s2); }
.mem-row { padding: 13px var(--s4); display: flex; flex-direction: column; gap: 6px; cursor: pointer; transition: border-color .15s, transform .12s; }
.mem-row:hover { border-color: var(--border-2); transform: translateX(2px); }
.mem-row .mr-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.mem-row .mr-name { font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; }
.mem-row .mr-mod { font-size: 11px; color: var(--faint); font-weight: 600; flex: none; }
.mem-row .mr-desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.mem-row .mr-links { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.link-chip { font-size: 10.5px; font-weight: 650; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border-2); color: var(--muted); }
.link-chip.active { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* slide-over */
.overlay { position: fixed; inset: 0; z-index: 90; background: rgba(4,6,12,.55); backdrop-filter: blur(3px); opacity: 0; animation: fade .2s forwards; }
@keyframes fade { to { opacity: 1; } }
.slideover {
  position: fixed; z-index: 91; top: 0; right: 0; bottom: 0; width: 100%; max-width: 560px;
  background: var(--surface); border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%); animation: slideIn .28s cubic-bezier(.2,.7,.3,1) forwards;
  box-shadow: -20px 0 50px -20px rgba(0,0,0,.6);
}
@keyframes slideIn { to { transform: none; } }
.slideover .so-head { display: flex; align-items: center; gap: var(--s3); padding: var(--s4) var(--s5); border-bottom: 1px solid var(--border); }
.slideover .so-head h2 { font-size: 15px; font-weight: 750; margin: 0; flex: 1; letter-spacing: -.01em; }
.slideover .so-close { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--muted); font-size: 18px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.slideover .so-body { overflow-y: auto; padding: var(--s5); flex: 1; }

/* markdown */
.md h1, .md h2, .md h3 { font-weight: 750; letter-spacing: -.01em; line-height: 1.3; margin: var(--s5) 0 var(--s2); }
.md h1 { font-size: 20px; } .md h2 { font-size: 16px; } .md h3 { font-size: 14px; }
.md h1:first-child, .md h2:first-child { margin-top: 0; }
.md p { font-size: 13.5px; line-height: 1.6; color: var(--text); margin: 0 0 var(--s3); }
.md ul, .md ol { margin: 0 0 var(--s3); padding-left: var(--s5); }
.md li { font-size: 13.5px; line-height: 1.55; margin-bottom: 5px; }
.md a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.md code { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }
.md pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: var(--s3); overflow-x: auto; margin: 0 0 var(--s3); }
.md pre code { background: none; border: none; padding: 0; }
.md strong { font-weight: 750; color: var(--text); }

/* ============================================================ SYSTEM */
.gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin-bottom: var(--s5); }
.gauge-card { padding: var(--s5) var(--s4); display: flex; flex-direction: column; align-items: center; gap: var(--s2); }
.gauge-card .g-lbl { font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); font-family: var(--mono); }
.gauge svg { display: block; }
.gauge .g-val { font-size: 22px; font-weight: 800; letter-spacing: -.03em; }
.gauge .g-sub { font-size: 10px; color: var(--muted); font-weight: 600; font-family: var(--mono); }
.gauge-fill { stroke-dashoffset: var(--gauge-offset); animation: gaugeFill 1.1s cubic-bezier(.16,.8,.24,1) both; filter: drop-shadow(0 0 5px currentColor); }
@keyframes gaugeFill { from { stroke-dashoffset: var(--gauge-track); } }
.load-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin-bottom: var(--s5); }
.load-cell { padding: var(--s4); text-align: center; }
.load-cell .lv { font-size: 24px; font-weight: 800; letter-spacing: -.02em; font-family: var(--mono); }
.load-cell .ll { font-size: 11px; color: var(--faint); font-weight: 600; margin-top: 2px; }
.info-list { padding: var(--s2) var(--s4); }
.info-list .ir { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 12px 0; border-bottom: 1px solid var(--border); }
.info-list .ir:last-child { border-bottom: none; }
.info-list .ir .ik { font-size: 13px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 9px; }
.info-list .ir .iv { font-size: 13px; font-weight: 650; font-family: var(--mono); }

/* CPU sparkline + process list (docs §4 Phase 1: "System view enhance") */
.cpu-row { display: flex; align-items: center; gap: var(--s4); padding: var(--s4); margin-bottom: var(--s5); }
.cpu-row .cpu-val { font-size: 30px; font-weight: 800; letter-spacing: -.03em; font-family: var(--mono); flex: none; }
.cpu-row .cpu-val small { font-size: 14px; font-weight: 700; color: var(--muted); }
.cpu-row .cpu-spark { flex: 1; min-width: 0; }
.cpu-row .cpu-lbl { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin-bottom: 6px; }
.proc-list { padding: var(--s2) var(--s4); }
.proc-row { display: grid; grid-template-columns: 1fr auto auto; gap: var(--s3); align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.proc-row:last-child { border-bottom: none; }
.proc-row .p-name { font-family: var(--mono); font-weight: 650; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proc-row .p-pid { color: var(--faint); font-size: 10.5px; margin-left: 6px; }
.proc-row .p-metric { font-family: var(--mono); font-weight: 700; color: var(--muted); font-size: 11.5px; min-width: 52px; text-align: right; }
.proc-row .p-metric.hot { color: var(--paused); }
.svc-history { display: flex; gap: 2px; align-items: flex-end; height: 16px; }
.svc-history span { flex: 1; min-width: 2px; height: 100%; border-radius: 1px; background: var(--live); opacity: .85; }
.svc-history span.down { background: var(--danger); }

/* ============================================================ LOGIN */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: var(--s5); position: relative; overflow: hidden; }
.login-card {
  width: 100%; max-width: 380px; padding: var(--s6) var(--s5); text-align: center;
  position: relative; backdrop-filter: blur(20px);
  background: linear-gradient(165deg, color-mix(in srgb, var(--surface) 88%, transparent), color-mix(in srgb, var(--surface-2) 82%, transparent));
}
.login-card.shake { animation: shake .42s; }
@keyframes shake { 10%,90%{transform:translateX(-1px)} 20%,80%{transform:translateX(3px)} 30%,50%,70%{transform:translateX(-7px)} 40%,60%{transform:translateX(7px)} }
.login-logo {
  font-size: 38px; margin-bottom: var(--s3); display: inline-flex; align-items: center; justify-content: center;
  width: 76px; height: 76px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--accent-soft), var(--surface-2) 72%);
  box-shadow: inset 0 0 0 1px var(--border-2), 0 0 40px -8px var(--accent-soft);
  animation: bob 5s ease-in-out infinite;
}
@keyframes bob { 50% { transform: translateY(-6px) rotate(-3deg); } }
.login-card h1 {
  font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  font-size: 21px; margin: 0 0 6px;
}
.login-card .sub { font-size: 12.5px; color: var(--muted); margin-bottom: var(--s5); font-family: var(--mono); }
.field { position: relative; margin-bottom: var(--s3); text-align: left; }
.field::before { content: "›"; position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--accent-2); font-weight: 700; pointer-events: none; }
.field input {
  width: 100%; padding: 13px 15px 13px 30px; font-size: 15px; font-family: var(--mono);
  background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--r-sm);
  color: var(--text); outline: none; transition: border-color .16s, box-shadow .16s;
}
.field input:focus { border-color: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-soft), 0 0 20px -8px var(--accent-2); }
.btn {
  width: 100%; padding: 13px; font-size: 13.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  font-family: var(--mono);
  border: none; border-radius: var(--r-sm); color: var(--accent-ink);
  background: linear-gradient(105deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 30px -10px var(--accent-soft);
  transition: transform .12s, filter .16s, box-shadow .16s;
}
.btn:hover { filter: brightness(1.08); box-shadow: 0 0 34px -6px var(--accent-soft); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .6; }
.login-err { font-size: 12.5px; color: var(--danger); min-height: 18px; margin-top: var(--s2); font-weight: 600; font-family: var(--mono); }

/* ============================================================ SKELETON / TOAST / EMPTY */
.skel { background: var(--surface-2); border-radius: var(--r-sm); position: relative; overflow: hidden; }
.skel::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text) 6%, transparent), transparent);
  animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-card { height: 128px; }
.skel-row { height: 56px; margin-bottom: var(--s2); }
.skel-grid { display: grid; grid-template-columns: 1fr; gap: var(--s3); }
@media (min-width: 560px) { .skel-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .skel-grid { grid-template-columns: repeat(3, 1fr); } }

.empty { text-align: center; padding: var(--s7) var(--s4); color: var(--faint); font-size: 13px; }
.empty .big { font-size: 34px; display: block; margin-bottom: var(--s2); opacity: .7; }

.toast-wrap { position: fixed; z-index: 100; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + var(--ticker-h) + 14px); display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: 92vw; pointer-events: none; }
@media (min-width: 900px) { .toast-wrap { bottom: calc(var(--ticker-h) + 22px); left: auto; right: 22px; transform: none; } }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 11px 15px; border-radius: var(--r-sm);
  background: var(--raise); border: 1px solid var(--border-2); box-shadow: 0 12px 34px -12px rgba(0,0,0,.7);
  font-size: 13px; font-weight: 600; color: var(--text); animation: toastIn .28s cubic-bezier(.2,.7,.3,1); }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }
.toast.err { border-color: color-mix(in srgb, var(--danger) 50%, var(--border)); }
.toast .t-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.toast.ok .t-dot { background: var(--live); } .toast.err .t-dot { background: var(--danger); }
.toast button { background: none; border: none; color: var(--accent); font-weight: 700; font-size: 12.5px; padding: 0 0 0 6px; }

/* ============================================================ FLEET (sidebar + topbar) */
.topbar-fleet { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 11.5px; font-weight: 700; color: var(--muted); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.status-dot.green { background: var(--live); color: var(--live); }
.status-dot.amber  { background: var(--paused); color: var(--paused); }
.status-dot.red     { background: var(--danger); color: var(--danger); }

.agent-mini {
  display: flex; align-items: center; gap: 9px; padding: 7px 6px; border-radius: var(--r-sm);
  cursor: default; transition: background .15s;
}
.agent-mini:hover { background: var(--surface-2); }
.agent-mini .am-avatar {
  position: relative; flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  background: var(--surface-2); border: 1.5px solid var(--border-2);
}
.agent-mini .am-avatar.working { border-color: var(--am-color, var(--accent)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--am-color, var(--accent)) 22%, transparent); }
.agent-mini .am-status { position: absolute; right: -1px; bottom: -1px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--surface); }
.agent-mini .am-body { min-width: 0; flex: 1; }
.agent-mini .am-name { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--text); }
.agent-mini .am-name .shield { font-size: 9px; opacity: .8; }
.agent-mini .am-task { font-size: 10.5px; color: var(--faint); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================ ACTIVITY TICKER */
.ticker {
  position: fixed; left: 0; right: 0; bottom: var(--nav-h); z-index: 45; height: var(--ticker-h);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px); border-top: 1px solid var(--border);
  display: flex; align-items: center; overflow: hidden;
}
@media (min-width: 900px) { .ticker { bottom: 0; left: 250px; } }
.ticker-label {
  flex: none; display: flex; align-items: center; gap: 6px; padding: 0 var(--s3);
  font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--faint);
  border-right: 1px solid var(--border); height: 100%;
}
.ticker-track { flex: 1; overflow: hidden; height: 100%; position: relative; }
.ticker-track:hover .ticker-scroll { animation-play-state: paused; }
.ticker-scroll { display: flex; align-items: center; gap: var(--s6); height: 100%; width: max-content; animation: tickerScroll linear infinite; padding-right: var(--s6); }
@keyframes tickerScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.ticker-item .t-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.ticker-item .t-title { font-weight: 650; color: var(--text); }
.ticker-item .t-time { color: var(--faint); font-size: 10.5px; }
.ticker-empty { padding: 0 var(--s4); font-size: 12px; color: var(--faint); }

/* ============================================================ COMMAND PALETTE (Cmd+K)
   Same reactor/HUD language as the boot sequence and .card's corner brackets, at
   command-console scale: glass panel, glow ring, a single scan sweep across the input
   row on open (targeting-lock beat), mono throughout since this reads as a terminal. */
.cmdk-overlay { position: fixed; inset: 0; z-index: 120; background: rgba(2,3,8,.72); backdrop-filter: blur(4px); display: flex; align-items: flex-start; justify-content: center; padding-top: 12vh; opacity: 0; animation: fade .16s forwards; }
.cmdk {
  width: 100%; max-width: 560px; margin: 0 var(--s4); position: relative;
  background: linear-gradient(165deg, color-mix(in srgb, var(--raise) 94%, transparent), color-mix(in srgb, var(--surface) 90%, transparent));
  backdrop-filter: blur(20px);
  border: 1px solid var(--accent-line); border-radius: var(--r-lg);
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.8), 0 0 0 1px var(--border), 0 0 46px -10px var(--accent-soft);
  overflow: hidden; transform: translateY(-6px); animation: cmdkIn .18s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes cmdkIn { to { transform: none; } }
.cmdk::before, .cmdk::after { content: ""; position: absolute; width: 16px; height: 16px; border: 1.5px solid var(--accent-2); opacity: .7; pointer-events: none; }
.cmdk::before { top: -1px; left: -1px; border-right: none; border-bottom: none; border-radius: var(--r-lg) 0 0 0; }
.cmdk::after { bottom: -1px; right: -1px; border-left: none; border-top: none; border-radius: 0 0 var(--r-lg) 0; }
.cmdk-input-row { position: relative; display: flex; align-items: center; gap: var(--s3); padding: var(--s4); border-bottom: 1px solid var(--border); overflow: hidden; }
.cmdk-input-row::after {
  content: ""; position: absolute; left: -30%; top: 0; bottom: 0; width: 30%;
  background: linear-gradient(90deg, transparent, var(--accent-2) 50%, transparent);
  opacity: .5; animation: cmdkScan .9s ease-out;
}
@keyframes cmdkScan { from { left: -30%; } to { left: 100%; } }
.cmdk-input-row svg { width: 18px; height: 18px; stroke: var(--accent-2); fill: none; stroke-width: 2; flex: none; filter: drop-shadow(0 0 4px var(--accent-soft)); }
.cmdk-input-row input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 15px; font-family: var(--mono); }
.cmdk-input-row input::placeholder { color: var(--faint); }
.cmdk-input-row .cmdk-esc { flex: none; font-size: 10px; font-weight: 700; letter-spacing: .04em; font-family: var(--mono); color: var(--faint); background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 5px; padding: 2px 7px; }
.cmdk-list { max-height: 52vh; overflow-y: auto; padding: 6px; }
.cmdk-group-lbl { font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-2); font-family: var(--mono); padding: 10px 10px 4px; }
.cmdk-item { display: flex; align-items: center; gap: var(--s3); width: 100%; text-align: left; padding: 10px; border-radius: var(--r-sm); border: 1px solid transparent; background: none; color: var(--text); font-size: 13.5px; font-weight: 600; transition: background .12s, border-color .12s; }
.cmdk-item .ci-icon { flex: none; width: 26px; height: 26px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--border-2); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.cmdk-item .ci-sub { color: var(--faint); font-weight: 500; font-size: 11px; font-family: var(--mono); margin-left: auto; }
.cmdk-item.active, .cmdk-item:hover { background: var(--accent-soft); border-color: var(--accent-line); }
.cmdk-item.active .ci-icon { border-color: var(--accent-line); box-shadow: 0 0 10px -3px var(--accent-soft); }
.cmdk-empty { padding: var(--s6) var(--s4); text-align: center; color: var(--faint); font-size: 13px; font-family: var(--mono); }

/* ============================================================ COMING SOON (Phase 3/4 preview shell) */
.soon-section { margin-top: var(--s6); }
.soon-grid { display: grid; grid-template-columns: 1fr; gap: var(--s3); }
@media (min-width: 560px) { .soon-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .soon-grid { grid-template-columns: repeat(3, 1fr); } }
.soon-card {
  padding: var(--s4); position: relative; filter: grayscale(.6); opacity: .68;
  transition: opacity .18s, filter .18s;
}
.soon-card:hover { opacity: .92; filter: grayscale(.25); }
.soon-card .soon-badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--faint); background: var(--surface-2); border: 1px solid var(--border-2); border-radius: 99px; padding: 2px 9px; margin-bottom: var(--s3);
}
.soon-card h4 { font-size: 13.5px; font-weight: 750; margin: 0 0 5px; letter-spacing: -.01em; }
.soon-card p { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0 0 var(--s3); }
.soon-card .soon-unlock { font-size: 11px; color: var(--faint); font-weight: 600; border-top: 1px dashed var(--border-2); padding-top: var(--s3); line-height: 1.4; }

.reduced { }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .001s !important; transition-duration: .001s !important; } }
