/* ==========================================================================
   IS IT CLEAN? · Official Terminal Stylesheet (isitclean.site)
   The 3-Point Forensic Lie Detector for Solana Memecoins
   Architecture: Obsidian Cybersecurity · Tabular Analytics · Micro-Glow
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --bg-black: #000000;
  --bg-deep: #050608;
  --bg-surface: #0a0c10;
  --bg-surface-2: #101319;
  --bg-surface-3: #171b24;
  --bg-card: rgba(13, 16, 22, 0.78);

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.11);
  --border-hover: rgba(255, 255, 255, 0.22);
  --border-active: rgba(16, 185, 129, 0.45);

  --text-main: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-dim: #475569;

  --clean-emerald: #10b981;
  --clean-emerald-glow: rgba(16, 185, 129, 0.25);
  --clean-mint: #34d399;
  --clean-cyan: #06b6d4;

  --warn-amber: #f59e0b;
  --warn-amber-glow: rgba(245, 158, 11, 0.25);

  --toxic-rose: #f43f5e;
  --toxic-rose-glow: rgba(244, 63, 94, 0.25);

  --accent-violet: #8b5cf6;

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'IBM Plex Mono', 'JetBrains Mono', ui-monospace, Menlo, monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --gutter: 28px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background-color: var(--bg-black);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Subtle Quantum Grid Background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(circle at 50% -10%, rgba(16, 185, 129, 0.06) 0%, transparent 65%),
    linear-gradient(to right, rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 100% 100%, 44px 44px, 44px 44px;
  pointer-events: none;
  z-index: 0;
}

.mono { font-family: var(--font-mono); }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; border: none; background: none; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--clean-emerald); outline-offset: 2px; }

/* ==========================================================================
   NAVIGATION BAR
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--gutter);
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
  transition: border-color 0.2s;
}

.top-nav.scrolled {
  border-bottom-color: var(--border-light);
}

.brand-anchor {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #020408;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px var(--clean-emerald-glow);
  transition: transform 0.2s;
}

.brand-anchor:hover .brand-icon {
  transform: scale(1.05);
}

.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-name {
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 7px;
}

.badge-tag {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--clean-emerald);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.28);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Nav Tabs */
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
}

.nav-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.18s;
  white-space: nowrap;
}

.nav-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab-btn.active {
  color: #fff;
  background: var(--bg-surface-3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.nav-tab-btn svg {
  flex-shrink: 0;
  opacity: 0.85;
}

/* Nav Stats Telemetry */
.nav-stats {
  display: flex;
  align-items: center;
  gap: 16px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--clean-emerald);
}

.live-dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--clean-emerald);
  box-shadow: 0 0 8px var(--clean-emerald);
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.8); }
}

.stat-item {
  display: flex;
  flex-direction: column;
  padding-left: 14px;
  border-left: 1px solid var(--border-subtle);
}

.stat-item .lbl {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}

.stat-item .val {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
}

/* Glowing Conic Pills */
@property --glow-angle {
  syntax: '<angle>';
  inherits: true;
  initial-value: 0deg;
}

@keyframes spin-glow {
  to { --glow-angle: 360deg; }
}

.glow-pill {
  --conic-border: conic-gradient(from var(--glow-angle), #10b981, #06b6d4, #8b5cf6, #f43f5e, #10b981);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 15px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-pill);
  background: linear-gradient(#080a0f, #080a0f) padding-box, var(--conic-border) border-box;
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  animation: spin-glow 6s linear infinite;
  white-space: nowrap;
}

.glow-pill::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: var(--conic-border);
  filter: blur(8px);
  opacity: 0.4;
  z-index: -1;
  animation: spin-glow 6s linear infinite;
}

.glow-pill:hover {
  transform: translateY(-1px);
}

.glow-pill:hover::before {
  opacity: 0.75;
}

.glow-pill .pill-tag {
  color: var(--clean-emerald);
  font-family: var(--font-mono);
  font-size: 11px;
}

.glow-pill.copied {
  background: linear-gradient(#064e3b, #064e3b) padding-box, var(--conic-border) border-box;
}

/* Secondary Nav Strip for mobile */
.sub-stats-strip {
  display: none;
  align-items: center;
  gap: 16px;
  padding: 9px var(--gutter);
  background: #040507;
  border-bottom: 1px solid var(--border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}
.sub-stats-strip::-webkit-scrollbar { display: none; }

/* ==========================================================================
   PAGE CONTAINER & VIEWS
   ========================================================================== */
main.terminal-main {
  position: relative;
  z-index: 1;
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px var(--gutter) 60px;
}

.view-section {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.view-section[hidden] {
  display: none !important;
}

/* ==========================================================================
   VIEW 1: SEARCH HERO CARD
   ========================================================================== */
.audit-search-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 30px 36px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(20px);
}

.audit-search-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--clean-emerald), var(--clean-cyan), transparent);
}

.hero-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-headline-group h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
  line-height: 1.2;
}

.hero-headline-group p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 6px;
  max-width: 680px;
}

