/* ==========================================================================
   DECKY CAP — Option B: Technical Monograph & Aerospace Paper Design System
   Academic Whitepaper Aesthetics · Precision Grids · Mathematical Telemetry
   ========================================================================== */

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

/* ── Inktrap Typography Definition ── */
@font-face {
  font-family: 'Malinton Display';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: local('Malinton Display'), local('MalintonDisplay'), local('Malinton-Display'), local('Malinton'), local('Malinton Bold');
}

:root {
  /* ── Option B: Monograph Light (Default / Whitepaper) ── */
  --bg: #fbfbf9;
  --bg-surface: #ffffff;
  --bg-raised: #f3f4f6;
  --bg-subtle: #f8fafc;
  --bg-grid: #f1f5f9;
  --border: #e2e8f0;
  --border-subtle: #f1f5f9;
  --border-strong: #cbd5e1;
  
  --accent: #0284c7;           /* Blueprint Cyan */
  --accent-hover: #0369a1;
  --accent-dim: rgba(2, 132, 199, 0.08);
  --accent-alt: #1d4ed8;       /* Defense Cobalt */
  --accent-amber: #d97706;     /* Telemetry Amber */
  --accent-emerald: #059669;   /* Status Green */
  
  --text-primary: #0f172a;     /* Monograph Ink */
  --text-secondary: #475569;   /* Technical Slate */
  --text-muted: #64748b;
  --text-code: #0369a1;
  
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 24px -4px rgba(15, 23, 42, 0.04);
  --card-shadow-hover: 0 12px 32px -4px rgba(2, 132, 199, 0.12), 0 0 0 1px rgba(2, 132, 199, 0.25);
  --grid-dot: rgba(15, 23, 42, 0.045);

  /* ── Typography (Inktrap Aerospace Monograph) ── */
  --font-heading: 'Malinton Display', 'Malinton', 'Plus Jakarta Sans', 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Malinton Display', 'Malinton', 'Plus Jakarta Sans', 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', 'JetBrains Mono', Consolas, monospace;

  /* ── Layout ── */
  --sidebar-width: 268px;
  --header-height: 56px;
  --toc-width: 220px;

  /* ── Radii ── */
  --radius-xs: 3px;
  --radius-sm: 5px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  /* ── Spacing ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Monograph Dark Theme ── */
body.dark-theme {
  --bg: #070a12;
  --bg-surface: #0c1220;
  --bg-raised: #131c30;
  --bg-subtle: #090e1a;
  --bg-grid: #0d1527;
  --border: #1e293b;
  --border-subtle: #141f33;
  --border-strong: #334155;
  
  --accent: #38bdf8;           /* Tactical Luminous Cyan */
  --accent-hover: #7dd3fc;
  --accent-dim: rgba(56, 189, 248, 0.1);
  --accent-alt: #60a5fa;
  --accent-amber: #f59e0b;
  --accent-emerald: #10b981;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-code: #38bdf8;
  
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  --card-shadow-hover: 0 12px 32px rgba(56, 189, 248, 0.18), 0 0 0 1px rgba(56, 189, 248, 0.35);
  --grid-dot: rgba(255, 255, 255, 0.035);
}

html {
  scroll-behavior: smooth;
  color-scheme: light dark;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg);
  background-image: 
    radial-gradient(var(--grid-dot) 1px, transparent 1px),
    linear-gradient(to right, var(--bg-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--bg-grid) 1px, transparent 1px);
  background-size: 24px 24px, 120px 120px, 120px 120px;
  background-position: 0 0, 0 0, 0 0;
  color: var(--text-primary);
  font-size: 14.5px;
  line-height: 1.75;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ── Responsive Lucide Icons ── */
.lucide-icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  transition: transform var(--transition-fast), stroke var(--transition-fast);
}

.lucide-icon-sm {
  width: 12px;
  height: 12px;
}

.lucide-icon-md {
  width: 16px;
  height: 16px;
}

.lucide-icon-lg {
  width: 18px;
  height: 18px;
}

/* ── Reading Progress Bar ── */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2.5px;
  background: linear-gradient(90deg, var(--accent-alt), var(--accent), var(--accent-amber));
  z-index: 1001;
  width: 0%;
  transition: width 0.1s linear;
  box-shadow: 0 0 10px var(--accent);
}

/* ── Custom Cursor ── */
#custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  background: var(--accent);
  transition:
    width 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
    height 0.2s cubic-bezier(0.2, 0.8, 0.2, 1),
    background-color 0.15s ease, border 0.15s ease;
  border: 1px solid transparent;
}

