/* ==========================================================================
   UNIVERSAL BOOK READER PLATFORM — DESIGN TOKENS & MULTI-THEME ENGINE
   Shared UX/UI Architecture • Dynamic Per-Book Aesthetic
   ========================================================================== */

/* 1. Theme: Lemma Obsidian (Default Techno-Thriller Dark) */
:root,
body[data-theme="lemma-dark"] {
  --bg-void: #07080b;
  --bg-obsidian: #0f1218;
  --bg-panel: #181c24;
  --bg-card: #131720;
  --bg-header-glass: rgba(11, 14, 20, 0.95);
  --bg-dock-glass: rgba(11, 14, 20, 0.96);
  --bg-modal-overlay: rgba(4, 5, 8, 0.92);
  --bg-modal-surface: #0d1017;
  
  --hairline: #242b38;
  --hairline-subtle: #161b22;
  
  --text-paper: #f1f5f9;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --r7-crimson: #ef4444;
  --telemetry-cyan: #06b6d4;
  --lemma-phosphor: #10b981;
  --evidence-amber: #f59e0b;
  
  --font-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --font-sans: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'Roboto Mono', 'JetBrains Mono', ui-monospace, monospace;
  
  --read-size: 18px;
  --read-line: 1.85;
  --column-width: 680px;
}

/* 2. Theme: Parchment Classic (Warm Vintage Paper, Sepia & Brass) */
body[data-theme="parchment-classic"] {
  --bg-void: #f5efe1;
  --bg-obsidian: #ebe2ce;
  --bg-panel: #dfd4bc;
  --bg-card: #ece3cf;
  --bg-header-glass: rgba(245, 239, 225, 0.95);
  --bg-dock-glass: rgba(245, 239, 225, 0.96);
  --bg-modal-overlay: rgba(30, 24, 18, 0.75);
  --bg-modal-surface: #f5efe1;
  
  --hairline: #cfc2a3;
  --hairline-subtle: #dbcfb2;
  
  --text-paper: #241c14;
  --text-muted: #6b5742;
  --text-dim: #8c7860;
  
  --r7-crimson: #9c2828;
  --telemetry-cyan: #7a5822;
  --lemma-phosphor: #286430;
  --evidence-amber: #af6b12;
}

/* 3. Theme: Midnight Slate (Cool Deep Blue-Gray) */
body[data-theme="midnight-slate"] {
  --bg-void: #0b0f19;
  --bg-obsidian: #111827;
  --bg-panel: #1f2937;
  --bg-card: #151e2e;
  --bg-header-glass: rgba(17, 24, 39, 0.95);
  --bg-dock-glass: rgba(17, 24, 39, 0.96);
  --bg-modal-overlay: rgba(6, 9, 16, 0.92);
  --bg-modal-surface: #0f1624;
  
  --hairline: #374151;
  --hairline-subtle: #1f2937;
  
  --text-paper: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --r7-crimson: #f43f5e;
  --telemetry-cyan: #38bdf8;
  --lemma-phosphor: #34d399;
  --evidence-amber: #fbbf24;
}

/* 4. Theme: Minimal Light (Clean Editorial Day Mode) */
body[data-theme="minimal-light"] {
  --bg-void: #f8fafc;
  --bg-obsidian: #ffffff;
  --bg-panel: #f1f5f9;
  --bg-card: #ffffff;
  --bg-header-glass: rgba(255, 255, 255, 0.95);
  --bg-dock-glass: rgba(255, 255, 255, 0.96);
  --bg-modal-overlay: rgba(15, 23, 42, 0.65);
  --bg-modal-surface: #ffffff;
  
  --hairline: #e2e8f0;
  --hairline-subtle: #f1f5f9;
  
  --text-paper: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  
  --r7-crimson: #e11d48;
  --telemetry-cyan: #0284c7;
  --lemma-phosphor: #059669;
  --evidence-amber: #d97706;
}

/* 5. Theme: Cyber Night (Synthwave Neon) */
body[data-theme="cyber-night"] {
  --bg-void: #090817;
  --bg-obsidian: #12102e;
  --bg-panel: #1a1742;
  --bg-card: #151236;
  --bg-header-glass: rgba(18, 16, 46, 0.95);
  --bg-dock-glass: rgba(18, 16, 46, 0.96);
  --bg-modal-overlay: rgba(5, 4, 15, 0.94);
  --bg-modal-surface: #100e2b;
  
  --hairline: #363073;
  --hairline-subtle: #211c4c;
  
  --text-paper: #f5f3ff;
  --text-muted: #a78bfa;
  --text-dim: #7c3aed;
  
  --r7-crimson: #ff2a6d;
  --telemetry-cyan: #05d9e8;
  --lemma-phosphor: #00ff9f;
  --evidence-amber: #ffb800;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
  background: var(--bg-void);
  color: var(--text-paper);
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg-void);
  color: var(--text-paper);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  touch-action: pan-y pinch-zoom;
  -webkit-tap-highlight-color: transparent;
}

/* Visibility Utilities */
.desktop-only {
  display: flex;
}

.mobile-only {
  display: none !important;
}

::selection {
  background: rgba(6, 182, 212, 0.35);
  color: var(--text-paper);
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

/* Reading Progress Bar */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--telemetry-cyan), var(--lemma-phosphor));
  z-index: 100;
  transition: width 0.1s ease-out;
}

/* ==========================================================================
   TOP BAR (STICKY NAV)
   ========================================================================== */
.terminal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-header-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  padding: 0;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
}

.header-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 54px;
  padding: 0 20px;
  padding-top: env(safe-area-inset-top);
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  min-width: 0;
}

.header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  position: relative;
}

/* Mobile Mode Sub-bar in Header */
.header-mode-subbar {
  display: none;
}

.chapter-picker-container {
  display: flex;
  align-items: center;
}

.chapter-select-dropdown {
  background: var(--bg-panel);
  color: var(--text-paper);
  border: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.header-mobile-chapter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.chapter-select-pill {
  background: var(--bg-panel);
  color: var(--text-paper);
  border: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 13px; /* Prevents iOS Safari auto-zoom */
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  text-align: center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 22px;
  max-width: 110px;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: inherit;
}

.brand-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-icon img {
  border-radius: 6px;
  width: 32px;
  height: 32px;
  display: block;
}

.brand-title {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-main {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-paper);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}

/* Tripartite Mode Switcher */
.mode-switcher {
  display: flex;
  align-items: center;
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 3px;
  gap: 2px;
}

.mode-btn {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mode-btn:hover {
  color: var(--text-paper);
}

.mode-btn.active {
  background: var(--bg-obsidian);
  color: var(--text-paper);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
  border: 1px solid var(--hairline);
}

.mode-btn.active[data-mode="media"] {
  color: var(--telemetry-cyan);
}

.mode-btn.active[data-mode="casebook"] {
  color: var(--evidence-amber);
}

.mode-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* Header Telemetry Status */
.telemetry-status {
  display: flex;
  align-items: center;
  gap: 16px;
}

.time-readout {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.r7-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #ff8080;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 4px;
  letter-spacing: 0.06em;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--r7-crimson);
  animation: r7Pulse 1.8s ease-in-out infinite;
}

@keyframes r7Pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.85); }
}

.tool-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  border-left: 1px solid var(--hairline);
  padding-left: 12px;
}

.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.icon-btn svg {
  width: 18px;
  height: 18px;
}

.icon-btn:hover {
  background: var(--bg-panel);
  border-color: var(--hairline);
  color: var(--text-paper);
}

.tool-btn-listen {
  width: auto;
  padding: 0 8px;
  gap: 4px;
  color: var(--telemetry-cyan);
}

