/* Pipeline JARVIS — original interface theme (no copyrighted layouts).
   Deep black/graphite, cyan/ice operational, amber warning, red critical. */

:root {
  --bg: #05070a;
  --bg-2: #0a0e14;
  --panel: rgba(16, 22, 30, 0.72);
  --panel-solid: #10161e;
  --line: rgba(56, 225, 255, 0.14);
  --line-strong: rgba(56, 225, 255, 0.35);
  --cyan: #38e1ff;
  --ice: #9ddcff;
  --text: #cfe3ee;
  --text-dim: #7d93a3;
  --amber: #ffb454;
  --red: #ff4d5e;
  --green: #43e6a0;
  --glow: 0 0 12px rgba(56, 225, 255, 0.18), inset 0 0 24px rgba(56, 225, 255, 0.03);
  --radius: 10px;
  --font: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Code", "SF Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(56, 225, 255, 0.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(56, 225, 255, 0.05), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  min-height: 100vh;
}
a { color: var(--ice); text-decoration: none; }
a:hover { color: var(--cyan); }
h1, h2, h3 { font-weight: 500; letter-spacing: 0.04em; }
h1 { font-size: 1.15rem; text-transform: uppercase; color: var(--cyan); margin: 0 0 1rem; }
h2 { font-size: 0.85rem; text-transform: uppercase; color: var(--ice); margin: 0 0 0.6rem; opacity: 0.9; }
code, .mono { font-family: var(--mono); font-size: 0.85em; }

/* ---- layout ---- */
.shell { display: grid; grid-template-columns: 218px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, var(--bg-2), var(--bg));
  border-right: 1px solid var(--line);
  padding: 0.9rem 0.6rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0.5rem 0.9rem; }
.brand .sigil {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  box-shadow: var(--glow);
  display: grid; place-items: center; color: var(--cyan); font-family: var(--mono); font-size: 12px;
}
.brand b { color: var(--cyan); font-weight: 600; letter-spacing: 0.12em; font-size: 0.8rem; }
.brand small { display: block; color: var(--text-dim); font-size: 0.6rem; letter-spacing: 0.2em; }
.navgroup { margin: 0.7rem 0 0.2rem; padding: 0 0.5rem; color: var(--text-dim); font-size: 0.62rem;
  text-transform: uppercase; letter-spacing: 0.18em; }
.nav a {
  display: block; padding: 0.34rem 0.55rem; margin: 1px 0; border-radius: 6px;
  color: var(--text); font-size: 0.8rem; border-left: 2px solid transparent;
}
.nav a:hover { background: rgba(56, 225, 255, 0.06); }
.nav a.active { border-left-color: var(--cyan); background: rgba(56, 225, 255, 0.09); color: var(--cyan); }
.nav .badge { float: right; }

.main { padding: 1rem 1.4rem 3rem; max-width: 1500px; }

/* ---- topbar ---- */
.topbar {
  display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
  padding: 0.55rem 0; margin-bottom: 1rem; border-bottom: 1px solid var(--line);
}
.topbar .spacer { flex: 1; }

/* ---- queen ring ---- */
.queen-ring { position: relative; width: 46px; height: 46px; flex: 0 0 auto; }
.queen-ring .ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1px solid var(--line-strong); box-shadow: var(--glow);
}
.queen-ring .ring::before {
  content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 1px dashed rgba(56, 225, 255, 0.25);
  animation: spin 24s linear infinite;
}
.queen-ring .core {
  position: absolute; inset: 12px; border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 225, 255, 0.85), rgba(56, 225, 255, 0.12) 70%);
  animation: pulse 3.2s ease-in-out infinite;
}
.queen-ring.mode-disabled .core { background: radial-gradient(circle, rgba(125,147,163,0.6), transparent 70%); animation: none; }
.queen-ring.mode-observation .core { background: radial-gradient(circle, rgba(157,220,255,0.75), rgba(157,220,255,0.08) 70%); }
.queen-ring.paused .core { background: radial-gradient(circle, rgba(255,180,84,0.8), rgba(255,180,84,0.1) 70%); animation: none; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; } }

/* ---- chips / badges ---- */
.chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.14rem 0.6rem; border-radius: 999px; font-size: 0.7rem;
  border: 1px solid var(--line); background: rgba(56, 225, 255, 0.05);
  color: var(--ice); letter-spacing: 0.05em;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); }