#custom-cursor.hover {
  width: 28px !important;
  height: 28px !important;
  background: transparent;
  border: 1.5px solid var(--accent);
  border-radius: 50% !important;
}

#custom-cursor.magnetic {
  background: var(--accent-dim);
  border: 1.5px solid var(--accent);
}

@media (pointer: coarse) {
  #custom-cursor {
    display: none !important;
  }
}

/* ── Header ── */
header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(251, 251, 249, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  transition: background var(--transition), border-color var(--transition);
}

body.dark-theme header {
  background: rgba(12, 18, 32, 0.92);
}

@media (min-width: 768px) {
  header {
    padding: 0 var(--space-6);
  }
}

.hd-left {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.logo-mark {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--transition), transform var(--transition-fast);
}

.logo-mark:hover {
  border-color: var(--accent);
  transform: scale(1.05);
}

.logo-mark svg {
  fill: var(--accent);
  width: 14px;
  height: 14px;
}

.logo-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.logo-title span {
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.08em;
  background: var(--accent-dim);
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid rgba(2, 132, 199, 0.2);
}

.hd-div {
  width: 1px;
  height: 18px;
  background: var(--border);
  margin: 0 4px;
}

.hd-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hd-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  max-width: 380px;
  margin: 0 var(--space-4);
}

/* ── Global Search Trigger (Header) ── */
.search-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 12.5px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.search-trigger:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--bg-surface);
  box-shadow: 0 0 0 1px var(--accent);
}

.search-trigger-content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
}

.kbd-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  padding: 1px 5px;
  color: var(--text-muted);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.hd-right {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.sb-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  margin-right: var(--space-1);
  transition: var(--transition-fast);
}

.sb-toggle:hover {
  border-color: var(--accent);
  color: var(--text-primary);
  background: var(--bg-raised);
}

.sb-toggle-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

body.sidebar-collapsed .sb-toggle-icon {
  transform: scaleX(-1);
}

/* ── Monograph Tags & Classification Badges ── */
.tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid currentColor;
}

.tag-r {
  color: var(--accent-emerald);
  border-color: rgba(5, 150, 105, 0.3);
  background: rgba(5, 150, 105, 0.06);
  display: none;
}

@media (min-width: 860px) {
  .tag-r {
    display: inline-flex;
  }
}

.tag-c {
  color: var(--accent-amber);
  border-color: rgba(217, 119, 6, 0.3);
  background: rgba(217, 119, 6, 0.06);
  display: none;
}

@media (min-width: 600px) {
  .tag-c {
    display: inline-flex;
  }
}

.vtag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(2, 132, 199, 0.25);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
}

/* ── Layout ── */
.layout {
  display: flex;
  margin-top: var(--header-height);
  min-height: calc(100vh - var(--header-height));
  width: 100%;
  position: relative;
}

@media (min-width: 769px) {
  .layout {
    padding-left: var(--sidebar-width);
    transition: padding-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  body.sidebar-collapsed .layout {
    padding-left: 0;
  }
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  position: fixed;
  top: var(--header-height);
  left: 0;
  height: calc(100vh - var(--header-height));
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: var(--space-4) 0 var(--space-12);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background var(--transition), border-color var(--transition);
  z-index: 90;
}

body.sidebar-open .sidebar {
  transform: translateX(0);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
}

#sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(2px);
  z-index: 89;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

body.sidebar-open #sidebar-overlay {
  opacity: 1;
  pointer-events: all;
}

.sidebar::-webkit-scrollbar {
  width: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 2px;
}

@media (min-width: 769px) {
  .sidebar {
    transform: translateX(0);
    box-shadow: none;
    z-index: 80;
  }

  #sidebar-overlay {
    display: none;
  }

  body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
  }
}

.sb-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: var(--space-4) var(--space-5) var(--space-2);
}

.sb-label:first-child {
  padding-top: var(--space-2);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 8px var(--space-5);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  user-select: none;
  position: relative;
}

.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-raised);
}

.nav-item.active {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-dim);
  border-left: 2px solid var(--accent);
}

.nav-num {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  width: 20px;
  flex-shrink: 0;
}

.nav-item.active .nav-num {
  color: var(--accent);
  font-weight: 600;
}

/* ── Theme Toggle Button ── */
.theme-toggle-wrap {
  padding: var(--space-3) var(--space-5) var(--space-3);
}

