/*
 * aegis-theme.css — High-End ThreeUI & Linear Design System for Aegis Protocol
 * Features: 3D Interactive Cyber Wave Canvas, Sleek Glass Navbar, 3D Card Tilt Physics,
 * Specular Glare Follow, Bento Grid with Living Software Components, Command Palette (⌘K)
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* ── Deep Matte Obsidian Surfaces ── */
  --bg:               #06080d;
  --bg-subtle:        #090d15;
  --surface:          rgba(12, 16, 24, 0.75);
  --surface-hover:    rgba(18, 24, 38, 0.88);
  --surface-solid:    #0c1018;
  --surface-elevated: #121826;
  --surface-card:     rgba(12, 16, 24, 0.7);
  
  /* ── Hairline Precision Borders ── */
  --border:           rgba(255, 255, 255, 0.08);
  --border-subtle:    rgba(255, 255, 255, 0.04);
  --border-hover:     rgba(255, 255, 255, 0.16);
  --border-focus:     rgba(0, 229, 255, 0.5);
  
  /* ── Restrained High-Craft Accents ── */
  --accent:           #00e5ff;
  --accent-glow:      rgba(0, 229, 255, 0.2);
  --accent-dim:       rgba(0, 229, 255, 0.08);
  --emerald:          #10b981;
  --emerald-glow:     rgba(16, 185, 129, 0.2);
  --amber:            #f59e0b;
  --amber-glow:       rgba(245, 158, 11, 0.2);
  --rose:             #f43f5e;
  --rose-glow:        rgba(244, 63, 94, 0.2);
  --purple:           #818cf8;
  --purple-glow:      rgba(129, 140, 248, 0.2);
  --indigo:           #6366f1;
  
  /* ── Typography & Neutrals ── */
  --text:             #f8fafc;
  --text-muted:       #94a3b8;
  --text-dim:         #64748b;
  --font-main:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono:        'JetBrains Mono', 'Fira Code', monospace;

  /* ── Springs & Timings ── */
  --ease-spring:      cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  min-height: 100vh;
  cursor: default;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, a, input, select, textarea, .chip, .asset-item {
  cursor: pointer;
}

button:active, .ae-btn-primary:active, .ae-btn-ghost:active {
  transform: translateY(1px) scale(0.985);
}