.chip.ok::before { background: var(--green); }
.chip.warn { border-color: rgba(255, 180, 84, 0.4); color: var(--amber); }
.chip.warn::before { background: var(--amber); }
.chip.crit { border-color: rgba(255, 77, 94, 0.5); color: var(--red); }
.chip.crit::before { background: var(--red); }
.badge {
  display: inline-block; min-width: 1.2em; text-align: center; padding: 0 0.35em;
  border-radius: 999px; font-size: 0.68rem; font-family: var(--mono);
  background: rgba(255, 180, 84, 0.15); color: var(--amber); border: 1px solid rgba(255, 180, 84, 0.35);
}

/* ---- panels ---- */
.grid { display: grid; gap: 0.8rem; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--glow);
  backdrop-filter: blur(7px);
  padding: 0.8rem 0.9rem;
}
.panel.warn { border-color: rgba(255, 180, 84, 0.35); }
.panel.crit { border-color: rgba(255, 77, 94, 0.45); box-shadow: 0 0 14px rgba(255, 77, 94, 0.15); }
.stat { font-size: 1.6rem; font-family: var(--mono); color: var(--cyan); line-height: 1.1; }
.stat.amber { color: var(--amber); } .stat.red { color: var(--red); } .stat.green { color: var(--green); }
.stat-label { font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-dim); }

/* ---- tables ---- */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
th { text-align: left; color: var(--text-dim); font-weight: 500; font-size: 0.66rem;
  text-transform: uppercase; letter-spacing: 0.12em; padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
td { padding: 0.4rem 0.5rem; border-bottom: 1px solid rgba(56, 225, 255, 0.06); vertical-align: top; }
tr:hover td { background: rgba(56, 225, 255, 0.03); }

/* ---- status pills ---- */
.pill { padding: 0.1rem 0.5rem; border-radius: 4px; font-size: 0.68rem; font-family: var(--mono); white-space: nowrap; }
.pill.success, .pill.done, .pill.approved, .pill.healthy, .pill.current, .pill.migrated { background: rgba(67,230,160,0.12); color: var(--green); }
.pill.failed, .pill.rejected, .pill.critical, .pill.blocked { background: rgba(255,77,94,0.14); color: var(--red); }
.pill.pending, .pill.queued, .pill.review, .pill.paused, .pill.high, .pill.shadowed { background: rgba(255,180,84,0.13); color: var(--amber); }
.pill.running, .pill.in-progress, .pill.open, .pill.captured, .pill.observation { background: rgba(56,225,255,0.12); color: var(--cyan); }
.pill.unknown, .pill.cancelled, .pill.disabled { background: rgba(125,147,163,0.15); color: var(--text-dim); }

/* ---- forms / buttons ---- */
input[type=text], input[type=password], input[type=search], input[type=email],
input[type=number], textarea, select {
  background: var(--bg-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 0.42rem 0.6rem; font-family: var(--font); font-size: 0.8rem;
  width: 100%; -webkit-appearance: none; appearance: none;
}
input[type=search]::placeholder, input::placeholder, textarea::placeholder { color: var(--muted); }
input[type=search]::-webkit-search-cancel-button { filter: invert(0.7); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--line-strong); box-shadow: 0 0 8px rgba(56,225,255,0.15); }
.btn {
  display: inline-block; cursor: pointer; border-radius: 6px; font-size: 0.74rem;
  padding: 0.4rem 0.85rem; letter-spacing: 0.06em; text-transform: uppercase;
  background: rgba(56, 225, 255, 0.1); color: var(--cyan);
  border: 1px solid var(--line-strong); transition: background 0.15s ease;
}
.btn:hover { background: rgba(56, 225, 255, 0.2); }
.btn.warn { background: rgba(255,180,84,0.1); color: var(--amber); border-color: rgba(255,180,84,0.4); }
.btn.warn:hover { background: rgba(255,180,84,0.2); }
.btn.danger { background: rgba(255,77,94,0.1); color: var(--red); border-color: rgba(255,77,94,0.45); }
.btn.danger:hover { background: rgba(255,77,94,0.22); }
.btn.small { padding: 0.18rem 0.5rem; font-size: 0.66rem; }
form.inline { display: inline; }

/* ---- alerts / messages ---- */
.alert { padding: 0.5rem 0.8rem; border-radius: 6px; margin-bottom: 0.5rem; font-size: 0.8rem;
  border: 1px solid var(--line); background: rgba(56,225,255,0.05); }
.alert.warning { border-color: rgba(255,180,84,0.4); background: rgba(255,180,84,0.07); color: var(--amber); }
.alert.critical, .alert.error { border-color: rgba(255,77,94,0.5); background: rgba(255,77,94,0.08); color: var(--red); }
.alert.success { border-color: rgba(67,230,160,0.4); background: rgba(67,230,160,0.07); color: var(--green); }

/* ---- misc ---- */
.hero-banner { border: 1px solid rgba(255,77,94,0.5); background: rgba(255,77,94,0.1);
  color: var(--red); text-align: center; padding: 0.4rem; font-size: 0.78rem;
  letter-spacing: 0.15em; text-transform: uppercase; }
.hero-banner.amber { border-color: rgba(255,180,84,0.5); background: rgba(255,180,84,0.09); color: var(--amber); }
.klist dt { color: var(--text-dim); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.12em; margin-top: 0.5rem; }
.klist dd { margin: 0.1rem 0 0; font-size: 0.8rem; }
.bar { height: 6px; border-radius: 3px; background: rgba(56,225,255,0.1); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--ice)); }
canvas.chart { width: 100%; height: 180px; }
.muted { color: var(--text-dim); }
.tree ul { list-style: none; padding-left: 1.1rem; border-left: 1px dashed var(--line); margin: 0.25rem 0; }
.tree > ul { border-left: none; padding-left: 0; }
.tree li { margin: 0.25rem 0; }

