/* ── NECRO: Cyber-Forensic Laboratory Design System ── */

:root {
  --bg: #030209;
  --bg-gradient: radial-gradient(circle at 50% 50%, #0a071f 0%, #030209 100%);
  --surface: rgba(12, 10, 31, 0.65);
  --surface-hover: rgba(20, 16, 51, 0.8);
  --surface-solid: #0c0a1f;
  /* Faint inset fill + ring track — theme-aware so dark-only rgba() values
     don't break on the light theme. */
  --surface-subtle: rgba(0, 0, 0, 0.22);
  --track: rgba(255, 255, 255, 0.06);

  --border: rgba(124, 58, 237, 0.15);
  --border-glow: rgba(124, 58, 237, 0.4);
  --border-neon: #a78bfa;
  
  --accent: #7c3aed;
  --accent-glow: rgba(124, 58, 237, 0.35);
  --accent-hover: #9f75ff;
  
  --neon-cyan: #06b6d4;
  --neon-cyan-glow: rgba(6, 182, 212, 0.35);
  
  --green: #10b981;
  --green-glow: rgba(16, 185, 129, 0.25);
  --red: #ef4444;
  --red-glow: rgba(239, 68, 68, 0.25);
  --amber: #fbbf24;
  --amber-glow: rgba(251, 191, 36, 0.25);
  
  --text: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  /* Clean Input Theme variables */
  --input-bg: rgba(12, 10, 31, 0.8);
  --input-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);

  /* Sidebar Modern Hover States */
  --sidebar-nav-hover: rgba(124, 58, 237, 0.06);
  --sidebar-nav-active: rgba(124, 58, 237, 0.12);
  --sidebar-nav-active-text: var(--text);
}

/* Light Mode Overrides — refined "clinical forensic lab" light theme (2026).
   Neutral slate hairlines (not purple-washed) + a real elevation scale = premium feel. */
[data-theme="light"] {
  --bg: #f4f5fb;                 /* calm cool canvas so white cards lift off it */
  --bg-gradient: radial-gradient(circle at 50% -8%, #ffffff 0%, #f4f5fb 55%);
  --surface: #ffffff;
  --surface-hover: #ffffff;
  --surface-solid: #ffffff;
  --surface-subtle: rgba(15, 23, 42, 0.03);
  --track: rgba(15, 23, 42, 0.07);
  --border: rgba(15, 23, 42, 0.09);          /* crisp neutral hairline */
  --border-strong: rgba(15, 23, 42, 0.14);
  --border-glow: rgba(79, 70, 229, 0.30);
  --border-neon: #4f46e5;
  --accent: #4f46e5;                          /* deeper indigo for actions */
  --accent-soft: #6366f1;
  --accent-glow: rgba(79, 70, 229, 0.20);
  --accent-hover: #4338ca;
  --text: #0b1220;
  --text-secondary: #475569;
  --text-muted: #7c8698;
  --neon-cyan: #0891b2;
  --neon-cyan-glow: rgba(8, 145, 178, 0.18);

  /* Amber/investigate: dark-mode fbbf24 is neon-bright — override to sophisticated warm brown
     that reads confidently on white without screaming. Everything using var(--amber) inherits. */
  --amber: #b45309;
  --amber-glow: rgba(180, 83, 9, 0.15);

  /* Green/revive: dark-mode #10b981 is emerald-lime on white — override to a deeper,
     richer teal-green that reads as "go" without looking neon. */
  --green: #047857;
  --green-glow: rgba(4, 120, 87, 0.15);

  /* Clean Input light variables */
  --input-bg: #ffffff;
  --input-shadow: inset 0 1px 2px rgba(2, 6, 23, 0.05);

  /* Sidebar light variables */
  --sidebar-nav-hover: rgba(79, 70, 229, 0.06);
  --sidebar-nav-active: rgba(79, 70, 229, 0.10);
  --sidebar-nav-active-text: var(--accent);

  /* Elevation scale — neutral, low-opacity layered shadows read as "expensive". */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-md: 0 4px 10px -2px rgba(16, 24, 40, 0.06), 0 2px 6px -2px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 18px 36px -10px rgba(16, 24, 40, 0.12), 0 6px 14px -6px rgba(16, 24, 40, 0.07);
  --shadow-accent: 0 10px 26px -8px rgba(79, 70, 229, 0.30);
}

/* Reset and Global Viewport Constraints */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  background-image: var(--bg-gradient);
  color: var(--text);
  font-family: var(--font-sans);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Holographic grid-mesh overlay ─────────────────────────────────────── */
.cyber-app-shell {
  position: relative;
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  z-index: 1;
}
.cyber-app-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(var(--border) 1px, transparent 1px),
                    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.10;  /* toned down from 0.45 — subtle texture, not game-UI grid */
}

/* ── Sidebar (Left Controller Panel) ───────────────────────────────────── */
.cyber-sidebar {
  position: relative;
  width: 330px;
  height: 100%;
  background: rgba(8, 6, 25, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  z-index: 10;
  flex-shrink: 0;
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4);
}

/* Branding Logo */
.cyber-brand {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding: 0.25rem 0.5rem;
}
.necro-svg-logo {
  animation: logo-float 4s infinite ease-in-out;
}
@keyframes logo-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-title {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #c084fc 0%, var(--accent-hover) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-subtitle {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--neon-cyan);
}

/* Sidebar Vertical Navigation Menu */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.sidebar-nav-item.nav-tab {
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  color: var(--text-secondary);
  padding: 0.65rem 0.95rem;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  width: 100%;
}
.sidebar-nav-item.nav-tab:hover {
  background: var(--sidebar-nav-hover);
  color: var(--text);
}
.sidebar-nav-item.nav-tab.active {
  background: var(--sidebar-nav-active);
  color: var(--sidebar-nav-active-text);
  font-weight: 600;
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
}
.sidebar-nav-item.nav-tab .nav-item-icon {
  display: flex; align-items: center; flex-shrink: 0;
  color: var(--neon-cyan);
  width: 16px; height: 16px;
}
.sidebar-nav-item.nav-tab.active .nav-item-icon {
  color: var(--border-neon);
}
.sidebar-nav-item.nav-tab .tab-badge {
  background: rgba(124, 58, 237, 0.2);
  border-color: var(--border);
  margin-left: auto;
}

.sidebar-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, var(--border) 50%, transparent 100%);
  margin: 1.25rem 0;
}

/* Panel Containers */
.cyber-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.pane-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.pane-header h3 {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}
.pane-icon {
  font-size: 0.95rem;
}

.scan-inputs {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.85rem;
  width: 100%;
}

/* Cyber Fields & Inputs */
.cyber-field, .input-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.cyber-field label, .input-group label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.input-glow-wrapper {
  position: relative;
  width: 100%;
}
.cyber-input,
.input-group input[type="text"],
.input-group input[type="number"] {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.95rem;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  transition: var(--transition);
  box-shadow: var(--input-shadow);
}
.cyber-input:focus,
.input-group input[type="text"]:focus,
.input-group input[type="number"]:focus {
  outline: none;
  border-color: var(--border-neon);
  box-shadow: 0 0 10px var(--accent-glow);
}
.scan-params-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* Custom modern checkbox design for mission-dryrun */
.mission-dryrun {
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin-left: 0.8rem;
  cursor: pointer;
  user-select: none;
}
.mission-dryrun input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-grid;
  place-content: center;
  background: rgba(255, 255, 255, 0.03);
}
.mission-dryrun input[type="checkbox"]::before {
  content: "";
  width: 8px;
  height: 8px;
  transform: scale(0);
  transition: 120ms transform ease-in-out;
  box-shadow: inset 1em 1em var(--accent);
  background-color: var(--accent);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
.mission-dryrun input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: rgba(139, 92, 246, 0.15);
}
.mission-dryrun input[type="checkbox"]:checked::before {
  transform: scale(1);
}

/* Neon buttons */
.btn-neon {
  position: relative;
  background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-neon:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.55);
}
.btn-neon:active { transform: translateY(0); }

.neon-glow-beam {
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transform: skewX(-20deg);
  animation: shine 4.5s infinite linear;
}

.btn-cyber {
  background: rgba(124, 58, 237, 0.08);
  border: 1px solid var(--border);
  color: var(--border-neon);
  border-radius: var(--radius);
  padding: 0.65rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.btn-cyber:hover:not(:disabled) {
  background: rgba(124, 58, 237, 0.2);
  border-color: var(--border-neon);
  color: #fff;
}
.btn-cyber:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.scan-chip-demos {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.25rem;
}
.chips-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
}
.chips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.chip-neon {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chip-neon:hover {
  background: rgba(6, 182, 212, 0.08);
  border-color: var(--neon-cyan);
  color: #fff;
  box-shadow: 0 0 8px var(--neon-cyan-glow);
}

.diagnostics-pane {
  margin-top: auto;
}

/* ── Cyber Workspace (Right Viewport Area) ────────────────────────────── */
.cyber-workspace {
  flex: 1;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: rgba(3, 2, 9, 0.45);
}

/* Scientific workspace header navigation */
.workspace-header {
  height: 60px;
  background: rgba(8, 6, 25, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 8;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.nav-tabs {
  display: flex;
  gap: 0.5rem;
}
.nav-tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.75rem 1.1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.nav-tab:hover {
  color: var(--text-secondary);
}
.nav-tab.active {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
  text-shadow: 0 0 12px var(--accent-glow);
}
.tab-badge {
  background: rgba(124, 58, 237, 0.18);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
  color: var(--border-neon);
}
.tab-badge.alert {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--red);
  box-shadow: 0 0 8px var(--red-glow);
}

/* ── Status dot (replaces old health-indicator + btn-hdr-api) ── */
.status-dot-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.status-dot-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}
.status-dot-btn:hover { background: rgba(255,255,255,0.06); }
.status-pulse {
  display: block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green-glow);
  transition: background 0.3s, box-shadow 0.3s;
}
.status-pulse.warn { background: var(--amber); box-shadow: 0 0 6px var(--amber-glow); }
.status-pulse.error { background: var(--red); box-shadow: 0 0 6px var(--red-glow); }

/* Status overlay card */
.status-overlay {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  min-width: 210px;
  background: var(--surface);
  border: 1px solid var(--border-neon);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45);
  z-index: 200;
  animation: fadeSlideIn 0.15s ease;
}
.status-overlay-header {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}
.status-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.28rem 0;
}
.svc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.svc-dot.svc-ok    { background: var(--green); box-shadow: 0 0 4px var(--green-glow); }
.svc-dot.svc-warn  { background: var(--amber); box-shadow: 0 0 4px var(--amber-glow); }
.svc-dot.svc-error { background: var(--red);   box-shadow: 0 0 4px var(--red-glow); }
.svc-name {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.svc-name span {
  color: var(--text-muted);
  font-size: 0.68rem;
}

/* keep old class names working in JS that might reference them */
.health-dot { display: none; }
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.btn-icon {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ── Main Viewport Content Scroller ───────────────────────────────────── */
.main-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  z-index: 2;
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 1.5rem;
  animation: tab-enter 0.35s ease forwards;
}
.tab-panel.active {
  display: flex;
}

@keyframes tab-enter {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Top Dynamic Stats Ticker ────────────────────────────────────────── */
.live-stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.85rem;
  width: 100%;
}
.live-stats-bar.hidden {
  display: none !important;
}
.ls-card {
  position: relative;
  background: rgba(12, 10, 31, 0.45);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}
.ls-card:hover {
  background: rgba(20, 16, 51, 0.6);
  border-color: var(--border-glow);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.ls-card-glow {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(circle at 10% 20%, rgba(124, 58, 237, 0.05) 0%, transparent 60%);
  pointer-events: none;
}
.ls-card-icon {
  font-size: 1.35rem;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.15));
}
.ls-card-content {
  display: flex;
  flex-direction: column;
}
.ls-value {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
  line-height: 1.15;
}
.ls-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0.01em;
}
.ls-card-integration {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(99, 102, 241, 0.04));
  border-color: rgba(124, 58, 237, 0.25);
}
.ls-card-integration:hover {
  border-color: rgba(124, 58, 237, 0.45);
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.25);
}
.ls-card-integration .ls-value {
  background: linear-gradient(90deg, #a78bfa, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ── Interactive Briefing & Onboarding Guide ─────────────────────────── */
.welcome-hero-static {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.welcome-hero-static .welcome-hero-header {
  background: transparent;
  border-bottom: none;
  padding-bottom: 0;
}
.welcome-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease, margin-top 0.4s ease, visibility 0.4s;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.welcome-hero.collapsed {
  max-height: 52px !important;
  margin-top: 0px !important;
  opacity: 0.8 !important;
}
.welcome-hero.collapsed .welcome-hero-content {
  opacity: 0 !important;
  max-height: 0px !important;
  margin-top: 0px !important;
  overflow: hidden;
  visibility: hidden !important;
}

.welcome-hero-header {
  padding: 0.85rem 1.25rem;
  background: rgba(12, 10, 31, 0.55);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.welcome-hero-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.welcome-hero-sparkle {
  font-size: 1.35rem;
}
.welcome-hero-title {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.welcome-hero-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.btn-hero-toggle {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.25rem 0.65rem;
  font-size: 0.7rem;
  cursor: pointer;
  transition: var(--transition);
}
.btn-hero-toggle:hover {
  color: var(--text);
  border-color: var(--border-glow);
}

.welcome-hero-content {
  padding: 1.25rem 1.5rem;
  max-height: 1000px;
  transition: max-height 0.4s ease, opacity 0.4s ease;
  opacity: 1;
}

.welcome-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}
.welcome-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.15rem;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  transition: var(--transition);
}
.welcome-col:hover {
  background: rgba(255, 255, 255, 0.025);
  border-color: var(--border);
}
.welcome-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.welcome-icon { font-size: 1.25rem; }
.welcome-col h3 {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--border-neon);
}
.welcome-text {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.welcome-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.welcome-steps li {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
  position: relative;
  padding-left: 1.15rem;
}
.welcome-steps li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--neon-cyan);
  font-weight: 700;
}

/* ── Interactive ROI Calculator Widget ── */
.why-briefing-pane {
  border-color: rgba(16, 185, 129, 0.12);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.01) 0%, rgba(3, 2, 9, 0.4) 100%);
}
.why-briefing-pane:hover {
  border-color: rgba(16, 185, 129, 0.25);
}
.roi-calculator-widget {
  background: rgba(16, 185, 129, 0.03);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: auto;
}
.widget-title {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--green);
  border-bottom: 1px solid rgba(16, 185, 129, 0.15);
  padding-bottom: 0.25rem;
}
.calculator-slider {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.calculator-slider label {
  font-size: 0.7rem;
  color: var(--text-secondary);
}
.calculator-slider strong {
  color: var(--green);
}
.cyber-range {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  outline: none;
  transition: background 0.3s;
}
.cyber-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--green);
  cursor: pointer;
  box-shadow: 0 0 8px var(--green-glow);
  transition: transform 0.1s;
}
.cyber-range::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.calculator-results {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
}
.calc-result-item {
  display: flex;
  flex-direction: column;
}
.calc-label {
  font-size: 0.58rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.calc-val {
  font-size: 1.05rem;
  font-weight: 800;
  font-family: var(--font-mono);
}
.text-amber { color: var(--amber); text-shadow: 0 0 6px var(--amber-glow); }
.text-neon-green { color: var(--green); text-shadow: 0 0 6px var(--green-glow); }

/* Integration status list in sidebar diagnostics */
.welcome-tech-stack {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.25rem 0.5rem;
}
.tech-tag-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  transition: var(--transition);
}
.tech-tag-status:hover {
  background: rgba(255, 255, 255, 0.04);
}
.tech-tag-status.active {
  border-color: rgba(16, 185, 129, 0.25);
  background: rgba(16, 185, 129, 0.03);
  color: var(--green);
}
.tech-tag-status.pending {
  border-color: rgba(251, 191, 36, 0.25);
  background: rgba(251, 191, 36, 0.03);
  color: var(--amber);
}
.tech-tag-status.inactive {
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.03);
  color: var(--red);
}
.tech-tag-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
  flex-shrink: 0;
}

