/**
 * MIDNIGHT CITY — TERMINAL DA ÉGIDE & CÓDICE TÁTICO
 * Design System Impeccable Refinado:
 * - Tipografia Operacional: Archivo (Títulos/Controles) + Source Sans 3 (Texto/Tabelas) + Space Mono (Comandos)
 * - Cabeçalho Compacto (1ª Tela Operacional em 1366x768)
 * - Superfície: Negro Estígio (#050608), Ouro Antigo (#d4af37) e Carmesim Sagrado (#c82924)
 * - Mascote Unificado: A Presença Aprisionada (Margem segura, balão contextual, Three.js isolado)
 * - Acessibilidade: Navegação por teclado nativa, focus rings visíveis, suporte a movimento reduzido
 */

:root {
  /* Cores Principais da Égide */
  --void: #050608;
  --surface-deep: #0a0912;
  --surface-card: #0f0e1a;
  --surface-elevated: #151324;
  --surface-hover: #1c1a30;
  
  --gold-primary: #d4af37;
  --gold-champagne: #f3e5ab;
  --gold-light: #f1d27a;
  --gold-dim: #8c6a2b;
  --gold-glow: rgba(212, 175, 55, 0.28);
  --gold-subtle: rgba(212, 175, 55, 0.12);
  
  --crimson-pure: #c82924;
  --crimson-glow: rgba(200, 41, 36, 0.3);
  --crimson-bg: rgba(200, 41, 36, 0.12);
  
  --text-ivory: #e6e3dc;
  --text-stone: #cfc7b4;
  --text-dim: #948e80;
  
  --border-gold: rgba(212, 175, 55, 0.24);
  --border-gold-bright: rgba(212, 175, 55, 0.55);
  --border-subtle: rgba(255, 255, 255, 0.08);

  /* Tipografia Operacional (Seção 13.1) */
  --font-heading: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono-code: 'Space Mono', 'JetBrains Mono', monospace;
  --font-brand: 'Cinzel', Georgia, serif;
  
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
}

/* ── Reset & Configurações de Superfície ── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--void);
  color: var(--text-ivory);
}

body[data-page="sistema"] {
  background-color: var(--void);
  color: var(--text-ivory);
  font-family: var(--font-body);
  font-size: 1.05rem; /* ~17px desktop per 13.1 */
  line-height: 1.62;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  user-select: auto;
}

::selection {
  background: var(--gold-primary);
  color: var(--void);
}

:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
}

/* Compensação de rolagem para header fixo (Seção 10.2) */
[id], .guide-station, .doc-reader-article, .doc-h2, .doc-h3 {
  scroll-margin-top: 110px;
}

/* ==========================================================================
   1. CABEÇALHO COMPACTO DO TERMINAL DA ÉGIDE (PRIMEIRA TELA OPERACIONAL)
   ========================================================================== */
.terminal-header-section {
  position: relative;
  background: radial-gradient(circle at 50% 15%, #100f1c 0%, var(--void) 75%);
  border-bottom: 1px solid var(--border-gold);
  padding: 5.5rem 1.5rem 2.25rem;
  text-align: center;
  overflow: hidden;
}

.terminal-header-section::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 50%;
  max-width: 650px;
  height: 100%;
  background-image: url('assets/neotheon-premium/terminal-egide-1280.webp');
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
  opacity: 0.16;
  pointer-events: none;
  mask-image: linear-gradient(to left, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 85%);
  -webkit-mask-image: linear-gradient(to left, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 85%);
  z-index: 0;
}

.terminal-shell {
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

/* Status Bar Superior */
.terminal-top-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono-code);
  font-size: 0.74rem;
}

.terminal-status-left {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-dim);
}

.terminal-stamp-badge {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-light);
  border: 1px solid var(--border-gold);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.terminal-security-label {
  color: var(--gold-primary);
  font-weight: 600;
  letter-spacing: 0.05em;
}

.talamasca-btn-consult {
  background: rgba(212, 175, 55, 0.09);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.95rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 38px;
}

.talamasca-btn-consult:hover {
  background: var(--gold-primary);
  color: var(--void);
  border-color: var(--gold-primary);
  box-shadow: 0 0 15px var(--gold-glow);
}

/* Bloco de Apresentação & H1 Único */
.terminal-intro-block {
  max-width: 820px;
  margin: 0 auto;
}

.terminal-crest-icon {
  margin-bottom: 0.25rem;
}

.terminal-main-h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.1rem, 3.8vw, 2.75rem);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 0.5rem;
}

.terminal-lead-desc {
  font-family: var(--font-body);
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--text-stone);
  margin: 0 0 1.75rem;
  line-height: 1.5;
}

/* Barra de Busca Rápida (1ª Tela) */
.terminal-search-wrapper {
  max-width: 680px;
  margin: 0 auto 1.6rem;
  width: 100%;
}

.terminal-search-field {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(15, 14, 26, 0.92);
  border: 1px solid var(--border-gold-bright);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.6rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.05);
  transition: all 0.25s ease;
}

.terminal-search-field:focus-within {
  border-color: var(--gold-light);
  box-shadow: 0 0 0 2px var(--gold-subtle), 0 10px 30px rgba(0, 0, 0, 0.7);
}