.tool-btn-listen.is-playing {
  color: var(--lemma-phosphor);
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
}

.audio-wave-anim {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 12px;
}

.audio-wave-anim .bar {
  width: 2px;
  background: var(--lemma-phosphor);
  border-radius: 1px;
  animation: soundwave 1s infinite ease-in-out;
}

.audio-wave-anim .b1 { height: 6px; animation-delay: 0.1s; }
.audio-wave-anim .b2 { height: 12px; animation-delay: 0.25s; }
.audio-wave-anim .b3 { height: 8px; animation-delay: 0.4s; }

@keyframes soundwave {
  0%, 100% { transform: scaleY(0.4); }
  50% { transform: scaleY(1.2); }
}

#btn-bookmark.is-bookmarked {
  color: var(--evidence-amber) !important;
}

#btn-bookmark.is-bookmarked .bookmark-icon {
  fill: currentColor;
}

.prose-flow p.has-bookmark {
  border-left: 3px solid var(--evidence-amber) !important;
  padding-left: 14px !important;
  position: relative;
}

.prose-flow p.has-bookmark::before {
  content: '🔖 ЗАКЛАДКА';
  position: absolute;
  top: -16px;
  left: 14px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--evidence-amber);
}

.prose-flow p.audio-reading-active {
  background: rgba(16, 185, 129, 0.08);
  border-left: 3px solid var(--lemma-phosphor) !important;
  padding-left: 14px !important;
  border-radius: 4px;
  transition: all 0.2s ease;
}

/* ==========================================================================
   MAIN READER CONTAINER & WORKBENCH LAYOUT
   ========================================================================== */
.reader-workspace {
  display: flex;
  flex: 1;
  position: relative;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

.reader-column {
  flex: 1;
  min-width: 0;
  padding: 40px 24px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: max-width 0.25s ease;
}

body[data-reading-mode="text"] .reader-article {
  max-width: var(--column-width);
}

body[data-reading-mode="media"] .reader-article {
  max-width: 760px;
}

body[data-reading-mode="casebook"] .reader-article {
  max-width: 720px;
}

.reader-article {
  width: 100%;
}

.chapter-meta {
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 24px;
  margin-bottom: 36px;
}

.chapter-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--telemetry-cyan);
  margin-bottom: 8px;
  display: block;
}

.chapter-title {
  font-family: var(--font-serif);
  font-size: clamp(32px, 4vw, 44px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin: 0 0 12px;
  color: var(--text-paper);
}

.chapter-dateline {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ==========================================================================
   PROSE TYPOGRAPHY & CANONICAL RULES
   ========================================================================== */
.prose-flow {
  font-family: var(--read-font-family, var(--font-serif));
  font-size: var(--read-size);
  line-height: var(--read-line);
  color: var(--text-paper);
}

.prose-flow p {
  margin: 0 0 1.3em 0;
}

.prose-flow .epigraph {
  margin-inline: 1.5em;
  white-space: pre-line;
  font-style: italic;
}

.prose-flow .scene-break {
  margin-block: 1.8em;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.2em;
}

.prose-flow code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  overflow-wrap: anywhere;
}

.prose-section-heading {
  margin: 1.6em 0 0.65em;
  font-size: 1.15em;
}

.parallel-text {
  margin-block: 1.8em;
  border-block: 1px solid var(--hairline);
}

.parallel-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.parallel-row + .parallel-row {
  border-top: 1px solid var(--hairline);
}

.parallel-cell,
.parallel-header > div {
  padding: 0.8em;
}

.parallel-cell + .parallel-cell,
.parallel-header > div + div {
  border-inline-start: 1px solid var(--hairline);
}

.parallel-header,
.parallel-label {
  font: 600 0.75em/1.4 var(--font-sans);
  color: var(--text-muted);
}

.parallel-label { display: none; }

.parallel-cell p {
  margin-bottom: 0.7em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.parallel-cell p:last-child { margin-bottom: 0; }

.parallel-cell:first-child p {
  font-family: var(--font-mono);
  font-size: 0.78em;
  line-height: 1.55;
}

@media (max-width: 700px) {
  .parallel-row { grid-template-columns: minmax(0, 1fr); }
  .parallel-header {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .parallel-cell + .parallel-cell { border-inline-start: 0; }
  .parallel-label {
    display: block;
    margin-bottom: 0.6em;
  }
}

/* CANONICAL RULE 1: Direct speech in italics */
.prose-flow em.human-speech,
.prose-flow .dialogue {
  font-style: italic;
  color: var(--text-paper);
}

/* CANONICAL RULE 2: Lemma output in monospaced phosphor */
.prose-flow p.lemma,
.prose-flow .lemma-voice {
  font-family: var(--font-mono);
  font-style: normal !important;
  font-size: calc(var(--read-size) * 0.88);
  line-height: 1.7;
  color: var(--lemma-phosphor);
  background: rgba(16, 185, 129, 0.06);
  border-left: 2px solid var(--lemma-phosphor);
  padding: 10px 16px;
  margin: 1.6em 0;
  border-radius: 0 4px 4px 0;
}

.prose-flow p.report-head {
  font-family: var(--font-mono);
  font-size: calc(var(--read-size) * 0.75);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--evidence-amber);
  background: var(--bg-panel);
  border-left: 3px solid var(--evidence-amber);
  padding: 12px 16px 4px;
  margin: 1.6em 0 0;
  border-radius: 4px 4px 0 0;
}

.prose-flow p.report {
  font-family: var(--font-mono);
  font-size: calc(var(--read-size) * 0.82);
  color: var(--text-paper);
  background: var(--bg-panel);
  border-left: 3px solid var(--evidence-amber);
  padding: 4px 16px;
  margin: 0;
  letter-spacing: 0.02em;
}

.prose-flow p.report:last-of-type {
  padding-bottom: 12px;
  border-radius: 0 0 4px 4px;
  margin-bottom: 1.6em;
}

.prose-flow .prose-code-figure {
  margin: 1.5em 0;
  padding: 0;
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--telemetry-cyan);
  border-radius: 6px;
  overflow: hidden;
}

.prose-flow .prose-code-figure.has-caption {
  border-left-color: var(--evidence-amber);
}

.prose-flow .prose-code-figure + .prose-code-figure {
  margin-top: -0.7em;
}

.prose-flow .prose-code-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-sans);
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

.prose-flow .prose-code-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--evidence-amber);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 4px;
  padding: 2px 7px;
  flex-shrink: 0;
}

.prose-flow pre.prose-code-block {
  margin: 0;
  padding: 13px 16px;
  background: var(--bg-obsidian);
  font-family: var(--font-mono);
  font-size: calc(var(--read-size) * 0.78);
  line-height: 1.55;
  color: var(--text-paper);
  white-space: pre;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.prose-flow pre.prose-code-block code {
  font-family: inherit;
  font-size: inherit;
  overflow-wrap: normal;
  white-space: pre;
}

/* ==========================================================================
   INLINE MULTIMEDIA CARDS (MEDIA MODE) & EVIDENCE BUNDLE TRACKING
   ========================================================================== */
.media-card {
  margin: 32px 0;
  background: var(--bg-obsidian);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.25s ease;
  position: relative;
}

.media-card:hover {
  border-color: rgba(6, 182, 212, 0.45);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5);
}

body[data-reading-mode="text"] .media-card {
  display: none !important;
}

.media-card-header {
  padding: 10px 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.media-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}