/* ── SUBTLE FILM GRAIN TEXTURE ── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* ── BESPOKE HIGH-CRAFT NAVIGATION BAR ── */
.ae-nav-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  background: rgba(6, 9, 15, 0.78);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.6), inset 0 1px 0 0 rgba(255, 255, 255, 0.06);
  z-index: 200;
}
.ae-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  gap: 16px;
}
.ae-nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  transition: opacity 0.15s ease;
}
.ae-nav-brand:hover {
  opacity: 0.9;
}
.ae-brand-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.15), rgba(12, 16, 26, 0.8));
  border: 1px solid rgba(0, 229, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.2s var(--ease-spring);
}
.ae-nav-brand:hover .ae-brand-icon-wrap {
  transform: scale(1.04);
  border-color: rgba(0, 229, 255, 0.55);
  box-shadow: 0 0 22px rgba(0, 229, 255, 0.3);
}
.ae-brand-text {
  display: flex;
  flex-direction: column;
}
.ae-brand-name {
  font-weight: 800;
  font-size: 0.96rem;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.1;
}
.ae-brand-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* Central Segmented Pill Links */
.ae-nav-links-wrap {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  display: flex;
  align-items: center;
  gap: 2px;
}
.ae-nav-link {
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 999px;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.ae-nav-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}
.ae-nav-link.ae-active {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Right Action Section */
.ae-nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ae-nav-cmd-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 10px;
  color: var(--text-dim);
  font-size: 0.76rem;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.15s ease;
}
.ae-nav-cmd-trigger:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
  color: var(--text-muted);
}
.ae-nav-submit-btn {
  background: #fff !important;
  color: #06080d !important;
  font-weight: 600 !important;
  padding: 7px 18px !important;
  border-radius: 999px !important;
  font-size: 0.82rem !important;
  box-shadow: 0 2px 14px rgba(255, 255, 255, 0.2);
  transition: all 0.15s var(--ease-spring) !important;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ae-nav-submit-btn:hover {
  background: #e2e8f0 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.35);
}

/* ── HERO LIVE RADAR TICKER PILL ── */
.hero-ticker-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 0.76rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.hero-ticker-pill:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.08);
}
.hero-ticker-text {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* ── 3D WAVE HUD CONTROLLER (Hero Corner) ── */
.wave-hud-controls {
  position: absolute;
  bottom: 20px;
  right: 28px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(13, 17, 26, 0.75);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
  backdrop-filter: blur(16px);
}
.wave-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.wave-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.wave-btn.active {
  color: var(--accent);
  background: rgba(0, 229, 255, 0.12);
}

/* ── LIVE TELEMETRY STRIP ── */
.telemetry-strip-wrapper {
  max-width: 1200px;
  margin: 0 auto 30px;
  padding: 0 32px;
  position: relative;
  z-index: 2;
}
.telemetry-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(13, 17, 26, 0.6);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 24px;
  backdrop-filter: blur(16px);
  gap: 20px;
}
.telemetry-item {
  display: flex;
  flex-direction: column;
}
.telemetry-val-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.telemetry-val {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.telemetry-lbl {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ── IN-HERO LIVE SWARM VERIFICATION MODAL / DRAWER ── */
.in-hero-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.in-hero-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.in-hero-modal {
  width: 100%;
  max-width: 720px;
  background: #0d111a;
  border: 1px solid var(--border-hover);
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.06);
  transform: translateY(12px) scale(0.97);
  transition: transform 0.25s var(--ease-spring);
}
.in-hero-modal-backdrop.open .in-hero-modal {
  transform: translateY(0) scale(1);
}

/* ── THREEUI 3D CARD PERSPECTIVE & TILT ── */
.bento-card, .ag-card, .instrument-card {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
  transition: border-color 0.25s, box-shadow 0.25s;
}
.bento-card:hover, .ag-card:hover, .instrument-card:hover {
  border-color: var(--border-hover);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 32px rgba(0, 229, 255, 0.06);
}

/* Dynamic Specular Glare on Hover */
.bento-card::before, .ag-card::before, .instrument-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(255, 255, 255, 0.08),
    transparent 45%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}
.bento-card:hover::before, .ag-card:hover::before, .instrument-card:hover::before {
  opacity: 1;
}

/* ── ANIMATED PRECISION BORDER HIGHLIGHT ── */
.border-beam-card {
  position: relative;
}
.border-beam-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--beam-angle, 0deg), transparent 75%, rgba(0, 229, 255, 0.4) 92%, transparent 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: rotateBeam 5s linear infinite;
  opacity: 0.6;
}
@property --beam-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}
@keyframes rotateBeam {
  0% { --beam-angle: 0deg; }
  100% { --beam-angle: 360deg; }
}

/* ── BUTTONS ── */
.ae-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.86rem;
  font-family: var(--font-main);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s var(--ease-spring);
  border: none;
}
.ae-btn-primary {
  background: #fff;
  color: #06080d;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.18);
}
.ae-btn-primary:hover {
  background: #e2e8f0;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(255, 255, 255, 0.25);
}
.ae-btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid var(--border);
}
.ae-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-hover);
}