.terminal-search-icon {
  color: var(--gold-light);
  display: flex;
  align-items: center;
  padding: 0 0.6rem;
}

.terminal-search-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 1.05rem;
  padding: 0.6rem 0.4rem;
  outline: none;
  min-width: 0;
}

.terminal-search-input::placeholder {
  color: var(--text-dim);
  font-size: 0.95rem;
}

.terminal-search-clear {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.terminal-search-clear:hover {
  color: #ffffff;
}

/* Alternador de Modos Único */
.mode-switch-container {
  display: inline-flex;
  background: rgba(15, 14, 26, 0.95);
  border: 1px solid var(--border-gold);
  border-radius: 9999px;
  padding: 4px;
  gap: 4px;
  max-width: 100%;
}

.mode-switch-btn {
  background: transparent;
  border: none;
  color: var(--text-stone);
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0.55rem 1.4rem;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  min-height: 42px;
}

.mode-switch-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.mode-switch-btn.active {
  background: var(--gold-primary);
  color: var(--void);
  box-shadow: 0 4px 14px var(--gold-glow);
}

/* ==========================================================================
   2. SUPERFÍCIE PRINCIPAL DO TERMINAL
   ========================================================================== */
.egide-terminal {
  background-color: var(--void);
  padding: 2.5rem 1.5rem 6rem;
  min-height: 60vh;
}

/* ==========================================================================
   3. RESULTADOS DE BUSCA (COM TRECHOS E PAGINAÇÃO)
   ========================================================================== */
.terminal-search-results-panel {
  background: var(--surface-card);
  border: 1px solid var(--border-gold-bright);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin-bottom: 3rem;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65);
}

.search-results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-gold);
  font-family: var(--font-mono-code);
  font-size: 0.82rem;
  color: var(--gold-light);
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-result-row {
  display: block;
  text-decoration: none;
  background: rgba(10, 9, 18, 0.75);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.4rem;
  transition: all 0.2s ease;
}

.search-result-row:hover {
  border-color: var(--gold-light);
  background: var(--surface-elevated);
  transform: translateX(3px);
}

.search-result-cat {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gold-light);
  margin-bottom: 0.35rem;
}

.search-result-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  color: #ffffff;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.search-result-snippet {
  font-family: var(--font-body);
  font-size: 0.98rem;
  color: var(--text-stone);
  line-height: 1.55;
  margin: 0 0 0.6rem;
}

.search-result-snippet mark {
  background: rgba(212, 175, 55, 0.35);
  color: #ffffff;
  padding: 1px 4px;
  border-radius: 2px;
  font-weight: 600;
}

.search-result-action {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  color: var(--gold-light);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.search-empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-stone);
}

.search-empty-state p {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
}

.search-empty-sub {
  font-size: 0.95rem;
  color: var(--text-dim);
}

.search-pagination-wrap {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
}

/* ==========================================================================
   4. MODO NOVATO (GUIA DO RECRUTA EM 6 ETAPAS)
   ========================================================================== */
/* ==========================================================================
   4. MODO COMEÇAR A JOGAR — DOSSIÊ EDITORIAL DA ÉGIDE (SEÇÃO 6 & 7)
   Abertura com microfilme • Navegação sticky • 6 apresentações específicas
   ========================================================================== */

/* ── 4.1 ABERTURA EDITORIAL COM PROJEÇÃO DE MICROFILME ── */
.novato-intro-banner {
  background: linear-gradient(135deg, rgba(21, 19, 36, 0.95) 0%, rgba(10, 9, 18, 0.98) 100%);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 2rem 2.25rem;
  margin-bottom: 2.5rem;
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

@media (min-width: 900px) {
  .novato-intro-banner {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.intro-stamp-badge {
  display: inline-block;
  font-family: var(--font-mono-code);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--border-gold);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
}

.novato-intro-title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  color: #ffffff;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
}

.novato-intro-desc {
  font-size: 1.08rem;
  color: var(--text-stone);
  margin: 0 0 1.5rem;
  line-height: 1.6;
  max-width: 600px;
}

.intro-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
}

.guide-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.65rem 1.35rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
}

.guide-action-btn.primary {
  background: var(--gold-primary);
  color: var(--void);
  border: 1px solid var(--gold-primary);
}

.guide-action-btn.primary:hover {
  background: var(--gold-light);
  box-shadow: 0 0 18px var(--gold-glow);
  transform: translateY(-1px);
}

.guide-action-btn.secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--gold-light);
  border: 1px solid var(--border-gold);
}

.guide-action-btn.secondary:hover {
  background: rgba(212, 175, 55, 0.12);
  border-color: var(--gold-light);
  color: #ffffff;
}

/* Moldura de Microfilme com Estabilização de Imagem */
.microfilm-frame {
  position: relative;
  background: #000000;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.microfilm-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  filter: contrast(1.1) brightness(0.92) sepia(0.15);
  transition: filter 0.65s ease, transform 0.65s ease;
}

.microfilm-frame:hover .microfilm-img {
  filter: contrast(1.15) brightness(1) sepia(0);
  transform: scale(1.02);
}

.microfilm-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(5, 6, 8, 0.1) 0%, rgba(5, 6, 8, 0.6) 100%);
  pointer-events: none;
}