.media-badge {
  color: var(--telemetry-cyan);
  font-weight: 600;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

/* Dynamic badge label depending on reading mode */
body[data-reading-mode="casebook"] .badge-tag-media {
  display: none !important;
}

body:not([data-reading-mode="casebook"]) .badge-tag-casebook {
  display: none !important;
}

.repeat-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border-radius: 3px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: #94a3b8;
  text-transform: uppercase;
  white-space: nowrap;
}

.media-title-text {
  color: var(--text-paper);
  font-weight: 500;
}

.media-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Bundle Tracking Chip inside Evidence Card */
body:not([data-reading-mode="casebook"]) .bundle-badge,
body:not([data-reading-mode="casebook"]) .bundle-alert-hud,
body:not([data-reading-mode="casebook"]) #bundle-hud {
  display: none !important;
}

.bundle-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 4px;
  color: var(--evidence-amber);
  font-family: var(--font-mono);
  font-size: 10px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.bundle-badge:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: var(--evidence-amber);
}

.bundle-badge.collected {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--lemma-phosphor);
}

/* Repeat Card & Spoiler Controls */
.media-card.is-repeat {
  border-color: rgba(148, 163, 184, 0.22);
}

.media-card.is-collapsible .media-card-header {
  cursor: pointer;
  user-select: none;
}

.media-card.is-collapsible .media-card-header:hover {
  background: rgba(30, 41, 59, 0.9);
}

.spoiler-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 4px;
  color: var(--telemetry-cyan);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.spoiler-toggle-btn:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: var(--telemetry-cyan);
  color: #fff;
}

.spoiler-arrow {
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.media-card:not(.is-collapsed) .spoiler-arrow {
  transform: rotate(180deg);
}

/* Collapsed State for Repeat Evidence */
.media-card.is-collapsed {
  margin: 18px 0;
  border-style: dashed;
  background: rgba(15, 23, 42, 0.55);
}

.media-card.is-collapsed .media-card-header {
  border-bottom: none;
}

.media-card.is-collapsed .media-card-body {
  display: none !important;
}

.media-card-body {
  padding: 16px;
}

.media-card-body img,
.media-card-body video {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
}

.media-card-caption {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 10px;
}



/* ==========================================================================
   BUNDLE COMPLETION TOAST / HUD NOTIFICATION
   ========================================================================== */
.bundle-alert-hud {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 120;
  max-width: 440px;
  width: calc(100% - 48px);
  background: rgba(15, 18, 24, 0.96);
  border: 1px solid var(--lemma-phosphor);
  border-radius: 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(16, 185, 129, 0.25);
  backdrop-filter: blur(16px);
  padding: 18px 20px;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  pointer-events: none;
}

.bundle-alert-hud.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.bundle-alert-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.bundle-alert-pill {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--lemma-phosphor);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 6px;
}

.bundle-alert-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-paper);
  margin: 0 0 4px 0;
}

.bundle-alert-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 14px 0;
}

.bundle-alert-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-bundle-action {
  background: var(--lemma-phosphor);
  color: var(--bg-void);
  border: 0;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-bundle-action:hover {
  background: #34d399;
  transform: translateY(-1px);
}

.btn-bundle-dismiss {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--hairline);
  font-size: 11px;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-bundle-dismiss:hover {
  color: var(--text-paper);
  border-color: var(--text-muted);
}

/* ==========================================================================
   DOSSIER SYNTHESIS MODAL (SOLVE RIDDLE & UNLOCK DEDUCTION)
   ========================================================================== */
.dossier-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 5, 8, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.dossier-overlay.active {
  opacity: 1 !important;
  pointer-events: auto;
  transition: none !important;
}

.dossier-modal {
  max-width: 680px;
  width: 100%;
  background: #0d1017 !important;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.95);
  overflow: hidden;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.dossier-modal-header {
  padding: 16px 24px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dossier-modal-body {
  padding: 24px;
  overflow-y: auto;
}

.dossier-evidence-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.dossier-evidence-thumb {
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dossier-evidence-thumb img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

.dossier-thumb-title {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-paper);
  line-height: 1.3;
}

.dossier-riddle-box {
  background: var(--bg-panel);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.riddle-question {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-paper);
  margin: 0 0 16px 0;
  line-height: 1.5;
}

.riddle-option-btn {
  width: 100%;
  text-align: left;
  background: var(--bg-obsidian);
  border: 1px solid var(--hairline);
  color: var(--text-paper);
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
  margin-bottom: 10px;
  transition: all 0.2s;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.riddle-option-btn:hover {
  border-color: var(--telemetry-cyan);
  background: rgba(6, 182, 212, 0.05);
}

.riddle-option-btn.selected-correct {
  border-color: var(--lemma-phosphor);
  background: rgba(16, 185, 129, 0.1);
}

.riddle-option-btn.selected-wrong {
  border-color: var(--r7-crimson);
  background: rgba(239, 68, 68, 0.1);
}

.dossier-reward-box {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid var(--lemma-phosphor);
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
  display: none;
}

.dossier-reward-box.show {
  display: block;
}

/* ==========================================================================
   FORENSIC INVESTIGATION DRAWER / RIGHT PANEL (DEEP DIVE)
   ========================================================================== */
.inspector-drawer {
  width: 440px;
  background: var(--bg-obsidian);
  border-left: 1px solid var(--hairline);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

body[data-reading-mode="text"] .inspector-drawer,
body[data-reading-mode="media"] .inspector-drawer {
  display: none !important;
}

.inspector-header {
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 12px;
}

.inspector-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--evidence-amber);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: block;
}

.inspector-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text-paper);
}

.telemetry-graph-card {
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 14px;
}

.telemetry-card-title {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--telemetry-cyan);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
}

.telemetry-raw-dump {
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-muted);
  background: var(--bg-void);
  padding: 12px;
  border-radius: 4px;
  border: 1px solid var(--hairline-subtle);
  overflow-x: auto;
}

/* Inspector Drawer Bundles List */
.inspector-bundle-item {
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.inspector-bundle-item:hover {
  border-color: var(--telemetry-cyan);
  background: rgba(6, 182, 212, 0.05);
}

.inspector-bundle-item.solved {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.04);
}

.bundle-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.bundle-item-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-paper);
}

.bundle-item-progress-text {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--telemetry-cyan);
}

.inspector-bundle-item.solved .bundle-item-progress-text {
  color: var(--lemma-phosphor);
}

.bundle-item-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-void);
  border-radius: 2px;
  overflow: hidden;
}

.bundle-item-progress-fill {
  height: 100%;
  background: var(--telemetry-cyan);
  transition: width 0.3s ease;
}

.inspector-bundle-item.solved .bundle-item-progress-fill {
  background: var(--lemma-phosphor);
}

/* ==========================================================================
   CHAPTER NAVIGATION BOTTOM BAR
   ========================================================================== */
