:root {
  --bg-void: #030811;
  --bg-deep: #061121;
  --bg-panel: rgba(8, 22, 41, 0.78);
  --bg-panel-solid: #081629;
  --bg-elevated: rgba(12, 31, 56, 0.86);
  --accent: #00e5ff;
  --accent-soft: rgba(0, 229, 255, 0.14);
  --accent-border: rgba(0, 229, 255, 0.28);
  --accent-glow: rgba(0, 229, 255, 0.35);
  --gold: #f59e0b;
  --gold-soft: rgba(245, 158, 11, 0.16);
  --emerald: #10b981;
  --crimson: #f43f5e;
  --text-primary: #eef8ff;
  --text-secondary: #9bc1dc;
  --text-muted: #6889a4;
  --font-display: 'Orbitron', 'Rajdhani', 'Eurostile', 'Segoe UI', system-ui, sans-serif;
  --font-ui: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
}

html[data-theme='gold'] {
  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, 0.15);
  --accent-border: rgba(245, 158, 11, 0.34);
  --accent-glow: rgba(245, 158, 11, 0.38);
  --gold: #00e5ff;
  --bg-void: #0b0703;
  --bg-deep: #171006;
  --bg-panel: rgba(28, 19, 8, 0.82);
  --bg-panel-solid: #1c1308;
  --bg-elevated: rgba(41, 27, 10, 0.88);
  --text-secondary: #e2c79d;
  --text-muted: #9b825d;
}

html[data-theme='stealth'] {
  --accent: #10b981;
  --accent-soft: rgba(16, 185, 129, 0.14);
  --accent-border: rgba(16, 185, 129, 0.3);
  --accent-glow: rgba(16, 185, 129, 0.34);
  --gold: #38bdf8;
  --bg-void: #030a08;
  --bg-deep: #071511;
  --bg-panel: rgba(9, 24, 20, 0.82);
  --bg-panel-solid: #091814;
  --bg-elevated: rgba(13, 35, 29, 0.88);
  --text-secondary: #9fd1be;
  --text-muted: #659282;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.hidden {
  display: none !important;
}

/* --- Holographic Backdrop --- */
.hud-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.hud-grid-layer {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(0, 229, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 229, 255, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
}

.hud-radial-glow {
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(circle at 18% 12%, var(--accent-soft), transparent 44%),
    radial-gradient(circle at 82% 84%, rgba(245, 158, 11, 0.07), transparent 40%);
}

.hud-scanline {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(255, 255, 255, 0.012) 4px
  );
}

/* --- Chamfered HUD Card --- */
.hud-card {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-md);
  padding: 18px;
  backdrop-filter: blur(12px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset, 0 12px 32px rgba(0, 0, 0, 0.35);
}

.hud-card::before,
.hud-card::after {
  content: '';
  position: absolute;
  width: 11px;
  height: 11px;
  pointer-events: none;
  border-color: var(--accent);
  opacity: 0.7;
}

.hud-card::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid var(--accent);
  border-left: 2px solid var(--accent);
  border-top-left-radius: 3px;
}

.hud-card::after {
  bottom: -1px;
  right: -1px;
  border-bottom: 2px solid var(--accent);
  border-right: 2px solid var(--accent);
  border-bottom-right-radius: 3px;
}

.eyebrow {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  font-weight: 700;
}

h2 { font-size: 20px; }
h3 { font-size: 15px; }
h4 { font-size: 13.5px; }