.microfilm-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.6rem 0.85rem;
  background: rgba(5, 6, 8, 0.88);
  border-top: 1px solid var(--border-gold);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono-code);
  font-size: 0.68rem;
  color: var(--gold-light);
  backdrop-blur: 4px;
}

.microfilm-label {
  letter-spacing: 0.1em;
  opacity: 0.8;
}

.microfilm-sub {
  font-weight: 700;
  color: #ffffff;
}

.microfilm-crosshairs::before,
.microfilm-crosshairs::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

.microfilm-crosshairs::before {
  top: 8px;
  left: 8px;
  width: 12px;
  height: 12px;
  border-top: 1.5px solid var(--gold-primary);
  border-left: 1.5px solid var(--gold-primary);
}

.microfilm-crosshairs::after {
  top: 8px;
  right: 8px;
  width: 12px;
  height: 12px;
  border-top: 1.5px solid var(--gold-primary);
  border-right: 1.5px solid var(--gold-primary);
}

/* ── 4.2 ESTRUTURA DOSSIÊ (ÍNDICE STICKY + CAPÍTULOS) ── */
.guide-dossier-layout {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 4rem;
}

@media (min-width: 1120px) {
  .guide-dossier-layout {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 2.25rem;
    align-items: start;
  }
}

/* Sidebar Sticky do Guia */
.guide-sticky-sidebar {
  position: relative;
}

@media (min-width: 1120px) {
  .guide-sticky-sidebar {
    position: sticky;
    top: 88px;
    z-index: 10;
  }
}

.guide-mobile-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
}

@media (min-width: 1120px) {
  .guide-mobile-status-bar {
    display: none;
  }
}

.guide-mobile-step-indicator {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  color: #ffffff;
}

.guide-step-tag {
  font-family: var(--font-mono-code);
  font-size: 0.7rem;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-light);
  padding: 1px 6px;
  border-radius: 2px;
  font-weight: 700;
}

.guide-mobile-expand-btn {
  background: none;
  border: none;
  color: var(--gold-light);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.5rem;
  min-height: 44px;
}

.guide-nav-list-wrap {
  display: none;
  background: var(--surface-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 1rem 0.85rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

@media (min-width: 1120px) {
  .guide-nav-list-wrap {
    display: block !important;
  }
}

.guide-nav-list-wrap.open {
  display: block;
  margin-top: 0.75rem;
}

.guide-nav-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.6rem;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono-code);
  font-size: 0.7rem;
  color: var(--gold-dim);
}

.guide-nav-title {
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-light);
}

.guide-nav-steps-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.guide-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  border-left: 2px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  cursor: pointer;
  transition: all 0.18s ease;
  min-height: 42px;
}

.guide-nav-item:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--border-gold);
}

.guide-nav-item.active {
  background: rgba(212, 175, 55, 0.16);
  border-color: var(--border-gold);
  border-left: 3px solid var(--gold-primary);
}

.guide-nav-item .step-num {
  font-family: var(--font-mono-code);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-light);
  min-width: 22px;
}

.guide-nav-item.active .step-num {
  color: #ffffff;
}

.guide-nav-item .step-label {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-stone);
  line-height: 1.3;
}

.guide-nav-item.active .step-label {
  color: #ffffff;
  font-weight: 700;
}

.guide-nav-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
}

.guide-nav-top-link {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0.35rem;
  transition: color 0.15s ease;
}

.guide-nav-top-link:hover {
  color: var(--gold-light);
}

/* ── 4.3 CAPÍTULOS EDITORIAIS (AS 6 ETAPAS) ── */
.guide-chapters-column {
  display: flex;
  flex-direction: column;
  gap: 3.5rem;
}

.station-card {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  scroll-margin-top: 96px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

@media (min-width: 768px) {
  .station-card {
    padding: 2.75rem 2.75rem;
  }
}

.station-card.active {
  border-color: var(--border-gold-bright);
  box-shadow: 0 16px 50px rgba(212, 175, 55, 0.08), 0 14px 40px rgba(0, 0, 0, 0.6);
}

.station-header {
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.5rem;
}

.station-tag-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}

.station-tag {
  font-family: var(--font-mono-code);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.1em;
}

.station-badge {
  background: rgba(212, 175, 55, 0.1);
  color: var(--gold-primary);
  border: 1px solid var(--border-gold);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.station-title {
  font-family: var(--font-heading);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
  margin: 0 0 0.65rem;
}

.station-objective {
  font-size: 1.05rem;
  color: var(--gold-champagne);
  margin: 0;
  line-height: 1.55;
}

.station-content-body {
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-ivory);
}

.station-section-label {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.station-footer {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.station-nav-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.station-step-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-gold);
  color: var(--text-stone);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 42px;
}

.station-step-btn:hover {
  background: var(--surface-hover);
  color: #ffffff;
  border-color: var(--gold-light);
}

.station-step-btn.next, .station-step-btn.finish {
  background: var(--gold-primary);
  color: var(--void);
  font-weight: 700;
  border-color: var(--gold-primary);
}

.station-step-btn.next:hover, .station-step-btn.finish:hover {
  background: var(--gold-light);
  box-shadow: 0 0 15px var(--gold-glow);
}