.chapter-nav-footer {
  border-top: 1px solid var(--hairline);
  margin-top: 50px;
  padding-top: 30px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.chapter-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  color: var(--text-paper);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.chapter-btn:hover {
  background: rgba(6, 182, 212, 0.1);
  border-color: var(--telemetry-cyan);
  color: var(--telemetry-cyan);
}

/* ==========================================================================
   MOBILE PWA APP-LIKE LAYOUT & NATIVE DOCK
   ========================================================================== */
.mobile-bottom-dock {
  display: none;
}

@media (max-width: 768px) {
  /* Visibility toggles */
  .desktop-only {
    display: none !important;
  }
  .mobile-only {
    display: flex !important;
  }

  /* Compact Native Top App Bar */
  .terminal-header {
    height: auto !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    border-bottom: none !important;
  }

  .header-main-row {
    height: calc(50px + env(safe-area-inset-top)) !important;
    padding: env(safe-area-inset-top) max(8px, env(safe-area-inset-right)) 0 max(8px, env(safe-area-inset-left)) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 4px !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border-bottom: 1px solid var(--hairline-subtle);
  }

  .header-mode-subbar {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    height: 38px !important;
    background: var(--bg-header-glass) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--hairline) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    z-index: 100 !important;
  }

  .subbar-mode-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    font-family: var(--font-mono) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.08em !important;
    color: var(--text-dim) !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    cursor: pointer !important;
    padding: 0 !important;
    height: 38px !important;
    transition: all 0.15s ease !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .subbar-mode-btn.active {
    background: rgba(255, 255, 255, 0.03) !important;
  }

  .subbar-mode-btn.active[data-mode="text"] {
    color: var(--text-paper) !important;
    border-bottom-color: var(--text-paper) !important;
  }

  .subbar-mode-btn.active[data-mode="media"] {
    color: var(--telemetry-cyan) !important;
    border-bottom-color: var(--telemetry-cyan) !important;
  }

  .subbar-mode-btn.active[data-mode="casebook"] {
    color: var(--evidence-amber) !important;
    border-bottom-color: var(--evidence-amber) !important;
  }

  .header-left {
    gap: 6px;
    flex-shrink: 0 !important;
  }

  .brand-section {
    gap: 5px;
  }

  .brand-main {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
  }

  .brand-icon, .brand-icon img {
    width: 24px;
    height: 24px;
  }

  .header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    min-width: 0 !important;
  }

  .chapter-select-pill {
    max-width: 84px !important;
    height: 34px !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    padding: 2px 16px 2px 8px !important;
    border-radius: 17px;
    background-position: right 5px center;
  }

  .header-right {
    gap: 0 !important;
    flex-shrink: 0 !important;
    display: flex !important;
    align-items: center !important;
  }

  #header-status-badge,
  .r7-pill,
  .status-badge {
    display: none !important;
  }

  .tool-actions {
    border-left: none !important;
    padding-left: 0 !important;
    gap: 2px !important;
    display: flex !important;
    align-items: center !important;
    flex-shrink: 0 !important;
  }

  /* Увеличенные эргономичные touch-кнопки (40x40px) в шапке для пальца */
  .icon-btn {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 13px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 1px solid transparent !important;
    color: var(--text-paper) !important;
    cursor: pointer !important;
    transition: background 0.15s ease, transform 0.1s ease !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .icon-btn:active {
    background: rgba(255, 255, 255, 0.08) !important;
    transform: scale(0.93) !important;
  }

  .icon-btn svg {
    width: 19px !important;
    height: 19px !important;
    display: block !important;
  }

  #btn-display-settings span {
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
  }

  .tool-btn-listen {
    width: 40px !important;
    padding: 0 !important;
  }

  /* Mobile Bottom Navigation Dock (Native PWA Tab Bar) */
  .mobile-bottom-dock {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    height: calc(56px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--bg-dock-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--hairline);
    z-index: 95;
    margin: 0;
    border-radius: 0;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.7);
  }

  .dock-tab-btn {
    background: transparent;
    border: 0;
    color: var(--text-dim);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 56px;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
    transition: color 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .dock-tab-btn .dock-tab-icon {
    stroke: currentColor;
    transition: transform 0.15s ease;
  }

  .dock-tab-btn .dock-tab-label {
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
  }

  .dock-tab-btn.active {
    background: rgba(255, 255, 255, 0.03);
  }

  #dock-btn-novel.active {
    color: var(--lemma-phosphor);
  }

  #dock-btn-blog.active {
    color: var(--telemetry-cyan);
  }

  #dock-btn-dossier.active {
    color: var(--evidence-amber);
  }

  .dock-tab-badge {
    position: absolute;
    top: -4px;
    right: -9px;
    background: var(--evidence-amber);
    color: #000;
    font-family: var(--font-mono);
    font-size: 8px;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 8px;
    line-height: 1.1;
  }

  .dock-tab-btn.active .dock-tab-icon {
    transform: scale(1.08);
  }

  /* Reader Workspace & Prose Flow */
  .reader-workspace {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .reader-column {
    padding: 16px 14px calc(74px + env(safe-area-inset-bottom)) 14px !important;
    width: 100% !important;
    max-width: 100vw !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
  }

  body[data-reading-mode="text"] .reader-article,
  body[data-reading-mode="media"] .reader-article,
  body[data-reading-mode="casebook"] .reader-article,
  .reader-article {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .chapter-meta {
    margin-bottom: 20px;
    padding-bottom: 14px;
  }

  .chapter-title {
    font-size: 24px !important;
    line-height: 1.25 !important;
  }

  .chapter-dateline {
    font-size: 11px !important;
  }

  .prose-flow p {
    font-size: var(--read-size);
    line-height: 1.7;
    margin-bottom: 16px;
    overflow-wrap: break-word;
    word-break: normal;
  }

  /* Inline Evidence Cards on Mobile */
  .media-card {
    margin: 24px 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .media-card-header {
    padding: 10px 12px !important;
    flex-wrap: wrap;
    gap: 8px;
  }

  .media-title-group {
    font-size: 10px !important;
  }

  .bundle-badge {
    font-size: 9px !important;
    padding: 3px 8px !important;
  }

  .media-card-body {
    padding: 12px !important;
  }

  .telemetry-raw-dump {
    font-size: 10px !important;
    padding: 8px 10px !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Mobile Inspector Drawer as Full Screen Sheet: Sit strictly between Mode Subbar and Bottom Dock */
  .inspector-drawer {
    position: fixed !important;
    top: calc(88px + env(safe-area-inset-top)) !important;
    bottom: calc(56px + env(safe-area-inset-bottom)) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 0 !important;
    border-left: 0 !important;
    border-top: 1px solid var(--hairline);
    background: var(--bg-void) !important;
    padding: 16px !important;
    z-index: 40 !important;
    box-sizing: border-box !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }

  /* HUD Notification toast above Bottom Dock */
  .bundle-alert-hud {
    bottom: calc(64px + env(safe-area-inset-bottom)) !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: calc(100% - 24px) !important;
    padding: 14px 16px !important;
  }

  .bundle-alert-title {
    font-size: 13px !important;
  }

  .bundle-alert-desc {
    font-size: 11px !important;
    margin-bottom: 10px !important;
  }

  /* Dossier Modal on Mobile */
  .dossier-overlay {
    padding: max(10px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)) !important;
    background: rgba(4, 5, 8, 0.96) !important;
  }

  .dossier-modal {
    max-height: calc(100vh - 24px) !important;
    border-radius: 12px !important;
    width: 100% !important;
    background: #0d1017 !important;
  }

  .dossier-modal-header {
    padding: 12px 16px !important;
  }

  .dossier-modal-body {
    padding: 14px 16px !important;
  }

  .dossier-evidence-row {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  .riddle-question {
    font-size: 13px !important;
    margin-bottom: 12px !important;
  }

  .riddle-option-btn {
    font-size: 12px !important;
    padding: 10px 12px !important;
  }

  /* Chapter Navigation Footer */
  .chapter-nav-footer {
    margin-top: 32px !important;
    padding-top: 20px !important;
    flex-direction: column;
    gap: 12px;
  }

  .chapter-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   UNIVERSAL READER EXTENSIONS: LIBRARY & THEME PICKER
   ========================================================================== */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--r7-crimson);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  padding: 4px 9px;
  border-radius: 4px;
  letter-spacing: 0.06em;
}

body[data-theme="parchment-classic"] .status-badge {
  background: rgba(122, 88, 34, 0.12);
  border-color: rgba(122, 88, 34, 0.35);
  color: var(--telemetry-cyan);
}

body[data-theme="minimal-light"] .status-badge {
  background: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.3);
  color: var(--telemetry-cyan);
}

/* Display Settings Popover Menu (Aa: Fonts, Size & Theme) */
.display-popover,
.theme-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 14px;
  background: var(--bg-obsidian);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 14px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7);
  z-index: 160;
  display: none;
  flex-direction: column;
  gap: 12px;
  width: 250px;
  box-sizing: border-box;
}