/* ---- responsive ---- */
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; display: flex; flex-wrap: wrap; gap: 0.15rem; }
  .sidebar .navgroup { width: 100%; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .main { padding: 0.7rem; }
}

/* ---- accessibility: reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
html[data-motion="off"] *, html[data-motion="off"] *::before, html[data-motion="off"] *::after {
  animation: none !important; transition: none !important;
}

/* ==== Voice console ==== */
.voice-grid { display: grid; grid-template-columns: 380px 1fr; gap: 0.9rem; }
@media (max-width: 980px) { .voice-grid { grid-template-columns: 1fr; } }
.orb-stage { display: flex; flex-direction: column; align-items: center; gap: 0.7rem; padding: 1.2rem 0.8rem; }
.orb {
  position: relative; width: 170px; height: 170px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: radial-gradient(circle at 50% 42%, rgba(56,225,255,0.20), rgba(56,225,255,0.03) 62%, transparent 75%);
  box-shadow: var(--glow); cursor: pointer; outline-offset: 4px;
  display: grid; place-items: center; user-select: none; -webkit-user-select: none;
  transition: box-shadow 0.25s ease;
}
.orb:focus-visible { outline: 2px solid var(--cyan); }
.orb .orb-core {
  width: 66px; height: 66px; border-radius: 50%;
  background: radial-gradient(circle, rgba(56,225,255,0.95), rgba(56,225,255,0.15) 72%);
  animation: pulse 3.4s ease-in-out infinite;
}
.orb .orb-ring1, .orb .orb-ring2 {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none;
}
.orb .orb-ring1 { inset: 10px; border: 1px dashed rgba(56,225,255,0.28); animation: spin 26s linear infinite; }
.orb .orb-ring2 { inset: 24px; border: 1px solid rgba(56,225,255,0.12); animation: spin 40s linear infinite reverse; }
.orb .orb-label { position: absolute; bottom: 16px; font-size: 0.62rem; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ice); }