.station-direct-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gold-light);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.45rem 0.95rem;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.station-direct-link:hover {
  background: var(--gold-primary);
  color: var(--void);
  border-color: var(--gold-primary);
}

/* ── 4.4 MÓDULO ETAPA 01: DIAGRAMA TÁTICO DE ESQUADRÃO (SVG) ── */
.squad-tactical-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  margin: 1.75rem 0;
  align-items: start;
}

@media (min-width: 900px) {
  .squad-tactical-layout {
    grid-template-columns: 1fr 1.15fr;
  }
}

.squad-svg-container {
  background: rgba(10, 9, 18, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
  position: relative;
}

.squad-svg-canvas {
  width: 100%;
  max-width: 320px;
  height: auto;
  margin: 0 auto;
  display: block;
}

.squad-con-line {
  stroke: var(--border-gold);
  stroke-width: 1.5;
  stroke-dasharray: 4 3;
  transition: stroke 0.3s ease, stroke-width 0.3s ease;
}

.squad-node {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.squad-node:hover {
  transform: scale(1.05);
}

.squad-node-circle {
  fill: var(--surface-card);
  stroke: var(--border-gold);
  stroke-width: 2;
  transition: all 0.25s ease;
}

.squad-node.active .squad-node-circle {
  stroke: var(--gold-primary);
  fill: rgba(212, 175, 55, 0.2);
  filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.5));
}

.squad-node-text {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  fill: #ffffff;
}

.squad-role-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  justify-content: center;
}

.squad-role-pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-stone);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.squad-role-pill:hover {
  border-color: var(--border-gold);
  color: #ffffff;
}

.squad-role-pill.active {
  background: var(--gold-primary);
  border-color: var(--gold-primary);
  color: var(--void);
  font-weight: 700;
}

/* Painel de Detalhes da Função */
.squad-role-detail-card {
  background: var(--surface-deep);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.squad-role-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0.65rem;
}

.squad-role-detail-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: #ffffff;
  font-weight: 700;
  margin: 0;
}

.squad-role-badge {
  font-family: var(--font-mono-code);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 2px;
  background: rgba(212, 175, 55, 0.15);
  color: var(--gold-light);
}

.squad-role-detail-desc {
  font-size: 1rem;
  color: var(--text-stone);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.squad-role-affiliations {
  font-size: 0.86rem;
  color: var(--gold-light);
  font-family: var(--font-mono-code);
  background: rgba(15, 14, 26, 0.8);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
}

/* ── 4.5 MÓDULO ETAPA 02: DOSSIÊ DE ORIGENS NARRATIVAS ── */
.origins-dossier-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  margin: 1.75rem 0;
  align-items: start;
}

@media (min-width: 900px) {
  .origins-dossier-layout {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

.origins-cards-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.origin-protocol-card {
  background: var(--surface-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  transition: all 0.2s ease;
}

.origin-protocol-card:hover {
  border-color: var(--border-gold);
}

.origin-protocol-card.open {
  border-color: var(--border-gold-bright);
  background: rgba(21, 19, 36, 0.75);
}

.origin-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.origin-card-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.origin-card-num {
  font-family: var(--font-mono-code);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-light);
}

.origin-card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.origin-toggle-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--gold-light);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 32px;
}

.origin-toggle-btn:hover {
  background: var(--gold-primary);
  color: var(--void);
}

.origin-card-body {
  display: none;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.98rem;
  color: var(--text-stone);
  line-height: 1.55;
}

.origin-protocol-card.open .origin-card-body {
  display: block;
}

/* ── 4.6 MÓDULO ETAPA 03: REQUISIÇÃO OFICIAL DE FICHA & CÓPIA ── */
.requisition-sheet-wrap {
  background: var(--surface-deep);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin: 1.75rem 0;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.55);
}

.requisition-sheet-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-gold);
}

.requisition-stamp {
  font-family: var(--font-mono-code);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.1em;
}

.copy-model-btn {
  background: var(--gold-primary);
  color: var(--void);
  border: 1px solid var(--gold-primary);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  min-height: 42px;
}

.copy-model-btn:hover {
  background: var(--gold-light);
  box-shadow: 0 0 15px var(--gold-glow);
  transform: translateY(-1px);
}

.copy-feedback-msg {
  font-family: var(--font-mono-code);
  font-size: 0.8rem;
  color: #79d799;
  font-weight: 700;
  display: none;
}

.requisition-fields-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin-bottom: 1.25rem;
}

.requisition-fields-table tr {
  border-bottom: 1px solid var(--border-subtle);
}

.requisition-fields-table td {
  padding: 0.75rem 0.65rem;
  vertical-align: top;
}

.field-key-cell {
  font-family: var(--font-mono-code);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--gold-light);
  width: 35%;
  white-space: nowrap;
}

.field-inst-cell {
  color: var(--text-stone);
}

/* ── 4.7 MÓDULO ETAPA 04: TRILHA DE PROGRESSÃO SEGURA ── */
.activity-progression-trail {
  position: relative;
  margin: 2rem 0;
  padding-left: 2rem;
}

.activity-progression-trail::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 10px;
  bottom: 20px;
  width: 2px;
  background: linear-gradient(180deg, var(--gold-primary) 0%, rgba(212, 175, 55, 0.2) 100%);
}