.theme-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 8px var(--space-4);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: var(--transition-fast);
}

.theme-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-surface);
}

.theme-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
}

.theme-btn .theme-icon-dark {
  display: none;
}

body.dark-theme .theme-btn .theme-icon-light {
  display: none;
}

body.dark-theme .theme-btn .theme-icon-dark {
  display: block;
}

/* ── Content Layout & Main Wrapper ── */
.content-wrapper {
  display: flex;
  width: 100%;
  min-width: 0;
  justify-content: center;
  align-items: flex-start;
  position: relative;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 var(--space-4);
  gap: var(--space-6);
}

main {
  flex: 1;
  width: 100%;
  min-width: 0;
  max-width: 860px;
  padding: 0 0 var(--space-12);
}

@media (min-width: 1024px) {
  main {
    padding: 0 0 100px;
  }
}

/* ── Breadcrumb Navigation ── */
.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.bc-root {
  color: var(--accent);
  font-weight: 500;
  cursor: pointer;
}

.bc-root:hover {
  text-decoration: underline;
}

.bc-sep {
  color: var(--border-strong);
  font-size: 10px;
}

.bc-cat {
  color: var(--text-secondary);
}

.bc-current {
  color: var(--text-primary);
  font-weight: 500;
}

/* ── On-Page Sub-TOC (Desktop Floating Right) ── */
.on-this-page-toc {
  display: none;
  width: 220px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-height) + 24px);
  max-height: calc(100vh - var(--header-height) - 48px);
  padding: var(--space-4) var(--space-4);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--card-shadow);
  font-size: 12px;
  overflow-y: auto;
  z-index: 20;
}

@media (min-width: 1440px) {
  .on-this-page-toc {
    display: block;
  }
}

@media (min-width: 1200px) {
  body.sidebar-collapsed .on-this-page-toc {
    display: block;
  }
}

.toc-title {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}

.toc-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.toc-link {
  color: var(--text-secondary);
  padding: 4px 6px;
  border-radius: var(--radius-xs);
  transition: var(--transition-fast);
  display: block;
  line-height: 1.4;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  font-size: 11.5px;
}

.toc-link:hover {
  color: var(--accent);
  background: var(--accent-dim);
}

.toc-link.active {
  color: var(--accent);
  font-weight: 600;
  border-left: 2px solid var(--accent);
  padding-left: 8px;
}

/* ── Section Container ── */
.section {
  display: none;
  padding-top: 36px;
  animation: monographFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.section.active {
  display: block;
}

@keyframes monographFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Monograph Header & Meta ── */
.sec-classification-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px dashed var(--border);
  padding-bottom: var(--space-2);
  margin-bottom: var(--space-3);
}

.sec-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: var(--space-2);
}

.sec-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.sec-desc {
  font-size: 15.5px;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 68ch;
  margin-bottom: var(--space-6);
  font-weight: 400;
}

/* ── Headings & Deep-Link Anchors ── */
h3 {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin: var(--space-8) 0 var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  scroll-margin-top: 72px;
  position: relative;
}

h3::before {
  content: '§';
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  opacity: 0.8;
}

.heading-anchor-link {
  opacity: 0;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  text-decoration: none;
  padding: 1px 6px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: opacity 0.15s ease, color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  user-select: none;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 400;
  margin-left: 6px;
}

.sec-title:hover .heading-anchor-link,
h3:hover .heading-anchor-link,
.math-card:hover .heading-anchor-link {
  opacity: 0.85;
}

.heading-anchor-link:hover {
  opacity: 1 !important;
  color: var(--accent);
  background: var(--accent-dim);
  border-color: var(--accent);
}

/* ── Tactical Deep-Link Toast Notification ── */
#tactical-toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 5000;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--accent);
  border-left: 3.5px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-primary);
  opacity: 0;
  transform: translateY(12px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 90vw;
}

#tactical-toast.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.toast-icon {
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
}

.toast-url {
  color: var(--accent);
  text-decoration: underline;
  margin-left: 4px;
}

p {
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
  font-size: 14.5px;
  line-height: 1.8;
  max-width: 72ch;
}

/* ── Divider ── */
.divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-8) 0;
  width: 100%;
}

/* ── Hero Box (Monograph Whitepaper Callout) ── */
.hero-box {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  padding: var(--space-6) var(--space-8);
  margin-bottom: var(--space-6);
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}

.hero-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--accent);
}

.hero-box:hover {
  box-shadow: var(--card-shadow-hover);
  border-color: rgba(2, 132, 199, 0.35);
}