.display-popover.show,
.theme-popover.show {
  display: flex;
}

.popover-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.popover-section-label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

.font-size-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  border-radius: 6px;
  padding: 3px;
}

.font-size-btn {
  background: transparent;
  border: 0;
  color: var(--text-paper);
  width: 32px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
}

.font-size-btn:hover {
  background: var(--bg-panel);
}

.font-size-display {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--telemetry-cyan);
  font-weight: 600;
}

.font-family-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

.font-family-btn {
  background: var(--bg-card);
  border: 1px solid var(--hairline);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 6px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.font-family-btn .font-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-paper);
}

.font-family-btn .font-sample {
  font-size: 9px;
  color: var(--text-dim);
}

.font-family-btn.active {
  border-color: var(--telemetry-cyan);
  background: rgba(6, 182, 212, 0.08);
}

.theme-options-grid {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.theme-option-btn {
  background: transparent;
  border: 0;
  color: var(--text-paper);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  transition: background 0.15s ease;
}

.theme-option-btn:hover {
  background: var(--bg-panel);
}

.theme-option-btn.active {
  background: var(--bg-panel);
  font-weight: 700;
  color: var(--telemetry-cyan);
}

.theme-color-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid var(--hairline);
  flex-shrink: 0;
}

/* Floating Audio Player Bar */
.audio-player-bar {
  position: fixed;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-dock-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--telemetry-cyan);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.75), 0 0 16px rgba(6, 182, 212, 0.15);
  border-radius: 12px;
  padding: 8px 14px;
  box-sizing: border-box;
}

@media (min-width: 769px) {
  .audio-player-bar {
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 580px;
  }
}

@media (max-width: 768px) {
  .audio-player-bar {
    bottom: calc(56px + env(safe-area-inset-bottom) + 8px);
    left: 8px;
    right: 8px;
    width: auto;
  }
}

.audio-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.audio-pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lemma-phosphor);
  animation: r7Pulse 1.2s infinite ease-in-out;
  flex-shrink: 0;
}

.audio-text-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.audio-title {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--lemma-phosphor);
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-current-phrase {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-paper);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-player-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.audio-ctrl-btn {
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  color: var(--text-paper);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.audio-ctrl-btn:hover {
  background: var(--bg-card);
  border-color: var(--telemetry-cyan);
}

.audio-playpause-btn {
  background: var(--telemetry-cyan);
  border: 0;
  color: #000;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.4);
}

.audio-speed-btn {
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
}

.audio-close-btn {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.audio-close-btn:hover {
  color: var(--r7-crimson);
}

/* Toast Notification */
.reader-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-15px);
  background: rgba(13, 16, 23, 0.96);
  border: 1px solid var(--telemetry-cyan);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  color: var(--text-paper);
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 7px 16px;
  border-radius: 20px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
  white-space: nowrap;
}

.reader-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

#reader-app:not([hidden]) {
  display: contents;
}

.library-shelf {
  width: min(100%, 1180px);
  margin-inline: auto;
  padding: clamp(28px, 6vw, 80px) clamp(18px, 5vw, 58px) 72px;
}

.shelf-author,
.shelf-nav a,
#shelf-books [role="alert"] a {
  color: var(--text-muted);
  text-underline-offset: 4px;
}

.shelf-author {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.shelf-author img {
  border-radius: 6px;
}

.shelf-header h1 {
  margin: 12px 0 20px;
  font: 600 clamp(38px, 7vw, 78px)/1.08 var(--font-serif);
  letter-spacing: -0.035em;
}

.shelf-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 12px;
}

.shelf-nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  font-size: 14px;
}

.shelf-author:hover,
.shelf-nav a:hover {
  color: var(--text-paper);
}

.shelf-section {
  margin-top: 36px;
  scroll-margin-top: 16px;
}

.shelf-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 14px;
}

.shelf-section-header h2 {
  margin: 0;
  font: 600 clamp(23px, 4vw, 32px)/1.2 var(--font-serif);
}

.shelf-section-header span,
.shelf-book-status {
  color: var(--text-muted);
  font-size: 12px;
}

.shelf-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.shelf-row > li { min-width: 0; }

.shelf-book {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  grid-template-areas: "cover details" "description description" "actions actions";
  gap: 16px;
  align-content: start;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--hairline);
  color: var(--text-paper);
}