.activity-milestone {
  position: relative;
  margin-bottom: 1.75rem;
}

.milestone-node {
  position: absolute;
  left: -2rem;
  top: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--surface-card);
  border: 2px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.milestone-node::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-light);
}

.milestone-card {
  background: var(--surface-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.4rem;
  transition: border-color 0.2s ease;
}

.milestone-card:hover {
  border-color: var(--border-gold);
}

.milestone-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.milestone-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.milestone-reward-badge {
  font-family: var(--font-mono-code);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--border-gold);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
}

.milestone-desc {
  font-size: 0.98rem;
  color: var(--text-stone);
  margin: 0;
  line-height: 1.55;
}

/* ── 4.8 MÓDULO ETAPA 06: VITRINE DE INVENTÁRIO DE MOEDAS ── */
.currency-vault-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin: 1.75rem 0;
}

.currency-tokens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.currency-token-card {
  background: var(--surface-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.currency-token-card.active {
  border-color: var(--gold-light);
  background: rgba(212, 175, 55, 0.1);
  box-shadow: 0 0 16px rgba(212, 175, 55, 0.15);
}

.currency-icon-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin: 0 auto 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: rgba(15, 14, 26, 0.9);
  border: 1.5px solid var(--border-gold);
}

.currency-token-card.active .currency-icon-circle {
  border-color: var(--gold-light);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.35);
}

.currency-token-name {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.35rem;
}

.currency-token-role {
  font-family: var(--font-mono-code);
  font-size: 0.72rem;
  color: var(--gold-light);
}

.currency-detail-panel {
  background: var(--surface-deep);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 1.5rem;
}

.currency-detail-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  color: #ffffff;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.currency-detail-desc {
  font-size: 1rem;
  color: var(--text-stone);
  line-height: 1.6;
  margin: 0;
}

/* Callouts Gerais */
.stencil-quote {
  background: rgba(212, 175, 55, 0.07);
  border-left: 3px solid var(--gold-primary);
  padding: 1rem 1.4rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--text-ivory);
}

.talamasca-callout {
  background: rgba(15, 14, 26, 0.9);
  border: 1px solid var(--border-gold);
  border-left: 4px solid var(--gold-primary);
  padding: 1.2rem 1.4rem;
  border-radius: var(--radius-sm);
  margin: 1.5rem 0;
}

.talamasca-danger-warning {
  background: var(--crimson-bg);
  border: 1px solid var(--crimson-pure);
  border-left: 4px solid var(--crimson-pure);
  color: #ffb8b6;
  padding: 1rem 1.4rem;
  border-radius: var(--radius-sm);
  margin: 1.5rem 0;
}

.talamasca-tip-box {
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid var(--border-gold);
  padding: 1.1rem 1.4rem;
  border-radius: var(--radius-sm);
  margin: 1.5rem 0;
}

/* ==========================================================================
   5. SIMULADOR DIDÁTICO DE ROLAGENS D10 (S03 / Seção 8.3)
   ========================================================================== */
.dice-sim-box {
  background: var(--surface-deep);
  border: 1px solid var(--border-gold-bright);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin: 1.75rem 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.dice-sim-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-gold);
}

.dice-sim-badge {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.08em;
}

.dice-sim-note {
  font-size: 0.8rem;
  color: var(--text-dim);
}

.dice-sim-formula {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.dice-cmd-badge {
  background: rgba(212, 175, 55, 0.12);
  color: var(--gold-light);
  border: 1px solid var(--border-gold);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono-code);
  font-size: 0.95rem;
  font-weight: 700;
}

.dice-sim-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.sim-ctrl-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.sim-ctrl-group label {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-stone);
}

.sim-select {
  background: var(--surface-card);
  border: 1px solid var(--border-gold);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  outline: none;
}

.sim-select:focus {
  border-color: var(--gold-light);
}

.dice-pill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.dice-pill {
  width: 48px;
  height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono-code);
  transition: all 0.2s ease;
}

.dice-pill .dice-num {
  font-size: 1.25rem;
  font-weight: 700;
}

.dice-pill .dice-tag {
  font-size: 0.7rem;
}

.dice-pill.success {
  background: rgba(212, 175, 55, 0.16);
  border-color: var(--gold-primary);
  color: var(--gold-light);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.15);
}

.dice-pill.fail {
  background: rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
}

.dice-res-explanation {
  background: rgba(15, 14, 26, 0.7);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.4rem;
}

.dice-count-line {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
  color: #ffffff;
}

.highlight-gold {
  color: var(--gold-light);
  font-weight: 700;
}

.dice-rule-quote {
  font-size: 1.05rem;
  color: var(--text-ivory);
  font-style: italic;
  margin: 0.5rem 0 0.85rem;
  line-height: 1.5;
}

.dice-footer-disclaimer {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.5;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.65rem;
}

.dice-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* ==========================================================================
   6. MODO ARQUIVO GERAL (2 COLUNAS: SIDEBAR + LEITOR)
   ========================================================================== */
.terminal-grid {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 2rem;
  max-width: 1280px;
  margin: 0 auto;
}

.terminal-sidebar-toggle-btn {
  display: none;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  background: var(--surface-card);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-bottom: 1.5rem;
  min-height: 44px;
}