/* ── BADGES & STATUS PILLS ── */
.ae-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.ae-badge-blue   { background: rgba(0, 229, 255, 0.08); color: var(--accent); border: 1px solid rgba(0, 229, 255, 0.22); }
.ae-badge-green  { background: rgba(16, 185, 129, 0.08); color: var(--emerald); border: 1px solid rgba(16, 185, 129, 0.22); }
.ae-badge-red    { background: rgba(244, 63, 94, 0.08); color: var(--rose); border: 1px solid rgba(244, 63, 94, 0.22); }
.ae-badge-yellow { background: rgba(245, 158, 11, 0.08); color: var(--amber); border: 1px solid rgba(245, 158, 11, 0.22); }
.ae-badge-purple { background: rgba(168, 85, 247, 0.08); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.22); }
.ae-badge-zinc   { background: rgba(255, 255, 255, 0.06); color: var(--text-muted); border: 1px solid var(--border); }

/* ── RANGE SLIDERS ── */
.ae-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  cursor: pointer;
}
.ae-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent);
}

/* ── COMMAND PALETTE MODAL (⌘K / Ctrl+K) ── */
.cmd-palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.cmd-palette-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.cmd-palette-box {
  width: 100%;
  max-width: 620px;
  background: #0b0f19;
  border: 1px solid var(--border-hover);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.06);
  overflow: hidden;
  transform: translateY(-8px) scale(0.98);
  transition: transform 0.2s var(--ease-spring);
}
.cmd-palette-backdrop.open .cmd-palette-box {
  transform: translateY(0) scale(1);
}
.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: var(--font-main);
  color: #fff;
}
.cmd-input::placeholder {
  color: var(--text-dim);
}
.cmd-list {
  max-height: 340px;
  overflow-y: auto;
  padding: 8px;
}
.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.86rem;
  text-decoration: none;
  transition: all 0.15s ease;
}
.cmd-item:hover, .cmd-item.selected {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}
.cmd-item-key {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 7px;
  border-radius: 4px;
  color: var(--text-dim);
}

/* ── REVEAL ON SCROLL ── */
.ae-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s var(--ease-spring), transform 0.5s var(--ease-spring);
}
.ae-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── FOOTER ── */
.ae-footer {
  border-top: 1px solid var(--border);
  padding: 48px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--text-dim);
  background: #04060a;
  position: relative;
  z-index: 2;
}

/* ── CYBER DEFENSE LOADING PREVIEW & SKELETON SUITE ── */
@keyframes aegisShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes aegisRadarSweep {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes aegisProgressIndeterminate {
  0% { width: 0%; transform: translateX(0%); }
  50% { width: 60%; transform: translateX(30%); }
  100% { width: 100%; transform: translateX(0%); }
}

.ae-loading-preview {
  background: rgba(12, 16, 24, 0.85);
  border: 1px solid rgba(0, 229, 255, 0.22);
  border-radius: 16px;
  padding: 24px;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  margin: 16px 0;
  animation: fadeIn 0.3s ease;
}

.ae-loading-preview::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), #38bdf8, transparent);
  box-shadow: 0 0 12px var(--accent);
}

.ae-loading-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.ae-loading-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ae-radar-spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(0, 229, 255, 0.2);
  border-top-color: var(--accent);
  border-right-color: #38bdf8;
  animation: aegisRadarSweep 0.85s linear infinite;
  flex-shrink: 0;
}

.ae-loading-title {
  font-weight: 700;
  font-size: 0.94rem;
  color: #fff;
  letter-spacing: -0.01em;
}

.ae-loading-timer-badge {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.25);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ae-progress-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 18px;
  position: relative;
}

.ae-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #00e5ff, #38bdf8, #818cf8);
  border-radius: 999px;
  transition: width 0.35s ease;
  box-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

.ae-progress-fill.indeterminate {
  width: 50%;
  animation: aegisProgressIndeterminate 1.6s ease-in-out infinite;
}

.ae-loading-steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.ae-loading-step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.82rem;
  color: var(--text-dim);
  transition: all 0.25s ease;
}

.ae-loading-step-item.active {
  background: rgba(0, 229, 255, 0.05);
  border-color: rgba(0, 229, 255, 0.3);
  color: #fff;
}

.ae-loading-step-item.done {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--emerald);
}