.hero-tags {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-3);
}

.hero-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(20px, 2.5vw, 24px);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  line-height: 1.25;
}

.hero-box p {
  max-width: 64ch;
  font-size: 14.5px;
  margin: 0;
}

/* ── Mathematical Aerospace Equation Card ── */
.math-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-5) 0;
  box-shadow: var(--card-shadow);
}

.math-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-2);
}

.math-equation {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--accent);
  background: var(--bg-raised);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  overflow-x: auto;
  margin: var(--space-2) 0;
}

.math-legend {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: var(--space-2);
}

/* ── Blueprint Image Container with Lightbox Trigger ── */
.blueprint-img {
  width: 100%;
  margin: var(--space-5) 0 var(--space-6);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  position: relative;
  background: var(--bg-surface);
  cursor: zoom-in;
  transition: var(--transition);
}

.blueprint-img:hover {
  border-color: var(--accent);
  box-shadow: var(--card-shadow-hover);
}

.blueprint-img img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.blueprint-overlay-btn {
  position: absolute;
  bottom: var(--space-3);
  right: var(--space-3);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-xs);
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  opacity: 0.85;
  transition: opacity var(--transition-fast);
}

.blueprint-img:hover .blueprint-overlay-btn {
  opacity: 1;
}

/* ── Lightbox Modal ── */
#blueprint-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 18, 0.94);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.25s ease;
}

#blueprint-lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-header {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  font-family: var(--font-mono);
  font-size: 12px;
}

.lightbox-title {
  font-weight: 500;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.lightbox-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lb-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  padding: 5px 12px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lb-btn:hover {
  background: var(--accent);
  color: #0f172a;
  border-color: var(--accent);
}

.lb-btn.active {
  background: var(--accent);
  color: #0f172a;
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.4);
}

.lightbox-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  padding: var(--space-6);
  cursor: default;
  user-select: none;
  touch-action: none;
}

.lightbox-viewport.pan-enabled {
  cursor: grab;
}

.lightbox-viewport.is-panning {
  cursor: grabbing !important;
}

.lightbox-viewport img {
  max-width: 92%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  transition: filter 0.3s ease;
  will-change: transform;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-viewport img.invert-blueprint {
  filter: invert(1) hue-rotate(180deg) contrast(1.15);
}

/* ── Global Command Palette Modal (Cmd+K) ── */
#cmd-palette-modal {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 18, 0.75);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 80px var(--space-4) var(--space-6);
  opacity: 0;
  transition: opacity 0.2s ease;
}

#cmd-palette-modal.active {
  display: flex;
  opacity: 1;
}

.cmd-palette-container {
  width: 100%;
  max-width: 640px;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--accent-dim);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(-8px) scale(0.98);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#cmd-palette-modal.active .cmd-palette-container {
  transform: translateY(0) scale(1);
}

.cmd-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-surface);
}

.cmd-search-icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

.cmd-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-primary);
}

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

.cmd-filter-tabs {
  display: flex;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.cmd-filter-btn {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-xs);
  padding: 3px 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.cmd-filter-btn:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.cmd-filter-btn.active {
  color: var(--accent);
  background: var(--bg-surface);
  border-color: var(--border-strong);
  font-weight: 600;
}

.cmd-results-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 8px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cmd-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.cmd-result-item:hover,
.cmd-result-item.selected {
  background: var(--accent-dim);
  color: var(--text-primary);
}

.cmd-result-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cmd-item-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  flex-shrink: 0;
}

.cmd-item-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cmd-item-title {
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-item-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-item-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-transform: uppercase;
  flex-shrink: 0;
}

.cmd-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-raised);
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-muted);
}

.cmd-shortcuts-hint {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Interactive Acronym Hover Cards ── */
.acronym-tag {
  color: var(--accent);
  font-weight: 600;
  border-bottom: 1.5px dotted var(--accent);
  cursor: help;
  position: relative;
  padding: 0 2px;
  border-radius: 2px;
  transition: background var(--transition-fast);
}

.acronym-tag:hover {
  background: var(--accent-dim);
}

.acronym-popover {
  position: fixed;
  z-index: 10000;
  width: 280px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-md);
  padding: var(--space-4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.acronym-popover.visible {
  opacity: 1;
  transform: translateY(0);
}

.acr-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 4px;
}

.acr-code {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.acr-domain {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.acr-full {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.3;
}

.acr-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* ── Tables & Data Presentation ── */
.table-wrap {
  overflow-x: auto;
  margin: var(--space-5) 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  box-shadow: var(--card-shadow);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead tr {
  background: var(--bg-raised);
}

th {
  text-align: left;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 10px 14px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--bg-subtle);
}

.tdb {
  color: var(--text-primary);
  font-weight: 600;
  font-family: var(--font-mono);
  font-size: 12.5px;
}

/* ── Spec Cards & Technical Modules ── */
.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-3);
  margin: var(--space-5) 0;
}

.spec-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
  position: relative;
}