.terminal-sidebar {
  background: var(--surface-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  height: fit-content;
  position: sticky;
  top: 90px;
}

.sidebar-title {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold-light);
  text-transform: uppercase;
  margin-bottom: 0.85rem;
  padding: 0 0.5rem 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.sidebar-categories-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-category-group {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

.sidebar-cat-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.sidebar-cat-btn {
  flex: 1;
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-stone);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 40px;
}

.sidebar-cat-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #ffffff;
}

.sidebar-cat-btn.active {
  background: rgba(212, 175, 55, 0.14);
  border-color: var(--border-gold);
  color: var(--gold-light);
  font-weight: 700;
}

.sidebar-category-group.active-group > .sidebar-cat-row .sidebar-cat-btn {
  color: var(--gold-light);
}

.sidebar-cat-icon {
  color: var(--gold-primary);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.sidebar-cat-expander {
  background: transparent;
  border: 1px solid transparent;
  color: var(--gold-light);
  width: 32px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.sidebar-cat-expander:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--border-subtle);
  color: #ffffff;
}

.sidebar-cat-chevron {
  display: inline-block;
  font-size: 0.85rem;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--gold-dim);
}

.sidebar-cat-chevron.rotated {
  transform: rotate(180deg);
  color: var(--gold-light);
}

/* Submenu de Tópicos dentro de cada Tema */
.sidebar-subtopics-list {
  list-style: none;
  margin: 0.2rem 0 0.5rem 1rem;
  padding: 0.25rem 0 0.25rem 0.75rem;
  border-left: 1.5px solid var(--border-gold);
  display: none;
  flex-direction: column;
  gap: 0.2rem;
}

.sidebar-subtopics-list.expanded {
  display: flex;
  animation: fadeInSubmenu 0.2s ease-out;
}

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

.sidebar-subtopic-item {
  margin: 0;
}

.sidebar-subtopic-link {
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  padding: 0.35rem 0.55rem;
  text-decoration: none;
  color: var(--text-stone);
  font-family: var(--font-body);
  font-size: 0.8rem;
  line-height: 1.35;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.sidebar-subtopic-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
  transform: translateX(2px);
}

.sidebar-subtopic-link.active {
  color: var(--gold-light);
  font-weight: 700;
  background: rgba(212, 175, 55, 0.14);
  border-left: 2px solid var(--gold-primary);
  padding-left: 0.45rem;
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.1);
}

.subtopic-dot {
  color: var(--gold-dim);
  font-size: 0.85rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.sidebar-subtopic-link.active .subtopic-dot {
  color: var(--gold-light);
}

.subtopic-text {
  word-break: break-word;
}

/* Área de Visualização do Diretório */
.category-hero-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.category-code-tag {
  font-family: var(--font-mono-code);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.1em;
}

.category-name-title {
  font-family: var(--font-heading);
  font-size: clamp(1.45rem, 2.2vw, 1.95rem);
  font-weight: 700;
  color: #ffffff;
  margin: 0.25rem 0 0.4rem;
}

.category-description {
  font-size: 1.05rem;
  color: var(--text-stone);
  margin: 0;
  line-height: 1.5;
}

.doc-cards-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.doc-row-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  background: var(--surface-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.6rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.doc-row-card:hover {
  border-color: var(--gold-light);
  background: var(--surface-elevated);
  transform: translateX(3px);
}

.doc-card-body {
  flex: 1;
}

.doc-row-title {
  font-family: var(--font-heading);
  font-size: 1.18rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.4rem;
}

.doc-row-summary {
  font-size: 0.98rem;
  color: var(--text-stone);
  line-height: 1.55;
  margin: 0 0 0.4rem;
}

.doc-row-source {
  font-family: var(--font-mono-code);
  font-size: 0.75rem;
  color: var(--gold-dim);
}

.doc-row-action {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--gold-light);
  font-weight: 600;
  white-space: nowrap;
}

/* ==========================================================================
   7. LEITOR DE DOCUMENTO COMPLETO (S07 / Seção 7)
   ========================================================================== */
.terminal-document-reader {
  background: var(--surface-card);
  border: 1px solid var(--border-gold-bright);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.75rem;
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.65);
  outline: none;
}

.reader-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 0.82rem;
  margin-bottom: 1.5rem;
}

.reader-breadcrumb a {
  color: var(--gold-light);
  text-decoration: none;
  font-weight: 600;
}

.reader-breadcrumb a:hover {
  text-decoration: underline;
}

.reader-breadcrumb-sep {
  color: var(--text-dim);
}

.reader-title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 2.8vw, 2.25rem);
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.4rem;
}

.reader-subtitle {
  font-size: 1.1rem;
  color: var(--text-stone);
  margin: 0 0 1.25rem;
}

.reader-meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--font-mono-code);
  font-size: 0.78rem;
  color: var(--gold-light);
  margin-bottom: 1.75rem;
}

/* Índice de Subtópicos do Leitor (TOC) */
.reader-subtopics-nav {
  background: var(--surface-deep);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 1rem 1.4rem;
  margin-bottom: 2rem;
}

.reader-toc-title {
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  display: block;
  margin-bottom: 0.6rem;
}