.shelf-book-details { grid-area: details; min-width: 0; }
.shelf-book h3 {
  margin: 0;
  font: 600 clamp(22px, 2.4vw, 28px)/1.22 var(--font-serif);
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}
.shelf-book h3 a { color: inherit; text-decoration: none; }
.shelf-book h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.shelf-book-meta {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}
.shelf-description {
  grid-area: description;
  margin: 0;
  max-width: 65ch;
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-paper);
  overflow-wrap: anywhere;
}
.shelf-actions {
  grid-area: actions;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.shelf-action {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 650;
  text-decoration: none;
  touch-action: manipulation;
}
.shelf-read { background: var(--text-paper); color: var(--bg-void); }
.shelf-read:hover { background: #dce8f1; }
.shelf-listen { border-color: var(--text-muted); color: var(--text-paper); }
.shelf-listen:hover { background: var(--bg-panel); }
.shelf-action:active { opacity: .8; }
.shelf-actions .shelf-book-status { display: inline-flex; min-height: 44px; align-items: center; font-size: 14px; }

.shelf-book a:focus-visible,
.shelf-nav a:focus-visible,
.shelf-author:focus-visible {
  outline: 2px solid var(--telemetry-cyan);
  outline-offset: 4px;
}

.shelf-cover {
  grid-area: cover;
  align-self: start;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  width: 72px;
  min-height: 0;
  aspect-ratio: 2 / 3;
  padding: 8px 6px 8px 10px;
  border-radius: 2px 7px 7px 2px;
  background: linear-gradient(90deg, #0005 0 6px, #ffffff20 7px, transparent 8px), var(--cover-color, #233744);
  box-shadow: 0 5px 12px #0005;
}

.shelf-cover strong {
  margin: 0;
  overflow-wrap: anywhere;
  font: 600 11px/1.2 var(--font-serif);
  text-wrap: balance;
}

.shelf-volume,
.shelf-cover-author {
  color: #e0e7ee;
  font-size: 7px;
  line-height: 1.3;
}

.shelf-volume {
  letter-spacing: 0.09em;
}

.shelf-cover-image { height: auto; padding: 0; object-fit: cover; }

.shelf-book.pending .shelf-cover { --cover-color: #252b34; }
#shelf-omega .shelf-book:not(.pending) { --cover-color: #453129; }
[data-book="mad-sports"] { --cover-color: #303862; }
[data-book="last-time"] { --cover-color: #5a3841; }
[data-book="after-midnight"] { --cover-color: #49352c; }
[data-book="root-access"] { --cover-color: #3c3a58; }
[data-book="lost-and-found"] { --cover-color: #324353; }
[data-book="yalisa"] { --cover-color: #3c4939; }
[data-book="inflation"] { --cover-color: #55422e; }

@media (min-width: 560px) {
  .shelf-book {
    grid-template-columns: 96px minmax(0, 1fr);
    grid-template-areas: "cover details" "cover description" "cover actions";
    column-gap: 24px;
    row-gap: 12px;
  }
  .shelf-cover { width: 96px; padding: 10px 8px 10px 13px; }
  .shelf-cover-image { padding: 0; }
  .shelf-cover strong { font-size: 13px; }
  .shelf-volume, .shelf-cover-author { font-size: 8px; }
}
@media (min-width: 1000px) {
  .shelf-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   INTERACTIVE TWO-LAYER GEOLOGICAL SCANNER (CHICXULUB)
   ========================================================================== */
.geo-scanner {
  background: #050a12;
  border: 1px solid #1a334d;
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  color: #e2e8f0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  margin: 16px 0;
  position: relative;
}

.geo-scanner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #081524;
  border-bottom: 1px solid #162c44;
  padding: 10px 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.geo-scanner-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
}

.geo-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: geo-pulse-dot 2s infinite;
}

@keyframes geo-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

.geo-tag {
  color: #38bdf8;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.geo-coords {
  color: #64748b;
  font-size: 10px;
}

.geo-scanner-modes {
  display: flex;
  gap: 6px;
}

.geo-tab-btn {
  background: #0a1b2d;
  border: 1px solid #1b3a58;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.geo-tab-btn:hover {
  background: #122840;
  color: #e2e8f0;
  border-color: #38bdf8;
}

.geo-tab-btn.active {
  background: #0e2e4e;
  color: #38bdf8;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

.geo-tab-pane {
  display: none;
}

.geo-tab-pane.active {
  display: block;
}

/* Split container */
.geo-split-container {
  position: relative;
  width: 100%;
  height: 440px;
  overflow: hidden;
  user-select: none;
  touch-action: pan-y;
  background: #02060b;
}

@media (max-width: 600px) {
  .geo-split-container {
    height: 330px;
  }
}

.geo-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.geo-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.geo-layer-paleo {
  z-index: 2;
  will-change: clip-path;
}

.geo-layer-badge {
  position: absolute;
  top: 12px;
  z-index: 6;
  background: rgba(6, 15, 24, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 6px 10px;
  border-radius: 4px;
  font-family: var(--font-mono, monospace);
  line-height: 1.3;
  pointer-events: none;
}

.geo-layer-badge.left {
  left: 12px;
  border-color: rgba(245, 158, 11, 0.4);
}

.geo-layer-badge.left span {
  color: #f59e0b;
  font-size: 10px;
  font-weight: 700;
  display: block;
}

.geo-layer-badge.right {
  right: 12px;
  text-align: right;
  border-color: rgba(56, 189, 248, 0.4);
}

.geo-layer-badge.right span {
  color: #38bdf8;
  font-size: 10px;
  font-weight: 700;
  display: block;
}

.geo-layer-badge small {
  color: #94a3b8;
  font-size: 8.5px;
  display: block;
}

/* Split divider line and handle */
.geo-split-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: #38bdf8;
  box-shadow: 0 0 12px #38bdf8;
  z-index: 10;
  transform: translateX(-50%);
  cursor: ew-resize;
  pointer-events: none;
}

.geo-split-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #071524;
  border: 2px solid #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: ew-resize;
  touch-action: none;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.geo-split-handle:hover,
.geo-split-handle:focus-visible {
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.9);
  outline: none;
}

.geo-handle-arrows {
  color: #38bdf8;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.geo-handle-label {
  font-family: var(--font-mono, monospace);
  font-size: 8px;
  color: #10b981;
  font-weight: 700;
  margin-top: 1px;
}

/* Range slider bottom bar */
.geo-slider-control {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #060e17;
  border-top: 1px solid #14283c;
}

.geo-slider-label {
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}

.geo-range-input {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #11263c;
  outline: none;
  cursor: pointer;
}

.geo-range-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  cursor: pointer;
  border: 2px solid #050a12;
}

.geo-range-input::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  cursor: pointer;
  border: 2px solid #050a12;
}

/* Interactive Hotspots */
.geo-hotspots-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 8;
}

.geo-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.geo-hotspot-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(8, 22, 36, 0.9);
  border: 2px solid #38bdf8;
  color: #38bdf8;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.7);
  transition: all 0.2s ease;
  padding: 0;
  position: relative;
}

.geo-hotspot-btn:hover,
.geo-hotspot-btn.active {
  transform: scale(1.2);
  background: #38bdf8;
  color: #040910;
  box-shadow: 0 0 20px rgba(56, 189, 248, 1);
}

.geo-hotspot-btn.turquoise {
  border-color: #10b981;
  color: #10b981;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.7);
}
.geo-hotspot-btn.turquoise:hover,
.geo-hotspot-btn.turquoise.active {
  background: #10b981;
  color: #040910;
  box-shadow: 0 0 20px rgba(16, 185, 129, 1);
}

.geo-hotspot-btn.amber {
  border-color: #f59e0b;
  color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.7);
}
.geo-hotspot-btn.amber:hover,
.geo-hotspot-btn.amber.active {
  background: #f59e0b;
  color: #040910;
  box-shadow: 0 0 20px rgba(245, 158, 11, 1);
}

.geo-hotspot-btn.crimson {
  border-color: #ef4444;
  color: #ef4444;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.7);
}
.geo-hotspot-btn.crimson:hover,
.geo-hotspot-btn.crimson.active {
  background: #ef4444;
  color: #040910;
  box-shadow: 0 0 20px rgba(239, 68, 68, 1);
}

/* Info card bottom */
.geo-info-card {
  padding: 14px 16px;
  background: #071321;
  border-top: 1px solid #162c44;
}

.geo-info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.geo-info-tag {
  font-family: var(--font-mono, monospace);
  font-size: 9.5px;
  color: #10b981;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.geo-info-title {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
}

.geo-info-text {
  font-size: 12px;
  line-height: 1.6;
  color: #cbd5e1;
  margin: 0 0 10px 0;
}

.geo-info-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: #38bdf8;
  border-top: 1px dashed #1b3854;
  padding-top: 8px;
}

/* Stratigraphic Core Tab */
.geo-core-view {
  padding: 16px;
  background: #060e17;
}

.geo-core-header {
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
}

.geo-core-columns {
  display: flex;
  gap: 10px;
  flex-direction: column;
}

.geo-stratum-row {
  display: flex;
  border: 1px solid #1a334d;
  border-radius: 4px;
  overflow: hidden;
  background: #0a1827;
  cursor: pointer;
  transition: all 0.2s ease;
}

.geo-stratum-row:hover,
.geo-stratum-row.selected {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
  transform: translateX(4px);
}

.geo-stratum-depth {
  width: 90px;
  padding: 10px;
  background: #081422;
  border-right: 1px solid #162d44;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
  display: flex;
  align-items: center;
}

.geo-stratum-visual {
  width: 20px;
  border-right: 1px solid #162d44;
}

.geo-stratum-content {
  flex: 1;
  padding: 8px 12px;
}

.geo-stratum-name {
  font-size: 12px;
  font-weight: 700;
  color: #e2e8f0;
  margin-bottom: 3px;
}

.geo-stratum-desc {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
}

.geo-stratum-meta {
  font-family: var(--font-mono, monospace);
  font-size: 9.5px;
  color: #38bdf8;
  margin-top: 4px;
}

/* ==========================================================================
   AI FORENSIC SCANNER (TRUMP & NORDICS / PLANETA K)
   ========================================================================== */
.forensic-tool {
  background: #050a12;
  border: 1px solid #1a3550;
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  color: #e2e8f0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  margin: 16px 0;
  position: relative;
}

.forensic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #081524;
  border-bottom: 1px solid #162c44;
  padding: 10px 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.forensic-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
}

.forensic-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: geo-pulse-dot 2s infinite;
}

.forensic-tag {
  color: #38bdf8;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.forensic-coords {
  color: #64748b;
  font-size: 10px;
}

.forensic-modes {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.forensic-filter-btn {
  background: #0a1b2d;
  border: 1px solid #1b3a58;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
  font-size: 9.5px;
  font-weight: 600;
  padding: 5px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.forensic-filter-btn:hover {
  background: #122840;
  color: #e2e8f0;
  border-color: #38bdf8;
}

.forensic-filter-btn.active {
  background: #0e2e4e;
  color: #38bdf8;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

/* Viewport */
.forensic-viewport {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  aspect-ratio: 1095 / 1029;
  background: #020509;
  overflow: hidden;
  user-select: none;
  cursor: crosshair;
  touch-action: none;
  border-radius: 4px;
}

.forensic-img-base,
.forensic-img-ela {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  display: block;
  pointer-events: none;
}

.forensic-img-ela {
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.forensic-viewport.filter-ela .forensic-img-ela {
  opacity: 1;
}

.forensic-overlay-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 4;
  display: none;
}

.forensic-viewport.filter-rays .forensic-overlay-rays {
  display: block;
}

.forensic-viewport.filter-glitches .forensic-overlay-glitches {
  display: block;
}

/* Magnifying Loupe */
.forensic-loupe {
  position: absolute;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 2px solid #38bdf8;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.7), inset 0 0 15px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 10;
  display: none;
  background-repeat: no-repeat;
  background-color: #030712;
  transform: translate(-50%, -50%);
  overflow: hidden;
}

.forensic-loupe-reticle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.forensic-loupe-reticle::before,
.forensic-loupe-reticle::after {
  content: "";
  position: absolute;
  background: rgba(56, 189, 248, 0.4);
}

.forensic-loupe-reticle::before {
  width: 100%;
  height: 1px;
}

.forensic-loupe-reticle::after {
  height: 100%;
  width: 1px;
}

.forensic-loupe-badge {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(5, 15, 25, 0.85);
  border: 1px solid #38bdf8;
  padding: 1px 6px;
  border-radius: 3px;
  font-family: var(--font-mono, monospace);
  font-size: 8px;
  color: #38bdf8;
  font-weight: 700;
  white-space: nowrap;
}

/* Hotspots for detective search */
.forensic-hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 6;
  cursor: pointer;
}

.forensic-hotspot-pulse {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px dashed #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f59e0b;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  transition: all 0.2s ease;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.forensic-hotspot.found .forensic-hotspot-pulse {
  border-color: #10b981;
  border-style: solid;
  background: rgba(16, 185, 129, 0.25);
  color: #10b981;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.8);
}

/* Quest progress bar */
.forensic-quest-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #081320;
  border-top: 1px solid #142a42;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.forensic-quest-counter {
  color: #f59e0b;
  font-weight: 700;
}

.forensic-quest-counter.completed {
  color: #10b981;
}

.forensic-quest-hint {
  color: #94a3b8;
  font-size: 9px;
}

/* Info card */
.forensic-card {
  padding: 14px 16px;
  background: #060e18;
  border-top: 1px solid #162c44;
}

.forensic-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.forensic-card-tag {
  font-family: var(--font-mono, monospace);
  font-size: 9.5px;
  color: #f59e0b;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.forensic-card-tag.verified {
  color: #10b981;
}

.forensic-card-title {
  margin: 0 0 6px 0;
  font-size: 14px;
  font-weight: 700;
  color: #f1f5f9;
}

.forensic-card-text {
  font-size: 12px;
  line-height: 1.6;
  color: #cbd5e1;
  margin: 0 0 10px 0;
}

.forensic-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: #38bdf8;
  border-top: 1px dashed #1b3854;
  padding-top: 8px;
}


/* ==========================================================================
   STREAM BROADCAST LIVE PLAYER (Chapter 2: Gleb's Broadcast 20:45:51 MSK)
   ========================================================================== */

.stream-widget {
  background: #07090e;
  border: 1px solid #162438;
  border-radius: 8px;
  overflow: hidden;
  font-family: var(--font-sans, system-ui, -apple-system, sans-serif);
  margin: 24px 0;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65);
}

.stream-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #0c121c;
  border-bottom: 1px solid #1a2a40;
  gap: 12px;
  flex-wrap: wrap;
}