.spec-card:hover {
  border-color: var(--accent);
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.spec-label {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: var(--space-1);
}

.spec-val {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.2;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
  margin: var(--space-5) 0;
}

.module-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: var(--space-5);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}

.module-card:hover {
  border-color: var(--accent);
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.mc-name {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.mc-desc {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-3);
  margin: var(--space-5) 0;
}

.mission-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: var(--space-5);
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  box-shadow: var(--card-shadow);
  transition: var(--transition);
}

.mission-card:hover {
  border-color: var(--accent);
  box-shadow: var(--card-shadow-hover);
  transform: translateY(-2px);
}

.mission-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.mission-card h4 {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.mission-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
  max-width: none;
}

/* ── Callout Box ── */
.callout {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: var(--space-4) var(--space-5);
  margin: var(--space-5) 0;
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
}

.callout-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
}

.callout p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.7;
}

/* ── Reference Lists & Document Citations ── */
ul.doc-list {
  color: var(--text-secondary);
  padding-left: var(--space-5);
  font-size: 14px;
  line-height: 1.9;
}

ul.doc-list li {
  margin-bottom: 3px;
}

/* ── Authors Strip ── */
.authors-strip {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
  padding: var(--space-5) 0;
  border-top: 1px solid var(--border);
  margin-top: var(--space-8);
}

.au-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.au-chip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.au-av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-raised);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-primary);
  font-weight: 600;
}

/* ── Footer Navigation ── */
.sec-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-10);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}

.fnav-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  letter-spacing: 0.04em;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.fnav-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-raised);
}

/* ── Scroll Reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Mobile Responsive System ── */
@media (max-width: 860px) {
  .hd-div,
  .hd-sub,
  .tag-r,
  .tag-c {
    display: none !important;
  }

  .hd-center {
    max-width: 260px;
  }
}

@media (max-width: 680px) {
  header {
    padding: 0 10px;
    gap: 6px;
    height: 52px;
  }

  .hd-left {
    gap: 6px;
    flex-shrink: 0;
  }

  .logo-title span {
    display: none;
  }

  .vtag {
    display: none !important;
  }

  .hd-center {
    flex: 0 0 auto;
    max-width: none;
    margin: 0;
  }

  .search-trigger {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius-xs);
  }

  .search-trigger-content span,
  .search-trigger .kbd-badge {
    display: none !important;
  }

  .search-icon {
    width: 15px;
    height: 15px;
  }

  .hd-right {
    gap: 6px;
  }

  .export-spec-btn {
    padding: 6px 9px;
    font-size: 10px;
  }
}

@media (max-width: 768px) {
  .layout {
    padding-left: 0 !important;
  }

  aside.sidebar {
    width: min(290px, 85vw);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.25);
  }

  .content-wrapper {
    padding: 0 var(--space-3);
    gap: 0;
  }

  main {
    padding: 0 var(--space-2) var(--space-10);
    max-width: 100%;
  }

  .on-this-page-toc {
    display: none !important;
  }

  .sec-classification-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .sec-title {
    font-size: clamp(22px, 5.5vw, 30px);
    gap: 6px;
  }

  .hero-box {
    padding: var(--space-4) var(--space-5);
  }

  .table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: var(--space-4) 0;
  }

  table {
    min-width: 520px;
  }

  .math-card {
    padding: var(--space-3) var(--space-4);
  }

  .math-equation {
    font-size: 11.5px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .spec-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .module-grid,
  .mission-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .monograph-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .monograph-tabs::-webkit-scrollbar {
    display: none;
  }

  .authors-strip {
    flex-wrap: wrap;
    gap: 8px;
  }

  .sec-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .sec-footer button {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  /* Modals */
  .cmd-palette-container {
    max-width: 100%;
    margin: 0;
  }

  #cmd-palette-modal {
    padding: 30px 10px 10px;
  }

  .cmd-filter-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .cmd-filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .cmd-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 12px;
  }

  .lightbox-header {
    height: auto;
    min-height: 48px;
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .lightbox-controls {
    flex-wrap: wrap;
    gap: 4px;
  }

  .lightbox-viewport {
    padding: 8px;
  }

  #tactical-toast {
    bottom: 16px;
    right: 12px;
    left: 12px;
    max-width: calc(100vw - 24px);
    justify-content: center;
    font-size: 11px;
    padding: 8px 12px;
  }
}