.ae-step-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
  transition: all 0.25s ease;
}

.ae-loading-step-item.active .ae-step-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulseGlow 1.2s infinite;
}

.ae-loading-step-item.done .ae-step-dot {
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

.ae-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.ae-skeleton-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.ae-skeleton-bar {
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.09) 50%, rgba(255, 255, 255, 0.03) 100%);
  background-size: 200% 100%;
  animation: aegisShimmer 1.5s infinite linear;
}

@media (max-width: 960px) {
  .ae-nav-inner { padding: 0 16px; }
  .ae-nav-links-wrap { max-width: 48vw; overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none; }
  .ae-nav-links-wrap::-webkit-scrollbar { display: none; }
  .telemetry-strip { grid-template-columns: repeat(2, 1fr); }
  .wave-hud-controls { display: none; }
}
@media (max-width: 680px) {
  .ae-nav-links-wrap { display: none; }
  .ae-brand-sub { display: none; }
  .ae-nav-cmd-trigger span { display: none; }
  .telemetry-strip { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════
   AEGIS HUMAN-CENTERED INFORMATION PRESENTATION PRIMITIVES
   ══════════════════════════════════════════════════════════════ */

/* Level 1: Decision & Orientation Banner (5-10s comprehension) */
.aegis-orientation-banner {
  background: rgba(13, 17, 26, 0.88);
  border: 1px solid var(--border-hover);
  border-radius: 18px;
  padding: 24px 28px;
  margin-bottom: 28px;
  backdrop-filter: blur(16px);
  position: relative;
  overflow: hidden;
}
.aegis-orientation-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
  background: var(--accent);
}
.aegis-orientation-banner.urgent::before { background: var(--rose); }
.aegis-orientation-banner.warning::before { background: var(--amber); }
.aegis-orientation-banner.verified::before { background: var(--emerald); }

.aegis-verdict-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.aegis-verdict-badge {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.aegis-verdict-badge.true, .aegis-verdict-badge.verified {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}
.aegis-verdict-badge.false {
  background: rgba(244, 63, 94, 0.15);
  color: #f43f5e;
  border: 1px solid rgba(244, 63, 94, 0.35);
}
.aegis-verdict-badge.misleading, .aegis-verdict-badge.unverified {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.aegis-strength-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.aegis-strength-pill.strong { color: #34d399; border-color: rgba(52, 211, 153, 0.4); }
.aegis-strength-pill.moderate { color: #38bdf8; border-color: rgba(56, 189, 248, 0.4); }
.aegis-strength-pill.limited { color: #fbbf24; border-color: rgba(251, 191, 36, 0.4); }
.aegis-strength-pill.insufficient { color: #f43f5e; border-color: rgba(244, 63, 94, 0.4); }

.aegis-bottomline {
  font-size: 1.08rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.5;
  margin-bottom: 8px;
}

/* Level 2: "Why This Matters" & "What Is Unknown" Blocks */
.aegis-why-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid #38bdf8;
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 18px;
}
.aegis-why-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #38bdf8;
  margin-bottom: 6px;
}
.aegis-why-list {
  margin: 0; padding-left: 18px;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.aegis-unknown-box {
  background: rgba(245, 158, 11, 0.03);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-left: 3px solid #fbbf24;
  border-radius: 10px;
  padding: 12px 18px;
  margin-bottom: 18px;
  font-size: 0.84rem;
  color: #fde68a;
  line-height: 1.5;
}
.aegis-unknown-title {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fbbf24;
  margin-bottom: 4px;
}

/* Dual-Column FOR / AGAINST Evidence Matrix */
.aegis-evidence-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}
@media (max-width: 820px) {
  .aegis-evidence-matrix { grid-template-columns: 1fr; }
}

.aegis-matrix-col {
  background: rgba(7, 9, 14, 0.6);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}
.aegis-matrix-col.for { border-top: 3px solid var(--emerald); }
.aegis-matrix-col.against { border-top: 3px solid var(--rose); }

.aegis-matrix-col-title {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.aegis-matrix-col.for .aegis-matrix-col-title { color: var(--emerald); }
.aegis-matrix-col.against .aegis-matrix-col-title { color: var(--rose); }

/* Event-Based Grouped News Unit */
.aegis-event-group {
  background: rgba(13, 17, 26, 0.7);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  transition: border-color 0.16s ease;
}
.aegis-event-group:hover {
  border-color: var(--border-hover);
}
.aegis-event-headline {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.4;
}
.aegis-event-meta {
  display: flex;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* Level 3: Universal Evidence Row with Progressive Disclosure */
.aegis-evidence-row {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: all 0.15s ease;
}
.aegis-evidence-row:hover {
  border-color: rgba(255, 255, 255, 0.15);
}
.aegis-evidence-summary {
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.aegis-evidence-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
}
.aegis-src-name {
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
}
.aegis-src-time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}
.aegis-role-badge {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}
.aegis-role-badge.primary { background: rgba(52, 211, 153, 0.12); color: #34d399; }
.aegis-role-badge.secondary { background: rgba(56, 189, 248, 0.12); color: #38bdf8; }
.aegis-role-badge.community { background: rgba(251, 191, 36, 0.12); color: #fbbf24; }
.aegis-role-badge.commentary { background: rgba(168, 85, 247, 0.12); color: #c084fc; }

.aegis-open-link {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(0, 229, 255, 0.08);
  border: 1px solid rgba(0, 229, 255, 0.2);
  transition: all 0.14s ease;
}
.aegis-open-link:hover {
  background: rgba(0, 229, 255, 0.2);
  border-color: var(--accent);
}

.aegis-evidence-drawer {
  padding: 14px 18px;
  background: rgba(0, 0, 0, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.6;
  display: none;
}
.aegis-evidence-row.expanded .aegis-evidence-drawer {
  display: block;
}

/* Compact Table Styling */
.aegis-compact-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  font-family: var(--font-main);
}
.aegis-compact-table th {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.aegis-compact-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
}
.aegis-compact-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
  color: #fff;
}

/* ── ACCESSIBILITY & KEYBOARD NAVIGATION (WCAG 2.2) ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.aegis-evidence-row:focus-visible,
.filter-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: 0 0 12px var(--accent-glow);
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Screen reader accessible text utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ── FORENSIC FUNNEL & SOURCE EXPLORER (AEGIS NATIVE AGENT REACH 3.0) ── */
.forensic-explorer-root {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 14px;
  font-family: var(--font-main);
  color: var(--text);
}

.fe-loading, .fe-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  background: var(--surface-card);
  border: 1px dashed var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
  gap: 12px;
}

.fe-empty-icon {
  font-size: 2rem;
  color: var(--accent);
  opacity: 0.8;
}

.fe-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(0, 229, 255, 0.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: fe-spin 0.8s linear infinite;
}

@keyframes fe-spin {
  to { transform: rotate(360deg); }
}

/* 1. Funnel Ribbon */
.fe-funnel-ribbon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(12, 16, 24, 0.95), rgba(18, 24, 38, 0.9));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 18px;
  overflow-x: auto;
  gap: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.fe-funnel-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  transition: all 0.2s var(--ease-spring);
}

.fe-funnel-step:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.fe-f-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.fe-step-read .fe-f-val { color: var(--accent); }
.fe-step-primary .fe-f-val { color: var(--amber); }
.fe-step-findings .fe-f-val { color: var(--emerald); }

.fe-f-lbl {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.fe-f-arrow {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.9rem;
  user-select: none;
}

/* 2. Tabs Header */
.fe-tabs-header {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 4px;
  overflow-x: auto;
}

.fe-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px 8px 0 0;
  color: var(--text-muted);
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.fe-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.03);
}

.fe-tab-btn.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-bottom-color: transparent;
  box-shadow: inset 0 2px 0 var(--accent);
}

.fe-tab-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.fe-tab-btn.active .fe-tab-count {
  background: var(--accent-dim);
  color: var(--accent);
}

/* 3. Findings Tab */
.fe-findings-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fe-finding-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.fe-finding-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}

.fe-fcard-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fe-fcard-num {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
}

.fe-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.fe-badge-green {
  background: rgba(16, 185, 129, 0.12);
  color: var(--emerald);
  border: 1px solid rgba(16, 185, 129, 0.25);
}

.fe-badge-red {
  background: rgba(244, 63, 94, 0.12);
  color: var(--rose);
  border: 1px solid rgba(244, 63, 94, 0.25);
}

.fe-badge-cyan {
  background: rgba(0, 229, 255, 0.1);
  color: var(--accent);
  border: 1px solid rgba(0, 229, 255, 0.25);
}

.fe-badge-amber {
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.fe-badge-muted {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.fe-badge-tier {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.fe-fcard-conf {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--emerald);
}

.fe-fcard-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
}

.fe-fcard-summary {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.fe-fcard-citations {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.06);
}

.fe-cite-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fe-cite-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(0, 229, 255, 0.07);
  border: 1px solid rgba(0, 229, 255, 0.2);
  border-radius: 12px;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fe-cite-pill:hover {
  background: rgba(0, 229, 255, 0.18);
  border-color: var(--accent);
  transform: translateY(-1px);
}

/* 4. Sources Tab (Accordion) */
.fe-sources-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fe-source-accordion {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fe-source-accordion:hover {
  border-color: var(--border-hover);
}

.fe-s-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  background: rgba(255, 255, 255, 0.015);
  gap: 12px;
}

.fe-s-header:hover {
  background: rgba(255, 255, 255, 0.035);
}

.fe-s-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.fe-s-idx {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 700;
}

.fe-s-domain {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
  white-space: nowrap;
}

.fe-s-title {
  font-size: 0.84rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fe-s-meta-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.fe-s-chars {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

.fe-s-chevron {
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: transform 0.2s ease;
}

.fe-source-accordion.open .fe-s-chevron {
  transform: rotate(180deg);
}

.fe-s-body {
  display: none;
  padding: 16px;
  border-top: 1px solid var(--border-subtle);
  background: rgba(6, 8, 13, 0.4);
  flex-direction: column;
  gap: 12px;
}

.fe-source-accordion.open .fe-s-body {
  display: flex;
}

.fe-s-body-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fe-link {
  color: var(--accent);
  text-decoration: none;
  word-break: break-all;
}

.fe-link:hover {
  text-decoration: underline;
}

.fe-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.fe-s-excerpt-box {
  background: rgba(12, 16, 24, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 12px 14px;
}

.fe-box-lbl {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.fe-passage {
  font-size: 0.84rem;
  color: var(--text);
  line-height: 1.6;
  font-style: normal;
}

.fe-full-text-details {
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

.fe-full-text-details summary {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
}

.fe-full-text-details summary:hover {
  color: var(--accent);
}

.fe-full-markdown {
  margin-top: 10px;
  padding: 12px;
  background: #040609;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  max-height: 300px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.5;
}

/* 5. Primary Filings Tab */
.fe-primaries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.fe-primary-card {
  background: var(--surface-card);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fe-pcard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fe-pcard-domain {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--amber);
}

.fe-pcard-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
  line-height: 1.4;
}

.fe-pcard-reason {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.fe-btn-link {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 6px;
  color: var(--amber);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  width: fit-content;
}

.fe-btn-link:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--amber);
}

/* 6. Syndication & Groups Tab */
.fe-groups-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fe-groups-note, .fe-audit-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid var(--purple);
  padding: 8px 12px;
  border-radius: 4px;
}

.fe-group-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fe-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fe-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fe-group-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-dim);
}

.fe-group-items {
  list-style: none;
  padding-left: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fe-group-items li {
  font-size: 0.8rem;
}

/* 7. Selection Audit Tab */
.fe-audit-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fe-table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.fe-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  text-align: left;
}

.fe-table th {
  background: rgba(18, 24, 38, 0.95);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.fe-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.fe-table tr.row-selected td {
  background: rgba(0, 229, 255, 0.025);
  color: #fff;
}

.fe-reason-code {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--amber);
  background: rgba(245, 158, 11, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

/* 8. Evidence Graph Tab */
.fe-graph-wrap {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fe-graph-header {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

.fe-graph-viewport {
  background: #04060a;
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.fe-graph-footer {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ══════════════════════════════════════════════════════════════════════════
   HIGH-CRAFT AGENT REAL-TIME PROGRESS & LOADING BAR COMPONENT
   ══════════════════════════════════════════════════════════════════════════ */
.agent-progress-box {
  background: rgba(10, 14, 23, 0.9);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 28px;
  margin: 20px 0;
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.agent-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.agent-progress-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.agent-progress-spinner {
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.agent-progress-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
}

.agent-progress-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.agent-progress-pct {
  font-weight: 800;
  color: var(--accent);
  background: rgba(0, 229, 255, 0.1);
  border: 1px solid rgba(0, 229, 255, 0.25);
  padding: 2px 8px;
  border-radius: 6px;
}

.agent-progress-timer {
  color: var(--text-dim);
}

.agent-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.agent-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #00e5ff, #818cf8, #f472b6);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.5);
  transition: width 0.35s ease;
}

.agent-progress-stages {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 768px) {
  .agent-progress-stages {
    grid-template-columns: 1fr 1fr;
  }
}

.agent-stage-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.agent-stage-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: color 0.2s ease;
}

.agent-stage-col.active .agent-stage-status {
  color: var(--accent);
}

.agent-stage-col.complete .agent-stage-status {
  color: var(--emerald);
}

.agent-stage-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  transition: all 0.2s ease;
}

.agent-stage-col.active .agent-stage-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.agent-stage-col.complete .agent-stage-dot {
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

}

.agent-stage-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* ── Hero Multi-Intent Investigation Launcher ── */
.hero-intent-bar {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 18px auto 0;
  max-width: 720px;
}

.hero-intent-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, color 0.18s;
  font-family: var(--font-main);
}

.hero-intent-btn:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.hero-intent-btn.active {
  border-color: var(--accent);
  background: rgba(0, 229, 255, 0.08);
  color: var(--accent);
}

.hero-divider-line {
  width: 100%;
  max-width: 640px;
  height: 1px;
  background: var(--border-subtle);
  margin: 22px auto 14px;
}

.hero-suggestions-title {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  margin-bottom: 10px;
}

.hero-suggestion-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, color 0.16s;
  font-family: var(--font-main);
  white-space: nowrap;
}

.hero-suggestion-chip:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.hero-suggestion-chip strong {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--accent);
  opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════════════════════
   UNIFIED REPORT RENDERER — v3.8.0
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Container ───────────────────────────────────────────────────────────── */
.unified-report {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 3rem;
  font-family: var(--font-main);
  color: var(--text);
}

/* ── Section ─────────────────────────────────────────────────────────────── */
.ur-section {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface-card);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}
.ur-section:hover {
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.05);
}

/* ── Heading ─────────────────────────────────────────────────────────────── */
.ur-heading {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 1rem 1.4rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background 0.15s ease;
}
.ur-heading::after {
  content: '▾';
  margin-left: auto;
  opacity: 0.5;
  transition: transform 0.2s ease;
  font-size: 0.9rem;
}
.ur-section.ur-collapsed .ur-heading::after { transform: rotate(-90deg); }
.ur-heading:hover { background: var(--surface-hover); }

/* Collapse body when section is toggled closed (mobile) */
.ur-section.ur-collapsed > *:not(.ur-heading) {
  display: none;
}

/* ── Summary ─────────────────────────────────────────────────────────────── */
.ur-summary {
  padding: 1.2rem 1.4rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text);
}
.ur-summary strong { color: var(--accent); }
.ur-empty { padding: 1rem 1.4rem; color: var(--text-muted); font-style: italic; }
.ur-error { padding: 1rem 1.4rem; color: var(--rose); }

/* ── Lists (findings / disagreements / changes / next steps) ─────────────── */
.ur-list {
  list-style: none;
  padding: 0.8rem 1.4rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.ur-list li {
  position: relative;
  padding-left: 1.2rem;
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--text);
}
.ur-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}
.ur-list-empty {
  color: var(--text-muted);
  font-style: italic;
}
.ur-list-empty::before { display: none; }

/* ── Evidence grid ───────────────────────────────────────────────────────── */
.ur-ev-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
}
@media (max-width: 820px) {
  .ur-ev-grid { grid-template-columns: 1fr; }
}

.ur-ev-col {
  background: var(--bg-subtle);
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.ur-ev-col-head {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}
.ur-ev-empty {
  color: var(--text-dim);
  font-style: italic;
  font-size: 0.85rem;
}

/* ── Evidence card ───────────────────────────────────────────────────────── */
.ur-ev-cards { display: flex; flex-direction: column; gap: 0.6rem; }

.ur-ev-card {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  background: var(--surface);
  padding: 0.8rem;
  transition: border-color 0.15s, background 0.15s;
}
.ur-ev-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}
.ur-ev-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.4rem;
}
.ur-ev-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  line-height: 1.4;
  flex: 1 1 0;
}
.ur-ev-title:hover { text-decoration: underline; }
.ur-ev-no-url {
  font-size: 0.72rem;
  color: var(--text-dim);
  font-style: italic;
  white-space: nowrap;
}
.ur-ev-snippet {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.ur-ev-card-foot {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* ── Badge ───────────────────────────────────────────────────────────────── */
.ur-badge {
  font-size: 0.6rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.ur-badge--primary {
  background: rgba(0, 229, 255, 0.12);
  color: var(--accent);
  border: 1px solid rgba(0, 229, 255, 0.25);
}

/* ── Timeline ────────────────────────────────────────────────────────────── */
.ur-tl-list {
  list-style: none;
  padding: 0.8rem 1.4rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.ur-tl-item {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.8rem;
  align-items: start;
}
.ur-tl-ts {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  white-space: nowrap;
  padding-top: 2px;
}
.ur-tl-desc {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.5;
}

/* ── Trust section ───────────────────────────────────────────────────────── */
.ur-trust-inner {
  padding: 1rem 1.4rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}
.ur-trust-sub {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}

/* Quality tensor axes */
.ur-qt-axes { display: flex; flex-direction: column; gap: 0.55rem; }
.ur-qt-axis {
  display: grid;
  grid-template-columns: 120px 1fr 48px;
  align-items: center;
  gap: 0.6rem;
}
.ur-qt-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.ur-qt-bar-wrap {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.ur-qt-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--emerald));
  border-radius: 3px;
  transition: width 0.4s ease;
}
.ur-qt-value {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent);
  text-align: right;
}

/* Trust metadata text */
.ur-sources-text { font-size: 0.88rem; color: var(--text-muted); }
.ur-trust-ph     { color: var(--text-dim); font-style: italic; }
.ur-tel-text     { font-size: 0.86rem; color: var(--text-muted); }
.ur-trust-note   { font-size: 0.8rem; color: var(--amber); margin-top: 0.3rem; }

/* ── Mobile overrides ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .unified-report { gap: 1rem; padding: 0 0.5rem 2rem; }
  .ur-qt-axis {
    grid-template-columns: 90px 1fr 40px;
    gap: 0.4rem;
  }
  .ur-qt-label { font-size: 0.7rem; }
  .ur-heading { font-size: 0.66rem; padding: 0.85rem 1rem; }
}