.orb[data-state="listening"] { box-shadow: 0 0 26px rgba(56,225,255,0.4), inset 0 0 30px rgba(56,225,255,0.08); }
.orb[data-state="listening"] .orb-core { animation: pulse 0.9s ease-in-out infinite; }
.orb[data-state="listening"] .orb-ring1 { border-color: rgba(56,225,255,0.6); animation-duration: 3s; }
.orb[data-state="processing"] { box-shadow: 0 0 22px rgba(255,180,84,0.35); border-color: rgba(255,180,84,0.5); }
.orb[data-state="processing"] .orb-core { background: radial-gradient(circle, rgba(255,180,84,0.9), rgba(255,180,84,0.12) 72%); animation: pulse 0.6s ease-in-out infinite; }
.orb[data-state="checking"] .orb-core { background: radial-gradient(circle, rgba(157,220,255,0.9), rgba(157,220,255,0.12) 72%); }
.orb[data-state="checking"] .orb-ring2 { border-style: dotted; border-color: rgba(157,220,255,0.5); animation-duration: 6s; }
.orb[data-state="speaking"] { box-shadow: 0 0 30px rgba(56,225,255,0.5); }
.orb[data-state="speaking"] .orb-core { animation: speakwave 0.55s ease-in-out infinite alternate; }
.orb[data-state="error"] { border-color: rgba(255,77,94,0.6); box-shadow: 0 0 20px rgba(255,77,94,0.3); }
.orb[data-state="error"] .orb-core { background: radial-gradient(circle, rgba(255,77,94,0.85), transparent 72%); animation: none; }
.orb[data-state="disabled"] { opacity: 0.4; cursor: not-allowed; }
.orb[data-state="disabled"] .orb-core { animation: none; background: radial-gradient(circle, rgba(125,147,163,0.6), transparent 70%); }
@keyframes speakwave { from { transform: scale(0.85); } to { transform: scale(1.12); } }

.voice-transcript { min-height: 3.2em; width: 100%; font-family: var(--mono); font-size: 0.85rem;
  color: var(--ice); border-top: 1px solid var(--line); padding-top: 0.5rem; }
.voice-transcript .interim { color: var(--text-dim); font-style: italic; }
.voice-statusline { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.voice-controls { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: center; margin-top: 0.4rem; }
.voice-response .classification { float: right; }
.voice-mic-meter { width: 120px; height: 8px; }
#voice-level { accent-color: var(--cyan); }

/* ---- Phase 2: empty / loading / offline / error states ---- */
.empty-state { text-align: center; padding: 1.6rem 1rem; color: var(--text-dim); }
.empty-state .empty-mark { font-size: 1.6rem; opacity: 0.5; line-height: 1; }
.empty-state .empty-msg { margin: 0.5rem 0 0; color: var(--text); opacity: 0.85; }
.empty-cell { text-align: center; color: var(--text-dim); padding: 1.1rem 0.5rem; font-style: italic; }

/* Skeleton shimmer for content that is still loading */
.skeleton { position: relative; overflow: hidden; background: rgba(56,225,255,0.05);
  border-radius: 4px; min-height: 0.9em; color: transparent !important; }
.skeleton::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(56,225,255,0.10), transparent);
  transform: translateX(-100%); animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
html[data-motion="off"] .skeleton::after { animation: none; }

/* Top loading bar shown during navigation / auto-refresh / form submit */
.loading-bar { position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--ice)); box-shadow: 0 0 8px var(--cyan);
  z-index: 1000; opacity: 0; transition: width 0.2s ease, opacity 0.3s ease; }
.loading-bar.active { opacity: 1; }
html[data-motion="off"] .loading-bar { transition: none; }

/* Offline / connection-lost banner */
.offline-banner { position: sticky; top: 0; z-index: 900; text-align: center;
  padding: 0.4rem 0.8rem; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase;
  border-bottom: 1px solid rgba(255,180,84,0.5); background: rgba(255,180,84,0.12); color: var(--amber); }
.offline-banner[hidden] { display: none; }

/* Standalone error pages (403 / 404 / 500) */
.error-page { max-width: 460px; margin: 12vh auto; padding: 0 1rem; text-align: center; }
.error-card { padding: 1.6rem 1.4rem; }
.error-code { font-family: var(--mono); font-size: 2.6rem; font-weight: 600; color: var(--cyan);
  letter-spacing: 0.1em; text-shadow: 0 0 18px rgba(56,225,255,0.35); }

/* Clickable stat/summary cards (Command Center) */
a.panel { color: inherit; display: block; text-decoration: none; transition: border-color 0.15s ease, transform 0.15s ease; }
a.panel:hover { border-color: var(--line-strong); transform: translateY(-1px); }
html[data-motion="off"] a.panel:hover { transform: none; }
.panel h2 a { color: inherit; }
.panel h2 a:hover { color: var(--cyan); }

