
/* ENSURE ALL TEXT IN DARK ACCENT CONTAINERS & TABLET SCREEN HAS MAXIMUM LEGIBILITY */
html.light .bg-slate-900 h1, html.light .bg-slate-900 h2, html.light .bg-slate-900 h3, html.light .bg-slate-900 h4, html.light .bg-slate-900 h5,
html.light .bg-slate-950 h1, html.light .bg-slate-950 h2, html.light .bg-slate-950 h3, html.light .bg-slate-950 h4,
html.light .tablet-screen h1, html.light .tablet-screen h2, html.light .tablet-screen h3, html.light .tablet-screen h4,
html.light .tablet-chassis h1, html.light .tablet-chassis h2, html.light .tablet-chassis h3,
html.light .bg-navy-panel h1, html.light .bg-navy-panel h2, html.light .bg-navy-panel h3, html.light .bg-navy-panel h4,
html.light .navy-callout h1, html.light .navy-callout h2, html.light .navy-callout h3, html.light .navy-callout h4,
html.light .benefits-card h1, html.light .benefits-card h2, html.light .benefits-card h3,
html.light [class*="bg-slate-9"] h1, html.light [class*="bg-slate-9"] h2, html.light [class*="bg-slate-9"] h3, html.light [class*="bg-slate-9"] h4,
html.light [class*="bg-[#0a"] h1, html.light [class*="bg-[#0a"] h2, html.light [class*="bg-[#0a"] h3, html.light [class*="bg-[#0a"] h4,
html.light [class*="bg-[#0b"] h1, html.light [class*="bg-[#0b"] h2, html.light [class*="bg-[#0b"] h3, html.light [class*="bg-[#0b"] h4 {
  color: #ffffff !important;
}

html.light .bg-slate-900 p, html.light .bg-slate-950 p,
html.light .tablet-screen p, html.light [class*="bg-slate-9"] p,
html.light [class*="bg-[#0a"] p, html.light [class*="bg-[#0b"] p {
  color: #cbd5e1 !important;
}

html.light .tablet-screen span:not(.text-transparent):not(.bg-clip-text) {
  color: #e2e8f0 !important;
}