/* ── Summary statistics row ────────────────────────────────────────── */
.summary-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  width: 100%;
}
.stat-card, .summary-stat {
  flex: 1 1 140px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 72px;
}
.repo-stat {
  flex: 2 1 220px;
  text-align: left;
}
.stat-value, .summary-val {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.stat-label, .summary-lbl {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0.01em;
  margin-top: 0.15rem;
}
.revive-stat .stat-value { color: var(--green); text-shadow: 0 0 6px var(--green-glow); }
.investigate-stat .stat-value { color: var(--amber); text-shadow: 0 0 6px var(--amber-glow); }
.buried-stat .stat-value { color: var(--text-muted); }

/* ── Filter bar ────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}
.filter-title {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-right: 0.5rem;
}
.filter-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 0.3rem 0.8rem;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.filter-btn:hover {
  border-color: var(--border-glow);
  color: var(--text-secondary);
}
.filter-btn.active {
  background: var(--border);
  color: var(--text);
  border-color: var(--border-neon);
}
.filter-btn.revive-filter.active { background: rgba(16, 185, 129, 0.15); border-color: var(--green); color: var(--green); }
.filter-btn.investigate-filter.active { background: rgba(251, 191, 36, 0.15); border-color: var(--amber); color: var(--amber); }
.filter-btn.buried-filter.active { background: rgba(100, 116, 139, 0.15); border-color: var(--text-muted); color: var(--text-muted); }

/* ── Graveyard Code Card Grid (Futuristic Crypts) ────────────────────── */
.graveyard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.25rem;
  /* Cards size to their own content — without this, expanding one card stretches
     every sibling in its grid row into tall empty columns. */
  align-items: start;
}

/* ── Registry master–detail ─────────────────────────────────────────────────
   List of features (left) + full dossier of the selected one (right). The split
   is sized to the viewport (minus the 60px header + 140px console) so the whole
   registry fits one screen; each pane scrolls internally instead of the page.
   --reg-chrome can be tuned per breakpoint. */
.graveyard-grid.registry-split {
  --reg-chrome: 232px;
  height: calc(100vh - var(--reg-chrome));
  min-height: 440px;
  grid-template-columns: clamp(208px, 22%, 300px) minmax(0, 1fr);
  align-items: stretch;
}
.registry-list,
.registry-detail {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}
.registry-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-right: 0.3rem;
}
.registry-detail { padding-right: 0.35rem; }

/* Master-list rows */
.registry-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  text-align: left;
  padding: 0.7rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  font-family: inherit;
}
.registry-row:hover { background: var(--surface-hover); border-color: var(--border-glow); }
.registry-row[data-rec="revive_now"] { border-left-color: var(--green); }
.registry-row[data-rec="investigate_further"] { border-left-color: var(--amber); }
.registry-row[data-rec="keep_buried"] { border-left-color: var(--text-muted); }
.registry-row.active {
  background: var(--sidebar-nav-active);
  border-color: var(--border-glow);
  box-shadow: 0 2px 12px var(--accent-glow);
}
.registry-row.hidden { display: none; }
.rr-icon { font-size: 1.05rem; line-height: 1; flex-shrink: 0; color: var(--text-secondary); }
.rr-main { display: flex; flex-direction: column; gap: 0.25rem; min-width: 0; flex: 1; }
.rr-name {
  font-size: 0.82rem; font-weight: 700; color: var(--text);
  line-height: 1.2; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.rr-sub { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.rr-badge { font-size: 0.58rem; }
.rr-date { font-size: 0.6rem; color: var(--text-muted); font-family: var(--font-mono); }
.rr-score { font-size: 1.05rem; font-weight: 800; font-family: var(--font-mono); flex-shrink: 0; line-height: 1; }
.rr-pct { font-size: 0.6rem; opacity: 0.7; margin-left: 1px; }

/* In the detail pane the dossier card fills the pane and doesn't hover-lift. */
.registry-detail .feature-card { margin: 0; }
.registry-detail .feature-card:hover { transform: none; box-shadow: 0 10px 40px var(--accent-glow); }

/* Narrow screens: stack — list becomes a horizontal strip above the detail. */
@media (max-width: 880px) {
  .graveyard-grid.registry-split {
    /* Footer console is hidden below 900px, so reclaim its 140px. */
    --reg-chrome: 96px;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .registry-list {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.35rem;
  }
  .registry-row { flex: 0 0 auto; width: 190px; border-left-width: 1px; border-top: 3px solid transparent; }
  .registry-row .rr-date { display: none; }
  .registry-row[data-rec="revive_now"] { border-top-color: var(--green); }
  .registry-row[data-rec="investigate_further"] { border-top-color: var(--amber); }
  .registry-row[data-rec="keep_buried"] { border-top-color: var(--text-muted); }
}
.feature-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}
.feature-card:hover {
  background: var(--surface-hover);
  border-color: var(--border-glow);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow);
}

/* Custom indicator glows based on card priority category */
.feature-card[data-rec="revive_now"],
.feature-card[data-rec="leave_intact"] {
  border-left: 4px solid var(--green);
}
.feature-card[data-rec="investigate_further"],
.feature-card[data-rec="needs_biopsy"] {
  border-left: 4px solid var(--amber);
}
.feature-card[data-rec="keep_buried"],
.feature-card[data-rec="excise_now"] {
  border-left: 4px solid var(--red);
}

.card-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}
.card-title-area {
  display: flex;
  flex-direction: column;
}
.card-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.card-meta {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 0.15rem;
}
.card-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  white-space: nowrap;
}
.badge-revive { background: rgba(16, 185, 129, 0.12); color: var(--green); border: 1px solid rgba(16, 185, 129, 0.25); }
.badge-investigate { background: rgba(251, 191, 36, 0.12); color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.25); }
.badge-buried { background: rgba(255, 255, 255, 0.03); color: var(--text-secondary); border: 1px solid rgba(255, 255, 255, 0.06); }

/* Progressive disclosure — "Show full forensics" toggle + collapsible panel */
.forensics-toggle {
  display: inline-flex; align-items: center; gap: 0.4rem;
  margin-top: 0.85rem; padding: 0.4rem 0.7rem;
  background: rgba(124, 92, 246, 0.06);
  border: 1px solid var(--border); border-radius: 8px;
  color: var(--text-secondary); font-size: 0.78rem; font-weight: 600;
  cursor: pointer; transition: var(--transition); width: 100%; justify-content: center;
}
.forensics-toggle:hover { background: rgba(124, 92, 246, 0.12); color: var(--text); border-color: var(--border-glow); }
.forensics-toggle .ft-caret { font-size: 0.7rem; opacity: 0.8; }
.card-forensics { display: none; }
.card-forensics.open {
  display: block;
  margin-top: 0.6rem; padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
  animation: forensicsFade 0.22s ease;
}
@keyframes forensicsFade {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Expanded card: full-width, two-column detail view ─────────────────────
   When a card opens (toggleCard adds .card-expanded-full), it spans the whole
   grid row instead of growing inside its narrow column — filling the empty gap
   left in the row — and lays the body out as decision (left) | dossier
   (right), collapsing to a single column on narrow screens. */
.feature-card.card-expanded-full {
  grid-column: 1 / -1;
  padding: 1.6rem 1.75rem;
  box-shadow: 0 10px 40px var(--accent-glow);
  border-color: var(--border-glow);
}
.card-expanded-full .card-body.expanded {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}
/* Two columns once there's room: decision (slightly wider) | dossier, split by
   a divider so the actionable left reads distinct from the evidence on the
   right. Tied to viewport width since the card always spans the full row. */
@media (min-width: 1080px) {
  .card-expanded-full .card-body.expanded {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
    column-gap: 2.5rem;
  }
  .card-expanded-full .card-forensics {
    border-left: 1px solid var(--border);
    padding-left: 2.5rem;
  }
}
/* Force the dossier panel open as the right column, and hide the now-redundant
   "Show full forensics" toggle. */
.card-expanded-full .card-forensics {
  display: block;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.card-expanded-full .forensics-toggle {
  display: none;
}
/* Promote the viability ring to a deliberate KPI in the wide header, so it
   reads as an intentional top-right metric rather than marooned text. */
.card-expanded-full .radial-viability-gauge {
  width: 68px;
  height: 68px;
}
.card-expanded-full .radial-value-text {
  font-size: 1.05rem;
}

/* Necrosis (dead-code) verdict badges */
.fc-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.badge-excise { background: rgba(239, 68, 68, 0.12); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.28); }
.badge-biopsy { background: rgba(251, 191, 36, 0.12); color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.25); }
.badge-intact { background: rgba(16, 185, 129, 0.12); color: var(--green); border: 1px solid rgba(16, 185, 129, 0.25); }