/* ---- Phase 3: unified JARVIS console (target selector + chat thread) ---- */
.console-grid { display: grid; grid-template-columns: 280px 360px 1fr; gap: 0.9rem; align-items: start; }
@media (max-width: 1180px) { .console-grid { grid-template-columns: 1fr; } }

.target-panel input[type=search] { margin-bottom: 0.5rem; }
.target-selected { font-size: 0.72rem; margin: 0.3rem 0 0.5rem; }
.target-recent { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-bottom: 0.5rem; }
.target-recent .chip { cursor: pointer; }
.target-list { max-height: 60vh; overflow: auto; }
.target-group { font-size: 0.62rem; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--text-dim); margin: 0.6rem 0 0.25rem; }
.target-item { display: flex; align-items: center; gap: 0.4rem; width: 100%; text-align: left;
  background: none; border: 1px solid transparent; border-radius: 6px; color: var(--text);
  padding: 0.3rem 0.45rem; cursor: pointer; font-size: 0.8rem; }
.target-item:hover { border-color: var(--line); background: rgba(56,225,255,0.05); }
.target-item.selected { border-color: var(--line-strong); background: rgba(56,225,255,0.10); color: var(--cyan); }
.target-item.child { padding-left: 1.4rem; font-size: 0.76rem; }
.target-item .t-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-dim); flex: 0 0 auto; }
.target-item .t-dot.healthy { background: var(--green); }
.target-item .t-dot.degraded, .target-item .t-dot.high { background: var(--amber); }
.target-item .t-dot.critical, .target-item .t-dot.failed { background: var(--red); }
.target-item .t-meta { margin-left: auto; font-size: 0.6rem; color: var(--text-dim); }

.voice-thread { display: flex; flex-direction: column; gap: 0.7rem; max-height: 66vh; overflow: auto; }
.turn { border: 1px solid var(--line); border-radius: 8px; padding: 0.55rem 0.7rem; }
.turn.user { align-self: flex-end; max-width: 85%; background: rgba(56,225,255,0.06); }
.turn.jarvis { align-self: flex-start; width: 100%; background: rgba(16,22,30,0.55); }
.turn .turn-who { font-size: 0.6rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-dim); }
.turn .turn-who .channel { float: right; }
.orchestration { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem; margin: 0.4rem 0;
  font-size: 0.66rem; font-family: var(--mono); }
.orchestration .orch-step { padding: 0.08rem 0.4rem; border: 1px solid var(--line); border-radius: 4px; color: var(--ice); }
.orchestration .orch-arrow { color: var(--text-dim); }
.orchestration.pending .orch-step { border-style: dashed; }
.routing-note { font-size: 0.66rem; color: var(--text-dim); margin: 0.2rem 0 0; }

/* ===================== Phase 6 — Jarvis Command Deck ===================== */
.deck { display: grid; grid-template-columns: 300px 1fr 340px; gap: 0.8rem; align-items: start; }
@media (max-width: 1200px) { .deck { grid-template-columns: 1fr; } }

.deck-clock { text-align: center; font-family: var(--mono); letter-spacing: 0.18em;
  color: var(--cyan); text-shadow: 0 0 14px rgba(56,225,255,0.4); margin: 0.2rem 0 0.6rem; }
.deck-clock .t { font-size: 1.9rem; font-weight: 600; }
.deck-clock .d { font-size: 0.66rem; color: var(--text-dim); letter-spacing: 0.24em; }

/* glass rails with angular clipped corners */
.deck-rail { display: flex; flex-direction: column; gap: 0.7rem; }
.glass { background: linear-gradient(160deg, rgba(16,22,30,0.66), rgba(10,14,20,0.5));
  border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--glow);
  clip-path: polygon(0 10px, 10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  padding: 0.7rem 0.8rem; }
.glass > h3 { font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ice); margin: 0 0 0.5rem; opacity: 0.9; border-bottom: 1px solid var(--line); padding-bottom: 0.3rem; }
.status-line { display: flex; justify-content: space-between; align-items: center; gap: 0.4rem;
  font-size: 0.72rem; padding: 0.16rem 0; border-bottom: 1px dashed rgba(56,225,255,0.08); }
.status-line:last-child { border-bottom: none; }
.status-line .k { color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.6rem; }
.status-line .v { font-family: var(--mono); }