.reader-toc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.toc-subtopic-link {
  color: var(--text-stone);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: 0.92rem;
  transition: color 0.15s ease;
}

.toc-subtopic-link:hover {
  color: var(--gold-light);
  text-decoration: underline;
}

/* Corpo do Documento (Tipografia & Tabelas) */
.reader-body-content {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-ivory);
}

.reader-body-content h3 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  color: #ffffff;
  font-weight: 700;
  margin: 2rem 0 0.85rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
  scroll-margin-top: 110px;
}

.reader-body-content p {
  margin: 0 0 1.25rem;
}

.reader-body-content ul, .reader-body-content ol {
  margin: 0 0 1.5rem;
  padding-left: 1.6rem;
}

.reader-body-content li {
  margin-bottom: 0.6rem;
}

/* Tabelas com Scroll Horizontal Local (Seção 5.3) */
.table-microfilm-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  background: var(--surface-deep);
}

.talamasca-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  text-align: left;
}

.talamasca-table th {
  background: rgba(212, 175, 55, 0.14);
  color: var(--gold-light);
  font-family: var(--font-heading);
  font-weight: 700;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border-gold);
  white-space: nowrap;
}

.talamasca-table td {
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-ivory);
}

.talamasca-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.talamasca-source-note {
  font-size: 0.84rem;
  color: var(--text-dim);
  font-style: italic;
  margin-top: 0.65rem;
}

/* Navegação Linear Sequencial (Tópico Anterior / Próximo Tópico) */
.reader-linear-nav {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-gold);
}

.linear-nav-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 640px) {
  .linear-nav-inner {
    grid-template-columns: 1fr;
  }
}

.linear-nav-btn {
  display: flex;
  flex-direction: column;
  padding: 1.15rem 1.35rem;
  background: var(--surface-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.2s ease;
  min-height: 80px;
  justify-content: center;
}

.linear-nav-btn:hover {
  border-color: var(--gold-light);
  background: rgba(212, 175, 55, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.linear-nav-btn.prev {
  text-align: left;
}

.linear-nav-btn.next {
  text-align: right;
  border-color: var(--border-gold);
  background: rgba(212, 175, 55, 0.05);
}

.linear-nav-btn.next:hover {
  background: rgba(212, 175, 55, 0.12);
}

.linear-nav-sub {
  font-family: var(--font-mono-code);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold-light);
  margin-bottom: 0.35rem;
  display: block;
}

.linear-nav-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
}

.linear-nav-placeholder {
  visibility: hidden;
}

/* ==========================================================================
   8. COMPANION DA PRESENÇA APRISIONADA (S06, S10, S11 / Seção 10)
   ========================================================================== */
.presence-floating-dock {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

.presence-floating-dock * {
  pointer-events: auto;
}

.presence-floating-dock.collapsed .presence-speech-bubble {
  display: none !important;
}

.presence-floating-dock.collapsed .presence-stage-wrap {
  transform: scale(0.85);
  opacity: 0.75;
}

/* Balão Contextual Seguro */
.presence-speech-bubble {
  width: 320px;
  max-width: calc(100vw - 36px);
  background: rgba(10, 9, 18, 0.96);
  border: 1px solid var(--border-gold-bright);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  margin-bottom: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 20px var(--gold-subtle);
  backdrop-filter: blur(12px);
  transition: all 0.25s ease;
}

.presence-speech-bubble.pinned {
  border-color: var(--gold-primary);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9), 0 0 28px rgba(212, 175, 55, 0.45);
}

.presence-pin-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.65rem;
  background: rgba(212, 175, 55, 0.07);
  border: 1px dashed var(--border-gold);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono-code);
  font-size: 0.72rem;
  color: var(--gold-light);
  margin-bottom: 0.75rem;
  transition: all 0.2s ease;
  user-select: none;
}

.presence-speech-bubble.pinned .presence-pin-status {
  background: rgba(212, 175, 55, 0.22);
  border-style: solid;
  border-color: var(--gold-primary);
  color: #ffffff;
  font-weight: 700;
}

.pin-hint-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.pin-hint-text {
  line-height: 1.25;
}

.presence-bubble-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.presence-bubble-tag {
  font-family: var(--font-mono-code);
  font-size: 0.65rem;
  color: var(--gold-light);
  font-weight: 700;
  letter-spacing: 0.08em;
}

.presence-bubble-close {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0 4px;
}

.presence-bubble-close:hover {
  color: #ffffff;
}

.presence-bubble-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.4rem;
}

.presence-bubble-quote {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--gold-light);
  line-height: 1.45;
  margin-bottom: 0.5rem;
}

.presence-bubble-note {
  font-size: 0.9rem;
  color: var(--text-stone);
  line-height: 1.55;
  margin-bottom: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.5rem;
}

.presence-bubble-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 0.6rem;
  font-family: var(--font-mono-code);
  font-size: 0.72rem;
}

.presence-cycle-btn {
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  font-family: var(--font-heading);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 32px;
}

.presence-cycle-btn:hover {
  background: var(--gold-primary);
  color: var(--void);
}

.presence-cycle-indicator {
  color: var(--text-dim);
}

/* Palco Three.js Compacto */
.presence-stage-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: all 0.2s ease;
}