/* --- Buttons & Inputs --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}

.btn:focus-visible,
.hud-input:focus-visible,
.hud-select:focus-visible,
.rail-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-soft), rgba(0, 229, 255, 0.24));
  border-color: var(--accent);
  color: #ffffff;
  box-shadow: 0 0 18px var(--accent-soft);
}

.btn-primary:hover {
  background: var(--accent);
  color: #030811;
  box-shadow: 0 0 22px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  border-color: var(--accent-border);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--accent-border);
}

.btn-danger {
  background: rgba(244, 63, 94, 0.14);
  border-color: rgba(244, 63, 94, 0.45);
  color: #fda4af;
}

.btn-danger:hover {
  background: #f43f5e;
  color: #ffffff;
}

.btn-lg { padding: 11px 18px; font-size: 13.5px; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-xs { padding: 4px 9px; font-size: 11.5px; }
.btn-icon {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--accent-border);
  color: var(--text-secondary);
  padding: 5px 10px;
  font-size: 11px;
}

.btn-icon[aria-pressed='true'] {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.btn-link {
  background: none;
  border: none;
  padding: 2px 4px;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
}

.btn-link:hover { text-decoration: underline; }

.hud-input,
.hud-select {
  background: rgba(3, 10, 20, 0.85);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 7px 11px;
  font-size: 13px;
  font-family: var(--font-ui);
}

.hud-input::placeholder { color: var(--text-muted); }

/* --- Auth Gate --- */
.auth-gate {
  position: relative;
  z-index: 5;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: 100%;
  max-width: 470px;
  text-align: center;
  padding: 30px 28px;
}

.auth-reactor-wrap {
  width: 152px;
  margin: 0 auto 14px;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: left;
  margin-bottom: 14px;
}

.auth-brand h1 {
  font-size: 20px;
  color: var(--text-primary);
}

.auth-copy {
  color: var(--text-secondary);
  margin: 0 0 18px;
  font-size: 13.5px;
}