/* center reactor */
.reactor-stage { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 0.6rem 0 0.2rem; }
.reactor { position: relative; width: 260px; height: 260px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 50%, rgba(56,225,255,0.10), transparent 62%);
  filter: drop-shadow(0 0 30px rgba(56,225,255,0.35)); }
.reactor .r-core { width: 84px; height: 84px; border-radius: 50%;
  background: radial-gradient(circle, #dff7ff, var(--cyan) 42%, rgba(56,225,255,0.15) 72%, transparent 80%);
  box-shadow: 0 0 40px rgba(56,225,255,0.7), inset 0 0 18px rgba(255,255,255,0.6); animation: pulse 3.2s ease-in-out infinite; }
.reactor .r-ring { position: absolute; border-radius: 50%; }
.reactor .r-ring.a { inset: 8px;  border: 1px dashed rgba(56,225,255,0.30); animation: spin 30s linear infinite; }
.reactor .r-ring.b { inset: 30px; border: 2px solid rgba(56,225,255,0.16); animation: spin 46s linear infinite reverse; }
.reactor .r-ring.c { inset: 56px; border: 1px dotted rgba(157,220,255,0.35); animation: spin 20s linear infinite; }
.reactor .r-tick { position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 6deg, rgba(56,225,255,0.18) 6deg 7deg, transparent 7deg 15deg); animation: spin 60s linear infinite; }
html[data-motion="off"] .reactor * { animation: none !important; }
.reactor.mode-disabled { filter: drop-shadow(0 0 16px rgba(125,147,163,0.3)); }
.reactor.mode-disabled .r-core { background: radial-gradient(circle, #c7d3da, var(--text-dim) 50%, transparent 78%); box-shadow: 0 0 20px rgba(125,147,163,0.4); animation: none; }
.reactor.paused .r-core { background: radial-gradient(circle, #ffe6c2, var(--amber) 45%, transparent 78%); box-shadow: 0 0 34px rgba(255,180,84,0.6); }
.reactor.mode-autonomous .r-core { background: radial-gradient(circle, #d6ffe9, var(--green) 44%, transparent 80%); box-shadow: 0 0 40px rgba(67,230,160,0.7); }

.reactor-label { text-align: center; }
.reactor-label .big { font-size: 0.8rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--cyan); }
.voicestate { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--text-dim); border: 1px solid var(--line); border-radius: 20px; padding: 0.25rem 0.9rem; }
.voicestate::before { content: "● "; color: var(--cyan); }

/* KPI stat row */
.deck-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; margin: 0.6rem 0; }
.deck-kpis .kpi { text-align: center; }
.deck-kpis .kpi .stat { font-size: 1.5rem; }

/* department status cards */
.dept-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.dept-card { border: 1px solid var(--line); border-radius: 6px; padding: 0.45rem 0.55rem;
  background: rgba(56,225,255,0.03); display: flex; flex-direction: column; gap: 0.2rem; }
.dept-card:hover { border-color: var(--line-strong); }
.dept-card .n { font-size: 0.78rem; color: var(--text); }
.dept-card .meta { display: flex; gap: 0.3rem; align-items: center; flex-wrap: wrap; }
.dept-card .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); }
.dept-card .dot.healthy { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dept-card .dot.degraded, .dept-card .dot.high { background: var(--amber); }
.dept-card .dot.critical, .dept-card .dot.failed { background: var(--red); }

/* resource-usage bars */
.res-bar { height: 8px; border-radius: 4px; background: rgba(56,225,255,0.08); overflow: hidden; margin-top: 0.2rem; }
.res-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--ice)); }
.res-bar.warn > span { background: linear-gradient(90deg, var(--amber), #ffd9a1); }
.res-bar.crit > span { background: linear-gradient(90deg, var(--red), #ff9aa4); }

/* activity timeline */
.timeline { display: flex; flex-direction: column; gap: 0.15rem; max-height: 220px; overflow: auto; }
.timeline .ev { font-family: var(--mono); font-size: 0.66rem; color: var(--text-dim); display: flex; gap: 0.4rem; }
.timeline .ev .tm { color: var(--cyan); opacity: 0.8; flex: 0 0 auto; }

/* bottom activity bars strip */
.deck-bars { margin-top: 0.8rem; }
.deck-bars canvas { width: 100%; height: 90px; }

/* deck search */
.deck-search { width: 100%; }

/* ============ Phase 6 — Iron Man HUD polish ============ */
/* animated grid + scanline behind the deck */
.deck { position: relative; }
.deck::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(56,225,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56,225,255,0.035) 1px, transparent 1px);
  background-size: 42px 42px; mask-image: radial-gradient(circle at 50% 40%, #000 30%, transparent 80%); }
.deck::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(rgba(56,225,255,0.05), transparent 3px); background-size: 100% 4px;
  animation: scan 8s linear infinite; opacity: 0.5; }
@keyframes scan { from { background-position: 0 0; } to { background-position: 0 100vh; } }
html[data-motion="off"] .deck::after { animation: none; }

/* HUD corner brackets on glass panels */
.glass { position: relative; }
.glass::before, .glass::after { content: ""; position: absolute; width: 12px; height: 12px; pointer-events: none;
  border-color: var(--line-strong); }
.glass::before { top: 4px; left: 4px; border-top: 1px solid var(--line-strong); border-left: 1px solid var(--line-strong); }
.glass::after { bottom: 4px; right: 4px; border-bottom: 1px solid var(--line-strong); border-right: 1px solid var(--line-strong); }
.glass > h3 { position: relative; }
.glass > h3::before { content: "▸ "; color: var(--cyan); }

/* reactor: outer sweep + stronger bloom */
.reactor { width: 280px; height: 280px; }
.reactor .r-sweep { position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 300deg, rgba(56,225,255,0.22) 350deg, transparent 360deg);
  animation: spin 4.5s linear infinite; }
html[data-motion="off"] .reactor .r-sweep { animation: none; }
.reactor::after { content: ""; position: absolute; inset: -18px; border-radius: 50%;
  border: 1px solid rgba(56,225,255,0.10); box-shadow: 0 0 40px rgba(56,225,255,0.25) inset; }

/* KPI hover lift + glow */
.deck-kpis .kpi { transition: transform 0.15s ease, box-shadow 0.15s ease; }
.deck-kpis .kpi:hover { transform: translateY(-2px); box-shadow: 0 0 18px rgba(56,225,255,0.28); }
html[data-motion="off"] .deck-kpis .kpi:hover { transform: none; }

/* clock: subtle flicker-free glow ring */
.deck-clock .t { position: relative; display: inline-block; padding: 0 0.4rem; }

/* streaming JARVIS bubble: blinking caret while tokens arrive */
.turn.jarvis.streaming .live-text::after {
  content: "▊"; color: var(--cyan); margin-left: 2px;
  animation: caret 1s steps(1) infinite;
}
html[data-motion="off"] .turn.jarvis.streaming .live-text::after { animation: none; }
@keyframes caret { 50% { opacity: 0; } }

/* ============ CSP: static inline-style utilities (script/style-src 'self') ============ */
.u1 { cursor:pointer;font-size:0.72rem; }
.u2 { display:flex;gap:0.4rem;align-items:center; }
.u3 { display:flex;gap:0.4rem;margin-top:0.2rem; }
.u4 { display:flex;gap:0.5rem;margin-top:0.4rem; }
.u5 { display:inline-flex;gap:0.3rem; }
.u6 { display:none; }
.u7 { font-size:0.55rem; }
.u8 { font-size:0.58rem; }
.u9 { font-size:0.62rem; }
.u10 { font-size:0.62rem;margin-bottom:0.3rem; }
.u11 { font-size:0.64rem; }
.u12 { font-size:0.64rem;margin-top:0.3rem; }
.u13 { font-size:0.66rem; }
.u14 { font-size:0.66rem; }
.u15 { font-size:0.66rem;margin-top:0.5rem; }
.u16 { font-size:0.68rem; }
.u17 { font-size:0.68rem; }
.u18 { font-size:0.68rem;margin-top:0.8rem; }
.u19 { font-size:0.68rem;max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.u20 { font-size:0.6rem; }
.u21 { font-size:0.6rem;max-width:22rem; }
.u22 { font-size:0.72rem; }
.u23 { font-size:0.72rem; }
.u24 { font-size:0.72rem;margin-top:0.2rem; }
.u25 { font-size:0.74rem; }
.u26 { font-size:0.74rem; }
.u27 { font-size:0.74rem;margin-bottom:0.7rem; }
.u28 { font-size:0.74rem;margin:0.4rem 0 1rem; }
.u29 { font-size:0.76rem; }
.u30 { font-size:0.7rem; }
.u31 { font-size:0.7rem;font-weight:400; }
.u32 { font-size:0.7rem;margin-top:0.6rem; }
.u33 { font-size:0.7rem;margin-top:0.8rem; }
.u34 { font-size:0.7rem;max-width:280px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap; }
.u35 { font-size:0.8rem; }
.u36 { font-weight:400;font-size:0.72rem; }
.u37 { grid-column:span 2; }
.u38 { justify-content:center;margin-bottom:1.2rem; }
.u39 { letter-spacing:0.3em;text-align:center; }
.u40 { letter-spacing:0.4em;text-align:center;font-size:1.1rem; }
.u41 { line-height:2;font-size:0.95rem;letter-spacing:0.06em; }
.u42 { margin-bottom:0.4rem; }
.u43 { margin-bottom:0.5rem; }
.u44 { margin-bottom:0.6rem; }
.u45 { margin-bottom:0.7rem; }
.u46 { margin-bottom:0.8rem; }
.u47 { margin-bottom:1rem; }
.u48 { margin-top:0.3rem; }
.u49 { margin-top:0.3rem; }
.u50 { margin-top:0.4rem; }
.u51 { margin-top:0.4rem;font-size:0.66rem; }
.u52 { margin-top:0.5rem; }
.u53 { margin-top:0.5rem; }
.u54 { margin-top:0.6rem; }
.u55 { margin-top:0.6rem; }
.u56 { margin-top:0.8rem; }
.u57 { margin-top:0.8rem; }
.u58 { margin-top:0.8rem;font-size:0.72rem; }
.u59 { margin-top:1.1rem;display:flex;gap:0.5rem;justify-content:center;flex-wrap:wrap; }
.u60 { margin-top:1rem; }
.u61 { margin-top:1rem; }
.u62 { margin:1rem 0;border:none;border-top:1px solid rgba(255,255,255,0.08); }
.u63 { max-width:220px;margin:0.8rem 0; }
.u64 { max-width:380px;margin:11vh auto;padding:0 1rem; }
.u65 { max-width:420px; }
.u66 { max-width:460px; }
.u67 { text-align:center;margin-top:1rem;font-size:0.62rem;letter-spacing:0.14em; }
.u68 { white-space:pre-wrap; }
.u69 { white-space:pre-wrap;max-height:150px;overflow:auto; }
.u70 { white-space:pre-wrap;max-height:240px;overflow:auto; }
.u71 { white-space:pre-wrap;max-height:260px;overflow:auto; }
.u72 { width:100%; }
.u73 { width:100%;display:flex;gap:0.4rem; }
.u74 { width:110px; }
.u75 { width:150px; }
.u76 { width:220px; }
.u77 { width:240px; }
.u78 { width:260px; }
.u79 { width:5rem; }
.u80 { width:6rem; }
.u81 { width:7rem; }
.u82 { width:90px; }
.u83 { width:9rem; }
.u84 { word-break:break-all;background:rgba(255,255,255,0.04);padding:0.5rem;border-radius:4px; }

/* ============ Mobile polish — preserve the command-deck look, stack cleanly ============ */
@media (max-width: 760px) {
  .main { padding: 0.6rem 0.7rem 2rem; }
  h1 { font-size: 1rem; }
  .topbar { gap: 0.4rem 0.5rem; }
  .deck { gap: 0.6rem; }
  .deck-kpis { grid-template-columns: 1fr 1fr; }
  .deck-clock .t { font-size: 1.5rem; }
  .reactor { width: min(66vw, 230px); height: min(66vw, 230px); }
  .reactor-stage { padding: 0.8rem; }
  table { font-size: 0.72rem; }
  .btn { font-size: 0.7rem; }
  /* sidebar becomes a scrollable strip instead of a tall wrapped block */
  .sidebar { max-height: 42vh; overflow-y: auto; }
}
@media (max-width: 430px) {
  .deck-kpis { grid-template-columns: 1fr 1fr; }
  .reactor { width: min(70vw, 200px); height: min(70vw, 200px); }
  .deck-clock .t { font-size: 1.3rem; }
  .brand small { display: none; }
  .chip { font-size: 0.62rem; padding: 0.1rem 0.45rem; }
}