[data-theme="light"] .badge-excise { background: rgba(220, 38, 38, 0.08); color: #dc2626; border-color: rgba(220, 38, 38, 0.2); }
[data-theme="light"] .badge-biopsy { background: rgba(217, 119, 6, 0.08); color: #d97706; border-color: rgba(217, 119, 6, 0.2); }
[data-theme="light"] .badge-intact { background: rgba(22, 163, 74, 0.08); color: #16a34a; border-color: rgba(22, 163, 74, 0.2); }

/* Necrosis summary stat accents */
.summary-excise .summary-val { color: #ef4444; text-shadow: 0 0 8px rgba(239, 68, 68, 0.45); }
.summary-biopsy .summary-val { color: var(--amber); text-shadow: 0 0 8px var(--amber-glow); }
.summary-intact .summary-val { color: var(--green); text-shadow: 0 0 8px var(--green-glow); }

[data-theme="light"] .summary-excise .summary-val { color: #dc2626; text-shadow: none; }
[data-theme="light"] .summary-biopsy .summary-val { color: #b45309; text-shadow: none; }
[data-theme="light"] .summary-intact .summary-val { color: #15803d; text-shadow: none; }

/* Necrosis card detail bits */
.nec-grid { display: flex; flex-wrap: wrap; gap: 1rem; margin-bottom: 0.5rem; font-size: 0.85rem; }
.nec-callers { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.nec-caller { font-size: 0.72rem; padding: 0.15rem 0.4rem; background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.15); border-radius: 4px; }
.fc-blast { margin-top: 0.4rem; font-size: 0.82rem; color: var(--text-secondary); }
.fc-annotation code { font-size: 0.78rem; color: var(--amber); word-break: break-word; }

/* ── Mission Control ─────────────────────────────────────────────────────── */
.tab-badge-hot {
  background: linear-gradient(90deg, #8b5cf6, #ec4899) !important;
  color: #fff !important; font-weight: 700; letter-spacing: 0.05em;
  animation: hotpulse 2.4s ease-in-out infinite;
}
@keyframes hotpulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }

.mission-card {
  border: 1px solid rgba(139, 92, 246, 0.25);
  background: radial-gradient(circle at 90% 10%, rgba(139, 92, 246, 0.06) 0%, rgba(9, 9, 14, 0) 60%), var(--surface);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.08);
}
[data-theme="light"] .mission-card {
  border-color: rgba(79, 70, 229, 0.25);
  background: radial-gradient(circle at 90% 10%, rgba(79, 70, 229, 0.04) 0%, rgba(255, 255, 255, 0) 60%), #ffffff;
  box-shadow: 0 4px 20px rgba(79, 70, 229, 0.05);
}
.btn-mission {
  background: linear-gradient(90deg, #8b5cf6, #6366f1) !important;
  border: none !important;
  font-weight: 700;
  color: #fff !important;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  width: 100%;
  justify-content: center;
  padding: 0.65rem 1rem;
}
.btn-mission:hover:not(:disabled) {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5);
  background: linear-gradient(90deg, #9c73f8, #7578f3) !important;
}
.btn-mission:active:not(:disabled) {
  transform: translateY(0.5px);
}


/* Phase tracker */
.mission-phases {
  display: flex; align-items: center; justify-content: center; gap: 0.3rem;
  flex-wrap: wrap; margin: 1.2rem 0; padding: 1.1rem; border-radius: 12px;
  background: rgba(139, 92, 246, 0.04); border: 1px solid rgba(139, 92, 246, 0.12);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.2);
}
[data-theme="light"] .mission-phases {
  background: rgba(79, 70, 229, 0.03);
  border-color: rgba(79, 70, 229, 0.1);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.03);
}
.mphase { display: flex; flex-direction: column; align-items: center; gap: 0.3rem;
  opacity: 0.4; transition: all 0.4s ease; min-width: 70px; }
.mphase-dot {
  width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-weight: 700; font-size: 0.9rem;
  background: rgba(255,255,255,0.05); border: 2px solid rgba(255,255,255,0.15); color: var(--text-secondary);
}
.mphase-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.mphase.active { opacity: 1; }
.mphase.active .mphase-dot {
  border-color: #8b5cf6; color: #fff; background: rgba(139,92,246,0.25);
  box-shadow: 0 0 14px rgba(139,92,246,0.55); animation: hotpulse 1.2s ease-in-out infinite;
}
.mphase.done { opacity: 1; }
.mphase.done .mphase-dot { border-color: var(--green); color: var(--green); background: rgba(16,185,129,0.12); }
.mphase.done .mphase-dot::after { content: '✓'; }
.mphase.done .mphase-dot { font-size: 0; }
.mphase.done .mphase-dot::after { font-size: 0.95rem; }
.mphase-arrow {
  color: #8b5cf6;
  font-size: 1.1rem;
  opacity: 0.3;
  font-weight: 900;
  text-shadow: 0 0 4px rgba(139, 92, 246, 0.3);
  transition: all 0.3s ease;
}
.mphase.done + .mphase-arrow {
  opacity: 0.95;
  color: var(--green);
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.65);
}

/* Mission result card */
.mission-result {
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 14px;
  padding: 1.5rem;
  background: rgba(139, 92, 246, 0.02);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  margin-bottom: 1.25rem;
  backdrop-filter: blur(10px);
}
[data-theme="light"] .mission-result {
  border-color: rgba(79, 70, 229, 0.15);
  background: rgba(79, 70, 229, 0.01);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}
.m-result-head { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.m-result-icon { font-size: 1.8rem; }
.m-result-title { font-size: 1.15rem; font-weight: 700; }
.m-result-sub { font-size: 0.8rem; color: var(--text-secondary); }
.m-section { margin: 1rem 0; }
.m-section-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-secondary); margin-bottom: 0.5rem; font-weight: 600; }
.m-plan { font-size: 0.92rem; line-height: 1.5; margin-bottom: 0.7rem; }
.m-objectives { display: flex; flex-direction: column; gap: 0.5rem; }
.m-obj-row { font-size: 0.88rem; }
.m-obj-tag { display: inline-block; font-size: 0.68rem; font-weight: 700; padding: 0.12rem 0.45rem;
  border-radius: 4px; margin-right: 0.5rem; letter-spacing: 0.05em; }
.m-obj-tag.m-revive { background: rgba(16,185,129,0.15); color: var(--green); }
.m-obj-tag.m-excise { background: rgba(239,68,68,0.15); color: #ef4444; }
.m-obj-reason { font-size: 0.8rem; color: var(--text-secondary); margin: 0.2rem 0 0 3rem; }
.m-challenge { padding: 0.7rem; border-radius: 8px; font-size: 0.85rem; }
.m-verdict-reject { background: rgba(239,68,68,0.08); border-left: 3px solid #ef4444; }
.m-verdict-downgrade { background: rgba(251,191,36,0.08); border-left: 3px solid var(--amber); }
.m-verdict-confirm, .m-verdict-confirmed { background: rgba(16,185,129,0.08); border-left: 3px solid var(--green); }
.m-obj { margin-top: 0.35rem; color: var(--text-secondary); }
.m-actions { display: flex; flex-direction: column; gap: 0.6rem; }
.m-action-card { padding: 0.8rem; border-radius: 8px; background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07); }
.m-action-card.m-revive { border-left: 3px solid var(--green); }
.m-action-card.m-excise { border-left: 3px solid #ef4444; }
.m-action-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.m-badge { font-size: 0.66rem; font-weight: 700; padding: 0.1rem 0.4rem; border-radius: 4px; }
.m-badge-ok { background: rgba(16,185,129,0.18); color: var(--green); }
.m-badge-prep { background: rgba(251,191,36,0.15); color: var(--amber); }
.m-prep-note { font-size: 0.8rem; color: var(--text-secondary); font-style: italic; }
.m-log { max-height: 200px; overflow-y: auto; font-family: var(--font-mono, monospace); font-size: 0.76rem; }
.m-log-row { padding: 0.2rem 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.m-log-phase { display: inline-block; min-width: 70px; color: #8b5cf6; text-transform: uppercase;
  font-weight: 600; font-size: 0.7rem; }
[data-theme="light"] .m-log-row { border-bottom-color: rgba(0,0,0,0.05); }
[data-theme="light"] .m-log-phase { color: var(--accent); }

/* ── Mission Control two-pane command console ───────────────────────────────
   Pattern: narrow command panel left (config + always-visible pipeline steps)
   + wide live-output panel right (idle → terminal → report). Both panes scroll
   internally; the outer split fills the viewport — no page scroll needed.     */

#tab-mission.active { flex: 1 1 auto; min-height: 0; }

.mission-split {
  --mc-chrome: 232px; /* header 60px + console 140px + gap ~32px */
  height: calc(100vh - var(--mc-chrome));
  min-height: 500px;
  display: grid;
  grid-template-columns: clamp(270px, 30%, 360px) minmax(0, 1fr);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 4px 24px rgba(124,92,246,0.07);
}

/* ── Left command pane ─────────────── */
.mission-config {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding: 1.5rem 1.4rem;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--surface);
}

.mlc-header { display: flex; align-items: center; gap: 0.75rem; }
.mlc-orb { display: flex; align-items: center; color: var(--accent); }
.mlc-title { font-size: 1rem; font-weight: 800; color: var(--text); letter-spacing: -0.01em; }
.mlc-tagline { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.1rem; }

/* Phase strip inside the right output pane — compact horizontal track */
.mission-output .mission-phases {
  flex-shrink: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  margin: 0;
}

/* Inputs */
.mlc-fields { display: flex; flex-direction: column; gap: 0.65rem; }
.mlc-field  { display: flex; flex-direction: column; gap: 0.28rem; }
.mlc-label  {
  font-size: 0.69rem; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: 0.05em;
  display: flex; align-items: center; gap: 0.4rem;
}
.mlc-badge {
  font-size: 0.6rem; font-weight: 600;
  padding: 0.08rem 0.38rem; border-radius: 4px;
  background: rgba(124,92,246,0.1); color: var(--accent);
  border: 1px solid rgba(124,92,246,0.18);
  letter-spacing: 0; text-transform: none;
}
[data-theme="light"] .mlc-badge { background: rgba(99,102,241,0.08); border-color: rgba(99,102,241,0.18); }
.mlc-input {
  width: 100%; padding: 0.52rem 0.7rem;
  background: var(--surface-subtle); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text);
  font-size: 0.8rem; font-family: var(--font-mono);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
  outline: none;
}
.mlc-input:focus {
  border-color: var(--border-glow);
  box-shadow: 0 0 0 3px rgba(124,92,246,0.1);
}
[data-theme="light"] .mlc-input { background: #ffffff; border-color: rgba(99,102,241,0.2); }

.mlc-secondary-row {
  display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap;
}
.mlc-footer {
  font-size: 0.67rem; color: var(--text-muted); line-height: 1.5;
  padding-top: 0.85rem; border-top: 1px solid var(--border);
  margin-top: auto;
}

/* ── Right output pane ─────────────── */
.mission-output {
  display: flex; flex-direction: column;
  overflow-y: auto; position: relative;
  background: var(--surface-subtle);
}
[data-theme="light"] .mission-output { background: #f8fafc; }

/* Idle placeholder — centered informational state before first run */
.mission-idle {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1rem; padding: 2rem; text-align: center;
}
.mi-orb {
  display: flex; align-items: center; color: var(--accent); opacity: 0.22;
  animation: mi-breathe 3.5s ease-in-out infinite;
}
@keyframes mi-breathe {
  0%, 100% { opacity: 0.18; transform: scale(1); }
  50%       { opacity: 0.38; transform: scale(1.06); }
}
.mi-title { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.mi-sub   { font-size: 0.85rem; color: var(--text-secondary); max-width: 360px; line-height: 1.55; }
.mi-phases-preview {
  display: flex; align-items: center; gap: 0.35rem;
  flex-wrap: wrap; justify-content: center;
}
.mi-ph  { font-size: 0.73rem; font-weight: 600; color: var(--text-secondary);
  padding: 0.22rem 0.6rem; border: 1px solid var(--border); border-radius: 20px; }
.mi-arr { font-size: 0.72rem; color: var(--text-muted); }
.mi-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: center; }
.mi-chip {
  font-size: 0.68rem; padding: 0.22rem 0.65rem; border-radius: 6px;
  background: rgba(124,92,246,0.07); border: 1px solid rgba(124,92,246,0.14); color: var(--accent);
}
[data-theme="light"] .mi-chip { background: rgba(99,102,241,0.06); border-color: rgba(99,102,241,0.14); }

/* Terminal fills the output pane during a live run */
.mission-terminal {
  flex: 1; min-height: 200px; margin: 0; border-radius: 0;
  border: none; border-bottom: 1px solid var(--border);
}

/* Mission result — no outer card; the output pane is the container */
.mission-output .mission-result {
  margin: 0; border: none; border-radius: 0;
  background: transparent; box-shadow: none; backdrop-filter: none;
  padding: 0; flex: 1;
}

/* Result header bar */
.m-result-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(90deg, rgba(124,58,237,0.08) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
}
[data-theme="light"] .m-result-bar {
  background: linear-gradient(90deg, rgba(99,102,241,0.06) 0%, transparent 100%);
}
.m-result-bar-left { display: flex; align-items: center; gap: 0.65rem; }
.m-result-icon { display: flex; align-items: center; color: var(--accent); }
.m-result-title { font-size: 1rem; font-weight: 800; color: var(--text); }
.m-result-sub { font-size: 0.74rem; color: var(--text-secondary); margin-top: 0.1rem; }
.m-result-status {
  font-size: 0.72rem; font-weight: 700;
  padding: 0.28rem 0.75rem; border-radius: 20px;
  background: rgba(16,185,129,0.1); color: var(--green);
  border: 1px solid rgba(16,185,129,0.22); white-space: nowrap;
}
.m-result-status.dry { background: rgba(251,191,36,0.1); color: var(--amber); border-color: rgba(251,191,36,0.22); }

/* Report body */
.m-report-body { padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 1.1rem; }

/* Plan target cards (REVIVE + EXCISE) */
.m-plan-cards { display: flex; flex-direction: column; gap: 0.6rem; }
.m-plan-card {
  display: flex; gap: 0.75rem; padding: 0.85rem 1rem;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
}
.m-plan-card.m-pc-revive { border-left: 3px solid var(--green); }
.m-plan-card.m-pc-excise { border-left: 3px solid #ef4444; }
.m-pc-icon { display: flex; align-items: center; flex-shrink: 0; margin-top: 0.1rem; width: 18px; height: 18px; }
.m-pc-body { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.m-pc-verb {
  font-size: 0.62rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}
.m-plan-card.m-pc-revive .m-pc-verb { color: var(--green); }
.m-plan-card.m-pc-excise .m-pc-verb { color: #ef4444; }
.m-pc-name   { font-size: 0.9rem; font-weight: 700; color: var(--text); }
.m-pc-reason { font-size: 0.77rem; color: var(--text-secondary); line-height: 1.45; }

/* Responsive — narrow screen: stack, hide stepper (too tall for horizontal strip) */
@media (max-width: 880px) {
  .mission-split {
    --mc-chrome: 96px;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }
  .mission-config {
    border-right: none; border-bottom: 1px solid var(--border);
    overflow-y: visible;
  }
  .mission-config .mission-phases { display: none; }
}

/* Radial Glowing SVG gauge for viability score */
.radial-viability-gauge {
  position: relative;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.radial-svg {
  transform: rotate(-90deg);
  width: 100%;
  height: 100%;
}
.radial-track {
  fill: none;
  stroke: var(--track);
  stroke-width: 4;
}
.radial-fill {
  fill: none;
  stroke-width: 4.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-in-out;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}
.radial-value-text {
  position: absolute;
  font-size: 0.85rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--text);
}

/* Card details styling */
.card-section-title {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.card-description {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.details-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 0.75rem;
}
.details-col {
  display: flex;
  flex-direction: column;
}
.death-reason-txt {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.metrics-box {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.02);
}
.metric-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
}
.metric-lbl { color: var(--text-muted); }
.metric-val { font-weight: 700; color: #fff; font-family: var(--font-mono); }

/* Grounded debate block styling inside card expansions */
.debate-box {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.04) 0%, rgba(6, 182, 212, 0.02) 100%);
  border: 1px solid rgba(124, 58, 237, 0.15);
  border-radius: 8px;
  padding: 0.75rem;
  margin-top: 0.25rem;
}
.debate-speech {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.45;
  font-style: italic;
  position: relative;
  padding-left: 0.65rem;
  border-left: 2px solid var(--accent);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  margin-top: 1rem;
}
.card-actions-sub {
  font-size: 0.67rem; color: var(--text-muted); width: 100%; margin-top: -0.2rem;
}

/* Unified action button trio — clear hierarchy, white text on hover for all */
.btn-action-primary {
  height: 40px; padding: 0 1.25rem;
  background: var(--accent); border: 1px solid var(--accent); border-radius: 9px;
  color: #fff; font-family: var(--font-sans); font-size: 0.88rem; font-weight: 700;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
  box-shadow: 0 4px 12px rgba(79,70,229,0.25);
}
.btn-action-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); box-shadow: 0 6px 18px rgba(79,70,229,0.35); }
.btn-action-primary:active { transform: translateY(1px); }

.btn-action-secondary {
  height: 40px; padding: 0 1.1rem;
  background: transparent; border: 1px solid var(--border-strong, rgba(15,23,42,0.18)); border-radius: 9px;
  color: var(--text-secondary); font-family: var(--font-sans); font-size: 0.88rem; font-weight: 600;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.btn-action-secondary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-action-secondary:active { transform: translateY(1px); }

.btn-action-link {
  height: 40px; padding: 0 0.9rem;
  background: transparent; border: 1px solid var(--border); border-radius: 9px;
  color: var(--text-muted); font-family: var(--font-sans); font-size: 0.85rem; font-weight: 500;
  text-decoration: none; display: inline-flex; align-items: center;
  cursor: pointer; transition: var(--transition); white-space: nowrap;
}
.btn-action-link:hover { color: var(--accent); border-color: var(--accent); background: rgba(79,70,229,0.05); }

/* ── Timeline Forensics (Charts grid) ────────────────────────────────── */

/* Insight summary cards row */
.tl-insight-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.tl-insight-card {
  flex: 1;
  min-width: 100px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.tl-insight-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.tl-ins-green::before  { background: #10b981; }
.tl-ins-amber::before  { background: #f59e0b; }
.tl-ins-muted::before  { background: #6b7280; }
.tl-ins-purple::before { background: #7c3aed; }
.tl-ins-blue::before   { background: #3b82f6; }
.tl-ins-val {
  font-size: 1.8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin-bottom: 0.3rem;
  color: var(--text);
}
.tl-ins-lbl {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

/* Charts grid — 2-column responsive */
.charts-grid-layout {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.2s;
}
.chart-card:hover {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
/* Full-width chart spans both columns */
.chart-full-width {
  grid-column: 1 / -1;
}
.chart-card h3 {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 0.25rem;
  color: var(--text);
}
.chart-container {
  position: relative;
  width: 100%;
  height: 200px;
}
@media (max-width: 900px) {
  .charts-grid-layout { grid-template-columns: 1fr; }
  .chart-full-width { grid-column: 1; }
  .tl-insight-row { gap: 0.5rem; }
}

/* ── Per-feature ROI breakdown (inside feature cards) ───────────────── */
.roi-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.roi-tier {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  letter-spacing: 0.04em;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.3);
  color: #a78bfa;
}
.roi-tier-p1 { background: rgba(16,185,129,0.1); border-color: rgba(16,185,129,0.3); color: var(--green); }
.roi-tier-p2 { background: rgba(6,182,212,0.1);  border-color: rgba(6,182,212,0.3);  color: var(--neon-cyan); }
.roi-demand {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.demand-high   { color: var(--green);     border-color: rgba(16,185,129,0.3); }
.demand-medium { color: var(--amber);     border-color: rgba(245,158,11,0.3); }
.demand-low    { color: var(--text-muted); }
.roi-requests {
  font-size: 0.68rem;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  background: rgba(6,182,212,0.06);
  border: 1px solid rgba(6,182,212,0.2);
  color: var(--neon-cyan);
}
.roi-estimate-value {
  font-weight: 600;
  color: var(--green);
}
.roi-drivers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}
.roi-driver-tag {
  font-size: 0.66rem;
  padding: 0.15rem 0.45rem;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
}
.roi-caveat {
  font-size: 0.66rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  font-style: italic;
}

/* ── Portfolio ROI ribbon ────────────────────────────────────────────── */
.roi-bar {
  background: linear-gradient(90deg, rgba(124, 58, 237, 0.12) 0%, rgba(16, 185, 129, 0.08) 100%);
  border: 1px solid rgba(124, 58, 237, 0.25);
  border-radius: 12px;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  box-shadow: 0 4px 15px var(--accent-glow);
}
.roi-bar-divider {
  width: 1px;
  height: 2.2rem;
  background: rgba(255, 255, 255, 0.08);
}
.roi-bar-item {
  display: flex;
  flex-direction: column;
}
.roi-bar-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.roi-bar-value {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--green);
  font-family: var(--font-mono);
}
.roi-bar-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* ── Active Watchlist ────────────────────────────────────────────────── */

/* Monitor banner at the top */
.monitor-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(124,58,237,0.1), rgba(16,185,129,0.06));
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
.monitor-banner-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex: 1;
}
.monitor-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(16,185,129,0.12);
  border: 1px solid rgba(16,185,129,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.monitor-banner-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  margin-bottom: 0.2rem;
}
.monitor-banner-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-ghost:hover {
  border-color: var(--purple);
  color: var(--purple);
  background: rgba(124,58,237,0.08);
}

/* Add repo panel */
.watch-add-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.watch-add-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.watch-add-icon {
  font-size: 1rem;
  color: var(--purple);
  font-weight: 400;
}
.watch-add-form {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}
.watch-url-input  { flex: 3; min-width: 240px; }
.watch-label-input { flex: 1; min-width: 130px; max-width: 200px; }
.watch-add-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  line-height: 1.5;
}

/* Section header above repo grid */
.watch-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}
.watch-section-count {
  background: rgba(124,58,237,0.15);
  color: var(--purple);
  border-radius: 20px;
  padding: 0.15rem 0.6rem;
  font-size: 0.68rem;
}

/* Repo cards grid */
.watch-repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}
.watch-repo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.watch-repo-card:hover {
  border-color: rgba(124,58,237,0.4);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.watch-repo-card.has-revivals {
  border-color: rgba(16,185,129,0.3);
  background: linear-gradient(180deg, rgba(16,185,129,0.04) 0%, var(--surface) 60%);
}

/* Card header */
.wrc-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.wrc-dot-wrap { flex-shrink: 0; }
.pulse-dot.pulse-green {
  background: var(--green);
  box-shadow: 0 0 10px var(--green-glow);
}
.wrc-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}
.wrc-path {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.15s;
}
.wrc-path:hover { color: var(--purple); }
.watch-label-chip {
  font-size: 0.62rem;
  font-weight: 600;
  background: rgba(124,58,237,0.15);
  color: var(--purple);
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.wrc-remove {
  flex-shrink: 0;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  border-radius: 5px;
  transition: color 0.15s;
}
.wrc-remove:hover { color: var(--red); }

/* Stats row */
.wrc-stats {
  display: flex;
  gap: 0.6rem;
}
.wrc-stat {
  flex: 1;
  text-align: center;
  border-radius: 8px;
  padding: 0.5rem 0.3rem;
  background: rgba(0,0,0,0.2);
  border: 1px solid transparent;
}
.wrc-stat-revive { border-color: rgba(16,185,129,0.25); background: rgba(16,185,129,0.07); }
.wrc-stat-invest { border-color: rgba(245,158,11,0.25); background: rgba(245,158,11,0.07); }
.wrc-stat-total  { border-color: rgba(124,58,237,0.2); }
.wrc-stat-val {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text);
}
.wrc-stat-revive .wrc-stat-val { color: var(--green); }
.wrc-stat-invest .wrc-stat-val { color: #f59e0b; }
.wrc-stat-lbl {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 0.2rem;
}
.wrc-no-results {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 0.4rem 0;
}

/* Footer */
.wrc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}
.wrc-last-scan {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.wrc-actions { display: flex; gap: 0.4rem; }
.btn-xs {
  font-size: 0.7rem;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  background: rgba(124,58,237,0.12);
  border: 1px solid rgba(124,58,237,0.25);
  color: var(--purple);
  cursor: pointer;
  transition: var(--transition);
}
.btn-xs:hover {
  background: rgba(124,58,237,0.25);
  border-color: var(--purple);
}

/* pulse dot base */
.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px var(--green-glow);
  animation: pulse-glow 2s infinite ease-in-out;
}

/* form shared */
.scan-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.35rem;
}
.scan-card h2 { font-size: 1rem; margin-bottom: 0.85rem; }
.scan-form {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  flex-wrap: wrap;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-width: 150px;
}
.form-group label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
}
.form-input {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  color: var(--text);
  font-family: var(--font-sans);
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

/* ── Simulated Agent CLI Terminal (Wow factor) ────────────────────────── */
.cyber-terminal-console {
  height: 140px;
  background: #030209;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 9;
  flex-shrink: 0;
}
.console-header {
  height: 32px;
  background: rgba(12, 10, 31, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  flex-shrink: 0;
}
.header-left-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.console-dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--neon-cyan);
  box-shadow: 0 0 6px var(--neon-cyan-glow);
  animation: pulse-glow 1.5s infinite;
}
.console-title {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
}
.console-status {
  font-size: 0.62rem;
  font-family: var(--font-mono);
  color: var(--neon-cyan);
}
.console-terminal-lines {
  flex: 1;
  overflow-y: auto;
  padding: 0.65rem 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: rgba(3, 2, 9, 0.95);
}

.terminal-line {
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-break: break-all;
}
.terminal-line.mcp { color: var(--neon-cyan); }
.terminal-line.gemini { color: #c084fc; }
.terminal-line.search { color: #34d399; } /* Google Search grounding — emerald green */
.terminal-line.revive { color: var(--green); }
.terminal-line.investigate { color: var(--amber); }
.terminal-line.buried { color: var(--text-muted); }
.terminal-line.error { color: var(--red); font-weight: 600; }
.terminal-line.done { color: var(--green); font-weight: 600; }

/* ── Generic Helper Classes & Aesthetics ────────────────────────────── */
.empty-state {
  grid-column: span 3;
  text-align: center;
  padding: 3rem 1.5rem;
  background: rgba(255, 255, 255, 0.015);
  border: 1px dashed var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.empty-icon {
  font-size: 2.2rem;
  animation: float 4s infinite ease-in-out;
}
.empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 450px;
}

/* Animations */
@keyframes pulse-glow {
  0%, 100% { opacity: 0.85; transform: scale(1); filter: drop-shadow(0 0 1px currentColor); }
  50% { opacity: 1; transform: scale(1.08); filter: drop-shadow(0 0 8px currentColor); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes shine {
  0% { left: -100%; }
  10% { left: 150%; }
  100% { left: 150%; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Scrollbar tweaks */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.15);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-glow);
}

.offline-banner {
  display: none;
  background: var(--red);
  color: #fff;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem;
  z-index: 9999;
}
.offline-banner.visible { display: block; }
.action-ribbon {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
}
/* ── Uniform button height across the action ribbon ─── */
/* All three primary action items share the same height token */
.action-ribbon .btn-neon.btn-post-gitlab,
.action-ribbon .slack-share-group,
.action-ribbon > .btn-secondary#exportJsonBtn {
  height: 2.6rem;
}
/* Normalise btn-neon padding in ribbon so height token wins */
.action-ribbon .btn-neon.btn-post-gitlab {
  padding: 0 1.1rem;
  display: inline-flex;
  align-items: center;
  font-size: 0.87rem;
}
/* Stretch the Slack group children to fill the shared height */
.action-ribbon .slack-share-group {
  display: inline-flex;
  align-items: stretch;
}
.action-ribbon .btn-slack {
  padding: 0 1rem;
  height: 100%;
  font-size: 0.87rem;
}
.action-ribbon .btn-slack-copy {
  padding: 0 0.7rem;
  height: 100%;
}
/* Export JSON — match height and upgrade typography to ribbon scale */
.action-ribbon > .btn-secondary#exportJsonBtn {
  padding: 0 1rem;
  font-size: 0.87rem;
  display: inline-flex;
  align-items: center;
}
.gitlab-post-group {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.gitlab-project-picker {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--surface);
  border: 1px solid var(--border-neon);
  border-radius: 10px;
  padding: 0.8rem;
  min-width: 320px;
  z-index: 100;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: fadeSlideIn 0.15s ease;
}
.gpp-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.gpp-row {
  display: flex;
  gap: 0.5rem;
}
.gpp-input {
  flex: 1;
  font-size: 0.8rem !important;
  padding: 0.4rem 0.65rem !important;
}
.gpp-submit {
  white-space: nowrap;
  padding: 0.4rem 0.9rem;
  font-size: 0.78rem;
}
.gpp-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
}
.btn-post-gitlab {
  background: linear-gradient(135deg, var(--green) 0%, #047857 100%);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 4px 15px var(--green-glow);
  white-space: nowrap;
}
.btn-post-gitlab:hover {
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

/* Toast alert elements */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 10000;
}
.toast {
  background: #0c0a1f;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1.15rem;
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
  animation: toast-in 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.toast.success { border-left: 4px solid var(--green); }
.toast.info { border-left: 4px solid var(--neon-cyan); }
.toast.error { border-left: 4px solid var(--red); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Card Body subcomponent details */
.card-body {
  display: none;
  flex-direction: column;
  gap: 0.95rem;
  border-top: 1px dashed var(--border);
  margin-top: 0.5rem;
  padding-top: 1rem;
  animation: tab-enter 0.3s ease forwards;
}
.card-body.expanded {
  display: flex;
}

.section-label {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.kill-commit {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  padding: 0.55rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.sha {
  color: var(--neon-cyan);
  font-weight: bold;
}

.reason-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Detection Provenance ── */
.detection-provenance {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.dp-method {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.dp-method-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.dp-conf {
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  font-family: monospace;
}
.dp-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.dp-signal {
  font-size: 0.68rem;
  padding: 0.1rem 0.45rem;
  border-radius: 20px;
  line-height: 1.6;
}
.dp-signal-pos {
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  color: #6ee7b7;
}
.dp-signal-neg {
  background: rgba(251,191,36,0.06);
  border: 1px solid rgba(251,191,36,0.15);
  color: var(--amber);
}

.snippets-list, .risks-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.snippets-list li, .risks-list li {
  position: relative;
  padding-left: 1.05rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
/* Calm danger marker — readable text, color carried only by a small dot */
.risks-list li::before {
  content: "";
  position: absolute; left: 0.1rem; top: 0.5em;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--red); opacity: 0.6;
}
.snippets-list li::before {
  content: "›";
  position: absolute; left: 0.1rem; top: 0;
  color: var(--text-muted); font-weight: 700;
}

/* Why Now Timeline widget */
.why-now-timeline {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  position: relative;
  padding-left: 0.5rem;
}
.tl-step {
  display: flex;
  gap: 1rem;
  position: relative;
  padding-bottom: 0.75rem;
}
.tl-step:last-child {
  padding-bottom: 0;
}
.tl-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  margin-top: 0.3rem;
  z-index: 2;
}
.tl-killed .tl-dot { background: var(--text-muted); }
.tl-resolved .tl-dot { background: var(--amber); box-shadow: 0 0 6px var(--amber-glow); }
.tl-ready .tl-dot { background: var(--green); box-shadow: 0 0 6px var(--green-glow); }
.tl-investigate .tl-dot { background: var(--amber); }

.tl-line {
  position: absolute;
  left: 4px;
  top: 10px;
  bottom: 0;
  width: 1px;
  background: var(--border);
  z-index: 1;
}
.tl-content {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.tl-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text);
}
.tl-date {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}
.tl-desc {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.verified-badge {
  font-size: 0.58rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: var(--green);
  border-radius: 4px;
  padding: 0.05rem 0.25rem;
  margin-left: 0.25rem;
}
.unverified-badge {
  font-size: 0.58rem;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.25);
  color: var(--amber);
  border-radius: 4px;
  padding: 0.05rem 0.25rem;
  margin-left: 0.25rem;
}
/* ADK web-search evidence — distinct from registry-verified (green) so the UI
   never overstates a Phase-2 google_search upgrade as a hard registry hit. */
.adk-badge {
  font-size: 0.58rem;
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: #60a5fa;
  border-radius: 4px;
  padding: 0.05rem 0.25rem;
  margin-left: 0.25rem;
}

/* Metrics grid in card */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
}
.metrics-grid .metric-item {
  background: rgba(0,0,0,0.12);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.metrics-grid .mval {
  font-size: 0.95rem;
  font-weight: 800;
  font-family: var(--font-mono);
}
.metrics-grid .mlabel {
  font-size: 0.58rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.1rem;
}

/* Competitive Intelligence Box */
.competitive-box {
  background: rgba(6, 182, 212, 0.04);
  border: 1px solid rgba(6, 182, 212, 0.15);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.comp-urgency {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--neon-cyan);
}
.comp-competitors {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text);
}
.comp-summary {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* Challenger Agent independent panel */
/* Challenger full-width row — sits below both columns, spans the full card width */
.card-challenger { display: none; }
.card-expanded-full .card-challenger {
  display: block;
  grid-column: 1 / -1;        /* span both columns */
  border-top: 1px solid var(--border);
  padding-top: 1.1rem;
  margin-top: 0.25rem;
}

/* 2-column layout inside the challenger: left = objection+step, right = risk list */
.challenger-cols {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 0.6rem;
}
@media (min-width: 920px) {
  .challenger-cols { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); column-gap: 1.75rem; }
  .challenger-col-risks { border-left: 1px solid var(--border); padding-left: 1.75rem; }
}
.challenger-col-main, .challenger-col-risks { display: flex; flex-direction: column; gap: 0.55rem; }

/* Challenger — a calm, scannable "adversarial review" card (not a red wall) */
.challenger-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.challenger-box.confirm { border-left-color: var(--green); }
.challenger-box.downgrade { border-left-color: var(--amber); }
.challenger-box.reject { border-left-color: var(--red); }
.challenger-head {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.challenger-chip {
  font-size: 0.7rem; font-weight: 800; letter-spacing: 0.02em;
  padding: 0.18rem 0.55rem; border-radius: 999px; white-space: nowrap;
}
.challenger-chip-confirm  { background: rgba(16,185,129,0.14); color: var(--green);  border: 1px solid rgba(16,185,129,0.3); }
.challenger-chip-downgrade{ background: rgba(251,191,36,0.16); color: #b45309;       border: 1px solid rgba(251,191,36,0.35); }
.challenger-chip-reject   { background: rgba(239,68,68,0.12);  color: #dc2626;       border: 1px solid rgba(239,68,68,0.28); }
.challenger-source {
  font-size: 0.62rem; color: var(--text-muted); font-family: var(--font-mono);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 55%;
}
.challenger-row { display: flex; flex-direction: column; gap: 0.15rem; }
.challenger-row-label {
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted);
}
.challenger-row-text { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }
.challenger-risk-list {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 0.4rem;
}
.challenger-risk-list li {
  position: relative; padding-left: 1.05rem;
  font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5;
}
.challenger-risk-list li::before {
  content: "▴"; position: absolute; left: 0; top: 0.05rem;
  color: var(--amber); font-size: 0.7rem;
}
.challenger-box.reject .challenger-risk-list li::before { color: var(--red); }
.challenger-more {
  font-size: 0.72rem; font-weight: 600; color: var(--text-muted); font-style: italic;
}

/* Open issue matching blocks */
.open-requests-box {
  background: rgba(16, 185, 129, 0.04);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.open-req-header {
  display: flex;
  flex-direction: column;
}
.open-req-count {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--green);
}
.open-req-insight {
  font-size: 0.65rem;
  color: var(--text-muted);
}
.open-req-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.open-req-list li a {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}
.open-req-list li a:hover {
  color: var(--green);
  text-decoration: underline;
}

/* Specific charts layout — defined in earlier block; keep responsive override */
@media (max-width: 1000px) {
  .charts-grid-layout {
    grid-template-columns: 1fr;
  }
}

.audit-briefing {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}
.audit-briefing h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.audit-briefing p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ── Revival Log table ───────────────────────────────────────────────── */
.log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  background: transparent;
}
.log-table thead tr {
  border-bottom: 1px solid var(--border-glow);
}
.log-table th {
  padding: 0.6rem 1rem;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  background: transparent;
  white-space: nowrap;
}
.log-table td {
  padding: 0.7rem 1rem;
  color: var(--text);
  border-bottom: 1px solid rgba(124, 58, 237, 0.07);
  vertical-align: middle;
  background: transparent;
}
.log-table tbody tr:hover td {
  background: rgba(124, 58, 237, 0.04);
}
.log-table td code {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--neon-cyan);
  background: rgba(6, 182, 212, 0.08);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}
.log-table td a.btn {
  font-size: 0.73rem;
  padding: 0.2rem 0.55rem;
}

/* ── Light Mode Aesthetic Overrides ─────────────────────────────────────── */
[data-theme="light"] .cyber-app-shell::before {
  opacity: 0.15;
  background-image: linear-gradient(rgba(0,0,0,0.04) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(0,0,0,0.04) 1px, transparent 1px);
}

[data-theme="light"] .cyber-sidebar {
  background: rgba(255, 255, 255, 0.95);
  border-right: 1px solid var(--border);
  box-shadow: 10px 0 30px rgba(99, 102, 241, 0.04);
}

[data-theme="light"] .workspace-header {
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .cyber-workspace {
  background: #f8fafc;
}

[data-theme="light"] .cyber-sidebar::before {
  opacity: 0.08;
}

[data-theme="light"] .cyber-terminal-console {
  background: #ffffff;
  border-top: 1px solid var(--border);
}

[data-theme="light"] .console-header {
  background: rgba(241, 245, 249, 0.95);
  border-bottom: 1px solid var(--border);
}

[data-theme="light"] .console-terminal-lines {
  background: #ffffff;
}

[data-theme="light"] .terminal-line {
  color: #334155;
}

[data-theme="light"] .terminal-line.mcp { color: #0891b2; }
[data-theme="light"] .terminal-line.gemini { color: #8b5cf6; }
[data-theme="light"] .terminal-line.search { color: #059669; }
[data-theme="light"] .terminal-line.revive { color: #059669; }
[data-theme="light"] .terminal-line.investigate { color: #d97706; }
[data-theme="light"] .terminal-line.buried { color: #64748b; }
[data-theme="light"] .terminal-line.error { color: #dc2626; }
[data-theme="light"] .terminal-line.done { color: #16a34a; }

[data-theme="light"] .tech-tag-status {
  background: rgba(99, 102, 241, 0.04);
  border: 1px solid rgba(99, 102, 241, 0.15);
  color: #312e81;
}

[data-theme="light"] .tech-tag-status.active {
  border-color: rgba(16, 185, 129, 0.45);
  background: rgba(16, 185, 129, 0.08);
  color: #065f46;
}

[data-theme="light"] .tech-tag-status.pending {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.08);
  color: #92400e;
}

[data-theme="light"] .tech-tag-status.inactive {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
  color: #991b1b;
}

[data-theme="light"] .feature-card {
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.05);
}

[data-theme="light"] .feature-card:hover {
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.12);
}

[data-theme="light"] .kill-commit {
  background: rgba(99, 102, 241, 0.03);
  border: 1px solid rgba(99, 102, 241, 0.1);
  color: #1e293b;
}

[data-theme="light"] .metrics-grid .metric-item {
  background: rgba(99, 102, 241, 0.04);
  border: 1px solid rgba(99, 102, 241, 0.08);
}

[data-theme="light"] .why-briefing-pane {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.06) 0%, rgba(255, 255, 255, 0.8) 100%);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

[data-theme="light"] .roi-calculator-widget {
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

[data-theme="light"] .calculator-results {
  background: rgba(99, 102, 241, 0.04);
}

[data-theme="light"] .welcome-col {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(99, 102, 241, 0.1);
}

[data-theme="light"] .welcome-col:hover {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.25);
}

[data-theme="light"] .chip-neon {
  background: #ffffff;
  color: #334155;
  border: 1px solid rgba(99, 102, 241, 0.18);
}

[data-theme="light"] .chip-neon:hover {
  background: rgba(6, 182, 212, 0.08);
  border-color: #0891b2;
  color: #0891b2;
}

[data-theme="light"] .ls-card {
  background: #ffffff;
  border-color: rgba(99, 102, 241, 0.15);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.06);
}

[data-theme="light"] .ls-card:hover {
  background: #f8f7ff;
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.12);
}

[data-theme="light"] .ls-card-glow {
  display: none;
}

[data-theme="light"] .ls-value {
  color: #1e1b4b;
}

[data-theme="light"] .ls-card-integration .ls-value {
  background: linear-gradient(90deg, #6d28d9, #4f46e5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .ls-card-integration {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(99, 102, 241, 0.02));
  border-color: rgba(99, 102, 241, 0.2);
}

[data-theme="light"] .btn-cyber {
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #4f46e5;
}

[data-theme="light"] .btn-cyber:hover:not(:disabled) {
  background: rgba(99, 102, 241, 0.15);
  color: #4338ca;
}

[data-theme="light"] .cyber-input {
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ════════════════════════════════════════════════════════════════════════════
   PREMIUM LIGHT REFINEMENT — elevation, hierarchy, restraint.
   Applies design principles: one elevation system, disciplined accent, consistent
   "eyebrow" labels (uppercase/tracked/muted), generous focus rings, calm chrome.
   Light-mode only; dark theme is untouched. (2026 UI/UX pass)
   ════════════════════════════════════════════════════════════════════════════ */

/* — Chrome: calm canvas, crisp white rails — */
[data-theme="light"] .cyber-workspace { background: var(--bg); }
[data-theme="light"] .cyber-sidebar {
  background: #ffffff;
  border-right: 1px solid var(--border);
  box-shadow: 1px 0 0 rgba(15, 23, 42, 0.04);
}
[data-theme="light"] .workspace-header {
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
[data-theme="light"] .workspace-title { letter-spacing: 0.08em; color: #0b1220; }

/* — Sidebar nav: quiet default, confident active pill — */
[data-theme="light"] .sidebar-nav-item.nav-tab { color: #56627a; font-weight: 500; }
[data-theme="light"] .sidebar-nav-item.nav-tab .nav-item-icon { color: #9aa6bd; }
[data-theme="light"] .sidebar-nav-item.nav-tab:hover { color: #0b1220; }
[data-theme="light"] .sidebar-nav-item.nav-tab.active {
  background: var(--sidebar-nav-active);
  border-left: 3px solid var(--accent);
  color: var(--accent); font-weight: 600;
}
[data-theme="light"] .sidebar-nav-item.nav-tab.active .nav-item-icon { color: var(--accent); }
[data-theme="light"] .sidebar-nav-item.nav-tab .tab-badge {
  background: rgba(15, 23, 42, 0.05); border: 1px solid var(--border); color: #64748b;
}
[data-theme="light"] .brand-subtitle { color: #0891b2; letter-spacing: 0.06em; }

/* — Top metric tiles: clean number-forward cards — */
[data-theme="light"] .ls-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  box-shadow: var(--shadow-sm);
}
[data-theme="light"] .ls-card:hover {
  background: #ffffff;
  border-color: rgba(79, 70, 229, 0.28);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
[data-theme="light"] .ls-value { color: #0b1220; font-size: 1.5rem; letter-spacing: -0.015em; }
[data-theme="light"] .ls-label {
  color: #7c8698; text-transform: uppercase; letter-spacing: 0.07em;
  font-size: 0.58rem; font-weight: 600;
}
[data-theme="light"] .ls-card-integration {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.05), #ffffff);
  border-color: rgba(79, 70, 229, 0.18);
}

/* — Result summary cards: give them genuine card presence — */
[data-theme="light"] .stat-card,
[data-theme="light"] .summary-stat {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
[data-theme="light"] .stat-label,
[data-theme="light"] .summary-lbl {
  text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.58rem;
  font-weight: 600; color: #7c8698;
}
[data-theme="light"] .revive-stat .stat-value { text-shadow: none; }
[data-theme="light"] .investigate-stat .stat-value { text-shadow: none; }

/* — Hero scanner card — */
[data-theme="light"] .scanner-console-card,
[data-theme="light"] .scanner-card {
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-top: 3px solid var(--accent);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(16, 24, 40, 0.06), 0 8px 24px -6px rgba(79, 70, 229, 0.10);
  padding: 1.75rem 1.75rem 1.5rem;
}
[data-theme="light"] .scanner-console-glow { display: none; }
[data-theme="light"] .scanner-console-header h3,
[data-theme="light"] .scanner-title {
  color: #0b1220;
  -webkit-text-fill-color: #0b1220;
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
  font-weight: 700;
}
[data-theme="light"] .scanner-console-header p,
[data-theme="light"] .scanner-sub {
  color: #64748b;
  font-size: 0.875rem;
  line-height: 1.6;
  max-width: 72ch;
}

/* — Inputs: crisp field, eyebrow label, generous indigo focus ring — */
[data-theme="light"] .cyber-input,
[data-theme="light"] .input-group input,
[data-theme="light"] .mlc-input,
[data-theme="light"] .form-input {
  background: #ffffff; border: 1px solid var(--border);
  box-shadow: var(--input-shadow); color: #0b1220;
}
[data-theme="light"] .cyber-field label,
[data-theme="light"] .input-group label,
[data-theme="light"] .mlc-label {
  text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 0.62rem; font-weight: 600; color: #7c8698;
}
[data-theme="light"] .cyber-input:focus,
[data-theme="light"] .input-group input:focus,
[data-theme="light"] .mlc-input:focus,
[data-theme="light"] .form-input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.14);
}

/* — Button hierarchy: ONE clear hero, calm secondaries — */
[data-theme="light"] .btn-neon {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  border: none; box-shadow: var(--shadow-accent);
}
[data-theme="light"] .btn-neon:hover { box-shadow: 0 14px 30px -8px rgba(79, 70, 229, 0.40); }
[data-theme="light"] .btn-cyber {
  background: #ffffff; border: 1px solid var(--border);
  color: #475569; box-shadow: var(--shadow-sm);
}
[data-theme="light"] .btn-cyber:hover:not(:disabled) {
  background: #ffffff; border-color: rgba(79, 70, 229, 0.32); color: var(--accent);
}
[data-theme="light"] .btn-hint { color: #94a3b8; }

/* — Chips: crisp white, calm, indigo on hover — */
[data-theme="light"] .chip-neon,
[data-theme="light"] .chip-live {
  background: #ffffff; border: 1px solid var(--border);
  color: #475569; box-shadow: var(--shadow-sm);
}
[data-theme="light"] .chip-neon:hover,
[data-theme="light"] .chip-live:hover {
  background: #ffffff; border-color: rgba(79, 70, 229, 0.32);
  color: var(--accent); box-shadow: var(--shadow-md);
}
[data-theme="light"] .chip-featured,
[data-theme="light"] .chip-flagship {
  border-color: rgba(79, 70, 229, 0.22);
}
[data-theme="light"] .chip-row-title { color: #0b1220; font-weight: 700; }
[data-theme="light"] .chip-row-desc { color: #94a3b8; }
[data-theme="light"] .chip-row-icon.live-icon { color: #16a34a; }

/* — Filter bar — */
[data-theme="light"] .filter-btn {
  background: #ffffff; border: 1px solid var(--border);
  box-shadow: var(--shadow-sm); color: #475569;
}
[data-theme="light"] .filter-btn:hover { border-color: rgba(79, 70, 229, 0.3); color: var(--accent); }
[data-theme="light"] .filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: var(--shadow-accent); }
[data-theme="light"] .filter-title,
[data-theme="light"] .filter-label {
  text-transform: uppercase; letter-spacing: 0.07em; color: #7c8698;
}

/* — Onboarding / quick-start card — */
[data-theme="light"] .onboarding-card {
  background: #ffffff; border: 1px solid var(--border); box-shadow: var(--shadow-md);
}
[data-theme="light"] .onboarding-step { background: #f8f9fd; border: 1px solid var(--border); }

/* — Section eyebrows used across the detail panel — */
[data-theme="light"] .section-label {
  text-transform: uppercase; letter-spacing: 0.07em; color: #7c8698; font-weight: 700;
}

/* Right-Side Dashboard Scanner Card styling */
.scanner-console-card {
  position: relative;
  background: rgba(12, 10, 31, 0.45);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.scanner-console-glow {
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-neon), transparent);
}
.scanner-console-header h3 {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #fff 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.scanner-console-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.scanner-console-body {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.scanner-form-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1rem;
  align-items: end;
}
.field-url {
  grid-column: span 1;
}
.field-param {
  grid-column: span 1;
}
.scanner-actions-row {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.btn-group-scanner {
  display: flex;
  gap: 0.75rem;
}
.scanner-quick-targets {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  flex: 1;
}
.quick-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chip-featured {
  border-color: rgba(6, 182, 212, 0.35) !important;
  color: var(--neon-cyan) !important;
  font-weight: 600;
  position: relative;
}
.chip-featured::after {
  content: 'instant';
  position: absolute;
  top: -7px;
  right: -2px;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(6, 182, 212, 0.7);
  background: var(--bg);
  padding: 0 3px;
  border-radius: 3px;
  pointer-events: none;
}
.chip-more {
  background: rgba(99, 102, 241, 0.08);
  border: 1px dashed rgba(99, 102, 241, 0.45);
  color: rgba(99, 102, 241, 0.9);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.28rem 0.7rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.03em;
}
.chip-more:hover {
  background: rgba(99, 102, 241, 0.18);
  border-color: rgba(99, 102, 241, 0.75);
  color: #a5b4fc;
}
.chip-sm {
  font-size: 0.68rem !important;
  padding: 0.22rem 0.55rem !important;
}

/* ── Repo Browser Panel ─────────────────────────────────────────── */
.repo-browser {
  margin-top: 0.85rem;
  background: rgba(6, 182, 212, 0.03);
  border: 1px solid rgba(6, 182, 212, 0.14);
  border-radius: 10px;
  padding: 1rem;
  animation: fadeSlideIn 0.2s ease;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.repo-browser-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}
.rb-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--neon-cyan);
}
.rb-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  transition: color 0.15s;
}
.rb-close:hover { color: #f87171; }
.repo-category {
  margin-bottom: 0.75rem;
}
.repo-cat-label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.repo-cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Light Theme tweaks for Scanner Console Card — deferred to the hero block above */

/* Onboarding Card for Empty State */
.onboarding-card {
  grid-column: span 3;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  max-width: 840px;
  margin: 1rem auto;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
[data-theme="light"] .onboarding-card {
  box-shadow: 0 10px 40px rgba(99, 102, 241, 0.04);
  background: #ffffff;
}
.onboarding-badge {
  background: var(--sidebar-nav-active);
  color: var(--accent);
  padding: 0.3rem 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: 50px;
  text-transform: uppercase;
}
.onboarding-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  letter-spacing: 0.02em;
}
.onboarding-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  max-width: 620px;
  line-height: 1.5;
  margin: 0;
}
.onboarding-steps {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 1.25rem;
  margin: 1.25rem 0;
  width: 100%;
}
.onboarding-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.01);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.02);
}
[data-theme="light"] .onboarding-step {
  background: #f8fafc;
  border-color: rgba(99, 102, 241, 0.05);
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.onboarding-step h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.onboarding-step p {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
  line-height: 1.4;
}
.onboarding-arrow {
  font-size: 1.25rem;
  color: var(--text-muted);
  user-select: none;
}
.onboarding-cta {
  margin-top: 0.5rem;
}
@media (max-width: 768px) {
  .onboarding-steps {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .onboarding-arrow {
    transform: rotate(90deg);
    margin: 0.25rem 0;
  }
}

/* ── Live Scan Terminal Panel ── */
/* ── Live Scan Terminal Panel ── */
.terminal, .terminal-panel {
  display: none;
  position: relative;
  background: #020617;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2.2rem 1.25rem 1.25rem 1.25rem;
  font-family: 'Fira Code', 'Courier New', Courier, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-secondary);
  max-height: 300px;
  overflow-y: auto;
  margin: 1.5rem 0;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.9), 0 4px 20px rgba(0, 0, 0, 0.4);
}
.terminal::before, .terminal-panel::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 15px;
  width: 8px;
  height: 8px;
  background: #ff5f56;
  border-radius: 50%;
  box-shadow: 14px 0 0 #ffbd2e, 28px 0 0 #27c93f;
  z-index: 10;
}
.terminal.visible, .terminal-panel.visible {
  display: block;
}
[data-theme="light"] .terminal, [data-theme="light"] .terminal-panel {
  background: #f8fafc;
  color: #334155;
  border-color: #cbd5e1;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
}

/* ── Generic .btn family (used in card actions, watch list, etc.) ─────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  border-radius: 8px;
  padding: 0.45rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}
.btn:hover { background: rgba(255,255,255,0.08); border-color: var(--border-glow); color: var(--text); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, #6366f1 100%);
  border-color: rgba(255,255,255,0.12);
  color: #fff;
  box-shadow: 0 3px 10px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 5px 16px rgba(124,58,237,0.5); color: #fff; }
.btn-secondary {
  background: rgba(124,58,237,0.08);
  border-color: var(--border);
  color: var(--border-neon);
}
.btn-secondary:hover { background: rgba(124,58,237,0.18); border-color: var(--border-neon); color: #fff; }
.slack-share-group {
  display: inline-flex;
  align-items: stretch;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(74, 21, 75, 0.7);
  box-shadow: 0 0 14px rgba(74, 21, 75, 0.4);
}
.slack-share-group .btn-slack {
  border-radius: 0;
  border: none;
  border-right: 1px solid rgba(255,255,255,0.12);
}
.slack-share-group .btn-slack:last-child { border-right: none; }
.btn-slack {
  background: linear-gradient(135deg, #4A154B 0%, #611f69 100%);
  border-color: transparent;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
  transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}
.btn-slack:hover {
  background: linear-gradient(135deg, #611f69 0%, #7c2d8a 100%);
  box-shadow: 0 0 20px rgba(97, 31, 105, 0.65);
  color: #fff;
  transform: translateY(-1px);
}
.btn-slack:active { transform: translateY(0); }
/* Slack 4-colour logo quadrants */
.slack-logo-icon .s-red    { fill: #E01E5A; }
.slack-logo-icon .s-green  { fill: #2EB67D; }
.slack-logo-icon .s-blue   { fill: #36C5F0; }
.slack-logo-icon .s-yellow { fill: #ECB22E; }
/* Sent state — green success */
.btn-slack.slack-sent {
  background: linear-gradient(135deg, #166534 0%, #15803d 100%);
  box-shadow: 0 0 14px rgba(21, 128, 61, 0.45);
  cursor: default;
}
.btn-slack.slack-sent:hover {
  background: linear-gradient(135deg, #166534 0%, #15803d 100%);
  transform: none;
}
.btn-slack-copy {
  padding: 0 0.7rem;
  min-width: 34px;
  justify-content: center;
}
.btn-slack-copy:hover { background: rgba(97, 31, 105, 0.55); }
.btn-sm { padding: 0.3rem 0.65rem; font-size: 0.75rem; }
.btn-ghost-mr {
  background: rgba(6,182,212,0.10);
  border-color: rgba(6,182,212,0.45);
  color: var(--neon-cyan);
  font-size: 0.9rem;
  padding: 0.5rem 1.1rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.btn-ghost-mr:hover {
  background: rgba(6,182,212,0.22);
  border-color: var(--neon-cyan);
  color: #fff;
  box-shadow: 0 0 14px rgba(6,182,212,0.35);
}

/* Ghost MR hero wrapper — makes it the visual centrepiece of every Revival Candidate card */
.ghost-mr-hero {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.ghost-mr-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  padding-left: 0.2rem;
}

/* Flagship chip — the one that guarantees Revive Now */
.chip-flagship {
  background: linear-gradient(135deg, rgba(16,185,129,0.18), rgba(6,182,212,0.12));
  border-color: rgba(16,185,129,0.55) !important;
  color: var(--green) !important;
  font-weight: 700;
}
.chip-flagship:hover {
  background: linear-gradient(135deg, rgba(16,185,129,0.32), rgba(6,182,212,0.22));
  box-shadow: 0 0 12px rgba(16,185,129,0.35);
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

/* Source badges */
.source-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
}
.source-mongodb { background: rgba(16,185,129,0.12); color: var(--green); border: 1px solid rgba(16,185,129,0.25); }
.source-mcp { background: rgba(6,182,212,0.1); color: var(--neon-cyan); border: 1px solid rgba(6,182,212,0.2); }
.source-inline { background: rgba(251,191,36,0.1); color: var(--amber); border: 1px solid rgba(251,191,36,0.2); }

/* ── ADK Synthesis panel ─────────────────────────────────────────────────── */
.adk-synthesis-panel {
  background: linear-gradient(135deg, rgba(124,58,237,0.08) 0%, rgba(6,182,212,0.04) 100%);
  border: 1px solid rgba(124,58,237,0.25);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.synth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.synth-title {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--border-neon);
}
.synth-subtitle { font-size: 0.72rem; color: var(--text-muted); }
.synth-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
  display: inline-block;
}
.synth-tag-ok { background: rgba(16,185,129,0.12); color: var(--green); border: 1px solid rgba(16,185,129,0.25); }
.synth-tag-warn { background: rgba(251,191,36,0.12); color: var(--amber); border: 1px solid rgba(251,191,36,0.25); }
.synth-tag-bad { background: rgba(239,68,68,0.12); color: var(--red); border: 1px solid rgba(239,68,68,0.25); }
.synth-section { display: flex; flex-direction: column; gap: 0.35rem; }
.synth-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.synth-summary {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-secondary);
}
.synth-pattern {
  font-size: 0.78rem;
  color: var(--neon-cyan);
  font-style: italic;
  line-height: 1.45;
}
.synth-priorities { display: flex; flex-direction: column; gap: 0.65rem; }
.synth-priority {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
}
.synth-rank {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent-hover);
  font-family: var(--font-mono);
  flex-shrink: 0;
  padding-top: 0.1rem;
}
.synth-reason { font-size: 0.75rem; color: var(--text-secondary); margin-top: 0.2rem; line-height: 1.4; }
.synth-action { font-size: 0.72rem; color: var(--neon-cyan); margin-top: 0.25rem; }
/* Canonical card verdict shown next to each synthesis priority so the narrative
   can never silently contradict the per-feature card. */
.synth-verdict {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  vertical-align: middle;
  white-space: nowrap;
}
.synth-verdict-revive { background: rgba(16,185,129,0.14); color: var(--green); border: 1px solid rgba(16,185,129,0.3); }
.synth-verdict-investigate { background: rgba(251,191,36,0.14); color: var(--amber); border: 1px solid rgba(251,191,36,0.3); }
.synth-verdict-buried { background: rgba(148,163,184,0.12); color: var(--text-muted); border: 1px solid rgba(148,163,184,0.25); }

/* ── Resurrection Chains panel ───────────────────────────────────────────── */
.resurrect-chains-panel {
  background: rgba(251,191,36,0.04);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.chains-title {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber);
}
.chain-item {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(251,191,36,0.1);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}
.chain-constraint { font-weight: 700; color: var(--amber); }

/* ── Group Scan — Cross-Repository Graveyard Federation ─────────────────── */
.btn-cyber.btn-group-scan {
  background: rgba(6,182,212,0.08);
  border: 1px solid rgba(6,182,212,0.25);
  color: var(--neon-cyan);
  border-radius: 8px;
  padding: 0.55rem 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.btn-cyber.btn-group-scan:hover, .btn-cyber.btn-group-scan.active {
  background: rgba(6,182,212,0.18);
  border-color: var(--neon-cyan);
  box-shadow: 0 0 12px rgba(6,182,212,0.25);
}
.group-scan-input {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  background: rgba(6,182,212,0.04);
  border: 1px solid rgba(6,182,212,0.15);
  border-radius: var(--radius);
}
.group-scan-divider { height: 0; margin-bottom: 0.75rem; }
.group-scan-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}
.group-scan-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  background: rgba(6,182,212,0.1);
  border: 1px solid rgba(6,182,212,0.25);
  border-radius: 6px;
  padding: 0.15rem 0.55rem;
}
.group-scan-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.group-scan-form {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.btn-neon.btn-group-run {
  background: linear-gradient(135deg, rgba(6,182,212,0.3), rgba(124,58,237,0.3));
  border: 1px solid rgba(6,182,212,0.4);
  color: var(--neon-cyan);
  border-radius: 8px;
  padding: 0.55rem 1.1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  height: 2.25rem;
  align-self: flex-end;
}
.btn-neon.btn-group-run:hover {
  background: linear-gradient(135deg, rgba(6,182,212,0.5), rgba(124,58,237,0.5));
  box-shadow: 0 0 16px rgba(6,182,212,0.35);
}
.btn-neon.btn-group-run:disabled { opacity: 0.5; cursor: not-allowed; }

/* Group scan results panel */
.group-scan-panel {
  background: rgba(6,182,212,0.03);
  border: 1px solid rgba(6,182,212,0.2);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.group-scan-results-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}
.group-scan-results-badge {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--neon-cyan);
}
.group-scan-namespace {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent-hover);
  background: rgba(124,58,237,0.1);
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 6px;
  padding: 0.1rem 0.5rem;
}
.group-scan-summary { font-size: 0.74rem; color: var(--text-muted); }
.group-scan-section { margin-bottom: 0.85rem; }
.group-scan-section-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.cross-chains-list { display: flex; flex-direction: column; gap: 0.5rem; }
.cross-chain-item {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(6,182,212,0.12);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
}
.cross-chain-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.cross-chain-key {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--neon-cyan);
}
.cross-chain-count { font-size: 0.72rem; color: var(--text-secondary); }
.cross-chain-unlock {
  font-size: 0.72rem;
  color: var(--green);
  background: rgba(16,185,129,0.07);
  border: 1px solid rgba(16,185,129,0.15);
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
}
.cross-chain-repos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.cross-chain-repo {
  font-size: 0.66rem;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.1rem 0.4rem;
  font-family: var(--font-mono);
}
.group-scan-no-chains {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  padding: 0.5rem 0;
}
.group-repos-grid {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.group-repo-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  padding: 0.25rem 0.5rem;
  background: rgba(255,255,255,0.02);
  border-radius: 5px;
}
.group-repo-name { font-family: var(--font-mono); color: var(--text-secondary); }
.group-repo-stats { color: var(--text-muted); font-size: 0.72rem; }
.group-scan-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

/* ── Feature EKG — Vitality Sparklines ──────────────────────────────────── */
.vitality-sparkline-row { margin-top: 0.35rem; }
.sparkline-container { min-height: 20px; }
.sparkline-loading { font-size: 0.68rem; color: var(--text-muted); font-style: italic; }
.sparkline-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.55rem 0.75rem;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.sparkline-svg { flex-shrink: 0; }
.sparkline-meta {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.sparkline-trend { font-size: 0.72rem; font-weight: 700; }
.sparkline-current { font-size: 0.68rem; color: var(--text-secondary); }
.sparkline-label { font-size: 0.6rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; }

/* ── Chip section rows (instant demo + live scan) ────────────────────────── */
.chip-section {
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.chip-row-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.chip-row-icon {
  font-size: 0.78rem;
  flex-shrink: 0;
}
.chip-row-icon.live-icon {
  color: #10b981;
  font-size: 0.6rem;
  animation: livepulse 1.5s ease-in-out infinite;
}
.chip-row-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.chip-row-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
}
[data-theme="light"] .chip-row-desc { color: #64748b; }
[data-theme="light"] .chip-row-title { color: #475569; }

/* Live scan chips — green (active/live), not red (danger) */
.chip-live {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(16,185,129,0.07);
  border: 1px solid rgba(16,185,129,0.3);
  color: #6ee7b7;
  border-radius: 20px;
  padding: 0.3rem 0.75rem;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-mono);
  white-space: nowrap;
}
.chip-live:hover {
  background: rgba(16,185,129,0.18);
  border-color: #10b981;
  color: #fff;
  box-shadow: 0 0 10px rgba(16,185,129,0.2);
}
[data-theme="light"] .chip-live {
  background: rgba(16,185,129,0.06);
  border-color: rgba(16,185,129,0.35);
  color: #065f46;
}
[data-theme="light"] .chip-live:hover {
  background: rgba(16,185,129,0.15);
  border-color: #10b981;
  color: #022c22;
}
@keyframes livepulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

/* Button hint text below each action button */
.btn-with-hint {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
}
.btn-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  padding-left: 0.2rem;
  line-height: 1;
}
[data-theme="light"] .btn-hint { color: #94a3b8; }

/* ── hidden utility ──────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Mobile Responsive ── tablet + phone ─────────────────────────────────── */
@media (max-width: 900px) {
  /* Stack layout: sidebar becomes a top bar */
  .cyber-app-shell {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    overflow: auto;
  }

  body {
    height: auto;
    overflow: auto;
  }

  /* Sidebar collapses to a compact top header */
  .cyber-sidebar {
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 0.75rem 1rem;
    gap: 0.75rem;
    border-right: none;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  /* Brand stays compact */
  .cyber-brand { flex-shrink: 0; }
  .brand-subtitle { display: none; }

  /* Sidebar dividers disappear on mobile */
  .sidebar-divider { display: none; }

  /* Nav becomes horizontal scroll row */
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 0.25rem;
    overflow-x: auto;
    flex: 1;
  }
  .sidebar-nav-item.nav-tab {
    white-space: nowrap;
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
    border-left: none;
    border-bottom: 2px solid transparent;
  }
  .sidebar-nav-item.nav-tab.active {
    border-left-color: transparent;
    border-bottom-color: var(--accent);
  }
  .tab-badge { display: none; }

  /* Hide sidebar extras on mobile */
  .sidebar-section-label,
  .ls-stats-strip,
  .cli-feed-container,
  .sidebar-footer,
  .active-integrations-strip { display: none; }

  /* Main content takes full width */
  .main-content-area {
    height: auto;
    overflow: auto;
    padding: 1rem;
  }

  /* Scanner form stacks vertically */
  .scanner-form-row {
    flex-direction: column;
    gap: 0.75rem;
  }
  .cyber-field { width: 100% !important; }
  .field-param { max-width: 100%; }

  /* Action buttons stack */
  .btn-group-scanner {
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
  }
  .btn-neon.btn-scan,
  .btn-cyber.btn-demo,
  .btn-cyber.btn-group-scan {
    width: 100%;
    justify-content: center;
  }

  /* Quick chip rows wrap nicely */
  .scanner-quick-targets { flex-wrap: wrap; }

  /* Summary stats bar: 2-col grid on mobile */
  .summary-bar {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .stat-card.repo-stat { grid-column: 1 / -1; }

  /* Feature cards single column */
  .feature-grid { grid-template-columns: 1fr; }

  /* Action ribbon wraps */
  .action-ribbon { flex-wrap: wrap; gap: 0.5rem; }

  /* Terminal takes full width */
  .terminal-panel { max-height: 200px; }

  /* Footer console hidden on mobile */
  .cyber-terminal-console { display: none; }
}

@media (max-width: 480px) {
  .brand-title { font-size: 1.25rem; }
  .scanner-console-header h3 { font-size: 1rem; }
  .summary-bar { grid-template-columns: 1fr; }
  .stat-card.repo-stat { grid-column: 1; }
  .feature-card { padding: 1rem; }
}

/* ── Premium UI/UX Collapsible & Panel Adjustments ── */
.scanner-console-header, .scanner-card-header-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 100%;
}
.sch-title-group {
  flex: 1;
}
.console-collapse-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  cursor: pointer;
  transition: var(--transition);
  margin-left: 1rem;
  flex-shrink: 0;
}
.console-collapse-btn:hover {
  border-color: var(--border-neon);
  color: var(--text);
  background: var(--sidebar-nav-hover);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* Collapsible state rules */
.scanner-console-card {
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.35s ease, margin 0.35s ease;
  max-height: 800px;
  overflow: hidden;
}
.scanner-console-card.collapsed {
  max-height: 72px;
}
.scanner-console-card.collapsed .scanner-console-body {
  opacity: 0;
  pointer-events: none;
}

.scanner-card {
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding 0.35s ease, margin 0.35s ease;
  max-height: 800px;
  overflow: hidden;
}
.scanner-card.collapsed {
  max-height: 72px;
}
.scanner-card.collapsed .scan-inputs,
.scanner-card.collapsed .scan-actions {
  opacity: 0;
  pointer-events: none;
}

/* Cyber Console Footer Collapsible */
.cyber-terminal-console {
  transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.cyber-terminal-console.collapsed {
  height: 38px !important;
}
.cyber-terminal-console.collapsed .console-terminal-lines {
  display: none !important;
}
.console-min-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 4px;
  width: 20px;
  height: 20px;
  line-height: 12px;
  font-size: 0.75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.console-min-btn:hover {
  border-color: var(--border-neon);
  color: var(--text);
  background: var(--sidebar-nav-hover);
}
.console-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ── Necrosis Double-Pane master-detail overrides ── */
.necrosis-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.15rem;
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 0.45rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.necrosis-row:hover {
  background: var(--surface-hover);
  border-color: var(--border-glow);
  transform: translateX(3px);
}
.necrosis-row.active {
  background: var(--sidebar-nav-active);
  border-color: var(--border-glow);
  border-left-color: var(--accent);
  box-shadow: 0 4px 15px var(--accent-glow);
  transform: translateX(5px);
}
.necrosis-row-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
  flex: 1;
}
.necrosis-row-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.necrosis-row-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.necrosis-row-path {
  font-size: 0.7rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
}
.necrosis-row-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.necrosis-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
}
.necrosis-badge.badge-excise {
  background: rgba(239, 68, 68, 0.15);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.necrosis-badge.badge-biopsy {
  background: rgba(251, 191, 36, 0.15);
  color: var(--amber);
  border: 1px solid rgba(251, 191, 36, 0.3);
}
.necrosis-badge.badge-intact {
  background: rgba(16, 185, 129, 0.15);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Light Theme WCAG Enhancements for high contrast */
[data-theme="light"] .ls-card-integration .ls-value,
[data-theme="light"] .sidebar-nav-item.nav-tab.active .nav-item-icon,
[data-theme="light"] .tab-badge,
[data-theme="light"] .nav-tab.active {
  color: #4f46e5 !important;
  text-shadow: none !important;
}
[data-theme="light"] .brand-subtitle {
  color: #0891b2 !important;
  text-shadow: none !important;
}
[data-theme="light"] .chip-neon:hover {
  background: rgba(79, 70, 229, 0.08);
  border-color: #4f46e5;
  color: #4f46e5;
  box-shadow: none;
}
[data-theme="light"] .status-pulse {
  box-shadow: none !important;
}
[data-theme="light"] .status-pulse.warn {
  background: #d97706;
}
[data-theme="light"] .status-pulse.error {
  background: #dc2626;
}

/* Text clipping preventative layout rules */
.fc-title-wrap, .registry-row-title, .ls-label {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

/* Timeline Click-to-Filter Month Tag Styles */
.month-filter-tag {
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid var(--border-neon);
  color: var(--text);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  margin-left: 0.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  animation: fadeSlideIn 0.2s ease;
}
[data-theme="light"] .month-filter-tag {
  background: rgba(79, 70, 229, 0.08);
  border-color: #4f46e5;
  color: #4f46e5;
}
.month-filter-tag button {
  background: none;
  border: none;
  color: var(--red);
  cursor: pointer;
  font-weight: 800;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 2px;
}
.month-filter-tag button:hover {
  color: #ff6b6b;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateX(-5px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ════════════════════════════════════════════════════════════════════════════
   COLOR HARMONIZATION + RESPONSIVE (2026 UI/UX pass, cont.)
   ════════════════════════════════════════════════════════════════════════════ */

/* ADK synthesis panel: clean white card with an indigo accent edge — replaces the
   washed lavender gradient that fought the rest of the palette. */
[data-theme="light"] .adk-synthesis-panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  box-shadow: var(--shadow-md);
}
[data-theme="light"] .synth-pattern,
[data-theme="light"] .synth-exec,
[data-theme="light"] .synth-summary { color: #475569; }
[data-theme="light"] .synth-reason { color: #64748b; }

/* Challenger-disagreement tags: readable amber, not low-contrast wash */
[data-theme="light"] .synth-tag-warn {
  background: rgba(251,191,36,0.14); color: #b45309; border: 1px solid rgba(251,191,36,0.35);
}

/* Action ribbon: keep brand colors, but make the export button a calm neutral so the
   row reads as one consistent control group. */
[data-theme="light"] .action-ribbon > .btn-secondary#exportJsonBtn {
  background: #ffffff; border: 1px solid var(--border); color: #475569; box-shadow: var(--shadow-sm);
}
[data-theme="light"] .action-ribbon > .btn-secondary#exportJsonBtn:hover {
  border-color: rgba(79,70,229,0.3); color: var(--accent);
}

/* Challenger box light tint */
[data-theme="light"] .challenger-box { background: #fbfbfe; }
[data-theme="light"] .challenger-row-text,
[data-theme="light"] .challenger-risk-list li { color: #475569; }

/* Action buttons in light mode */
[data-theme="light"] .btn-action-secondary {
  border-color: rgba(15,23,42,0.14); color: #334155;
}
[data-theme="light"] .btn-action-link {
  border-color: rgba(15,23,42,0.1); color: #64748b;
}

/* Green/revive colour system — light mode overrides.
   Dark-mode #10b981 is lime-bright on white. Use deep teal-green (#047857)
   with very low-opacity warm fills for badges. */
[data-theme="light"] .badge-revive,
[data-theme="light"] .badge-intact {
  background: rgba(4, 120, 87, 0.07);
  color: #047857;
  border-color: rgba(4, 120, 87, 0.22);
}
[data-theme="light"] .filter-btn.revive-filter.active {
  background: rgba(4, 120, 87, 0.09);
  border-color: rgba(4, 120, 87, 0.35);
  color: #047857;
}
[data-theme="light"] .revive-stat .stat-value { color: #047857; text-shadow: none; }
[data-theme="light"] .summary-intact .summary-val { color: #047857; text-shadow: none; }
[data-theme="light"] .synth-verdict-revive {
  background: rgba(4, 120, 87, 0.08);
  color: #047857;
  border-color: rgba(4, 120, 87, 0.25);
}
[data-theme="light"] .tl-ready .tl-dot {
  background: #047857;
  box-shadow: 0 0 5px rgba(4, 120, 87, 0.25);
}
[data-theme="light"] .registry-row[data-rec="revive_now"] { border-left-color: rgba(4, 120, 87, 0.55); }
[data-theme="light"] .challenger-chip-confirm {
  background: rgba(4, 120, 87, 0.08);
  color: #047857;
  border-color: rgba(4, 120, 87, 0.25);
}
[data-theme="light"] .tl-ins-green::before { background: #047857; }

/* Amber/investigate colour system — light mode overrides.
   Dark mode uses neon #fbbf24 for legibility on near-black.
   Light mode needs warm brown (#b45309) with very low-opacity warm fills
   so badges and highlights feel refined, not neon-yellow on white. */
[data-theme="light"] .badge-investigate,
[data-theme="light"] .badge-biopsy {
  background: rgba(180, 83, 9, 0.07);
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.22);
}
[data-theme="light"] .filter-btn.investigate-filter.active {
  background: rgba(180, 83, 9, 0.09);
  border-color: rgba(180, 83, 9, 0.35);
  color: #b45309;
}
[data-theme="light"] .investigate-stat .stat-value {
  color: #b45309; text-shadow: none;
}
[data-theme="light"] .synth-tag-warn {
  background: rgba(180, 83, 9, 0.07);
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.22);
}
[data-theme="light"] .synth-verdict-investigate {
  background: rgba(180, 83, 9, 0.08);
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.28);
}
[data-theme="light"] .source-inline {
  background: rgba(180, 83, 9, 0.06);
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.18);
}
[data-theme="light"] .challenger-chip-downgrade {
  background: rgba(180, 83, 9, 0.08);
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.25);
}
[data-theme="light"] .m-badge-prep {
  background: rgba(180, 83, 9, 0.08);
  color: #b45309;
}
[data-theme="light"] .tl-resolved .tl-dot,
[data-theme="light"] .tl-investigate .tl-dot {
  background: #b45309;
  box-shadow: 0 0 5px rgba(180, 83, 9, 0.25);
}
[data-theme="light"] .registry-row[data-rec="investigate_further"] {
  border-left-color: rgba(180, 83, 9, 0.55);
}
/* Demand badge in light mode */
[data-theme="light"] .demand-medium { color: #b45309; border-color: rgba(180, 83, 9, 0.25); }
/* text-amber helper */
[data-theme="light"] .text-amber { color: #b45309; text-shadow: none; }

/* ── Responsive: never clip, gracefully stack on smaller viewports ──────────── */
[data-theme="light"] .cyber-workspace,
.cyber-workspace { min-width: 0; }                 /* prevent flex children overflow */
.main-viewport { min-width: 0; }

@media (max-width: 1180px) {
  .main-viewport { padding: 1.25rem 1.4rem; }
  .live-stats-bar { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
@media (max-width: 960px) {
  .main-viewport { padding: 1rem; gap: 1.1rem; }
  .mission-split { grid-template-columns: 1fr; }
  .charts-grid-layout { grid-template-columns: 1fr; }
  .live-stats-bar { grid-template-columns: repeat(2, 1fr); }
  .scanner-form-row { flex-direction: column; align-items: stretch; }
  .cyber-field.field-param { width: 100%; }
}
@media (max-width: 760px) {
  .cyber-sidebar { width: 64px; }
  .cyber-sidebar .brand-text,
  .cyber-sidebar .nav-item-text,
  .cyber-sidebar .tab-badge,
  .cyber-sidebar .nav-info { display: none; }
  .sidebar-nav-item.nav-tab { justify-content: center; }
  .live-stats-bar { grid-template-columns: 1fr 1fr; }
  .workspace-title { font-size: 0.95rem !important; }
}

/* ── Nav info affordance — hover/focus tooltip that educates per section ───── */
.cyber-sidebar, .sidebar-nav { overflow: visible; }   /* let tooltips escape the rail */
.nav-info {
  flex-shrink: 0;
  width: 16px; height: 16px; margin-left: 0.3rem;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.7rem; line-height: 1;
  color: var(--text-muted); opacity: 0.4;
  cursor: help; border-radius: 50%;
  transition: opacity 0.18s ease, color 0.18s ease;
  position: relative;
}
.sidebar-nav-item:hover .nav-info { opacity: 0.65; }
.nav-info:hover, .nav-info:focus-visible { opacity: 1; color: var(--accent); outline: none; }
/* tooltip rendered via JS #navTip at body root — no ::after needed */

/* ── Body-root tooltip (escapes sidebar stacking context) ── */
#navTip {
  position: fixed;
  max-width: 260px;
  padding: 0.65rem 0.85rem;
  background: #0f1626;
  color: #e2e8f0;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: 0;
  text-align: left;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(2, 6, 23, 0.45);
  pointer-events: none;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.14s ease;
}
#navTip.visible {
  opacity: 1;
}
[data-theme="light"] #navTip {
  background: #1e293b;
  border-color: rgba(30, 41, 59, 0.22);
  color: #f1f5f9;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.28);
}

/* ════════════════════════════════════════════════════════════════════════════
   NECROSIS DETAIL CARD — structured 2-column dossier (was unstyled stacked text)
   ════════════════════════════════════════════════════════════════════════════ */
.feature-card-header {
  display: flex; align-items: center; gap: 0.85rem; padding-left: 0.85rem;
}
.fc-icon { display: flex; align-items: center; flex-shrink: 0; width: 20px; height: 20px; }
.fc-title-wrap { display: flex; flex-direction: column; gap: 0.22rem; min-width: 0; flex: 1; }
.fc-name { font-size: 1.05rem; font-weight: 700; color: var(--text); letter-spacing: -0.01em; }
.fc-meta {
  font-size: 0.74rem; color: var(--text-muted);
  display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center;
}
.fc-meta code { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-secondary); }

.nec-body {
  display: flex; flex-direction: column; gap: 1.1rem;
  border-top: 1px dashed var(--border); margin-top: 0.9rem; padding-top: 1.1rem;
}
@media (min-width: 1080px) {
  .card-expanded-full .nec-body.expanded {
    display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    column-gap: 2.5rem; align-items: start;
  }
  .card-expanded-full .nec-body .nec-col-side {
    border-left: 1px solid var(--border); padding-left: 2.5rem;
  }
}
.nec-col { display: flex; flex-direction: column; gap: 1.1rem; min-width: 0; }
.fc-section { display: flex; flex-direction: column; gap: 0.5rem; }

/* Annotation: a real code block (dark, mono) — not loose amber text */
.fc-annotation {
  margin: 0; padding: 0.7rem 0.85rem; border-radius: 8px;
  background: #0b1220; border: 1px solid rgba(15, 23, 42, 0.25); overflow-x: auto;
}
.fc-annotation code {
  font-family: var(--font-mono); font-size: 0.76rem; color: #fbbf24;
  white-space: pre; word-break: normal;
}

/* Verdict metrics as compact KPI tiles */
.nec-verdict-row { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.nec-metric {
  flex: 1 1 88px; min-width: 80px;
  display: flex; flex-direction: column; gap: 0.2rem;
  background: var(--surface-subtle); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.55rem 0.7rem;
}
.nm-label { font-size: 0.55rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); font-weight: 700; }
.nm-val { font-size: 0.95rem; font-weight: 800; color: var(--text); line-height: 1.15; }
.nm-sub { font-size: 0.7rem; font-weight: 600; color: var(--text-muted); }
.nm-val-excise_now { color: var(--red); }
.nm-val-needs_biopsy { color: #d97706; }
.nm-val-leave_intact { color: var(--text-secondary); }

.fc-reasoning { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.55; }
.fc-blast {
  font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5;
  background: var(--surface-subtle); border-radius: 8px; padding: 0.55rem 0.7rem;
}
.fc-blast-label {
  font-weight: 700; color: var(--text-muted); text-transform: uppercase;
  font-size: 0.58rem; letter-spacing: 0.06em; margin-right: 0.35rem;
}
.fc-inline-val { font-size: 0.82rem; color: var(--text-secondary); }
.fc-inline-val code { font-family: var(--font-mono); font-size: 0.76rem; color: var(--accent); }

/* Removal risks — calm danger marker, readable text */
.fc-risks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.fc-risks li {
  position: relative; padding-left: 1.05rem;
  font-size: 0.78rem; color: var(--text-secondary); line-height: 1.5;
}
.fc-risks li::before {
  content: ""; position: absolute; left: 0.1rem; top: 0.5em;
  width: 5px; height: 5px; border-radius: 50%; background: var(--amber); opacity: 0.75;
}

.fc-signals { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.signal-chip {
  font-size: 0.68rem; padding: 0.22rem 0.55rem; border-radius: 6px;
  background: var(--surface-subtle); border: 1px solid var(--border); color: var(--text-secondary);
}
.nec-callers-none, .nec-action-note {
  font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; font-style: italic;
}
.sl-sub {
  font-weight: 500; text-transform: none; letter-spacing: 0;
  color: var(--text-muted); font-size: 0.62rem; opacity: 0.85;
}