.search-form-row {
  display: flex;
  gap: 12px;
  position: relative;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-input-wrapper svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-input {
  width: 100%;
  height: 52px;
  padding: 0 20px 0 48px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: #fff;
  transition: all 0.2s;
}

.search-input:focus {
  border-color: var(--clean-emerald);
  box-shadow: 0 0 16px var(--clean-emerald-glow);
}

.btn-audit-submit {
  height: 52px;
  padding: 0 26px;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 4px 18px rgba(5, 150, 105, 0.35);
  white-space: nowrap;
}

.btn-audit-submit:hover {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  box-shadow: 0 0 24px var(--clean-emerald-glow);
  transform: translateY(-1px);
}

.quick-demo-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.quick-demo-row .lbl {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.demo-chip {
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.demo-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--clean-emerald);
  color: #fff;
}

/* ==========================================================================
   CLEANLINESS HERO CARD & RADIAL GAUGE
   ========================================================================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.card-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.card-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title-group h2 {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
}

.card-subtitle {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* Top Dossier Hero */
.dossier-hero {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 28px 32px;
}

.token-avatar-ring {
  width: 78px;
  height: 78px;
  border-radius: 16px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.16);
  background: #06080d;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  position: relative;
}

.token-avatar-ring img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.token-meta-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.token-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.token-title-row h1 {
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}

.token-ticker-badge {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--clean-emerald);
  border: 1px solid var(--border-light);
}

.token-ca-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
}

.btn-copy-address {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
}
.btn-copy-address:hover { color: #fff; border-color: var(--border-light); }

/* Giant Radial Cleanliness Gauge */
.clean-gauge-wrapper {
  display: flex;
  align-items: center;
  gap: 18px;
}

.gauge-svg-box {
  width: 108px;
  height: 108px;
  position: relative;
}

.gauge-svg-box svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.gauge-center-text {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.gauge-center-text .score {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
}

.gauge-center-text .lbl {
  font-size: 9.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.gauge-verdict-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  text-align: right;
}

.verdict-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.verdict-tag.clean {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--clean-emerald);
}

.verdict-tag.warn {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--warn-amber);
}

.verdict-tag.toxic {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: var(--toxic-rose);
}

/* ==========================================================================
   THE 3 PILLARS TRIAD GRID
   ========================================================================== */
.triad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.pillar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s, transform 0.2s;
}

.pillar-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.pillar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pillar-number {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
}

.pillar-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}

.pillar-title-group h3 {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.pillar-title-group p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 3px;
}

.pillar-metric-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.pillar-metric-row .lbl {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}

.pillar-metric-row .val {
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
}

/* Pillar Progress / Visual Meter Bar */
.pillar-meter-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-pill);
  overflow: hidden;
  position: relative;
}

.pillar-meter-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.4s ease-out;
}

.pillar-details-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.pillar-detail-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pillar-detail-item .k { color: var(--text-muted); }
.pillar-detail-item .v { font-family: var(--font-mono); font-weight: 600; color: #fff; }

/* ==========================================================================
   FORENSIC SIGNALS LOG & TABLES
   ========================================================================== */
.duo-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
}

.signals-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.signal-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  line-height: 1.45;
}

.signal-row.good {
  border-left: 3px solid var(--clean-emerald);
  background: rgba(16, 185, 129, 0.03);
}

.signal-row.warn {
  border-left: 3px solid var(--warn-amber);
  background: rgba(245, 158, 11, 0.03);
}

.signal-row.bad {
  border-left: 3px solid var(--toxic-rose);
  background: rgba(244, 63, 94, 0.03);
}

.signal-row b { color: #fff; }

/* Data Tables */
.table-scroll-container {
  overflow-x: auto;
  border-radius: var(--radius-sm);
}

table.forensic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  text-align: left;
}

table.forensic-table th {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
}

table.forensic-table th.r,
table.forensic-table td.r {
  text-align: right;
}

table.forensic-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  white-space: nowrap;
}

table.forensic-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
  color: #fff;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
}

.tag-pill.clean { background: rgba(16, 185, 129, 0.12); color: var(--clean-emerald); }
.tag-pill.warn { background: rgba(245, 158, 11, 0.12); color: var(--warn-amber); }
.tag-pill.toxic { background: rgba(244, 63, 94, 0.12); color: var(--toxic-rose); }
.tag-pill.cyan { background: rgba(6, 182, 212, 0.12); color: var(--clean-cyan); }

.btn-audit-cell {
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--clean-emerald);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-audit-cell:hover {
  background: var(--clean-emerald);
  color: #000;
}

/* ==========================================================================
   RADAR FILTERS & CONTROLS
   ========================================================================== */
.radar-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-chip {
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-chip:hover {
  color: #fff;
  border-color: var(--border-light);
}

.filter-chip.active {
  background: var(--bg-surface-3);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   API MODAL & FOOTER
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(620px, 94vw);
  background: #090c12;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.02);
}

.modal-card-header h3 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.btn-modal-close {
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
}
.btn-modal-close:hover { color: #fff; }

.modal-card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.code-snippet-box {
  background: #020306;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--clean-emerald);
  overflow-x: auto;
  line-height: 1.6;
}

/* Footer */
.terminal-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background: rgba(4, 5, 8, 0.85);
  padding: 24px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-dim);
}

.footer-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  transition: color 0.15s;
}
.footer-link:hover { color: var(--clean-emerald); }

/* Responsive Media Queries */
@media (max-width: 1080px) {
  .triad-grid { grid-template-columns: 1fr; }
  .duo-grid { grid-template-columns: 1fr; }
  .dossier-hero { grid-template-columns: 1fr; text-align: left; }
  .clean-gauge-wrapper { justify-content: flex-start; }
  .nav-stats { display: none; }
  .sub-stats-strip { display: flex; }
}

@media (max-width: 768px) {
  :root { --gutter: 16px; }
  .top-nav { height: auto; padding: 10px var(--gutter); flex-wrap: wrap; gap: 10px; }
  .nav-tabs { order: 3; width: 100%; justify-content: center; }
  .terminal-footer { flex-direction: column; align-items: flex-start; }
}