@media (max-width: 440px) {
  header {
    padding: 0 8px;
    height: 52px;
  }

  .logo-mark {
    width: 26px;
    height: 26px;
  }

  .logo-mark svg {
    width: 12px;
    height: 12px;
  }

  .logo-title {
    font-size: 14px;
    letter-spacing: -0.01em;
  }

  .export-spec-btn span {
    display: none;
  }

  .export-spec-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
    border-radius: var(--radius-xs);
  }

  .export-spec-btn svg {
    width: 14px;
    height: 14px;
  }

  .sb-toggle {
    width: 30px;
    height: 30px;
    margin-right: 0;
  }

  .spec-grid {
    grid-template-columns: 1fr;
  }

  .hero-tags {
    gap: 4px;
  }
}

/* ==========================================================================
   PHASE 4: OPERATOR EXPERIENCE, SPEC EXPORT & PRINT WHITE PAPER
   ========================================================================== */

/* ── Monograph Tabs ── */
.monograph-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin: var(--space-5) 0 var(--space-4);
  overflow-x: auto;
}

.mono-tab-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 8px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-fast);
}

.mono-tab-btn:hover {
  color: var(--text-primary);
}

.mono-tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 600;
}

.mono-tab-panel {
  display: none;
  animation: monographFadeIn 0.2s ease both;
}

.mono-tab-panel.active {
  display: block;
}

/* ── Export JSON Spec Button (Header) ── */
.export-spec-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.export-spec-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-raised);
}

.export-spec-btn svg {
  width: 12px;
  height: 12px;
}

/* ── JSON Export Modal ── */
#json-export-modal {
  position: fixed;
  inset: 0;
  background: rgba(7, 10, 18, 0.85);
  backdrop-filter: blur(8px);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  opacity: 0;
  transition: opacity 0.2s ease;
}

#json-export-modal.active {
  display: flex;
  opacity: 1;
}

.json-modal-box {
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.json-modal-header {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-5);
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-primary);
}

.json-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.json-code-view {
  flex: 1;
  overflow: auto;
  padding: var(--space-4) var(--space-5);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.6;
  white-space: pre;
}

/* ── Audio Mute Toggle in Sidebar ── */
.audio-toggle-wrap {
  padding: 0 var(--space-5) var(--space-4);
}

.audio-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: 7px var(--space-4);
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}

.audio-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ── Print / PDF Whitepaper Stylesheet ── */
@media print {
  @page {
    margin: 1.5cm;
    size: letter portrait;
  }

  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
    line-height: 1.5 !important;
  }

  header,
  aside,
  .on-this-page-toc,
  #progress-bar,
  #custom-cursor,
  .sb-toggle,
  .theme-toggle-wrap,
  .audio-toggle-wrap,
  .fnav-btn,
  .search-trigger,
  #cmd-palette-modal,
  #blueprint-lightbox,
  #json-export-modal,
  .blueprint-overlay-btn,
  .hotspot-pin,
  .hotspot-callout-card,
  .compare-filter-group,
  .config-option-btn-group {
    display: none !important;
  }

  .layout {
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
  }

  .content-wrapper,
  main {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: block !important;
  }

  .section {
    display: block !important;
    page-break-before: always;
    break-before: page;
    padding-top: 24pt !important;
  }

  .section:first-child {
    page-break-before: avoid;
    break-before: avoid;
    padding-top: 0 !important;
  }

  .mono-tab-panel {
    display: block !important;
  }

  .monograph-tabs {
    display: none !important;
  }

  .hero-box,
  .spec-card,
  .module-card,
  .mission-card,
  .callout,
  .math-card,
  .table-wrap {
    border: 1px solid #cccccc !important;
    box-shadow: none !important;
    background: #ffffff !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .sec-title {
    color: #000000 !important;
    font-size: 22pt !important;
  }

  .sec-desc,
  p,
  td,
  li {
    color: #222222 !important;
  }

  .tdb,
  th {
    color: #000000 !important;
  }

  img {
    max-width: 100% !important;
    break-inside: avoid;
  }
}