.stream-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stream-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #f87171;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.stream-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  animation: streamPulse 1.4s infinite ease-in-out;
}

@keyframes streamPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.85); }
}

.stream-channel-meta {
  display: flex;
  flex-direction: column;
}

.stream-channel-name {
  font-size: 13px;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: 0.5px;
}

.stream-channel-sub {
  font-size: 10px;
  color: #64748b;
}

.stream-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stream-viewers {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: #38bdf8;
}

.stream-countdown-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: #94a3b8;
}

.stream-countdown-timer {
  color: #fbbf24;
  font-weight: 700;
  background: rgba(251, 191, 36, 0.12);
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.stream-audio-btn {
  background: #111e30;
  border: 1px solid #1e3a5f;
  color: #94a3b8;
  padding: 6px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.stream-audio-btn:hover {
  color: #38bdf8;
  border-color: #38bdf8;
  background: #162842;
}

/* Main Grid: Video Stage (left) + Chat (right) */
.stream-main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  min-height: 480px;
  background: #07090e;
}

@media (max-width: 900px) {
  .stream-main-grid {
    grid-template-columns: 1fr;
  }
}

.stream-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #040609;
  border-right: 1px solid #162438;
}

@media (max-width: 900px) {
  .stream-stage {
    border-right: none;
    border-bottom: 1px solid #162438;
  }
}

.stream-video-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1165 / 810;
  background: #020306;
  overflow: hidden;
}

.stream-cam-feed,
.stream-desktop-feed img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.stream-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.3) 50%);
  background-size: 100% 4px;
  z-index: 2;
  opacity: 0.6;
}

.stream-mic-meter {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(7, 14, 23, 0.88);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 4px;
  padding: 4px 8px;
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: #38bdf8;
}

.mic-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.mic-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.m-bar {
  width: 2px;
  height: 100%;
  background: #10b981;
  border-radius: 1px;
  transform-origin: bottom;
  transform: scaleY(0.4);
  transition: transform 0.08s ease;
}

.stream-notif-toast {
  position: absolute;
  top: 48px;
  left: 12px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(13, 22, 36, 0.94);
  border: 1px solid #1e3a5f;
  border-left: 3px solid #38bdf8;
  padding: 6px 10px;
  border-radius: 4px;
  backdrop-filter: blur(6px);
  max-width: 260px;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

.notif-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.notif-author {
  font-size: 9px;
  color: #94a3b8;
  font-weight: 600;
}

.notif-text {
  font-size: 11px;
  color: #f1f5f9;
}

.stream-pip-window {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 35%;
  max-width: 290px;
  aspect-ratio: 360 / 220;
  background: #080e18;
  border: 1px solid #1e3a5f;
  border-radius: 5px;
  overflow: hidden;
  z-index: 6;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
}

.stream-pip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0e1726;
  padding: 4px 6px;
  border-bottom: 1px solid #1b2e47;
}

.stream-pip-title {
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.5px;
}

.stream-pip-tabs {
  display: flex;
  gap: 3px;
}

.stream-pip-tab {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.15s;
}