.presence-canvas-card {
  width: 100px;
  height: 115px;
  background: rgba(10, 9, 18, 0.9);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  position: relative;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: all 0.2s ease;
}

.presence-canvas-card:hover {
  border-color: var(--gold-light);
  box-shadow: 0 0 20px var(--gold-glow);
  transform: translateY(-2px);
}

.presence-floating-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Fallback Visual e Camadas da Presença (Higgsfield) */
.presence-fallback-visual {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.presence-layered {
  position: relative;
  width: 90px;
  height: 95px;
  isolation: isolate;
  pointer-events: none;
}

.presence-layered .presence-orb {
  position: absolute;
  width: 64px;
  height: auto;
  left: 2px;
  top: 14px;
  animation: presence-idle 4s ease-in-out infinite;
}

.presence-layered .presence-broom {
  position: absolute;
  width: auto;
  height: 85px;
  left: 56px;
  top: 2px;
  transform-origin: 50% 38%;
  transform: rotate(-6deg);
}

.presence-layered.is-sweeping .presence-broom {
  animation: presence-sweep 1.8s ease-in-out 1;
}

@keyframes presence-idle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes presence-sweep {
  0%, 100% { transform: rotate(-6deg); }
  25%, 65% { transform: rotate(6deg); }
  45%, 85% { transform: rotate(-6deg); }
}

@media (prefers-reduced-motion: reduce) {
  .presence-layered .presence-orb,
  .presence-layered.is-sweeping .presence-broom {
    animation: none;
  }
}

.presence-canvas-badge {
  position: absolute;
  bottom: 4px;
  font-family: var(--font-mono-code);
  font-size: 0.6rem;
  color: var(--gold-light);
  letter-spacing: 0.08em;
  background: rgba(5, 6, 8, 0.8);
  padding: 1px 5px;
  border-radius: 2px;
  z-index: 2;
}

.presence-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-card);
  border: 1px solid var(--border-gold);
  color: var(--gold-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
}

.presence-toggle-btn:hover {
  background: var(--gold-primary);
  color: var(--void);
}

/* ==========================================================================
   9. MODAL DA PRESENÇA (AJUDA & FAQS • SEM IA)
   ========================================================================== */
.presence-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(5, 6, 8, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.presence-dialog {
  background: var(--surface-card);
  border: 1px solid var(--border-gold-bright);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 30px var(--gold-subtle);
}

.presence-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-gold);
}

.presence-title-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.presence-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.presence-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease;
}

.presence-close-btn:hover {
  color: #ffffff;
}

.presence-body {
  padding: 1.75rem;
}

.presence-signal-window {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
}

.presence-svg-frame {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.presence-intro-text p {
  margin: 0 0 0.35rem;
  font-size: 0.96rem;
  color: var(--text-stone);
}

.presence-response-box {
  background: var(--surface-deep);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  margin-bottom: 1.75rem;
}

.presence-response-q {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 0.5rem;
}

.presence-response-a {
  font-size: 0.98rem;
  color: var(--text-ivory);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.presence-doc-shortcut-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--void);
  background: var(--gold-primary);
  text-decoration: none;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s ease;
}

.presence-doc-shortcut-btn:hover {
  background: var(--gold-light);
}

.presence-faq-section h4 {
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin: 0 0 1rem;
}

.presence-faq-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}

.presence-faq-chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.presence-faq-chip:hover {
  border-color: var(--border-gold);
  background: rgba(212, 175, 55, 0.08);
}

.faq-chip-q {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
}

.faq-chip-cat {
  font-family: var(--font-mono-code);
  font-size: 0.72rem;
  color: var(--gold-light);
}

/* ==========================================================================
   10. RESPONSIVIDADE E BREAKPOINTS (S15 / Seção 5.2 & 5.3)
   ========================================================================== */
@media (max-width: 1024px) {
  .terminal-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .terminal-sidebar-toggle-btn {
    display: flex;
  }

  .terminal-sidebar {
    display: none;
    position: static;
    margin-bottom: 1.5rem;
  }

  .terminal-sidebar.open {
    display: block;
  }

  .terminal-document-reader {
    padding: 1.75rem 1.5rem;
  }

  .station-card {
    padding: 1.75rem 1.5rem;
  }

  .novato-intro-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 640px) {
  .terminal-header-section {
    padding: 5rem 1rem 1.75rem;
  }

  .terminal-top-status {
    flex-direction: column;
    align-items: flex-start;
  }

  .terminal-main-h1 {
    font-size: 1.85rem;
  }

  .mode-switch-container {
    width: 100%;
    justify-content: center;
  }

  .mode-switch-btn {
    flex: 1;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
  }

  .presence-floating-dock {
    bottom: 16px;
    right: 16px;
  }

  .presence-speech-bubble {
    width: calc(100vw - 32px);
    right: 0;
  }

  .presence-canvas-card {
    width: 80px;
    height: 95px;
  }

  .station-nav-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .station-step-btn, .station-direct-link {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   11. MOVIMENTO REDUZIDO (S14 / Seção 11.3)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .presence-canvas-card:hover {
    transform: none !important;
  }

  .doc-row-card:hover, .search-result-row:hover {
    transform: none !important;
  }
}