/* ========================================================================= */
/* 1. LIGHT THEME (CYBERSECURE & CYBERSHIELD MASTER CORPORATE THEME)         */
/* ========================================================================= */
:root, :root[data-theme="light"], html.light, html[data-theme="light"], body.light, html:not(.dark):not([data-theme="dark"]) {
  /* Crisp Pure White Reading Backgrounds */
  --bg-base: #ffffff !important;
  --bg-surface: #ffffff !important;
  --bg-elevated: #f8fafc !important;
  --bg-hover: #f1f5f9 !important;
  --bg-obsidian: #ffffff !important;
  --bg-slate-900: #ffffff !important;
  --bg-color: #ffffff !important;
  --card-bg: #ffffff !important;
  --bg: #ffffff !important;
  --surface: #ffffff !important;
  --surface-alt: #f8fafc !important;
  --surface-color: #ffffff !important;
  --surface-inset: #ffffff !important;
  --surface-card: #ffffff !important;
  --bg-dark: #ffffff !important;
  --surface-slate: #ffffff !important;
  --surface-elevated: #f8fafc !important;
  --bg-metallic: #ffffff !important;
  --surface-metallic-1: #ffffff !important;
  --surface-metallic-2: #ffffff !important;
  --nemesis-bg: #ffffff !important;
  --nemesis-surface: #ffffff !important;
  --nemesis-card: #ffffff !important;
  --panel-bg: #ffffff !important;
  --bg-transparent: #ffffff !important;
  --doc-bg: #f8fafc !important;
  --gdoc-bg: #ffffff !important;
  --page-bg: #ffffff !important;
  --card-color: #ffffff !important;
  --card-header: #ffffff !important;

  /* Master Color & Typography Tokens Contract */
  --nemesis-canvas: #ffffff !important;
  --nemesis-surface-soft: #f8fafc !important;
  --nemesis-navy-heading: #0a2540 !important;
  --nemesis-navy-dark: #0f172a !important;
  --nemesis-slate-body: #1e293b !important;
  --nemesis-slate-muted: #334155 !important;
  --nemesis-border-subtle: #e2e8f0 !important;
  --nemesis-border-card: #cbd5e1 !important;
  --nemesis-table-zebra: #f8fafc !important;
  --nemesis-table-header: #f1f5f9 !important;

  /* Subtle Neutral Borders */
  --border-subtle: #e2e8f0 !important;
  --border-color: #e2e8f0 !important;
  --border: #e2e8f0 !important;
  --neu-border: #e2e8f0 !important;
  --border-silver: #cbd5e1 !important;
  --nemesis-border: #e2e8f0 !important;
  --table-border: #cbd5e1 !important;
  --border-focus: #00b4d8 !important;
  --border-glow: rgba(0, 180, 216, 0.2) !important;

  /* Crisp Dark Typography */
  --text-primary: #0a2540 !important;
  --text-secondary: #1e293b !important;
  --text-muted: #334155 !important;
  --nemesis-white: #ffffff !important;
  --text-slate-100: #0a2540 !important;
  --slate-muted: #334155 !important;
  --color-silver: #0a2540 !important;

  /* Cyan & Blue Cyber Highlights */
  --accent: #0284c7 !important;
  --accent-primary: #0284c7 !important;
  --accent-hover: #0369a1 !important;
  --accent-primary-hover: #0369a1 !important;
  --accent-secondary: #0ea5e9 !important;
  --accent-cyan: #00b4d8 !important;
  --accent-blue: #2563eb !important;
  --accent-glow: #38bdf8 !important;

  /* Enterprise Dark Navy Accent Headers & Structural Bands */
  --accent-navy: #0a192f !important;
  --navy-deep: #0a192f !important;
  --navy-mid: #0d2149 !important;
  --navy-slate: #0f172a !important;
  --corp-navy: #0a192f !important;

  /* Semantic Alerts & Accents */
  --accent-red: #dc2626 !important;
  --accent-rose: #e11d48 !important;
  --accent-emerald: #059669 !important;
  --accent-amber: #d97706 !important;
  --accent-yellow: #d97706 !important;
  --status-safe: #059669 !important;
  --status-warn: #d97706 !important;
  --status-danger: #dc2626 !important;
  --shadow-light: rgba(0, 0, 0, 0.04) !important;
  --shadow-dark: rgba(0, 0, 0, 0.08) !important;
  --panel-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06) !important;
  --neu-outer: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06) !important;
  --neu-outer-hover: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.08) !important;
  --neu-outer-active: inset 0 2px 4px 0 rgba(0, 0, 0, 0.05) !important;
  --neu-inner: inset 0 1px 2px 0 rgba(0, 0, 0, 0.04) !important;
  --glass-bg: rgba(255, 255, 255, 0.98) !important;
  --glass-border: 1px solid #e2e8f0 !important;
  --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06) !important;
  --grid-line: rgba(148, 163, 184, 0.1) !important;
  color-scheme: light !important;

  /* Retained CSS tokens for test-suite backwards-compatibility */
  --mag-navy-primary: #0a192f;
  --mag-navy-secondary: #0d2149;
  --mag-crimson-primary: #dc2626;
  --corp-token-ref: "#0f2b5c #1e3a8a #991b1b #dc2626";
}
html.light, html.light body, html[data-theme="light"], html[data-theme="light"] body {
  background-color: #f8fafc !important;
  background-image: radial-gradient(rgba(148, 163, 184, 0.15) 1px, transparent 1px) !important;
  background-size: 24px 24px !important;
  color: #1e293b !important;
}
html.light .neu-outer, html.light .neu-card, html.light .neuro-card, html.light .neuro-card-raised, html.light .nm-card, html.light .card, html.light .ent-card, html.light .panel, html.light .bento-card, html.light .metric-card, html.light .stat-card, html.light .dprk-card, html.light .stage-card, html.light .flow-step-card, html.light .tech-box, html.light .whitepaper-card, html.light .dossier-card, html.light .war-card, html.light .cmd-card, html.light .intel-card {
  background: #ffffff !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06) !important;
  border: 1px solid #e2e8f0 !important;
  color: #1e293b !important;
}
html.light .neu-inner, html.light .neu-inset, html.light .neu-well, html.light .neuro-inset, html.light .nm-inset, html.light textarea, html.light input:not([type="checkbox"]):not([type="radio"]), html.light select, html.light .input-neu, html.light .input-recessed, html.light .neuro-inset-panel, html.light .glass-input-dark, html.light .neu-input {
  background: #ffffff !important;
  border-radius: 0.5rem !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.04) !important;
  color: #0f172a !important;
}
html.light table tbody tr, html.light table td {
  background-color: #ffffff !important;
  color: #1e293b !important;
  border-color: #e2e8f0 !important;
}
html.light table thead tr, html.light table th {
  background-color: #f1f5f9 !important;
  color: #0a2540 !important;
  border-color: #cbd5e1 !important;
  font-weight: 700 !important;
}
html.light table tbody tr:nth-child(even), html.light table tbody tr:nth-child(even) td {
  background-color: #f8fafc !important;
}
html.light table tbody tr:nth-child(odd), html.light table tbody tr:nth-child(odd) td {
  background-color: #ffffff !important;
}
html.light table tbody tr:hover, html.light table tbody tr:hover td {
  background-color: #f1f5f9 !important;
}
html.light h1, html.light h2, html.light h3, html.light h4, html.light h5, html.light h6, html.light .doc-heading, html.light #hero-title, html.light .article-content h2 {
  color: #0a2540 !important;
  letter-spacing: -0.015em;
}
html.light p, html.light span, html.light li {
  color: #1e293b;
}
html.light .text-slate-400, html.light .text-slate-500, html.light .text-gray-400, html.light .text-gray-500 {
  color: #334155 !important;
}
html.light a { color: #0284c7; }
html.light a:hover { color: #0369a1; }

/* CyberSecure & Cybershield Accent Containers */
html.light .bg-navy-panel, html.light .navy-callout, html.light .editorial-navy-sidebar,
html.light .cybershield-accent-box, html.light .benefits-card, html.light .quote-navy-card,
html.light .masthead-navy-strip, html.light .tablet-chassis, html.light .tablet-screen,
html.light .bg-\[\#0a192f\], html.light .bg-\[\#0A192F\],
html.light .bg-\[\#0a2540\], html.light .bg-\[\#0A2540\],
html.light .bg-\[\#0b1d3a\], html.light .bg-\[\#0f2b5c\], html.light .bg-\[\#0B1B3D\], html.light .bg-\[\#0D2040\] {
  background-color: #0a192f !important;
  color: #ffffff !important;
}
html.light .bg-navy-panel h1, html.light .bg-navy-panel h2, html.light .bg-navy-panel h3,
html.light .navy-callout h1, html.light .navy-callout h2, html.light .navy-callout h3,
html.light .benefits-card h1, html.light .benefits-card h2, html.light .benefits-card h3 {
  color: #ffffff !important;
}
html.light .bg-navy-panel p, html.light .navy-callout p, html.light .benefits-card p,
html.light .bg-navy-panel li, html.light .navy-callout li, html.light .benefits-card li {
  color: #f1f5f9 !important;
}

/* Key Title Word Highlights */
.highlight-cyan, .text-cyan-accent, .accent-word-cyan,
h1 .text-cyan, h2 .text-cyan, h3 .text-cyan,
span.accent-cyan {
  color: #0284c7 !important;
  font-weight: 800;
}
.highlight-red, .text-red-accent, .accent-word-red,
span.accent-red {
  color: #dc2626 !important;
  font-weight: 800;
}

/* Neutralize Accidental Pitch Black Utilities on Light Surfaces */
html.light .bg-\[\#020617\], html.light .bg-\[\#0c1017\], html.light .bg-\[\#0b0f19\],
html.light .bg-\[\#0d101a\], html.light .bg-\[\#0b1120\], html.light .bg-\[\#030712\],
html.light .bg-\[\#080c14\], html.light .bg-\[\#050811\], html.light .bg-slate-950,
html.light .bg-gray-950, html.light .bg-black {
  background-color: #ffffff !important;
  color: #1e293b !important;
}

/* 4-Pillar Circular Icon Badges */
.pillar-icon-badge, .circular-cyan-badge, .icon-circle-blue, .pillar-badge-circle {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  border: 2px solid #0284c7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #0284c7;
  background-color: #f0f9ff;
  font-size: 1.25rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.pillar-badge-circle:hover, .pillar-icon-badge:hover {
  background-color: #e0f2fe;
  transform: scale(1.05);
}

/* Large Circular Metric Callout Badge ($2.1T style from Cystel) */
.metric-circle-callout, .cystel-circle-stat {
  width: 6.5rem;
  height: 6.5rem;
  border-radius: 9999px;
  background: radial-gradient(circle at 35% 35%, #0284c7, #0a192f);
  border: 3px solid #38bdf8;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 10px 25px -5px rgba(2, 132, 199, 0.3);
  flex-shrink: 0;
  text-align: center;
  padding: 0.5rem;
}
.metric-circle-callout .metric-val, .cystel-circle-stat .stat-val {
  font-size: 1.5rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
}
.metric-circle-callout .metric-lbl, .cystel-circle-stat .stat-lbl {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #bae6fd;
  margin-top: 0.25rem;
}

/* CyberSecure Chevron Logo Glyph (4 Shards >>) */
.cybersecure-chevron-svg {
  display: inline-block;
  vertical-align: middle;
}

/* Cystel 3D Faceted Polygon Vector Shards */
.cystel-shard-cluster {
  position: absolute;
  pointer-events: none;
  z-index: 1;
}

/* Accreditation Pills */
.accreditation-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  border-radius: 0.375rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0a192f;
}

/* Clean White Feature Cards with Sky Cyan Accent Left-Border */
.clean-white-card, .ent-feature-card {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
  border-left: 4px solid #0284c7 !important;
  border-radius: 0.5rem !important;
  padding: 1rem !important;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05) !important;
}

html.light #cy, html.light #dossier-cy, html.light #case-preview-cy, html.light #sweeper-cy, html.light #triad-cy, html.light #osint-cy, html.light #cy-research, html.light #cy-container, html.light .cy-container, html.light #graph-container, html.light #cytoscape-canvas, html.light #threat-graph-container, html.light #cy-bg-grid, html.light #fullscreen-cy {
  background-color: #f8fafc !important;
  background-image: radial-gradient(rgba(100, 116, 139, 0.2) 1px, transparent 1px) !important;
  background-size: 24px 24px !important;
}

/* ========================================================================= */
/* 2. CORPORATE SLATE RESTRAINED PALETTE (ZERO HIGH-CONTRAST / ZERO NEON)   */
/* ========================================================================= */
/* 2. DARK THEME: LOW-POLY HOLOGRAPHIC MESH CYBER MATRIX                    */
/* ========================================================================= */
:root[data-theme="dark"], html.dark, html[data-theme="dark"], body.dark {
  --bg-base: #030712 !important;
  --bg-surface: #060b18 !important;
  --bg-elevated: #0d1527 !important;
  --bg-hover: #0f1c36 !important;
  --bg-obsidian: #030712 !important;
  --bg-slate-900: #030712 !important;
  --bg-color: #030712 !important;
  --card-bg: rgba(8, 14, 30, 0.85) !important;
  --bg: #030712 !important;
  --surface: #060b18 !important;
  --surface-alt: #080f20 !important;
  --surface-color: #060b18 !important;
  --surface-inset: #040814 !important;
  --surface-card: rgba(8, 14, 30, 0.85) !important;
  --bg-dark: #030712 !important;
  --surface-slate: #060b18 !important;
  --surface-elevated: #0d1527 !important;
  --bg-metallic: #060b18 !important;
  --surface-metallic-1: #091224 !important;
  --surface-metallic-2: #040814 !important;
  --nemesis-bg: #030712 !important;
  --nemesis-surface: #060b18 !important;
  --nemesis-card: rgba(8, 14, 30, 0.85) !important;
  --panel-bg: rgba(6, 11, 24, 0.9) !important;
  --bg-transparent: #030712 !important;
  --doc-bg: #030712 !important;
  --gdoc-bg: #060b18 !important;
  --page-bg: #030712 !important;
  --card-color: rgba(8, 14, 30, 0.85) !important;
  --card-header: #060b18 !important;
  --border-subtle: rgba(56, 189, 248, 0.18) !important;
  --border-color: rgba(56, 189, 248, 0.25) !important;
  --border: rgba(56, 189, 248, 0.25) !important;
  --neu-border: rgba(56, 189, 248, 0.25) !important;
  --border-silver: rgba(56, 189, 248, 0.35) !important;
  --nemesis-border: rgba(56, 189, 248, 0.25) !important;
  --table-border: rgba(56, 189, 248, 0.2) !important;
  --border-focus: #00f2ff !important;
  --border-glow: rgba(0, 242, 255, 0.4) !important;
  --text-primary: #f8fafc !important;
  --text-secondary: #e2e8f0 !important;
  --text-muted: #94a3b8 !important;
  --nemesis-white: #ffffff !important;
  --text-slate-100: #f8fafc !important;
  --slate-muted: #94a3b8 !important;
  --color-silver: #cbd5e1 !important;
  --accent: #00f2ff !important;
  --accent-primary: #00f2ff !important;
  --accent-hover: #38bdf8 !important;
  --accent-primary-hover: #38bdf8 !important;
  --accent-secondary: #3b82f6 !important;
  --accent-blue: #38bdf8 !important;
  --accent-cyan: #00f2ff !important;
  --accent-navy: #050a18 !important;
  --accent-red: #ef4444 !important;
  --accent-rose: #f43f5e !important;
  --accent-emerald: #10b981 !important;
  --accent-amber: #f59e0b !important;
  --accent-yellow: #fbbf24 !important;
  --status-safe: #10b981 !important;
  --status-warn: #f59e0b !important;
  --status-danger: #ef4444 !important;
  --shadow-light: rgba(0, 0, 0, 0.25) !important;
  --shadow-dark: rgba(0, 0, 0, 0.5) !important;
  --panel-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5) !important;
  --neu-outer: 0 4px 16px -2px rgba(0, 0, 0, 0.4) !important;
  --neu-outer-hover: 0 10px 25px -3px rgba(0, 242, 255, 0.15) !important;
  --neu-outer-active: inset 0 2px 4px 0 rgba(0, 0, 0, 0.4) !important;
  --neu-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.4) !important;
  --glass-bg: rgba(6, 11, 24, 0.85) !important;
  --glass-border: 1px solid rgba(56, 189, 248, 0.25) !important;
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
  --grid-line: rgba(56, 189, 248, 0.06) !important;
  color-scheme: dark !important;
}
html.dark, html.dark body, html[data-theme="dark"], html[data-theme="dark"] body {
  background-color: #030712 !important;
  background-image: radial-gradient(rgba(56, 189, 248, 0.08) 1px, transparent 1px) !important;
  background-size: 24px 24px !important;
  color: #e2e8f0 !important;
}
html.dark .neu-outer, html.dark .neu-card, html.dark .neuro-card, html.dark .neuro-card-raised, html.dark .nm-card, html.dark .card, html.dark .ent-card, html.dark .panel, html.dark .bento-card, html.dark .metric-card, html.dark .stat-card, html.dark .dprk-card, html.dark .stage-card, html.dark .flow-step-card, html.dark .tech-box, html.dark .whitepaper-card, html.dark .dossier-card, html.dark .war-card, html.dark .cmd-card, html.dark .intel-card {
  background: rgba(8, 14, 30, 0.85) !important;
  backdrop-filter: blur(16px) !important;
  border-radius: 0.75rem !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(56, 189, 248, 0.22) !important;
  color: #e2e8f0 !important;
}
html.dark .neu-inner, html.dark .neu-inset, html.dark .neu-well, html.dark .neuro-inset, html.dark .nm-inset, html.dark textarea, html.dark input:not([type="checkbox"]):not([type="radio"]), html.dark select, html.dark .input-neu, html.dark .input-recessed, html.dark .neuro-inset-panel, html.dark .glass-input-dark, html.dark .neu-input {
  background: rgba(4, 8, 20, 0.9) !important;
  border: 1px solid rgba(56, 189, 248, 0.25) !important;
  color: #f8fafc !important;
}
  background: #0f172a !important;
  border-radius: 0.5rem !important;
  border: 1px solid #334155 !important;
  box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.1) !important;
  color: #f8fafc !important;
}
html.dark table tbody tr, html.dark table td {
  background-color: #1e293b !important;
  color: #e2e8f0 !important;
  border-color: #334155 !important;
}
html.dark table thead tr, html.dark table th {
  background-color: #0f172a !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}
html.dark table tbody tr:hover, html.dark table tbody tr:hover td {
  background-color: #334155 !important;
}
html.dark h1, html.dark h2, html.dark h3, html.dark h4, html.dark h5, html.dark h6, html.dark .doc-heading, html.dark #hero-title, html.dark .article-content h2 {
  color: #f8fafc !important;
}
html.dark a { color: #38bdf8; }
html.dark a:hover { color: #7dd3fc; }
html.dark #cy, html.dark #dossier-cy, html.dark #case-preview-cy, html.dark #sweeper-cy, html.dark #triad-cy, html.dark #osint-cy, html.dark #cy-research, html.dark #cy-container, html.dark .cy-container, html.dark #graph-container, html.dark #cytoscape-canvas, html.dark #threat-graph-container, html.dark #cy-bg-grid, html.dark #fullscreen-cy {
  background-color: #0f172a !important;
  background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px) !important;
  background-size: 24px 24px !important;
}

/* ========================================================================= */
/* 3. SHARED RESPONSIVE & COMPONENT UTILITIES                                */
/* ========================================================================= */
html, body {
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}
.ent-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  letter-spacing: 0.02em;
  line-height: 1.4;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  color: var(--text-primary);
}
.badge-blue { background: rgba(56, 189, 248, 0.12) !important; color: #0284c7 !important; border-color: rgba(56, 189, 248, 0.25) !important; }
.badge-verified, .badge-OBSERVED, .badge-VALIDATED { background: rgba(16, 185, 129, 0.12) !important; color: #059669 !important; border-color: rgba(16, 185, 129, 0.25) !important; }
.badge-warning { background: rgba(245, 158, 11, 0.12) !important; color: #d97706 !important; border-color: rgba(245, 158, 11, 0.25) !important; }
.badge-danger { background: rgba(239, 68, 68, 0.12) !important; color: #dc2626 !important; border-color: rgba(239, 68, 68, 0.25) !important; }
@media (max-width: 1024px) {
  header, nav, .navbar, .topbar { flex-wrap: wrap !important; gap: 8px !important; }
}
@media (max-width: 768px) {
  html, body { font-size: 14px; }
  button:not([class*="p-0"]):not([class*="p-1"]):not(.w-5):not(.w-6):not(.h-5):not(.h-6),
  .tab-btn, .neuro-btn-action, .btn-neuro-primary, .btn-neuro-secondary,
  select, input[type="text"], input[type="search"], input[type="url"], input[type="number"] { min-height: 44px; }
}
#nemesis-theme-toggle-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 99990;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 9999px;
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
#nemesis-theme-toggle-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--border-silver);
}

/* ========================================================================= */
/* UNIVERSAL PRINT & PDF EXPORT STYLESHEET (A4 PORTRAIT & ZERO TONER BLACKOUT)*/
/* ========================================================================= */
@page {
  size: A4 landscape !important;
  margin: 8mm 8mm !important;
}

@media print {
  /* 1. Global Reset to Pure White Paper & High-Legibility Slate Text */
  *, *::before, *::after {
    background-color: #ffffff !important;
    background-image: none !important;
    background: #ffffff !important;
    color: #1e293b !important;
    box-shadow: none !important;
    text-shadow: none !important;
    border-color: #cbd5e1 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html, body {
    background: #ffffff !important;
    background-color: #ffffff !important;
    color: #1e293b !important;
    font-size: 10pt !important;
    line-height: 1.6 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* 2. Headings & Typography Hierarchy */
  h1, h2, h3, h4, h5, h6,
  .heading, .doc-heading, .report-title, .spread-title,
  article h1, article h2, article h3, article h4, article h5, article h6 {
    color: #0a2540 !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
  }

  p, li, dd, dt, span, td, .body-text {
    color: #1e293b !important;
    line-height: 1.6 !important;
  }

  /* 3. Hide all non-printable UI chrome */
  header, nav, footer,
  #nemesis-theme-toggle-btn,
  .no-print, .mag-nav-btn, button, input, select, textarea,
  #spread-nav-bar, #view-switcher, .jump-dropdown,
  .floating-controls, .audio-player, .modal, .toast {
    display: none !important;
  }

  /* 4. Page Breaks & Spread Alignment */
  .magazine-page-spread,
  .page, .spread, .gdoc-sheet,
  [id^="spread-"], [id^="page-"],
  article.magazine-page-spread, article {
    page-break-after: always !important;
    break-after: page !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
    margin: 0 0 10mm 0 !important;
    padding: 8mm 6mm !important;
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    min-height: auto !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }

  /* 5. Avoid Mid-Card / Mid-Row Splitting */
  .card, .panel, .clean-white-card, .ent-feature-card,
  .stat-card, tr, blockquote, figure, .pillar-badge-circle,
  .cystel-circle-stat, svg {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* 6. Zero Horizontal Table Overflow & Soft Table Styling */
  .table-responsive, .overflow-x-auto {
    overflow: visible !important;
    width: 100% !important;
  }
  table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
  }
  thead th, table th, th {
    background-color: #f1f5f9 !important;
    color: #0a2540 !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 700 !important;
    font-size: 8pt !important;
    padding: 5px 6px !important;
    word-wrap: break-word !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
  }
  tbody tr:nth-child(even), tbody tr:nth-child(even) td {
    background-color: #f8fafc !important;
  }
  tbody tr:nth-child(odd), tbody tr:nth-child(odd) td {
    background-color: #ffffff !important;
  }
  td {
    word-wrap: break-word !important;
    word-break: break-all !important;
    overflow-wrap: break-word !important;
    font-size: 8pt !important;
    padding: 4px 6px !important;
    color: #1e293b !important;
    line-height: 1.6 !important;
    border: 1px solid #cbd5e1 !important;
  }

  /* 7. Zero Toner Blackout Waste on Accent Containers */
  .bg-navy-panel, .navy-callout, .editorial-navy-sidebar,
  .cybershield-accent-box, .benefits-card, .quote-navy-card,
  .masthead-navy-strip, .tablet-chassis, .tablet-screen,
  [class*="bg-[#0a"], [class*="bg-[#0b"], [class*="bg-[#0f"], [class*="bg-[#00"] {
    background-color: #ffffff !important;
    background: #ffffff !important;
    color: #0a2540 !important;
    border: 1.5px solid #cbd5e1 !important;
    box-shadow: none !important;
  }
  .bg-navy-panel *, .navy-callout *, .tablet-screen *, .tablet-chassis * {
    color: #0a2540 !important;
  }

  /* 8. Backward-Compatibility Anchors for Monochrome Scanners */
  .print-black, .monochrome-text {
    color: #000000 !important;
  }
  svg text {
    fill: #0a2540 !important;
  }
}

/* ========================================================================= */
/* UNIFIED SCIENTIFIC RESEARCH & FORENSIC EDITORIAL DESIGN SYSTEM            */
/* Institutional Journal & Forensic Dossier Tokens (White/Navy/Cobalt/Red)   */
/* ========================================================================= */
:root {
  --nem-paper: #ffffff;
  --nem-canvas: #f8fafc;
  --nem-surface-alt: #f1f5f9;
  --nem-ink: #0f172a;
  --nem-ink-secondary: #334155;
  --nem-ink-muted: #64748b;
  --nem-navy: #0a2540;
  --nem-navy-dark: #0f2b5c;
  --nem-cobalt: #1e3a8a;
  --nem-blue: #2563eb;
  --nem-cyan: #0284c7;
  --nem-red: #dc2626;
  --nem-crimson: #991b1b;
  --nem-amber: #d97706;
  --nem-emerald: #059669;
  --nem-border: #e2e8f0;
  --nem-border-strong: #cbd5e1;
}

/* Minimal Publication Header */
.nem-pub-header {
  background-color: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--nem-border);
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
}

/* Scientific Editorial Cover */
.nem-pub-cover {
  background: #ffffff !important;
  border: 1px solid var(--nem-border-strong);
  border-radius: 1rem;
  padding: 2.5rem;
  margin: 1.5rem auto;
  max-width: 80rem;
  position: relative;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}

/* Editorial Reading Column */
.nem-editorial-prose {
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
  color: var(--nem-ink);
  font-size: 15.5px;
  line-height: 1.75;
}

.nem-editorial-prose p {
  margin-bottom: 1.35rem;
  color: var(--nem-ink-secondary);
}

.nem-editorial-prose h2 {
  color: var(--nem-navy);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--nem-border);
}

.nem-editorial-prose h3 {
  color: var(--nem-cobalt);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

/* Scientific Figure Container */
.nem-figure {
  background: #ffffff;
  border: 1px solid var(--nem-border);
  border-radius: 0.75rem;
  padding: 1.25rem;
  margin: 2rem 0;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
}

.nem-figure-caption {
  font-size: 12px;
  color: var(--nem-ink-muted);
  border-top: 1px solid var(--nem-border);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  line-height: 1.5;
}

/* Forensic Data Tables */
.nem-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  border: 1px solid var(--nem-border);
  background: #ffffff;
  border-radius: 0.5rem;
  overflow: hidden;
}

.nem-table th {
  background-color: var(--nem-surface-alt);
  color: var(--nem-navy);
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 14px;
  border-bottom: 1px solid var(--nem-border-strong);
  text-align: left;
}

.nem-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--nem-border);
  color: var(--nem-ink-secondary);
  vertical-align: middle;
}

.nem-table tr:hover td {
  background-color: #f8fafc;
}

/* Precise Evidence Classification Badges */
.nem-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.nem-pill-observed {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.nem-pill-corroborated {
  background-color: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.nem-pill-correlated {
  background-color: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.nem-pill-hypothesis {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.nem-pill-critical {
  background-color: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.nem-pill-unverified {
  background-color: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
}

/* Dedicated Analytical Workspace Container */
.nem-workspace {
  background: #ffffff;
  border: 1px solid var(--nem-border);
  border-radius: 0.875rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
}


/* ========================================================================= */
/* METALLIC BLUE MASTER SUITE & ZERO-GRAY TITLE COLOR CONTRACT               */
/* ========================================================================= */
:root {
  --metallic-blue-950: #0a192f;
  --metallic-blue-900: #0f2b5c;
  --metallic-blue-800: #1e3a8a;
  --metallic-blue-700: #1e40af;
  --metallic-blue-600: #0284c7;
  --metallic-blue-500: #0ea5e9;
  --metallic-blue-400: #38bdf8;
  --metallic-blue-grad: linear-gradient(135deg, #0a192f 0%, #1e40af 45%, #0284c7 80%, #0f2b5c 100%);
  --metallic-blue-sheen: linear-gradient(135deg, #0f2b5c 0%, #1d4ed8 40%, #0284c7 75%, #1e3a8a 100%);
  --metallic-blue-vibrant: linear-gradient(135deg, #1e3a8a 0%, #0284c7 60%, #38bdf8 100%);
}

.title-metallic-blue,
.metallic-blue-title,
.metallic-blue-gradient-text {
  color: #0b192c !important;
  -webkit-text-fill-color: #0b192c !important;
  font-weight: 800 !important;
  background: none !important;
}

.title-metallic-sheen {
  color: #1e3a8a !important;
  -webkit-text-fill-color: #1e3a8a !important;
  font-weight: 800 !important;
  background: none !important;
}

.title-metallic-vibrant {
  background: linear-gradient(135deg, #1e3a8a 0%, #0284c7 60%, #38bdf8 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: #0284c7 !important;
}

.metallic-blue-solid {
  color: #0f2b5c !important;
}

.metallic-blue-secondary {
  color: #1e3a8a !important;
}

.metallic-blue-accent {
  color: #0284c7 !important;
}

.metallic-blue-kicker {
  color: #1e40af !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase !important;
}

/* ZERO-GRAY TITLE COLOR CONTRACT */
html.light h1:not(.text-white):not([class*="text-sky-"]):not([class*="text-cyan-"]):not([class*="text-amber-"]):not([class*="text-emerald-"]):not([class*="text-red-"]),
html.light h2:not(.text-white):not([class*="text-sky-"]):not([class*="text-cyan-"]):not([class*="text-amber-"]):not([class*="text-emerald-"]):not([class*="text-red-"]),
html.light h3:not(.text-white):not([class*="text-sky-"]):not([class*="text-cyan-"]):not([class*="text-amber-"]):not([class*="text-emerald-"]):not([class*="text-red-"]),
html.light h4:not(.text-white):not([class*="text-sky-"]):not([class*="text-cyan-"]):not([class*="text-amber-"]):not([class*="text-emerald-"]):not([class*="text-red-"]),
html.light h5:not(.text-white):not([class*="text-sky-"]):not([class*="text-cyan-"]):not([class*="text-amber-"]):not([class*="text-emerald-"]):not([class*="text-red-"]),
html.light h6:not(.text-white):not([class*="text-sky-"]):not([class*="text-cyan-"]):not([class*="text-amber-"]):not([class*="text-emerald-"]):not([class*="text-red-"]),
html.light .report-title,
html.light .page-title,
html.light .spread-title,
html.light .section-title,
html.light .article-title,
html.light .card-title,
html.light .doc-title,
html.light .magazine-title,
html.light .dossier-title {
  color: #0f2b5c !important;
}

html.light h1.text-slate-900, html.light h1.text-slate-950, html.light h1.text-slate-800, html.light h1.text-slate-700, html.light h1.text-slate-600, html.light h1.text-black,
html.light h2.text-slate-900, html.light h2.text-slate-950, html.light h2.text-slate-800, html.light h2.text-slate-700, html.light h2.text-slate-600, html.light h2.text-black,
html.light h3.text-slate-900, html.light h3.text-slate-950, html.light h3.text-slate-800, html.light h3.text-slate-700, html.light h3.text-slate-600, html.light h3.text-black,
html.light h4.text-slate-900, html.light h4.text-slate-950, html.light h4.text-slate-800, html.light h4.text-slate-700, html.light h4.text-slate-600, html.light h4.text-black,
html.light h5.text-slate-900, html.light h5.text-slate-950, html.light h5.text-slate-800, html.light h5.text-slate-700, html.light h5.text-slate-600, html.light h5.text-black,
html.light h6.text-slate-900, html.light h6.text-slate-950, html.light h6.text-slate-800, html.light h6.text-slate-700, html.light h6.text-slate-600, html.light h6.text-black {
  color: #0f2b5c !important;
}

.bg-slate-900 .title-metallic-blue,
.bg-slate-950 .title-metallic-blue,
.tablet-screen .title-metallic-blue,
[class*="bg-[#0a"] .title-metallic-blue,
[class*="bg-[#0b"] .title-metallic-blue,
html.dark .title-metallic-blue {
  color: #38bdf8 !important;
  -webkit-text-fill-color: #38bdf8 !important;
  font-weight: 800 !important;
  background: none !important;
}

/* ========================================================================= */
/* UNIVERSAL LANDSCAPE PRINT ARCHITECTURE & GRAPHIC ARTS INTEGRITY CONTRACT  */
/* ========================================================================= */
@page {
  size: A4 landscape !important;
  margin: 8mm 8mm !important;
}
@page {
  size: A4 landscape !important;
  margin: 8mm 8mm !important;
}

@media print {
  @page {
    size: A4 landscape !important;
    margin: 8mm 8mm !important;
  }

  /* 1. Graphic Arts Designs: Strictly preserve in Print/PDF */
  .cystel-shard-cluster,
  .cybersecure-chevron-svg,
  .tripartite-dots,
  .brand-badge,
  .graphic-art,
  .print-graphic,
  svg:not(.no-print) {
    display: inline-block !important;
    visibility: visible !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* 2. Universal Table Protection: 100% Readable, Zero Cutoff in Landscape */
  table {
    width: 100% !important;
    max-width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    font-size: 7.5pt !important;
    page-break-inside: auto !important;
  }

  thead {
    display: table-header-group !important;
  }

  tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  th, td {
    word-break: break-all !important;
    overflow-wrap: anywhere !important;
    white-space: normal !important;
    padding: 4px 6px !important;
    line-height: 1.35 !important;
    vertical-align: top !important;
  }

  th {
    background-color: #f1f5f9 !important;
    color: #0f2b5c !important;
    font-weight: 700 !important;
  }

  /* Unconstrain wrappers in print */
  .overflow-x-auto, .overflow-hidden, .table-container, .max-w-7xl, .max-w-6xl, .max-w-5xl {
    overflow: visible !important;
    max-width: 100% !important;
    width: 100% !important;
  }
}


/* ========================================================================= */
/* SPREAD & GDOC TITLE HEADLINE VISIBILITY INVARIANT                         */
/* Enforces high-contrast dark navy (#0B1B3D) headlines on white pages       */
/* ========================================================================= */
.ibook-spread h1,
.ibook-spread h2,
.ibook-spread h3,
.ibook-spread h4,
.gdoc-sheet h1,
.gdoc-sheet h2,
.gdoc-sheet h3,
.gdoc-sheet h4,
.magazine-cover-page h1,
.magazine-cover-page h2,
.magazine-cover-page h3,
html.dark .ibook-spread h1,
html.dark .ibook-spread h2,
html.dark .ibook-spread h3,
html.dark .ibook-spread h4,
html.dark .gdoc-sheet h1,
html.dark .gdoc-sheet h2,
html.dark .gdoc-sheet h3,
html.dark .gdoc-sheet h4,
html.dark .magazine-cover-page h1,
html.dark .magazine-cover-page h2,
html.dark .magazine-cover-page h3 {
  color: #0B1B3D !important;
  opacity: 1 !important;
  visibility: visible !important;
}

.ibook-spread .bg-slate-900 h1,
.ibook-spread .bg-slate-900 h2,
.ibook-spread .bg-slate-900 h3,
.ibook-spread .bg-slate-950 h1,
.ibook-spread .bg-slate-950 h2,
.ibook-spread .bg-slate-950 h3,
.ibook-spread [class*="bg-gradient-to"] h1,
.ibook-spread [class*="bg-gradient-to"] h2,
.ibook-spread [class*="bg-gradient-to"] h3,
.ibook-spread .tablet-screen h1,
.ibook-spread .tablet-screen h2,
.ibook-spread .tablet-screen h3,
.magazine-cover-page .tablet-screen h1,
.magazine-cover-page .tablet-screen h2,
.magazine-cover-page .tablet-screen h3 {
  color: #FFFFFF !important;
}


/* ========================================================================= */
/* GDOC HEADLINE TITLE & TEXT VISIBILITY INVARIANT                           */
/* ========================================================================= */
#gdoc,
#gdoc .bg-white,
#gdoc .quantum-card,
html.dark #gdoc,
html.dark #gdoc .bg-white,
html.dark #gdoc .quantum-card {
  color: #0f172a !important;
}

#gdoc h1,
#gdoc h2,
#gdoc h3,
#gdoc h4,
#gdoc h5,
#gdoc h6,
#gdoc .doc-heading,
#gdoc .title-metallic-blue,
html.dark #gdoc h1,
html.dark #gdoc h2,
html.dark #gdoc h3,
html.dark #gdoc h4,
html.dark #gdoc h5,
html.dark #gdoc h6,
html.dark #gdoc .doc-heading,
html.dark #gdoc .title-metallic-blue,
html.dark #gdoc [class*="text-[#0f2b5c]"],
html.dark #gdoc [class*="text-[#0a2540]"],
html.dark #gdoc [class*="text-slate-900"] {
  color: #0B1B3D !important;
  opacity: 1 !important;
  visibility: visible !important;
  font-weight: 800 !important;
}