.stream-pip-tab:hover {
  color: #e2e8f0;
}

.stream-pip-tab.active {
  background: #1e3a5f;
  color: #38bdf8;
  border-color: #38bdf8;
  font-weight: 700;
}

.stream-pip-swap-btn {
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 13px;
  cursor: pointer;
  padding: 0 3px;
}

.stream-pip-swap-btn:hover {
  color: #38bdf8;
}

.stream-pip-body {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #04070c;
}

.stream-pip-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.stream-chyron {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  background: rgba(5, 9, 15, 0.9);
  border: 1px solid rgba(22, 36, 56, 0.9);
  border-left: 3px solid #10b981;
  border-radius: 4px;
  padding: 7px 12px;
  backdrop-filter: blur(8px);
  z-index: 5;
  pointer-events: none;
}

.stream-chyron-badge {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  color: #10b981;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.stream-chyron-quote {
  font-size: 12px;
  font-style: italic;
  color: #f1f5f9;
  line-height: 1.35;
}

/* Timeline steps */
.stream-timeline-bar {
  padding: 8px 12px;
  background: #080d15;
  border-top: 1px solid #162438;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.stream-timeline-label {
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  color: #64748b;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.stream-timeline-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.stream-step-btn {
  background: #0f1826;
  border: 1px solid #1b2e47;
  border-radius: 4px;
  padding: 6px 3px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.stream-step-btn:hover {
  border-color: #38bdf8;
  background: #132238;
}

.stream-step-btn.active {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}

.stream-step-btn.alert-step {
  border-color: rgba(251, 191, 36, 0.4);
}

.stream-step-btn.alert-step.active {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.15);
}

.stream-step-btn.r7-step {
  border-color: rgba(244, 63, 94, 0.4);
}

.stream-step-btn.r7-step.active {
  border-color: #f43f5e;
  background: rgba(244, 63, 94, 0.18);
}

.step-time {
  display: block;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
}

.step-label {
  display: block;
  font-size: 9px;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* Chat Column */
.stream-chat-col {
  display: flex;
  flex-direction: column;
  background: #0a0f18;
  border-left: 1px solid #162438;
}

@media (max-width: 900px) {
  .stream-chat-col {
    border-left: none;
  }
}

.stream-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #0e1522;
  border-bottom: 1px solid #1a2a40;
}

.chat-header-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #e2e8f0;
  letter-spacing: 0.5px;
}

.chat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.chat-mode-badge {
  font-family: var(--font-mono, monospace);
  font-size: 9px;
  color: #64748b;
  background: #141f30;
  padding: 2px 5px;
  border-radius: 3px;
}

.stream-chat-list {
  flex: 1;
  padding: 10px 12px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  min-height: 260px;
  scroll-behavior: smooth;
}

.chat-msg-row {
  font-size: 12px;
  line-height: 1.45;
  animation: chatFade 0.2s ease-out;
}

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

.chat-msg-row.clickable {
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  transition: background 0.15s;
}

.chat-msg-row.clickable:hover {
  background: rgba(56, 189, 248, 0.08);
}

.chat-msg-time {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  color: #475569;
  margin-right: 4px;
}

.chat-msg-author {
  font-weight: 700;
  color: #38bdf8;
  margin-right: 4px;
}

.chat-msg-text {
  color: #cbd5e1;
}

.chat-msg-row.alert-msg {
  background: rgba(244, 63, 94, 0.12);
  border-left: 2px solid #f43f5e;
  padding: 4px 6px;
  border-radius: 2px;
}

.chat-msg-row.alert-msg .chat-msg-author {
  color: #f43f5e;
  font-family: var(--font-mono, monospace);
  font-weight: 700;
}

.chat-msg-row.alert-msg .chat-msg-text {
  color: #fda4af;
  font-family: var(--font-mono, monospace);
  font-weight: 600;
}

.chat-msg-row.user-msg {
  background: rgba(16, 185, 129, 0.1);
  border-left: 2px solid #10b981;
  padding: 4px 6px;
  border-radius: 2px;
}

.chat-msg-row.user-msg .chat-msg-author {
  color: #10b981;
  font-weight: 700;
}

.stream-factcheck-popup {
  background: #09131f;
  border: 1px solid #1e3a5f;
  border-left: 3px solid #38bdf8;
  border-radius: 4px;
  padding: 8px 10px;
  margin: 0 10px 8px 10px;
  font-size: 11px;
  line-height: 1.4;
  color: #e2e8f0;
}

.fc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.fc-badge {
  font-family: var(--font-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  color: #38bdf8;
}

.fc-close {
  background: none;
  border: none;
  color: #64748b;
  font-size: 12px;
  cursor: pointer;
}

.stream-chat-chips {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 6px 10px;
  background: #0c1320;
  border-top: 1px solid #162438;
  scrollbar-width: none;
}

.stream-chip {
  flex-shrink: 0;
  background: #131f33;
  border: 1px solid #1e3250;
  color: #94a3b8;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.stream-chip:hover {
  color: #38bdf8;
  border-color: #38bdf8;
  background: #192a45;
}

.stream-chat-form {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  background: #0e1624;
  border-top: 1px solid #1a2a40;
}

.stream-chat-input {
  flex: 1;
  background: #070a10;
  border: 1px solid #1e3250;
  color: #f1f5f9;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  outline: none;
}

.stream-chat-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 6px rgba(56, 189, 248, 0.2);
}

.stream-chat-send {
  background: #1e3a5f;
  border: 1px solid #38bdf8;
  color: #38bdf8;
  width: 32px;
  height: 30px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.stream-chat-send:hover {
  background: #38bdf8;
  color: #04070c;
}

/* Breach overlay (20:46:38) */
.stream-breach-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 14, 0.92);
  backdrop-filter: blur(8px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.stream-breach-box {
  background: #080f1a;
  border: 1px solid #f43f5e;
  box-shadow: 0 0 24px rgba(244, 63, 94, 0.35);
  border-radius: 6px;
  width: 100%;
  max-width: 520px;
  padding: 16px;
  font-family: var(--font-mono, monospace);
}

.breach-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed rgba(244, 63, 94, 0.4);
  padding-bottom: 8px;
  margin-bottom: 10px;
}

.breach-pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f43f5e;
  animation: streamPulse 1s infinite;
  display: inline-block;
  margin-right: 6px;
}

.breach-title {
  font-size: 11px;
  font-weight: 700;
  color: #f43f5e;
  letter-spacing: 0.5px;
}

.breach-dismiss-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
}

.breach-time {
  font-size: 10px;
  color: #fbbf24;
  margin-bottom: 8px;
}

.breach-terminal {
  background: #04070d;
  border: 1px solid #142236;
  border-radius: 4px;
  padding: 10px;
  font-size: 11px;
  line-height: 1.6;
  margin: 10px 0;
}

.term-line {
  color: #cbd5e1;
}

.term-cyan { color: #38bdf8; font-weight: 700; }
.term-amber { color: #fbbf24; font-weight: 700; }
.term-crimson { color: #f43f5e; font-weight: 700; }
.term-success { color: #10b981; font-weight: 700; margin-top: 6px; }

.term-alert-banner {
  margin-top: 8px;
  background: rgba(244, 63, 94, 0.2);
  border: 1px solid #f43f5e;
  color: #fecdd3;
  padding: 6px 8px;
  border-radius: 3px;
  font-weight: 700;
  text-align: center;
}

.breach-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.breach-examine-btn {
  background: #f43f5e;
  border: none;
  color: #fff;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.breach-examine-btn:hover {
  background: #e11d48;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.6);
}