.auth-status-banner {
  background: rgba(0, 229, 255, 0.07);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

.auth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-footnote {
  margin: 18px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

/* --- Main HUD Shell --- */
.hud-app {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 58px;
}

.hud-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 18px;
  background: rgba(3, 8, 17, 0.9);
  border-bottom: 1px solid var(--accent-border);
  backdrop-filter: blur(14px);
  flex-wrap: wrap;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-jarvis { color: var(--accent); }
.brand-divider { color: var(--text-muted); }
.brand-org { color: var(--text-primary); }
.brand-domain { font-size: 11px; color: var(--text-muted); }

.topbar-telemetry {
  display: flex;
  align-items: center;
  gap: 14px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--accent-border);
  background: var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.status-pill.status-nominal { border-color: rgba(16, 185, 129, 0.5); background: rgba(16, 185, 129, 0.14); color: #6ee7b7; }
.status-pill.status-warning { border-color: rgba(245, 158, 11, 0.5); background: rgba(245, 158, 11, 0.16); color: #fcd34d; }
.status-pill.status-critical { border-color: rgba(244, 63, 94, 0.6); background: rgba(244, 63, 94, 0.18); color: #fda4af; }
.status-pill.status-scanning { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 8px currentColor;
  animation: pulseDot 1.8s ease-in-out infinite;
}

.clock-readout {
  font-size: 12px;
  color: var(--text-secondary);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.theme-switcher {
  display: inline-flex;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.theme-chip {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 5px 8px;
  cursor: pointer;
}

.theme-chip.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.operator-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
}

.operator-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
}

/* --- Workspace Grid --- */
.hud-workspace {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  flex: 1;
}

.hud-rail {
  border-right: 1px solid var(--accent-border);
  background: rgba(4, 12, 24, 0.72);
  padding: 16px 12px 68px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.rail-item:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.rail-item.active {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--text-primary);
  box-shadow: 0 0 14px rgba(0, 229, 255, 0.08) inset;
}

.rail-code {
  font-size: 10.5px;
  color: var(--accent);
  opacity: 0.85;
}

.rail-label { flex: 1; }

.rail-badge {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.rail-badge-alert {
  background: rgba(244, 63, 94, 0.24);
  color: #fda4af;
}

.rail-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auto-sweep-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.rail-meta {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--text-muted);
}

/* --- Main Content --- */
.hud-main {
  padding: 20px 24px 36px;
  min-width: 0;
}

.hud-view {
  display: none;
  flex-direction: column;
  gap: 18px;
}

.hud-view.active {
  display: flex;
}

.view-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.view-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* --- Arc Reactor & Hero --- */
.hero-core-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
}

.core-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

.core-visual {
  flex: 0 0 176px;
}

.arc-svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 0 12px var(--reactor-glow));
}

.arc-ring-outer {
  transform-origin: 110px 110px;
  animation: spinSlow 24s linear infinite;
}

.arc-ring-inner {
  transform-origin: 110px 110px;
  animation: spinReverse 16s linear infinite;
}

.arc-state-scanning .arc-ring-outer { animation-duration: 3.5s; }
.arc-state-scanning .arc-ring-inner { animation-duration: 2.2s; }

.arc-score {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  fill: #ffffff;
}

.arc-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  fill: var(--reactor-color);
}

.core-briefing {
  flex: 1;
  min-width: 0;
}

.core-briefing h3 {
  font-size: 17px;
  margin-bottom: 6px;
}

.briefing-copy {
  margin: 0 0 14px;
  color: var(--text-secondary);
  font-size: 13px;
}

.briefing-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.analytics-kpi-strip,
.ops-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kpi-card {
  padding: 14px 16px;
}

.kpi-label {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.kpi-value {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.kpi-sub {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.overview-split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

/* --- Fleet Matrix & Cards --- */
.compact-fleet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.mini-site-tile {
  background: rgba(3, 10, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.12s ease;
}

.mini-site-tile:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.mini-tile-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.site-name-trunc {
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-domain-small {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 8px;
}

.mini-tile-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 1px solid transparent;
}

.badge-online { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.4); }
.badge-degraded { background: rgba(245, 158, 11, 0.16); color: #fcd34d; border-color: rgba(245, 158, 11, 0.4); }
.badge-offline { background: rgba(244, 63, 94, 0.18); color: #fda4af; border-color: rgba(244, 63, 94, 0.45); }
.badge-standby { background: rgba(148, 163, 184, 0.14); color: #cbd5e1; border-color: rgba(148, 163, 184, 0.3); }

.fleet-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 14px;
}

.site-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.site-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.site-card-url {
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

.site-card-url:hover { text-decoration: underline; }

.site-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background: rgba(3, 10, 20, 0.65);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.metric-cell span {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.metric-cell strong {
  font-size: 13.5px;
  color: var(--text-primary);
}

.site-card-spark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sparkline-svg {
  width: 112px;
  height: 28px;
}

.site-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.site-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* --- Alerts --- */
.alerts-stack {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.alert-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(3, 10, 20, 0.72);
  border-left: 3px solid var(--accent);
}

.alert-row.sev-critical { border-left-color: var(--crimson); background: rgba(244, 63, 94, 0.08); }
.alert-row.sev-warning { border-left-color: var(--gold); background: rgba(245, 158, 11, 0.08); }

.alert-title { font-weight: 600; font-size: 13px; margin: 0 0 2px; }
.alert-detail { margin: 0; font-size: 12px; color: var(--text-secondary); }
.alert-meta { font-size: 10.5px; color: var(--text-muted); white-space: nowrap; }

/* --- Analytics Charts & Vitals --- */
.segmented-control {
  display: inline-flex;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  cursor: pointer;
}

.seg-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.analytics-main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 16px;
}

.chart-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-secondary);
}

.swatch {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 2px;
  margin-right: 5px;
}

.swatch-cyan { background: #00e5ff; }
.swatch-gold { background: #f59e0b; }

.traffic-chart-svg {
  width: 100%;
  height: auto;
  display: block;
}

.chart-axis-text {
  font-family: var(--font-mono);
  font-size: 10px;
  fill: var(--text-muted);
}

.vitals-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.vital-card {
  background: rgba(3, 10, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
}

.vital-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.vital-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

.vital-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid;
}

.vital-value {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.vital-track {
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.vital-bar { height: 100%; border-radius: 999px; }

.analytics-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.hud-bar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hud-bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  margin-bottom: 4px;
}

.hud-bar-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud-bar-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
  overflow: hidden;
}

.hud-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 999px;
}

.donut-layout {
  display: flex;
  align-items: center;
  gap: 18px;
}

.donut-svg {
  width: 118px;
  height: 118px;
  flex-shrink: 0;
}

.donut-total { font-family: var(--font-display); font-size: 18px; fill: #ffffff; font-weight: 700; }
.donut-caption { font-family: var(--font-mono); font-size: 8.5px; fill: var(--text-muted); letter-spacing: 0.1em; }

.donut-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.donut-legend li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.legend-swatch { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.legend-name { flex: 1; }
.legend-pct { color: var(--text-secondary); }

/* --- Tables --- */
.table-wrap { overflow-x: auto; }

.hud-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}

.hud-table th {
  text-align: left;
  padding: 9px 10px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--accent-border);
}

.hud-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.hud-table tr:hover td { background: rgba(0, 229, 255, 0.04); }

.check-yes { color: var(--emerald); font-weight: 700; }
.check-no { color: var(--crimson); opacity: 0.85; }

/* --- Operations & Ecosystem --- */
.ops-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.infra-grid,
.ecosystem-grid,
.deploy-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.infra-card,
.eco-card,
.deploy-step {
  background: rgba(3, 10, 20, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 13px 14px;
}

.infra-card p,
.eco-card p,
.deploy-step p {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.step-num {
  display: inline-block;
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 4px;
}

/* --- J.A.R.V.I.S. Command Console --- */
.jarvis-console {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: rgba(3, 8, 17, 0.94);
  border-top: 1px solid var(--accent-border);
  backdrop-filter: blur(14px);
}

.console-transcript {
  max-height: 220px;
  overflow-y: auto;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.transcript-entry {
  font-size: 12.5px;
  white-space: pre-wrap;
}

.transcript-user { color: var(--gold); }
.transcript-jarvis { color: var(--text-primary); }

.console-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
}

.console-prompt {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.console-input {
  flex: 1;
  min-width: 140px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
}

.console-quick-chips {
  display: flex;
  gap: 5px;
}

.cmd-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 11px;
  cursor: pointer;
}

.cmd-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Inspector Drawer & Modals --- */
.drawer-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(2, 6, 14, 0.72);
  backdrop-filter: blur(5px);
}

.modal-backdrop {
  display: grid;
  place-items: center;
  padding: 18px;
}

.inspector-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(500px, 100vw);
  z-index: 55;
  background: var(--bg-panel-solid);
  border-left: 1px solid var(--accent-border);
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.55);
}

.drawer-header,
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-card {
  width: 100%;
  max-width: 480px;
  padding: 0;
  overflow: hidden;
}

.modal-wide { max-width: 640px; }

.modal-form,
.modal-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
}

.form-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
  padding-bottom: 8px;
}

.form-error {
  margin: 0;
  color: #fda4af;
  font-size: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.code-block-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.code-block {
  margin: 0;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: #02060e;
  border: 1px solid var(--accent-border);
  color: var(--accent);
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.muted-copy,
.muted-empty {
  color: var(--text-muted);
  font-size: 12.5px;
  margin: 0;
}

.hud-toast {
  position: fixed;
  right: 18px;
  bottom: 66px;
  z-index: 60;
  background: var(--bg-elevated);
  border: 1px solid var(--accent);
  color: var(--text-primary);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

/* --- Animations --- */
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes spinReverse {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

@media (prefers-reduced-motion: reduce) {
  .arc-ring-outer,
  .arc-ring-inner,
  .pulse-dot {
    animation: none !important;
  }
}

/* --- Responsive Breakpoints --- */
@media (max-width: 1120px) {
  .hero-core-grid,
  .overview-split,
  .analytics-main-grid {
    grid-template-columns: 1fr;
  }
  .analytics-kpi-strip,
  .ops-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .hud-workspace {
    grid-template-columns: 1fr;
  }
  .hud-rail {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--accent-border);
    padding: 8px 10px;
  }
  .rail-item {
    white-space: nowrap;
    width: auto;
    padding: 7px 10px;
  }
  .rail-footer { display: none; }
  .hud-main { padding: 14px 12px 28px; }
  .core-card { flex-direction: column; text-align: center; }
  .briefing-actions { justify-content: center; }
  .analytics-breakdown-grid { grid-template-columns: 1fr; }
  .console-quick-chips { display: none; }
  .topbar-telemetry { display: none; }
  .form-row { grid-template-columns: 1fr; }
}
