/* 
  The Falklands Historical Record & Jamstack Portal
  Design System & Stylesheet
*/

:root,
html,
[data-theme="dark"],
[data-theme="light"] {
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-serif: 'Merriweather', Georgia, Cambria, 'Times New Roman', Times, serif;
  --font-mono: 'JetBrains Mono', SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Color Palette - Dark Mode (Default & Active System Theme) */
  --bg-primary: #090d16;
  --bg-surface: #0f172a;
  --bg-card: #141e33;
  --bg-subtle: #1e293b;
  --bg-hover: #334155;
  --border-color: #334155;
  --border-light: #1e293b;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  --primary: #3b82f6;       /* Blue */
  --primary-hover: #60a5fa;
  --primary-light: #172554;
  --primary-border: #1e40af;

  --accent-gold: #f59e0b;    /* Royal Gold */
  --accent-gold-bg: #451a03;
  --accent-red: #ef4444;     /* British Red / Warning */
  --accent-red-bg: #450a0a;
  --accent-green: #22c55e;   /* Validated Fact */
  --accent-green-bg: #052e16;
  --accent-purple: #a855f7;
  --accent-purple-bg: #3b0764;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.6);

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

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --header-height: 4rem;
}

/* ==========================================================================
   PRESERVED LIGHT THEME PALETTE
   (Preserved for future re-enablement and visual refinement)
   ==========================================================================
.theme-light-preserved {
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-hover: #e2e8f0;
  --border-color: #cbd5e1;
  --border-light: #e2e8f0;

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --primary: #1e3a8a;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-border: #bfdbfe;

  --accent-gold: #b45309;
  --accent-gold-bg: #fef3c7;
  --accent-red: #b91c1c;
  --accent-red-bg: #fee2e2;
  --accent-green: #15803d;
  --accent-green-bg: #dcfce7;
  --accent-purple: #6d28d9;
  --accent-purple-bg: #ede9fe;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}
*/

/* Theme Toggle Controls - Temporarily removed from UI while Dark Theme is default & only theme */
#theme-toggle-btn,
#drawer-theme-btn,
.theme-toggle-btn {
  display: none !important;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
  scroll-padding-top: calc(var(--header-height, 4rem) + 0.75rem);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-top: var(--header-height, 4rem);
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

@media (max-width: 768px) {
  :root {
    --header-height: 3.5rem;
  }
  .container {
    padding: 0 1rem;
  }
}

/* Header & Navigation - Persistently Floating at Top of Page */
header.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1500;
  background-color: rgba(15, 23, 42, 0.94);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-header .container {
  max-width: 1480px;
}

.nav-wrapper,
.header-inner,
.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  gap: 0.75rem;
  width: 100%;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
}

.logo-icon {
  width: 2.3rem;
  height: 1.84rem;
  background: #090e1a url('assets/images/atlas-1765-logo.svg') no-repeat center center;
  background-size: cover;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  color: transparent;
  user-select: none;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.logo-icon:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.logo-text h1 {
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.logo-text span {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  white-space: nowrap;
  display: block;
}

/* Dropdown Navigation Architecture (Clean 3-Cluster System) */
nav.desktop-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.nav-link,
.nav-dropdown-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.7rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover,
.nav-dropdown:hover .nav-dropdown-btn,
.nav-dropdown.open .nav-dropdown-btn {
  color: var(--text-primary);
  background-color: var(--bg-card);
  border-color: var(--border-color);
}

.nav-link.active {
  color: #ffffff;
  background-color: var(--primary-light);
  border-color: var(--primary-border);
}

.btn-databases-highlight {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}
.btn-databases-highlight:hover,
.nav-dropdown:hover .btn-databases-highlight,
.nav-dropdown.open .btn-databases-highlight {
  background: rgba(59, 130, 246, 0.22);
  border-color: var(--primary);
  color: #ffffff;
}

.nav-pill-badge {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 700;
  background: var(--primary);
  color: #ffffff;
  padding: 0.1rem 0.42rem;
  border-radius: var(--radius-full);
}

.dropdown-chevron {
  font-size: 0.65rem;
  transition: transform var(--transition-fast);
  color: var(--text-muted);
}
.nav-dropdown:hover .dropdown-chevron,
.nav-dropdown.open .dropdown-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

/* Dropdown Menu Container */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 290px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  box-shadow: 0 14px 30px -4px rgba(0, 0, 0, 0.65), 0 8px 12px -6px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Multi-column Adaptive Layout for Databases & Vaults */
.nav-dropdown[data-section="databases"] .nav-dropdown-menu,
.nav-dropdown-menu-wide {
  min-width: 680px;
  max-width: min(740px, calc(100vw - 2rem));
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem 0.6rem;
  right: 0;
  left: auto;
  max-height: calc(100vh - 4.5rem);
  max-height: calc(100dvh - 4.5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* Custom Scrollbar for Dropdown Menu */
.nav-dropdown[data-section="databases"] .nav-dropdown-menu::-webkit-scrollbar,
.nav-dropdown-menu-wide::-webkit-scrollbar {
  width: 5px;
}
.nav-dropdown[data-section="databases"] .nav-dropdown-menu::-webkit-scrollbar-track,
.nav-dropdown-menu-wide::-webkit-scrollbar-track {
  background: transparent;
}
.nav-dropdown[data-section="databases"] .nav-dropdown-menu::-webkit-scrollbar-thumb,
.nav-dropdown-menu-wide::-webkit-scrollbar-thumb {
  background: var(--border-color, rgba(148, 163, 184, 0.2));
  border-radius: 4px;
}
.nav-dropdown[data-section="databases"] .nav-dropdown-menu::-webkit-scrollbar-thumb:hover,
.nav-dropdown-menu-wide::-webkit-scrollbar-thumb:hover {
  background: var(--primary, #38bdf8);
}

/* Vertical real estate constraints (short viewports: laptops, split screens, tablets) */
@media (max-height: 800px) {
  .nav-dropdown[data-section="databases"] .nav-dropdown-menu,
  .nav-dropdown-menu-wide {
    padding: 0.35rem 0.45rem;
    gap: 0.25rem 0.45rem;
  }
  .nav-dropdown[data-section="databases"] .nav-dropdown-item,
  .nav-dropdown-menu-wide .nav-dropdown-item {
    padding: 0.42rem 0.55rem;
    gap: 0.55rem;
  }
  .nav-dropdown[data-section="databases"] .dropdown-item-desc,
  .nav-dropdown-menu-wide .dropdown-item-desc {
    font-size: 0.72rem;
    margin-top: 0.1rem;
    line-height: 1.25;
  }
}

/* Extremely constrained vertical real estate (< 650px height) */
@media (max-height: 650px) {
  .nav-dropdown[data-section="databases"] .nav-dropdown-menu,
  .nav-dropdown-menu-wide {
    padding: 0.25rem 0.35rem;
    gap: 0.2rem 0.35rem;
    max-height: calc(100vh - 3.8rem);
  }
  .nav-dropdown[data-section="databases"] .nav-dropdown-item,
  .nav-dropdown-menu-wide .nav-dropdown-item {
    padding: 0.32rem 0.45rem;
    gap: 0.45rem;
  }
  .nav-dropdown[data-section="databases"] .dropdown-item-icon,
  .nav-dropdown-menu-wide .dropdown-item-icon {
    font-size: 1.1rem;
  }
  .nav-dropdown[data-section="databases"] .dropdown-item-title,
  .nav-dropdown-menu-wide .dropdown-item-title {
    font-size: 0.8rem;
  }
  .nav-dropdown[data-section="databases"] .dropdown-item-desc,
  .nav-dropdown-menu-wide .dropdown-item-desc {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}

/* Individual Dropdown Item */
.nav-dropdown-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  border: 1px solid transparent;
}

.nav-dropdown-item:hover {
  background: var(--bg-subtle);
  border-color: var(--border-light);
  color: var(--text-primary);
  transform: translateX(2px);
}

.dropdown-item-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 0.1rem;
}

.dropdown-item-text {
  flex: 1;
  min-width: 0;
}

.dropdown-item-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  line-height: 1.3;
}

.dropdown-badge-count {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: var(--bg-primary);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
  flex-shrink: 0;
}

.dropdown-item-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 0.2rem;
}

/* Header Controls */
.header-controls {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.search-input-wrapper input {
  padding: 0.38rem 0.75rem 0.38rem 1.95rem;
  font-size: 0.82rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  width: 165px;
  box-sizing: border-box;
  transition: width var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  width: 200px;
  background-color: var(--bg-surface);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.search-icon {
  position: absolute;
  left: 0.65rem;
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.85rem;
}

.btn-icon {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 2.15rem;
  height: 2.15rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.btn-icon:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.lang-toggle {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  flex-shrink: 0;
}

.lang-toggle:hover {
  background: var(--bg-hover);
}

/* Header Back Button Removed - Clutters header menu and causes horizontal overrun */
.btn-subpage-back {
  display: none !important;
}

.btn-subpage-back:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--primary);
  transform: translateX(-2px);
}

.btn-subpage-back .back-arrow {
  font-size: 0.85rem;
  transition: transform var(--transition-fast);
}

.btn-subpage-back:hover .back-arrow {
  transform: translateX(-2px);
}

/* Header Mobile Menu Toggle Button */
.mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.mobile-menu-btn:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.mobile-menu-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* ==========================================================================
   Universal Bilingual Language Display System (CSS-Driven)
   ========================================================================== */

/* Default & English Mode: Show English, Hide Spanish */
.lang-es,
html:not([lang="es"]) .lang-es,
html[lang="en"] .lang-es {
  display: none !important;
}

.lang-en,
html:not([lang="es"]) .lang-en,
html[lang="en"] .lang-en {
  display: block;
}

span.lang-en, a.lang-en, strong.lang-en, em.lang-en, b.lang-en, i.lang-en, small.lang-en, code.lang-en, label.lang-en,
html:not([lang="es"]) span.lang-en, html:not([lang="es"]) a.lang-en, html:not([lang="es"]) strong.lang-en, html:not([lang="es"]) em.lang-en,
html[lang="en"] span.lang-en, html[lang="en"] a.lang-en, html[lang="en"] strong.lang-en, html[lang="en"] em.lang-en, html[lang="en"] small.lang-en {
  display: inline !important;
}

li.lang-en,
html:not([lang="es"]) li.lang-en,
html[lang="en"] li.lang-en {
  display: list-item !important;
}

/* Spanish Mode: Show Spanish, Hide English */
html[lang="es"] .lang-en {
  display: none !important;
}

html[lang="es"] .lang-es {
  display: block !important;
}

html[lang="es"] span.lang-es,
html[lang="es"] a.lang-es,
html[lang="es"] strong.lang-es,
html[lang="es"] em.lang-es,
html[lang="es"] b.lang-es,
html[lang="es"] i.lang-es,
html[lang="es"] small.lang-es,
html[lang="es"] code.lang-es,
html[lang="es"] label.lang-es {
  display: inline !important;
}

html[lang="es"] li.lang-es {
  display: list-item !important;
}

/* Bilingual comparative document box */
.bilingual-doc-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 768px) {
  .bilingual-doc-box {
    grid-template-columns: 1fr;
  }
}
.doc-col-es {
  border-left: 3px solid #0284c7;
  padding-left: 1rem;
}
.doc-col-en {
  border-left: 3px solid #64748b;
  padding-left: 1rem;
}
.doc-lang-tag {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  display: inline-block;
  margin-bottom: 0.5rem;
}
.tag-es {
  background-color: rgba(2, 132, 199, 0.15);
  color: #0284c7;
}
.tag-en {
  background-color: rgba(100, 116, 139, 0.15);
  color: #64748b;
}

/* Hero Section */
.hero {
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-primary) 100%);
  border-bottom: 1px solid var(--border-light);
  padding: 3.5rem 0 2.5rem;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  background-color: var(--primary-light);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero h2 {
  font-family: var(--font-sans);
  font-size: 2.75rem;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  max-width: 950px;
  margin: 0 auto 1rem;
}

.hero p.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  max-width: 820px;
  margin: 0 auto 2rem;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background-color: var(--bg-card);
  color: var(--text-primary);
  padding: 0.75rem 1.6rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-secondary:hover {
  background-color: var(--bg-hover);
  border-color: var(--text-muted);
}

/* Stats Ribbon */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}

.stat-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
  border-color: var(--primary);
}

.stat-number {
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 0.35rem;
}

.stat-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.stat-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Main Content Area */
main.site-content {
  flex: 1;
  padding: 2.5rem 0 5rem;
}

/* Section Header */
.section-header {
  margin-bottom: 2rem;
  text-align: left;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title-group h3 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  letter-spacing: -0.02em;
}

.section-title-group p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-top: 0.25rem;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.75rem;
}

.filter-btn {
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.filter-btn.active {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Interactive Tabs Section - Refactored (No horizontal scrollbar) */
.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2.5rem;
  padding: 0.5rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow-x: visible;
}

.tab-btn {
  padding: 0.65rem 1.15rem;
  background-color: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: normal;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  user-select: none;
}

.tab-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.tab-btn.active,
[data-theme="dark"] .tab-btn.active {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary-border);
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.35);
  font-weight: 700;
}

.tab-pane {
  display: none;
  animation: fadeIn 250ms ease;
}

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

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

/* Timeline Layout */
.timeline-container {
  position: relative;
  padding-left: 2.5rem;
}

.timeline-container::before {
  content: '';
  position: absolute;
  left: 0.85rem;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--primary) 0%, var(--accent-gold) 100%);
  border-radius: var(--radius-full);
}

.timeline-card {
  position: relative;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.timeline-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
  transform: translateX(4px);
}

.timeline-dot {
  position: absolute;
  left: -2.15rem;
  top: 1.5rem;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 50%;
  background-color: var(--bg-surface);
  border: 3px solid var(--primary);
  box-shadow: var(--shadow-sm);
}

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

.timeline-year-badge {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--primary);
  background-color: var(--primary-light);
  border: 1px solid var(--primary-border);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-sm);
}

.timeline-category {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
}

.timeline-card h4 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  color: var(--text-primary);
}

.timeline-summary {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
  line-height: 1.55;
}

.timeline-significance {
  background-color: var(--bg-subtle);
  border-left: 3px solid var(--accent-gold);
  padding: 0.65rem 0.9rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.85rem;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.timeline-significance strong {
  color: var(--accent-gold);
}

.timeline-sources {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Demographics Side-by-Side Comparison: ALWAYS 2 COLUMNS (NEVER DEGRADE TO 1 COLUMN) */
.demographics-split,
.demographics-comparison-split,
#demographics-comparison-split {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 1.75rem;
  margin-bottom: 2.5rem;
  width: 100%;
  box-sizing: border-box;
}

.demographics-comparison-split > div {
  min-width: 0;
  box-sizing: border-box;
}

.demographics-comparison-split h4 {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 1.25rem !important;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  word-break: normal;
  overflow-wrap: break-word;
}

/* 2-Column Responsive Scaling: Enforces strict 2-column comparative layout across all viewports */
@media (max-width: 992px) {
  .demographics-split,
  .demographics-comparison-split,
  #demographics-comparison-split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 1.25rem !important;
  }
  .demographics-comparison-split h4 {
    font-size: 1.05rem;
    margin-bottom: 1rem !important;
  }
}

@media (max-width: 880px) {
  .demographics-split,
  .demographics-comparison-split,
  #demographics-comparison-split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 0.85rem !important;
  }
  .demographics-comparison-split h4 {
    font-size: 0.95rem;
    margin-bottom: 0.75rem !important;
    line-height: 1.25;
  }
}

@media (max-width: 640px) {
  .demographics-split,
  .demographics-comparison-split,
  #demographics-comparison-split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 0.5rem !important;
  }
  .demographics-comparison-split h4 {
    font-size: 0.82rem;
    margin-bottom: 0.5rem !important;
    line-height: 1.2;
    flex-wrap: wrap;
  }
}

@media (max-width: 420px) {
  .demographics-split,
  .demographics-comparison-split,
  #demographics-comparison-split {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 0.35rem !important;
  }
  .demographics-comparison-split h4 {
    font-size: 0.76rem;
    margin-bottom: 0.35rem !important;
  }
}

/* Demographics Cards Styling */
#demographics .person-card {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin-bottom: 1rem;
  transition: all var(--transition-fast);
  word-break: normal;
  overflow-wrap: break-word;
}

#demographics .person-card:hover,
#demographics .falklands-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
}

/* Card Header */
#demographics .person-header {
  display: flex;
  align-items: flex-start;
  margin-bottom: 0.5rem;
  width: 100%;
}

#demographics .person-identity-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
  width: 100%;
}

#demographics .person-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  background-color: var(--bg-surface);
}

#demographics .person-info {
  min-width: 0;
  flex: 1;
}

#demographics .person-name {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 0.2rem;
  word-break: normal;
  overflow-wrap: break-word;
}

#demographics .person-role {
  font-size: 0.84rem;
  color: #9333ea;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  word-break: normal;
  overflow-wrap: break-word;
}

[data-theme="dark"] #demographics .person-role {
  color: #c084fc;
}

/* Badges Container */
#demographics .person-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0.6rem 0 0.75rem 0;
  width: 100%;
}

#demographics .badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.55rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: normal;
  line-height: 1.3;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  box-sizing: border-box;
  word-break: normal;
  overflow-wrap: break-word;
}

/* Metadata Row */
#demographics .person-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.85rem;
  margin-bottom: 0.65rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

#demographics .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  word-break: normal;
  overflow-wrap: break-word;
}

#demographics .person-desc {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
  word-break: normal;
  overflow-wrap: break-word;
}

/* Dossier Link Button */
#demographics .person-footer {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--border-light);
}

#demographics .btn-dossier {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  line-height: 1.3;
  word-break: normal;
  overflow-wrap: break-word;
}

#demographics .btn-dossier,
#demographics .btn-dossier-arg,
#demographics .btn-dossier-falk {
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid var(--primary-border);
}

#demographics .btn-dossier:hover,
#demographics .btn-dossier-arg:hover,
#demographics .btn-dossier-falk:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Branch & Body Badge Themes (Purple like Martín Menem) */
.badge-branch-pen,
.badge-branch-chancellery,
.badge-branch-senate,
.badge-branch-deputies,
.badge-body-dual,
.badge-body-exco,
.badge-body-legco {
  background: rgba(147, 51, 234, 0.12);
  color: #9333ea;
  border: 1px solid rgba(147, 51, 234, 0.3);
}

/* Dark Mode Badges & Buttons */
[data-theme="dark"] #demographics .btn-dossier,
[data-theme="dark"] #demographics .btn-dossier-arg,
[data-theme="dark"] #demographics .btn-dossier-falk {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(96, 165, 250, 0.35);
}

[data-theme="dark"] #demographics .btn-dossier:hover,
[data-theme="dark"] #demographics .btn-dossier-arg:hover,
[data-theme="dark"] #demographics .btn-dossier-falk:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

[data-theme="dark"] .badge-branch-pen,
[data-theme="dark"] .badge-branch-chancellery,
[data-theme="dark"] .badge-branch-senate,
[data-theme="dark"] .badge-branch-deputies,
[data-theme="dark"] .badge-body-dual,
[data-theme="dark"] .badge-body-exco,
[data-theme="dark"] .badge-body-legco {
  background: rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  border-color: rgba(192, 132, 252, 0.4);
}

/* Filter Bar Styling */
#demographics .filter-bar {
  margin-bottom: 1.5rem;
}

#demographics .filter-btn {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

#demographics .filter-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}

#demographics .filter-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  font-weight: 700;
}

#demographics .filter-btn.falk-btn.active {
  background: var(--accent-green);
  color: #ffffff;
  border-color: var(--accent-green);
}

/* Demographics Cards Responsive Scaling in 2-Column Mode */
@media (max-width: 880px) {
  #demographics .person-card {
    padding: 0.85rem 0.7rem;
    margin-bottom: 0.75rem;
  }
  #demographics .person-avatar {
    width: 44px;
    height: 44px;
  }
  #demographics .person-name {
    font-size: 0.95rem;
  }
  #demographics .person-role {
    font-size: 0.78rem;
  }
  #demographics .person-desc {
    font-size: 0.8rem;
    line-height: 1.45;
  }
  #demographics .badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
  }
  #demographics .person-meta {
    font-size: 0.75rem;
    gap: 0.3rem 0.6rem;
  }
  #demographics .btn-dossier {
    font-size: 0.76rem;
    padding: 0.35rem 0.55rem;
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
    text-align: center;
  }
}

@media (max-width: 640px) {
  #demographics .person-card {
    padding: 0.65rem 0.5rem;
    margin-bottom: 0.55rem;
    border-radius: var(--radius-sm);
  }
  #demographics .person-identity-wrapper {
    gap: 0.45rem;
  }
  #demographics .person-avatar {
    width: 36px;
    height: 36px;
  }
  #demographics .person-name {
    font-size: 0.84rem;
    line-height: 1.2;
  }
  #demographics .person-role {
    font-size: 0.7rem;
    line-height: 1.2;
  }
  #demographics .person-desc {
    font-size: 0.72rem;
    line-height: 1.35;
  }
  #demographics .badge {
    font-size: 0.58rem;
    padding: 0.12rem 0.28rem;
    letter-spacing: 0;
  }
  #demographics .person-meta {
    font-size: 0.68rem;
    gap: 0.2rem 0.35rem;
    line-height: 1.25;
    margin-bottom: 0.45rem;
  }
  #demographics .person-footer {
    margin-top: 0.5rem;
    padding-top: 0.4rem;
  }
  #demographics .btn-dossier {
    font-size: 0.68rem;
    padding: 0.28rem 0.35rem;
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
    text-align: center;
  }
}

@media (max-width: 420px) {
  #demographics .person-card {
    padding: 0.5rem 0.35rem;
    margin-bottom: 0.45rem;
  }
  #demographics .person-identity-wrapper {
    gap: 0.35rem;
  }
  #demographics .person-avatar {
    width: 28px;
    height: 28px;
  }
  #demographics .person-name {
    font-size: 0.76rem;
    line-height: 1.15;
  }
  #demographics .person-role {
    font-size: 0.64rem;
    line-height: 1.15;
  }
  #demographics .person-desc {
    font-size: 0.65rem;
    line-height: 1.3;
  }
  #demographics .badge {
    font-size: 0.52rem;
    padding: 0.1rem 0.2rem;
  }
  #demographics .person-meta {
    font-size: 0.6rem;
    gap: 0.15rem 0.25rem;
  }
  #demographics .btn-dossier {
    font-size: 0.6rem;
    padding: 0.2rem 0.25rem;
  }
}

/* 2-Column Cabinet Filter Grid: Stays 2 columns */
.cabinet-filter-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 1.75rem;
  width: 100%;
  box-sizing: border-box;
}
.cabinet-filter-col {
  min-width: 0;
  box-sizing: border-box;
}

@media (max-width: 880px) {
  .cabinet-filter-grid {
    gap: 0.85rem !important;
  }
  #demographics .filter-btn,
  #cabinet-filters .filter-btn,
  .cabinet-filter-grid .filter-btn {
    font-size: 0.75rem;
    padding: 0.28rem 0.45rem;
    max-width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 640px) {
  .cabinet-filter-grid {
    gap: 0.45rem !important;
  }
  #demographics .filter-btn,
  #cabinet-filters .filter-btn,
  .cabinet-filter-grid .filter-btn {
    font-size: 0.65rem;
    padding: 0.2rem 0.32rem;
    letter-spacing: -0.01em;
  }
}

@media (max-width: 420px) {
  .cabinet-filter-grid {
    gap: 0.3rem !important;
  }
  #demographics .filter-btn,
  #cabinet-filters .filter-btn,
  .cabinet-filter-grid .filter-btn {
    font-size: 0.58rem;
    padding: 0.16rem 0.25rem;
    letter-spacing: -0.02em;
  }
}

/* 2-Column Demographic Findings Callout Grid */
.demographic-findings-grid {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
}
.finding-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  min-width: 0;
  box-sizing: border-box;
}
.finding-card .finding-title {
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  line-height: 1.25;
}
.finding-card p {
  font-size: 0.74rem;
  line-height: 1.42;
  color: var(--text-secondary);
  margin: 0;
}
.finding-falklands {
  border-left: 3px solid var(--accent-green);
}
.finding-argentina {
  border-left: 3px solid var(--primary);
}

@media (max-width: 880px) {
  .finding-card {
    padding: 0.55rem 0.65rem;
  }
  .finding-card .finding-title {
    font-size: 0.76rem;
  }
  .finding-card p {
    font-size: 0.69rem;
    line-height: 1.38;
  }
}

@media (max-width: 640px) {
  .demographic-findings-grid {
    gap: 0.45rem !important;
  }
  .finding-card {
    padding: 0.45rem 0.4rem;
  }
  .finding-card .finding-title {
    font-size: 0.70rem;
    line-height: 1.2;
  }
  .finding-card p {
    font-size: 0.63rem;
    line-height: 1.32;
  }
}

@media (max-width: 420px) {
  .demographic-findings-grid {
    gap: 0.3rem !important;
  }
  .finding-card {
    padding: 0.35rem 0.3rem;
  }
  .finding-card .finding-title {
    font-size: 0.64rem;
    line-height: 1.15;
    margin-bottom: 0.25rem;
  }
  .finding-card p {
    font-size: 0.58rem;
    line-height: 1.25;
  }
}

.dossier-column {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

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

.dossier-column-header h4 {
  font-size: 1.35rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dossier-column-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Dossier Cards */
.person-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  transition: all var(--transition-fast);
}

.person-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
}

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

.person-identity-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
  flex: 1;
}

.person-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-color);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
  background-color: var(--bg-surface);
}

.person-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.person-role {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-post,
.badge-expat,
.badge-immigrant {
  background-color: var(--accent-red-bg);
  color: var(--accent-red);
  border: 1px solid rgba(185, 28, 28, 0.25);
}

[data-theme="dark"] .badge-post,
[data-theme="dark"] .badge-expat,
[data-theme="dark"] .badge-immigrant {
  background-color: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}

.badge-mixed {
  background-color: var(--accent-gold-bg);
  color: var(--accent-gold);
  border: 1px solid rgba(180, 83, 9, 0.25);
}

.badge-pre,
.badge-gen {
  background-color: var(--accent-green-bg);
  color: var(--accent-green);
  border: 1px solid rgba(21, 128, 61, 0.3);
}

[data-theme="dark"] .badge-pre,
[data-theme="dark"] .badge-gen {
  background-color: rgba(34, 197, 94, 0.18);
  color: #86efac;
  border-color: rgba(34, 197, 94, 0.4);
}

.person-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.person-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Feature Callout Box */
.feature-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.feature-box.highlight {
  border-left: 6px solid var(--primary);
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-subtle) 100%);
}

.feature-box h4 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.feature-box p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.feature-box p:last-child {
  margin-bottom: 0;
}

/* Debunked Myths Grid */
.myths-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.myth-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-fast);
}

.myth-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
}

.myth-header {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.myth-icon {
  background-color: var(--accent-red-bg);
  color: var(--accent-red);
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.myth-header h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.35;
}

.myth-fact-box {
  background-color: var(--bg-subtle);
  border-left: 3px solid var(--accent-green);
  padding: 0.85rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.myth-fact-box strong {
  color: var(--accent-green);
  display: block;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.myth-legal {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.btn-copy {
  align-self: flex-start;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
}

.btn-copy:hover {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* A to Z Rebuttal Grid */
.atoz-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 1.75rem;
  justify-content: center;
}

.atoz-btn {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-sm);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.atoz-btn:hover {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

.atoz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.atoz-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
}

.atoz-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
}

.atoz-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.atoz-letter {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--accent-gold));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 900;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.atoz-card-header h4 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-primary);
}

.atoz-content-en, .atoz-content-es {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.atoz-content-es {
  font-style: italic;
  border-left: 2px solid var(--accent-gold);
  padding-left: 0.75rem;
}

/* Legal & Historical Glossary Components */
.glossary-toolbar {
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.glossary-search-box {
  position: relative;
  margin-bottom: 1rem;
}

.glossary-search-input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  color: var(--text-primary);
  font-size: 0.92rem;
  outline: none;
  font-family: inherit;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.glossary-search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.glossary-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.glossary-pill {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.glossary-pill:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--primary);
}

.glossary-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary-hover);
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.35);
}

.glossary-pill-count {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 9999px;
  padding: 0.08rem 0.45rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
}

.atoz-btn.empty {
  opacity: 0.35;
  cursor: not-allowed;
  background-color: var(--bg-primary);
  border-color: var(--border-color);
}

.atoz-btn.active {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

.glossary-card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.glossary-badge-cat {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.glossary-badge-international_law { background: rgba(59, 130, 246, 0.12); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.glossary-badge-bilateral_treaties { background: rgba(16, 185, 129, 0.12); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.glossary-badge-un_architecture { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }
.glossary-badge-argentine_statutes { background: rgba(245, 158, 11, 0.12); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.glossary-badge-historical_precedents { background: rgba(168, 85, 247, 0.12); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }

.glossary-citation {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  padding: 0.35rem 0.6rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}

.glossary-forensic-box {
  background: var(--bg-subtle);
  border-left: 3px solid var(--primary);
  padding: 0.75rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 1rem;
  font-size: 0.84rem;
  line-height: 1.5;
}

.glossary-forensic-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.glossary-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
  flex-wrap: wrap;
}

.glossary-dossier-link {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
}

.glossary-dossier-link:hover {
  color: var(--primary-hover);
  transform: translateX(2px);
}


/* Map & Plaque Media Section */
.media-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

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

.media-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.media-preview-container {
  background-color: #0b0f19;
  position: relative;
  min-height: 320px;
  max-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.media-preview-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform var(--transition-normal);
  cursor: pointer;
}

.media-preview-container img:hover {
  transform: scale(1.02);
}

.media-info {
  padding: 1.5rem;
}

.media-info h4 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.media-info p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1rem;
}

/* Architects Grid */
.architects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.architect-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.architect-card h4 {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 0.25rem;
}

.architect-role {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 0.75rem;
}

.architect-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.85rem;
}

.architect-impact {
  background-color: var(--bg-subtle);
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-primary);
}

/* Modal Popup */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.85);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background-color: var(--bg-surface);
  border-radius: var(--radius-lg);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  box-shadow: var(--shadow-xl);
}

.modal-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-primary);
}

/* Search Highlights */
mark.search-highlight {
  background-color: #fef08a;
  color: #0f172a;
  padding: 0 0.2rem;
  border-radius: 2px;
}

/* ==========================================================================
   Universal Site Footer & Multi-Column Navigation Matrix
   ========================================================================== */
footer.site-footer {
  background-color: var(--bg-surface);
  background: linear-gradient(180deg, var(--bg-surface) 0%, #070c18 100%);
  border-top: 1px solid var(--border-color);
  padding: 4rem 0 2.25rem 0;
  margin-top: auto;
  position: relative;
  color: var(--text-secondary);
}

.site-footer .container {
  max-width: 1280px;
}

/* Centered fallback for legacy pages using .footer-content */
.footer-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.footer-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

/* High-Impact Multi-Column Footer Grid */
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 3.5rem;
  align-items: start;
  text-align: left;
}

.footer-col {
  display: flex;
  flex-direction: column;
  text-align: left;
}

/* Brand Column */
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.1rem;
  text-decoration: none;
  width: fit-content;
}

.footer-logo-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.08rem;
  background: #090e1a url('assets/images/atlas-1765-logo.svg') no-repeat center center;
  background-size: cover;
  border-radius: 6px;
  font-size: 0;
  color: transparent;
  user-select: none;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.footer-logo:hover .footer-logo-icon {
  transform: scale(1.05);
  border-color: rgba(56, 189, 248, 0.65);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.footer-logo-title {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}

.footer-col p {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 400px;
  margin: 0 0 1.25rem 0;
  text-align: left;
}

.footer-trust-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.8rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  font-size: 0.76rem;
  color: var(--text-secondary);
  font-weight: 500;
  width: fit-content;
}

.footer-trust-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

/* Section Column Headings */
.footer-col h4,
.footer-col-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #38bdf8;
  margin: 0 0 1.25rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  min-width: 140px;
  text-align: left;
}

/* Link Lists */
.footer-links {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  text-align: left;
}

.footer-links li {
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.88rem;
  line-height: 1.4;
  transition: all var(--transition-fast);
  padding: 0.15rem 0;
}

.footer-links a::before {
  content: '›';
  color: var(--primary);
  font-size: 1.15rem;
  line-height: 1;
  opacity: 0.4;
  transition: all var(--transition-fast);
  margin-top: -1px;
}

.footer-links a:hover {
  color: #ffffff;
  transform: translateX(4px);
  text-decoration: none;
}

.footer-links a:hover::before {
  opacity: 1;
  color: #60a5fa;
  transform: translateX(2px);
}

.footer-links a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Bottom Bar */
.footer-bottom {
  margin-top: 3.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  text-align: left;
}

.footer-bottom p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

.footer-legal-link {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

.footer-legal-link:hover {
  color: var(--primary-hover);
}

.footer-bottom-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer-back-to-top {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.footer-back-to-top:hover {
  color: var(--text-primary);
  border-color: var(--primary);
  background: var(--bg-hover);
  transform: translateY(-2px);
  text-decoration: none;
}

/* Legal Safe Harbor & Campillay Compliance Notice */
.legal-safe-harbor {
  max-width: 1280px;
  margin: 2rem auto 0 auto;
  padding: 1.25rem 1.5rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  font-size: 0.76rem;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: left;
}

.legal-safe-harbor p {
  margin: 0 0 0.65rem 0;
}

.legal-safe-harbor p:last-child {
  margin-bottom: 0;
}

.legal-safe-harbor strong {
  color: var(--text-secondary);
}

.legal-safe-harbor em {
  font-style: italic;
  color: var(--text-primary);
}

/* Bottom Legal Contact Link Button */
.legal-contact-btn-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.5rem auto 0 auto;
  text-align: center;
  width: 100%;
}

.legal-contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  padding: 0.75rem 1.6rem;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none !important;
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-md, 8px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}

.legal-contact-btn:hover {
  background: rgba(56, 189, 248, 0.18) !important;
  border-color: rgba(56, 189, 248, 0.7) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(56, 189, 248, 0.25);
  color: #7dd3fc !important;
}

.legal-contact-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(56, 189, 248, 0.2);
}

.legal-contact-btn-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 500;
  background: rgba(56, 189, 248, 0.15);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #bae6fd;
  letter-spacing: 0.02em;
}

.legal-contact-btn .btn-arrow {
  transition: transform 0.2s ease;
}

.legal-contact-btn:hover .btn-arrow {
  transform: translateX(3px);
}

[data-theme="light"] .legal-contact-btn {
  background: rgba(2, 132, 199, 0.08);
  border-color: rgba(2, 132, 199, 0.35);
  color: #0284c7 !important;
}

[data-theme="light"] .legal-contact-btn:hover {
  background: rgba(2, 132, 199, 0.15) !important;
  border-color: rgba(2, 132, 199, 0.7) !important;
  color: #0369a1 !important;
}

[data-theme="light"] .legal-contact-btn-badge {
  background: rgba(2, 132, 199, 0.12);
  border-color: rgba(2, 132, 199, 0.3);
  color: #0369a1;
}

/* Responsive Footer Breakpoints */
@media (max-width: 900px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
  }
  .footer-col:first-child {
    grid-column: span 2;
  }
}

@media (max-width: 640px) {
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-col:first-child {
    grid-column: span 1;
  }
  footer.site-footer {
    padding: 2.5rem 0 1.5rem;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  .footer-bottom-actions {
    width: 100%;
    justify-content: space-between;
  }
}

/* Toast Notification */
.toast-msg {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: #1e293b;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 3000;
  display: none;
  animation: slideUp 200ms ease;
}

.toast-msg.show {
  display: block;
}

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

/* Responsive Utilities */

/* Compact Desktop Navigation Adjustment: Tier 1 (1221px - 1440px) */
@media (max-width: 1440px) and (min-width: 1221px) {
  html .logo-text span,
  html .logo-text .lang-en,
  html .logo-text .lang-es,
  html[lang] .logo-text span,
  header .logo-text span {
    display: none !important;
  }
  .desktop-nav {
    gap: 0.22rem;
  }
  .nav-link,
  .nav-dropdown-btn {
    padding: 0.35rem 0.55rem;
    font-size: 0.82rem;
  }
  .search-input-wrapper input {
    width: 130px;
  }
  .search-input-wrapper input:focus {
    width: 170px;
  }
}

/* Compact Desktop Navigation Adjustment: Tier 2 (993px - 1220px) */
@media (max-width: 1220px) and (min-width: 993px) {
  html .logo-text span,
  html .logo-text .lang-en,
  html .logo-text .lang-es,
  html[lang] .logo-text span,
  header .logo-text span {
    display: none !important;
  }
  .desktop-nav {
    gap: 0.14rem;
  }
  .nav-link,
  .nav-dropdown-btn {
    padding: 0.28rem 0.42rem;
    font-size: 0.77rem;
  }
  .search-input-wrapper input {
    width: 105px;
  }
  .search-input-wrapper input:focus {
    width: 145px;
  }
  .ipfs-nav-btn {
    padding: 0.28rem 0.45rem;
    font-size: 0.76rem;
  }
  .lang-toggle {
    padding: 0.28rem 0.42rem;
    font-size: 0.74rem;
  }
  .nav-dropdown[data-section="databases"] .nav-dropdown-menu,
  .nav-dropdown-menu-wide {
    min-width: 580px;
    gap: 0.25rem 0.4rem;
  }
}

/* ==========================================================================
   MOBILE NAVIGATION ARCHITECTURE (3 CONFIGURABLE MODES)
   - Mode A: Off-Canvas Slide-Over Drawer (Default / Recommended)
   - Mode B: Modern Bottom App Bar & Slide-Up Sheet
   - Mode C: Horizontally Scrollable Chip Pills Ribbon
   - Selector: Footer Configuration Widget
   ========================================================================== */

/* Universal Header Compactness & Degradation Breakpoint (<= 992px) */
@media (max-width: 992px) {
  .desktop-nav {
    display: none !important;
  }
  .mobile-menu-btn {
    display: inline-flex !important;
  }
}

@media (max-width: 640px) {
  .logo-text span {
    display: none !important;
  }
  .site-logo {
    gap: 0.4rem;
  }
  .logo-icon {
    width: 2.1rem;
    height: 1.68rem;
    font-size: 0;
  }
  .logo-text h1 {
    font-size: 0.92rem;
  }
  .ipfs-nav-btn .ipfs-nav-label {
    display: none;
  }
  .ipfs-nav-btn {
    padding: 0.32rem 0.45rem;
    font-size: 0.85rem;
  }
  .lang-toggle {
    padding: 0.28rem 0.45rem;
    font-size: 0.75rem;
  }
  .btn-icon, .mobile-menu-btn {
    width: 2rem;
    height: 2rem;
    font-size: 0.95rem;
  }
  .btn-subpage-back {
    padding: 0.28rem 0.5rem;
    font-size: 0.74rem;
  }
}

/* Small Smart Phones (<= 480px) */
@media (max-width: 480px) {
  .site-header .container {
    padding: 0 0.55rem;
  }
  .site-logo {
    gap: 0.35rem;
  }
  .logo-icon {
    width: 1.95rem;
    height: 1.56rem;
    font-size: 0;
  }
  .logo-text h1 {
    font-size: 0.86rem;
  }
  .header-controls {
    gap: 0.22rem;
  }
  /* On small mobile screens, IPFS is accessible via Drawer, Bottom Sheet & Footer */
  .header-controls .ipfs-nav-btn {
    display: none !important;
  }
  .btn-subpage-back span:not(.back-arrow) {
    display: none !important;
  }
  .btn-subpage-back {
    padding: 0;
    width: 1.85rem;
    height: 1.85rem;
    justify-content: center;
  }
  .lang-toggle {
    padding: 0.25rem 0.38rem;
    font-size: 0.72rem;
  }
  .btn-icon, .mobile-menu-btn {
    width: 1.85rem;
    height: 1.85rem;
    font-size: 0.88rem;
  }
}

/* Extra Small Smart Phones (<= 360px) */
@media (max-width: 360px) {
  .site-header .container {
    padding: 0 0.4rem;
  }
  .logo-text h1 {
    font-size: 0.8rem;
    letter-spacing: -0.02em;
  }
  .logo-icon {
    width: 1.8rem;
    height: 1.44rem;
    font-size: 0;
  }
  .header-controls {
    gap: 0.18rem;
  }
  .lang-toggle {
    padding: 0.22rem 0.32rem;
    font-size: 0.68rem;
  }
  .btn-icon, .mobile-menu-btn {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.82rem;
  }
}

@media (max-width: 768px) {
  .nav-wrapper {
    height: 3.5rem;
    padding: 0.4rem 0;
    flex-wrap: nowrap;
    gap: 0.4rem;
  }
  /* On mobile viewports, search is contained inside the slide-over drawer */
  .header-controls .search-input-wrapper {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   OFF-CANVAS SLIDE-OVER DRAWER (MOBILE NAVIGATION)
   -------------------------------------------------------------------------- */
.nav-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

body.drawer-open .nav-drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 992px) {
  body.drawer-open {
    overflow: hidden !important;
  }
}

.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 340px;
  max-width: 86vw;
  height: 100vh;
  height: 100dvh;
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border-color);
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.28);
  z-index: 2500;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

body.drawer-open .nav-drawer {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  flex-shrink: 0;
}

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

.drawer-logo-icon {
  width: 2.3rem;
  height: 1.84rem;
  background: #090e1a url('assets/images/atlas-1765-logo.svg') no-repeat center center;
  background-size: cover;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0;
  color: transparent;
  user-select: none;
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  flex-shrink: 0;
  overflow: hidden;
}

.drawer-title h3 {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text-primary);
  line-height: 1.1;
}

.drawer-subtitle {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  display: block;
}

.drawer-close-btn {
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.drawer-close-btn:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  transform: rotate(90deg);
}

.drawer-search {
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  background-color: var(--bg-subtle);
  flex-shrink: 0;
}

.drawer-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.drawer-search-wrapper .search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.drawer-search-wrapper input {
  width: 100%;
  padding: 0.45rem 0.75rem 0.45rem 2.2rem;
  font-size: 0.82rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  box-sizing: border-box;
}

.drawer-search-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  -webkit-overflow-scrolling: touch;
}

.drawer-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.drawer-group-title {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  padding-left: 0.25rem;
}

.drawer-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.drawer-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  border-left: 3px solid transparent;
}

.drawer-link:hover {
  background-color: var(--bg-subtle);
  color: var(--primary);
  transform: translateX(3px);
}

.drawer-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 700;
}

.drawer-link-icon {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
}

.drawer-link-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.drawer-link-main {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
}

.drawer-link-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  flex-shrink: 0;
}

.drawer-action-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.drawer-action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--bg-hover);
}

.drawer-footer-row {
  display: flex;
  gap: 0.5rem;
}

.drawer-pill-btn {
  flex: 1;
  padding: 0.45rem 0.6rem;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
}

.drawer-pill-btn:hover {
  border-color: var(--text-muted);
  color: var(--text-primary);
}

/* Mobile Phones (<= 768px) */
@media (max-width: 768px) {
  .hero {
    padding: 2.5rem 0 2rem;
  }
  .hero h2 {
    font-size: 1.85rem;
    line-height: 1.2;
  }
  .hero p.hero-subtitle {
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }
  .stat-card {
    padding: 1rem 0.85rem;
  }
  .stat-number {
    font-size: 1.6rem;
  }
  .myths-grid, .atoz-grid, .architects-grid, .media-grid, .sources-grid {
    grid-template-columns: 1fr;
  }
  .doctrinal-grid {
    grid-template-columns: 1fr;
  }
  .nav-tabs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.45rem;
    padding: 0.45rem;
    margin-bottom: 1.75rem;
  }
  .tab-btn {
    padding: 0.65rem 0.5rem;
    font-size: 0.82rem;
    border-radius: var(--radius-md);
    background-color: var(--bg-subtle);
    border-color: var(--border-color);
    text-align: center;
    justify-content: center;
  }
  .nav-tabs .tab-btn:last-child {
    grid-column: span 2;
  }
}

/* Small Mobile Phones (<= 480px) */
@media (max-width: 480px) {
  .logo-text span {
    display: none;
  }
  .logo-text h1 {
    font-size: 0.95rem;
  }
  .hero h2 {
    font-size: 1.5rem;
  }
  .hero-actions .btn-primary, .hero-actions .btn-secondary {
    width: 100%;
    justify-content: center;
  }
  .nav-tabs {
    grid-template-columns: 1fr;
  }
  .nav-tabs .tab-btn:last-child {
    grid-column: span 1;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Stat Card Links & Action Indicators */
a.stat-card {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: inherit;
  cursor: pointer;
}

a.stat-card:hover {
  text-decoration: none;
}

.stat-card-action {
  margin-top: 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: transform var(--transition-fast);
}

.stat-card:hover .stat-card-action {
  transform: translateX(4px);
  color: var(--primary-hover);
}


/* ==========================================================================
   Master Sources & Archival Database Styles
   ========================================================================== */

.sources-filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
  align-items: center;
}

.sources-search-box {
  flex: 1;
  min-width: 250px;
  position: relative;
}

.sources-search-input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color var(--transition-fast);
}

.sources-search-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}

.sources-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.95rem;
  pointer-events: none;
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.source-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.source-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25);
  border-color: var(--primary);
}

.source-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-argentine,
[data-theme="dark"] .badge-argentine {
  background-color: #082f49;
  color: #7dd3fc;
  border: 1px solid #0284c7;
}

.badge-british,
[data-theme="dark"] .badge-british {
  background-color: #450a0a;
  color: #fca5a5;
  border: 1px solid #dc2626;
}

.badge-international,
[data-theme="dark"] .badge-international {
  background-color: #052e16;
  color: #86efac;
  border: 1px solid #16a34a;
}

.badge-bilateral,
[data-theme="dark"] .badge-bilateral {
  background-color: #3b0764;
  color: #d8b4fe;
  border: 1px solid #9333ea;
}

/* Character Profile & Historical Figures Stance Badges */
.badge-propagator,
.source-badge.badge-propagator,
.badge.badge-propagator,
.stance-propagator,
.source-badge-propagator,
[data-theme="dark"] .badge-propagator,
[data-theme="dark"] .source-badge.badge-propagator,
[data-theme="dark"] .badge.badge-propagator,
[data-theme="dark"] .stance-propagator {
  background-color: rgba(239, 68, 68, 0.15) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, 0.4) !important;
}

[data-theme="light"] .badge-propagator,
[data-theme="light"] .source-badge.badge-propagator,
[data-theme="light"] .badge.badge-propagator,
[data-theme="light"] .stance-propagator {
  background-color: #fee2e2 !important;
  color: #dc2626 !important;
  border: 1px solid #f87171 !important;
}

.badge-defender,
.source-badge.badge-defender,
.badge.badge-defender,
.badge-neutral,
.source-badge.badge-neutral,
.badge.badge-neutral,
.stance-defender,
[data-theme="dark"] .badge-defender,
[data-theme="dark"] .source-badge.badge-defender,
[data-theme="dark"] .badge-neutral,
[data-theme="dark"] .source-badge.badge-neutral,
[data-theme="dark"] .stance-defender {
  background-color: rgba(16, 185, 129, 0.15) !important;
  color: #10b981 !important;
  border: 1px solid rgba(16, 185, 129, 0.4) !important;
}

[data-theme="light"] .badge-defender,
[data-theme="light"] .source-badge.badge-defender,
[data-theme="light"] .badge-neutral,
[data-theme="light"] .source-badge.badge-neutral,
[data-theme="light"] .stance-defender {
  background-color: #dcfce7 !important;
  color: #15803d !important;
  border: 1px solid #86efac !important;
}

.badge-analyst,
.source-badge.badge-analyst,
.badge.badge-analyst,
.stance-analyst,
[data-theme="dark"] .badge-analyst,
[data-theme="dark"] .source-badge.badge-analyst,
[data-theme="dark"] .stance-analyst {
  background-color: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(59, 130, 246, 0.4) !important;
}

[data-theme="light"] .badge-analyst,
[data-theme="light"] .source-badge.badge-analyst,
[data-theme="light"] .badge.badge-analyst,
[data-theme="light"] .stance-analyst {
  background-color: #e0f2fe !important;
  color: #0284c7 !important;
  border: 1px solid #7dd3fc !important;
}

.badge-primary,
.source-badge.badge-primary,
[data-theme="dark"] .badge-primary,
[data-theme="dark"] .source-badge.badge-primary {
  background-color: rgba(56, 189, 248, 0.12) !important;
  color: #38bdf8 !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
}

[data-theme="light"] .badge-primary,
[data-theme="light"] .source-badge.badge-primary {
  background-color: #f0f9ff !important;
  color: #0369a1 !important;
  border: 1px solid #bae6fd !important;
}

.source-type-tag {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  background-color: var(--bg-subtle);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
}

.source-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.source-repo {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.source-citation {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--primary);
  background-color: var(--primary-light);
  border: 1px solid var(--primary-border);
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
  word-break: break-all;
}

.source-summary {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.source-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: auto;
}

.source-btn-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  color: white;
  background-color: var(--primary);
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.source-btn-link:hover {
  background-color: var(--primary-hover);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
}

.source-btn-wayback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-secondary);
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.source-btn-wayback:hover {
  background-color: var(--border-light);
  color: var(--primary);
  border-color: var(--primary-light, #93c5fd);
  text-decoration: none;
  transform: translateY(-1px);
}

/* ==========================================================================
   Subpage Sources Dossier Box Styles
   ========================================================================== */

.sources-dossier-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  margin: 2.5rem 0;
  box-shadow: var(--shadow-sm);
}

.sources-dossier-box h3 {
  font-size: 1.35rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sources-dossier-box .subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.sources-dossier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.sources-dossier-col {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sources-dossier-col h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.sources-dossier-col p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 0.85rem;
}

.sources-dossier-actions {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-light);
}

.sources-dossier-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.sources-dossier-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.sources-dossier-wayback {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.sources-dossier-wayback:hover {
  color: var(--primary);
  text-decoration: underline;
}

@media (max-width: 768px) {
  .sources-grid {
    grid-template-columns: 1fr;
  }
  .sources-dossier-grid {
    grid-template-columns: 1fr;
  }
}


/* Timeline Argentine Official Verification Box */
.timeline-arg-proof,
[data-theme="dark"] .timeline-arg-proof {
  margin-top: 0.85rem;
  background-color: #082f49;
  border: 1px solid #0369a1;
  border-left: 4px solid #38bdf8;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #e0f2fe;
}

.timeline-arg-header,
[data-theme="dark"] .timeline-arg-header {
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #38bdf8;
}

.timeline-arg-quote {
  font-style: italic;
  margin-bottom: 0.5rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.timeline-arg-link,
[data-theme="dark"] .timeline-arg-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: #38bdf8;
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.timeline-arg-link:hover,
[data-theme="dark"] .timeline-arg-link:hover {
  color: #7dd3fc;
}

.timeline-wayback-link,
[data-theme="dark"] .timeline-wayback-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  font-weight: 500;
  color: #94a3b8;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.timeline-wayback-link:hover,
[data-theme="dark"] .timeline-wayback-link:hover {
  color: #38bdf8;
  text-decoration: underline;
}

.wayback-sub-link,
[data-theme="dark"] .wayback-sub-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: #94a3b8;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.wayback-sub-link:hover,
[data-theme="dark"] .wayback-sub-link:hover {
  color: #38bdf8;
  text-decoration: underline;
}

/* --- Side-by-Side Treaty Comparison Matrix & Responsive Degradation --- */
.treaty-matrix-section {
  margin: 2.5rem 0;
}

.treaty-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.treaty-header-text {
  flex: 1;
}

.treaty-view-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.25rem;
  gap: 0.25rem;
  flex-shrink: 0;
}

.treaty-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: calc(var(--radius-sm) - 2px);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.treaty-view-btn:hover,
[data-theme="dark"] .treaty-view-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.treaty-view-btn.active {
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.treaty-scroll-hint {
  display: none;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  padding: 0.4rem 0.75rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  border: 1px dashed var(--border-color);
}

.treaty-table-container {
  width: 100%;
  margin: 1.25rem 0;
  box-sizing: border-box;
}

/* ========================================================
   TABLE VIEW MODE (Desktop / Multi-column tabular layout)
   ======================================================== */
.treaty-table-container.treaty-view-table {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

.treaty-table-container.treaty-view-table .treaty-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
  min-width: 920px;
}

.treaty-table-container.treaty-view-table .treaty-table th {
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-weight: 700;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--border-color);
  white-space: nowrap;
}

.treaty-table-container.treaty-view-table .treaty-table td {
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
  line-height: 1.5;
  color: var(--text-secondary);
}

.treaty-table-container.treaty-view-table .treaty-table tr:last-child td {
  border-bottom: none;
}

.treaty-table-container.treaty-view-table .treaty-row-highlight,
[data-theme="dark"] .treaty-table-container.treaty-view-table .treaty-row-highlight {
  background: rgba(239, 68, 68, 0.12);
  border-left: 4px solid var(--accent-red);
}

/* Suppress mobile/card-specific elements in table view */
.treaty-table-container.treaty-view-table .treaty-cell-label,
.treaty-table-container.treaty-view-table .treaty-card-highlight-badge,
.treaty-table-container.treaty-view-table .treaty-mobile-status-badge {
  display: none !important;
}

.treaty-table-container.treaty-view-table .treaty-desktop-status-badge {
  display: block;
}

/* ========================================================
   CARDS VIEW MODE (Responsive Card Deck / Zero Scrollbar)
   ======================================================== */
.treaty-table-container.treaty-view-cards {
  overflow-x: visible;
  border: none;
  background: transparent;
  box-shadow: none;
}

.treaty-table-container.treaty-view-cards .treaty-table {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
  min-width: 0 !important;
  border-collapse: separate;
  border: none;
}

.treaty-table-container.treaty-view-cards .treaty-table thead {
  display: none !important;
}

.treaty-table-container.treaty-view-cards .treaty-table tbody {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}

.treaty-table-container.treaty-view-cards .treaty-table tr {
  display: flex;
  flex-direction: column;
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  box-sizing: border-box;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.treaty-table-container.treaty-view-cards .treaty-table tr:hover {
  box-shadow: var(--shadow-md);
}

.treaty-table-container.treaty-view-cards .treaty-table tr.treaty-row-highlight,
[data-theme="dark"] .treaty-table-container.treaty-view-cards .treaty-table tr.treaty-row-highlight {
  border: 2px solid var(--accent-red);
  background: rgba(239, 68, 68, 0.12);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.25);
}

.treaty-table-container.treaty-view-cards .treaty-table td {
  display: block;
  width: 100%;
  padding: 0.65rem 0;
  border-bottom: 1px dashed var(--border-color);
  box-sizing: border-box;
}

.treaty-table-container.treaty-view-cards .treaty-table td:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.treaty-table-container.treaty-view-cards .treaty-cell-title {
  padding-top: 0;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 0.35rem;
  padding-bottom: 0.85rem;
}

.treaty-card-highlight-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: #ef4444;
  color: #ffffff;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  margin-bottom: 0.65rem;
}

.treaty-title-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.treaty-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.35;
}

.treaty-year-pill {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--bg-subtle);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

.treaty-mobile-status-badge {
  display: block;
  margin-top: 0.65rem;
}

.treaty-table-container.treaty-view-cards .treaty-desktop-status-badge {
  display: none !important;
}

.treaty-cell-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.treaty-parties-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.treaty-signatories-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  line-height: 1.45;
}

.treaty-type-name {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.92rem;
}

.treaty-scope-quote {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  background: var(--bg-subtle);
  padding: 0.5rem 0.85rem;
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  line-height: 1.45;
}

.treaty-reservation-desc {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.treaty-conduct-box {
  font-size: 0.85rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.treaty-effect-box {
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--primary);
  background: rgba(0, 129, 200, 0.08);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

.treaty-effect-box,
[data-theme="dark"] .treaty-effect-box {
  background: rgba(0, 129, 200, 0.16);
}

/* Badges */
.treaty-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 0.45rem;
}

.treaty-badge-none,
[data-theme="dark"] .treaty-badge-none {
  background-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border: 1px solid #ef4444;
}

.treaty-badge-explicit,
[data-theme="dark"] .treaty-badge-explicit {
  background-color: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border: 1px solid #22c55e;
}

/* ========================================================
   RESPONSIVE MEDIA QUERIES (Narrow Viewports <= 992px)
   ======================================================== */
@media (max-width: 992px) {
  .treaty-header-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }

  .treaty-view-switcher {
    align-self: flex-start;
  }

  /* Automatically degrade to Card Deck on narrow screens unless .force-table is explicitly applied */
  .treaty-table-container:not(.force-table) {
    overflow-x: visible !important;
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    margin: 1rem 0;
  }

  .treaty-table-container:not(.force-table) .treaty-table {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
    width: 100% !important;
    min-width: 0 !important;
    border-collapse: separate !important;
    border: none !important;
  }

  .treaty-table-container:not(.force-table) .treaty-table thead {
    display: none !important;
  }

  .treaty-table-container:not(.force-table) .treaty-table tbody {
    display: flex !important;
    flex-direction: column !important;
    gap: 1.25rem !important;
    width: 100% !important;
  }

  .treaty-table-container:not(.force-table) .treaty-table tr {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    background: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--radius-md) !important;
    padding: 1.15rem !important;
    box-shadow: var(--shadow-sm) !important;
    box-sizing: border-box !important;
  }

  .treaty-table-container:not(.force-table) .treaty-table tr.treaty-row-highlight,
  [data-theme="dark"] .treaty-table-container:not(.force-table) .treaty-table tr.treaty-row-highlight {
    border: 2px solid var(--accent-red) !important;
    background: rgba(239, 68, 68, 0.12) !important;
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25) !important;
  }

  .treaty-table-container:not(.force-table) .treaty-table td {
    display: block !important;
    width: 100% !important;
    padding: 0.65rem 0 !important;
    border-bottom: 1px dashed var(--border-color) !important;
    box-sizing: border-box !important;
  }

  .treaty-table-container:not(.force-table) .treaty-table td:last-child {
    border-bottom: none !important;
    padding-bottom: 0 !important;
  }

  .treaty-table-container:not(.force-table) .treaty-cell-title {
    padding-top: 0 !important;
    border-bottom: 2px solid var(--border-color) !important;
    margin-bottom: 0.35rem !important;
    padding-bottom: 0.75rem !important;
  }

  .treaty-table-container:not(.force-table) .treaty-cell-label {
    display: flex !important;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
  }

  .treaty-table-container:not(.force-table) .treaty-card-highlight-badge {
    display: inline-flex !important;
  }

  .treaty-table-container:not(.force-table) .treaty-mobile-status-badge {
    display: block !important;
  }

  .treaty-table-container:not(.force-table) .treaty-desktop-status-badge {
    display: none !important;
  }

  /* When table mode is forced on narrow viewports, display horizontal scroll hint */
  .treaty-table-container.force-table + .treaty-scroll-hint {
    display: block;
  }
}

/* ========================================================
   SUBPAGE COMPARISON TABLES RESPONSIVE STYLING
   ======================================================== */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
  margin: 1.25rem 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.comparison-table th {
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-weight: 700;
  padding: 0.85rem 1rem;
  border-bottom: 2px solid var(--border-color);
}

.comparison-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
  color: var(--text-secondary);
  line-height: 1.5;
}

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

@media (max-width: 768px) {
  .comparison-table {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .comparison-table thead {
    display: none;
  }

  .comparison-table tbody {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
  }

  .comparison-table tr {
    display: flex;
    flex-direction: column;
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
  }

  .comparison-table td {
    display: block;
    width: 100%;
    padding: 0.5rem 0;
    border-bottom: 1px dashed var(--border-color);
    box-sizing: border-box;
  }

  .comparison-table td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .comparison-table td:first-child {
    padding-top: 0;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 0.25rem;
    padding-bottom: 0.6rem;
    font-size: 1rem;
    color: var(--text-primary);
  }
}

/* --- Academic Citation Generator UI & Modal --- */
.source-btn-cite {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.source-btn-cite:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.sources-dossier-cite {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.38rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sources-dossier-cite:hover {
  background: var(--bg-hover);
  border-color: var(--primary);
  color: var(--primary);
}

.citation-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.citation-tab-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.citation-tab-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.citation-tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

#citation-text-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-primary);
  margin: 0;
  max-height: 220px;
  overflow-y: auto;
}

/* --- IPFS Decentralized Mirror & Modal --- */
.ipfs-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.12) 0%, rgba(56, 189, 248, 0.04) 100%);
  color: var(--primary);
  border: 1px solid var(--primary-border);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.ipfs-nav-btn:hover {
  background: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.ipfs-cid-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.82rem;
  color: var(--primary);
  word-break: break-all;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0.75rem 0 1.25rem;
}

.ipfs-gateway-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 1.5rem;
}

.ipfs-gateway-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.ipfs-gateway-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  transform: translateY(-1px);
}

.ipfs-footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.ipfs-footer-badge:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* --- IPFS Document & PDF Badges / Action Buttons --- */
.btn-doc-ipfs,
.btn-ipfs {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}

.btn-doc-ipfs:hover,
.btn-ipfs:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #ffffff;
  border-color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(56, 189, 248, 0.35);
}

.btn-ipfs-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.18rem 0.5rem;
  background: rgba(56, 189, 248, 0.1);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  vertical-align: middle;
  margin-left: 0.45rem;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-ipfs-inline:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #ffffff;
  border-color: #38bdf8;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(56, 189, 248, 0.25);
}

/* ==========================================================================
   Two-Way Citation Jump & Return System
   ========================================================================== */
/* In-Text Citation Link: Unobtrusive, clean scholarly hyperlink */
.citation-ref {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 0.1rem;
  margin: 0 0.1rem;
  background: transparent;
  border: none;
  border-radius: 2px;
  transition: color var(--transition-fast), background-color var(--transition-fast), text-decoration-color var(--transition-fast);
  vertical-align: baseline;
  display: inline;
}

.citation-ref:hover,
.citation-ref:focus-visible {
  color: var(--primary-hover);
  background-color: var(--primary-light);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

/* Optional Superscript Wrapper for Academic Citations */
sup.citation-sup {
  font-size: 0.8em;
  line-height: 0;
  vertical-align: super;
  margin-left: 0.1rem;
}

/* Return to Text Button at bottom of Citation Cards */
.btn-return-citation {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--bg-surface);
  border: 1px solid var(--border-color, #cbd5e1);
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all var(--transition-fast, 0.2s ease);
  text-decoration: none;
  width: 100%;
  margin-top: 0.6rem;
  box-sizing: border-box;
}

.btn-return-citation:hover {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.btn-return-citation .return-arrow {
  font-size: 1.05rem;
  transition: transform 0.2s ease;
}

.btn-return-citation:hover .return-arrow {
  transform: translateY(-2px);
}

/* Card Highlight Animation when Jumped to */
@keyframes citationCardPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(2, 132, 199, 0.7);
    border-color: var(--primary);
    background-color: var(--primary-light, rgba(2, 132, 199, 0.12));
  }
  50% {
    box-shadow: 0 0 0 12px rgba(2, 132, 199, 0);
    border-color: var(--primary);
    background-color: var(--primary-light, rgba(2, 132, 199, 0.06));
  }
  100% {
    box-shadow: none;
  }
}

.citation-highlight-pulse {
  animation: citationCardPulse 2.5s cubic-bezier(0.25, 1, 0.5, 1);
  border-color: var(--primary) !important;
  scroll-margin-top: 100px;
}

/* Origin Text Highlight when Returned */
@keyframes citationOriginPulse {
  0% {
    background-color: rgba(251, 191, 36, 0.4);
    outline: 2px solid rgba(245, 158, 11, 0.85);
    border-radius: 4px;
  }
  70% {
    background-color: rgba(251, 191, 36, 0.15);
    outline: 2px solid rgba(245, 158, 11, 0.3);
  }
  100% {
    background-color: transparent;
    outline: 2px solid transparent;
  }
}

.citation-origin-pulse {
  animation: citationOriginPulse 2.2s cubic-bezier(0.25, 1, 0.5, 1);
  scroll-margin-top: 120px;
}

/* ==========================================================================
   JOURNAL & COUNTER-DISPATCHES SECTION (THE COUNTER-PROPAGANDA RECORD)
   ========================================================================== */

.journal-hero {
  background: radial-gradient(circle at 80% 20%, rgba(220, 38, 38, 0.12), transparent 50%),
              radial-gradient(circle at 10% 80%, rgba(30, 58, 138, 0.15), transparent 50%),
              var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: 3.5rem 0 2.5rem;
  position: relative;
}

.journal-badge,
[data-theme="dark"] .journal-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1rem;
}

.journal-stats-ribbon {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.journal-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.journal-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.journal-stat-value {
  font-size: 1.85rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1.2;
  font-family: var(--font-mono);
}

.journal-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-top: 0.35rem;
}

/* Journal Controls, Search & Filter Bar */
.journal-controls-wrapper {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  box-shadow: var(--shadow-sm);
}

.journal-search-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.journal-search-box {
  flex: 1;
  min-width: 280px;
  position: relative;
  display: flex;
  align-items: center;
}

.journal-search-box input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.journal-search-box input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}

.journal-search-box .search-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

.journal-filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.75rem;
}

/* Responsive Time Filters Grid */
.journal-time-filters-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 1rem;
}

@media (max-width: 768px) {
  .journal-time-filters-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }
}

/* Journal Unified Select Dropdown */
.journal-select {
  width: 100%;
  padding: 0.8rem 1.15rem;
  font-size: 0.92rem;
  font-weight: 500;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1rem;
  padding-right: 2.75rem;
}

[data-theme="dark"] .journal-select {
  background-color: var(--bg-surface);
  border-color: var(--border-color);
  color: var(--text-primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.journal-select:hover {
  border-color: var(--primary);
}

.journal-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.15);
}

/* Active Filter Pill Tags */
.active-filters-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding: 0.65rem 1rem;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

[data-theme="dark"] .active-filters-bar {
  background: var(--bg-card);
}

.active-filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}

.active-filter-tag button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease;
}

.active-filter-tag button:hover {
  color: var(--accent-red);
}

.journal-filter-label {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.journal-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.journal-filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 0.4rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

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

.journal-filter-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 4px rgba(30, 58, 138, 0.25);
}

.journal-filter-btn .count-badge {
  background: rgba(0, 0, 0, 0.12);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
}

.journal-filter-btn.active .count-badge {
  background: rgba(255, 255, 255, 0.25);
}

/* Journal Feed & Dispatch Cards */
.journal-feed-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.journal-dispatch-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}

.journal-dispatch-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-color);
}

.journal-dispatch-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.journal-dispatch-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.journal-date-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.journal-target-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(30, 58, 138, 0.08);
  color: var(--primary);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
}

.journal-target-tag:hover {
  background: rgba(30, 58, 138, 0.16);
}

.journal-verdict-pill,
[data-theme="dark"] .journal-verdict-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Original Target Claim Box */
.journal-claim-box {
  background: rgba(239, 68, 68, 0.04);
  border-left: 4px solid var(--accent-red);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.15rem 1.35rem;
  margin-bottom: 1.35rem;
}

.journal-claim-header {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-red);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.journal-claim-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  font-family: var(--font-serif);
}

.journal-claim-source {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.journal-claim-source a {
  color: var(--text-secondary);
  text-decoration: underline;
}

/* Counter-Hit Rebuttal Content */
.journal-rebuttal-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.journal-rebuttal-title a {
  color: inherit;
  text-decoration: none;
}

.journal-rebuttal-title a:hover {
  color: var(--primary);
}

.journal-rebuttal-body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* Evidence Tags */
.journal-evidence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.journal-evidence-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Action Footer */
.journal-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
}

.journal-read-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: #ffffff;
  padding: 0.55rem 1.15rem;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.journal-read-link:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.journal-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.journal-copy-btn:hover {
  background: var(--bg-hover);
  border-color: var(--text-muted);
}

/* ==========================================================================
   READABILITY & ERGONOMICS (WCAG 2.2 AAA & ISO 24495-1 PLAIN LANGUAGE)
   ========================================================================== */

/* Reading Line Length Constraint (65-75ch optimal for eye tracking) */
.dossier-body,
.reading-measure,
.prose-reading {
  max-width: 72ch !important;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.75;
  font-size: 1.05rem;
}

.dossier-body p {
  margin-bottom: 1.25rem;
  line-height: 1.75;
}

/* High-Contrast "Key Takeaways" / "Bottom Line" Scannable Callout */
.key-takeaways-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 1.5rem 1.75rem;
  margin: 1.75rem 0 2.25rem;
  box-shadow: var(--shadow-sm);
}

.key-takeaways-header {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.key-takeaways-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary-border);
}

.key-takeaways-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0;
  letter-spacing: -0.01em;
}

.key-takeaways-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.key-takeaways-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.key-takeaways-icon {
  font-size: 1.15rem;
  line-height: 1.35;
  flex-shrink: 0;
}

.key-takeaways-item strong {
  color: var(--text-primary);
  font-weight: 700;
}

/* Inline Legal & Historical Terminology Gloss / Tooltip */
.term-gloss {
  border-bottom: 1.5px dotted var(--primary);
  cursor: help;
  position: relative;
  font-style: normal;
  font-weight: inherit;
  color: var(--text-primary);
  text-decoration: none;
}

.term-gloss:hover::after,
.term-gloss:focus::after {
  content: attr(data-gloss);
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--text-primary);
  color: var(--bg-surface);
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: normal;
  width: max-content;
  max-width: 300px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  line-height: 1.35;
  pointer-events: none;
}

.term-gloss:hover::before,
.term-gloss:focus::before {
  content: "";
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 6px 6px 0 6px;
  border-style: solid;
  border-color: var(--text-primary) transparent transparent transparent;
  z-index: 1000;
}

@media (max-width: 768px) {
  .key-takeaways-card {
    padding: 1.25rem 1rem;
    margin: 1.25rem 0;
  }
  .key-takeaways-item {
    font-size: 0.92rem;
  }
}

/* --------------------------------------------------------------------------
   Wayback Machine Snapshot Pills & Primary Citation Badges
   -------------------------------------------------------------------------- */
.journal-wayback-pill {
  font-size: 0.78rem;
  color: #22c55e !important;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.journal-wayback-pill:hover,
.journal-wayback-pill:focus-visible {
  background: rgba(34, 197, 94, 0.22);
  border-color: rgba(34, 197, 94, 0.55);
  color: #16a34a !important;
  text-decoration: none;
  transform: translateY(-1px);
}

.journal-cite-item {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  margin-top: 0.65rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

.journal-cite-icon {
  font-size: 1.1rem;
  line-height: 1;
  margin-top: 0.1rem;
}

.journal-cite-content {
  flex: 1;
  font-size: 0.85rem;
}

/* ==========================================================================
   Universal Closed Captions & Video Subtitle System
   ========================================================================== */
video::cue {
  display: none !important;
  opacity: 0 !important;
}

.custom-subtitle-overlay {
  position: absolute;
  bottom: 54px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 680px;
  text-align: center;
  pointer-events: none;
  z-index: 15;
  transition: opacity 0.15s ease;
}

.custom-subtitle-cue {
  display: inline-block;
  background: rgba(10, 15, 29, 0.92);
  color: #ffffff;
  font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-sm, 6px);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  max-width: 100%;
  word-break: break-word;
}

@media (max-width: 640px) {
  .custom-subtitle-overlay {
    bottom: 46px;
    width: 94%;
  }
  .custom-subtitle-cue {
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
  }
}

.btn-cc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid #10b981;
  color: #34d399;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all var(--transition-fast, 150ms ease);
  user-select: none;
}

.btn-cc-toggle:hover {
  background: rgba(16, 185, 129, 0.28);
  border-color: #34d399;
  transform: translateY(-1px);
}

.btn-cc-toggle.cc-off {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--border-color, #334155);
  color: var(--text-muted, #94a3b8);
}

.btn-cc-toggle.cc-off:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary, #f8fafc);
}

.btn-cc-toggle .cc-icon {
  font-size: 0.95rem;
}

/* ==========================================================================
   Universal IPFS Video Streaming & Provenance Bar
   ========================================================================== */
.ipfs-provenance-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.65rem 0.95rem;
  margin-top: 0.45rem;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: var(--radius-sm, 6px);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.78rem;
  color: var(--text-secondary, #cbd5e1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.ipfs-badge-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.ipfs-icon-hub {
  font-size: 1rem;
  line-height: 1;
}

.ipfs-badge-title {
  font-weight: 700;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
}

.ipfs-cid-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #38bdf8;
  font-family: var(--font-mono, "SFMono-Regular", Consolas, monospace);
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 150ms ease;
  user-select: none;
}

.ipfs-cid-chip:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: #38bdf8;
  color: #7dd3fc;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}

.ipfs-copy-icon {
  font-size: 0.75rem;
  opacity: 0.7;
}

.ipfs-badge-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.ipfs-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.75rem;
}

.ipfs-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px currentColor;
  animation: ipfsPulse 2s infinite ease-in-out;
}

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

.ipfs-gateway-dropdown-wrapper {
  position: relative;
}

.ipfs-gateway-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #f1f5f9;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 1.6rem 0.25rem 0.65rem;
  border-radius: 4px;
  cursor: pointer;
  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='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  background-size: 9px;
  transition: all 150ms ease;
}

.ipfs-gateway-select:hover, .ipfs-gateway-select:focus {
  border-color: #60a5fa;
  outline: none;
  background-color: rgba(30, 41, 59, 0.95);
}

@media (max-width: 640px) {
  .ipfs-provenance-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .ipfs-badge-right {
    width: 100%;
    justify-content: space-between;
  }
}

/* ==========================================================================
   SMART DYNAMIC BACK NAVIGATION SYSTEM (PREMIUM REDESIGN)
   ========================================================================== */

.smart-back-nav {
  margin: 3.5rem auto 2rem auto;
  padding: 1.4rem 1.65rem;
  background: linear-gradient(135deg, rgba(20, 27, 45, 0.78) 0%, rgba(13, 18, 30, 0.9) 100%);
  border: 1px solid rgba(59, 130, 246, 0.24);
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.smart-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.smart-nav-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary, #38bdf8);
}

.smart-nav-kicker-icon {
  font-size: 0.85rem;
}

.smart-nav-hint {
  font-size: 0.8rem;
  color: var(--text-muted, #94a3b8);
}

.smart-nav-buttons {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

/* Common button action styling */
.btn-smart-action,
.btn-smart-back,
.btn-smart-portal {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius-md, 8px);
  font-size: 0.92rem;
  text-decoration: none !important;
  cursor: pointer;
  transition: all var(--transition-fast, 0.2s ease);
  line-height: 1.3;
  white-space: nowrap;
}

/* Primary contextual back button */
.btn-smart-primary,
.btn-smart-back {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.45) 0%, rgba(37, 99, 235, 0.28) 100%);
  border: 1px solid rgba(96, 165, 250, 0.55);
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.2);
}

.btn-smart-primary:hover,
.btn-smart-back:hover {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.65) 0%, rgba(29, 78, 216, 0.48) 100%);
  border-color: #93c5fd;
  transform: translateY(-2px);
  box-shadow: 0 6px 22px rgba(59, 130, 246, 0.42);
  color: #ffffff !important;
}

.btn-smart-primary:hover .nav-icon-badge,
.btn-smart-back:hover .btn-icon {
  transform: translateX(-3px);
  background: rgba(255, 255, 255, 0.25);
}

/* Secondary exploration / companion buttons */
.btn-smart-secondary,
.btn-smart-portal {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary, #cbd5e1) !important;
  font-weight: 600;
}

.btn-smart-secondary:hover,
.btn-smart-portal:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.28);
  color: #ffffff !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

/* Icon badge within action buttons */
.nav-icon-badge,
.btn-smart-action .btn-icon,
.btn-smart-back .btn-icon,
.btn-smart-portal .btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 0.95rem;
  line-height: 1;
  transition: transform var(--transition-fast, 0.2s ease), background 0.2s ease;
  flex-shrink: 0;
}

.btn-smart-primary .nav-icon-badge,
.btn-smart-back .btn-icon {
  background: rgba(59, 130, 246, 0.35);
  color: #ffffff;
}

.btn-smart-text {
  display: inline-flex;
  align-items: center;
}

@media (max-width: 768px) {
  .smart-back-nav {
    padding: 1.2rem 1rem;
    margin-top: 2.5rem;
  }
  .smart-nav-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  .smart-nav-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    width: 100%;
  }
  .btn-smart-action,
  .btn-smart-back,
  .btn-smart-portal {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

/* ==========================================================================
   Portal Research Hub & Dossier Grid Showcase
   ========================================================================== */
.portal-hub-section {
  margin-top: 1rem;
  padding-top: 0.5rem;
}

.portal-timeline-section {
  margin-top: 3.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--border-color);
  animation: fadeIn 250ms ease;
}

.portal-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.75rem;
}

.portal-hub-card {
  background: linear-gradient(135deg, rgba(20, 27, 45, 0.75), rgba(13, 18, 30, 0.85));
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: inherit;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.portal-hub-card:hover {
  transform: translateY(-4px);
  border-color: #0081C8;
  box-shadow: 0 12px 30px rgba(0, 129, 200, 0.25);
}

.portal-hub-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.portal-hub-card-icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.portal-hub-card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: rgba(0, 129, 200, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.portal-hub-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.portal-hub-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0 0 1.25rem 0;
  flex-grow: 1;
}

.portal-hub-card-action {
  font-size: 0.85rem;
  font-weight: 700;
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: gap 0.2s ease;
}

.portal-hub-card:hover .portal-hub-card-action {
  gap: 0.65rem;
  color: #60a5fa;
}

/* ==========================================================================
   PRIMARY ARCHIVAL VERIFICATION & LEGAL RECEIPTS FRAMEWORK
   ========================================================================== */

.primary-archival-banner {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 58, 138, 0.25));
  border: 1px solid rgba(59, 130, 246, 0.4);
  border-left: 5px solid var(--primary, #3b82f6);
  border-radius: var(--radius-md, 8px);
  padding: 1.25rem 1.5rem;
  margin: 1.75rem 0 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.primary-archival-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.primary-archival-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #93c5fd;
}

.primary-archival-hash-badge {
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono, monospace);
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.primary-archival-desc {
  font-size: 0.9rem;
  color: var(--text-secondary, #cbd5e1);
  line-height: 1.55;
  margin: 0;
}

.primary-archival-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  align-items: center;
  padding-top: 0.65rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
}

.primary-archival-ref {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: #94a3b8;
  margin-left: auto;
}

/* Proof Box Callout */
.proof-box {
  background: rgba(16, 185, 129, 0.05);
  border-left: 4px solid var(--accent-green, #10b981);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md, 8px);
  margin: 1.5rem 0 2rem;
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-left-width: 4px;
}

.proof-box-title {
  font-weight: 800;
  color: #059669;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

[data-theme="dark"] .proof-box-title {
  color: #34d399;
}

/* Sources Dossier Grid & Cards */
.sources-dossier-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.25rem;
}

.source-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md, 8px);
  padding: 1.35rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast, 0.15s ease), border-color var(--transition-fast, 0.15s ease);
}

.source-card:hover {
  border-color: var(--primary, #3b82f6);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.source-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.source-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.source-badge-treaty {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.source-badge-icj {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

.source-badge-patent {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.source-badge-statute {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.source-card-title {
  margin: 0.35rem 0 0.25rem 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.35;
}

.source-card-citation {
  font-size: 0.82rem;
  font-family: var(--font-mono, monospace);
  color: var(--text-muted);
  margin-bottom: 0.65rem;
}

.source-card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0.5rem 0 0.85rem 0;
}

.source-card-forensic {
  background: rgba(30, 41, 59, 0.6);
  border-left: 3px solid var(--primary, #3b82f6);
  padding: 0.65rem 0.85rem;
  border-radius: 0 4px 4px 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #e2e8f0;
  margin-bottom: 0.85rem;
}

.source-card-forensic strong {
  color: #93c5fd;
}

.source-card-hash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.4rem 0.65rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm, 4px);
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  word-break: break-all;
}

/* Triad Links Row */
.triad-links-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn-triad {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm, 4px);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--transition-fast, 0.15s ease);
  border: 1px solid var(--border-color);
}

.btn-triad-vault {
  background: #2563eb;
  color: #ffffff !important;
  border-color: #1d4ed8;
}
.btn-triad-vault:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.btn-triad-official {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399 !important;
  border-color: rgba(16, 185, 129, 0.35);
}
.btn-triad-official:hover {
  background: rgba(16, 185, 129, 0.22);
  transform: translateY(-1px);
}

.btn-triad-wayback {
  background: rgba(59, 130, 246, 0.1);
  color: #60a5fa !important;
  border-color: rgba(59, 130, 246, 0.3);
}
.btn-triad-wayback:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
}

.btn-triad-icj {
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc !important;
  border-color: rgba(168, 85, 247, 0.35);
}
.btn-triad-icj:hover {
  background: rgba(168, 85, 247, 0.22);
  transform: translateY(-1px);
}

/* In-text Legal & Archival Links */
.legal-inline-link {
  color: var(--primary, #38bdf8);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition-fast, 0.15s ease), text-decoration-color var(--transition-fast, 0.15s ease);
}
.legal-inline-link:hover {
  color: #60a5fa;
  text-decoration-thickness: 2px;
}

/* ==========================================================================
   Executive Briefing: The Four Forensic Pillars
   ========================================================================== */
.executive-briefing-section {
  margin-top: 1.5rem;
  padding-top: 0.5rem;
}

.briefing-eyebrow {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #38bdf8;
  margin-bottom: 0.4rem;
}

.executive-briefing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 1.75rem;
}

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

.briefing-pillar-card {
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.85), rgba(13, 18, 30, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  padding: 1.6rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  position: relative;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.briefing-pillar-card:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 14px 35px rgba(0, 129, 200, 0.2);
}

.briefing-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.briefing-pillar-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-treaty {
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.badge-demographics {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(192, 132, 252, 0.35);
}

.badge-law {
  background: rgba(234, 179, 8, 0.15);
  color: #facc15;
  border: 1px solid rgba(250, 204, 21, 0.35);
}

.badge-democracy {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.briefing-pillar-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.briefing-pillar-title {
  font-size: 1.18rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.35;
  margin: 0 0 0.85rem 0;
}

.briefing-pillar-text {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 1.25rem 0;
  flex-grow: 1;
}

.briefing-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.briefing-link-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: #38bdf8;
  text-decoration: none;
  transition: color 0.15s ease, gap 0.15s ease;
}

.briefing-link-primary:hover {
  color: #93c5fd;
  gap: 0.6rem;
}

.briefing-link-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

.briefing-link-secondary:hover {
  color: var(--text-primary);
}

/* Specialized Vaults Strip */
.specialized-vaults-strip {
  margin-top: 2.25rem;
  padding: 1.25rem 1.5rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.vaults-strip-header {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.vaults-strip-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.vault-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.8rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.2s ease;
}

.vault-pill-btn:hover {
  background: rgba(0, 129, 200, 0.18);
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateY(-1px);
}

/* ==========================================================================
   Powerline Segmented Chevrons & Terminal Statusline System
   ========================================================================== */
.powerline-bar {
  display: inline-flex;
  align-items: stretch;
  flex-wrap: nowrap;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.35));
  margin: 0.5rem 0 1.25rem 0;
  line-height: 1;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.powerline-bar::-webkit-scrollbar {
  display: none;
}

.powerline-segment {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 1.45rem 0.45rem 1.15rem;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%, 11px 50%);
  margin-left: -10px;
  transition: filter var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
  color: #ffffff;
  user-select: none;
}

.powerline-segment:first-child {
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%);
  margin-left: 0;
  padding-left: 0.95rem;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.powerline-segment:last-child {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 11px 50%);
  padding-right: 1.05rem;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

.powerline-segment:only-child {
  clip-path: none;
  border-radius: 4px;
  margin-left: 0;
  padding: 0.45rem 0.95rem;
}

a.powerline-segment {
  cursor: pointer;
}

a.powerline-segment:hover {
  filter: brightness(1.22);
  z-index: 5;
  text-decoration: none;
}

.powerline-segment .pl-icon {
  display: inline-flex;
  align-items: center;
  font-size: 0.9em;
  line-height: 1;
}

/* Palette Presets matching site colors */
.pl-blue {
  background: #1d4ed8;
  color: #ffffff;
}

.pl-navy {
  background: #0f172a;
  color: #93c5fd;
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.pl-slate {
  background: #1e293b;
  color: #cbd5e1;
}

.pl-card {
  background: #141e33;
  color: #94a3b8;
}

.pl-gold {
  background: #b45309;
  color: #ffffff;
}

.pl-green {
  background: #15803d;
  color: #ffffff;
}

.pl-red {
  background: #b91c1c;
  color: #ffffff;
}

.pl-purple {
  background: #7e22ce;
  color: #ffffff;
}

.pl-cyan {
  background: #0284c7;
  color: #ffffff;
}

.pl-active {
  background: #38bdf8;
  color: #090d16;
  font-weight: 800;
}

/* Modifiers */
.powerline-bar.pl-sans .powerline-segment {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: none;
  letter-spacing: normal;
}

.powerline-bar.pl-arrow-end .powerline-segment:last-child {
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%, 11px 50%);
  padding-right: 1.45rem;
  border-radius: 0;
}

/* Slanted Forward-Slash ( / ) Segmented Statusline System */
.powerline-bar.pl-slanted .powerline-segment {
  clip-path: polygon(11px 0, 100% 0, calc(100% - 11px) 100%, 0 100%);
  margin-left: -10px;
  padding: 0.42rem 1.35rem 0.42rem 1.3rem;
  border-radius: 0;
}

.powerline-bar.pl-slanted .powerline-segment:first-child {
  clip-path: polygon(0 0, 100% 0, calc(100% - 11px) 100%, 0 100%);
  margin-left: 0;
  padding-left: 0.95rem;
  border-top-left-radius: 4px;
  border-bottom-left-radius: 4px;
}

.powerline-bar.pl-slanted .powerline-segment:last-child {
  clip-path: polygon(11px 0, 100% 0, 100% 100%, 0 100%);
  padding-right: 1.05rem;
  border-top-right-radius: 4px;
  border-bottom-right-radius: 4px;
}

/* Responsive handling on small screens */
@media (max-width: 640px) {
  .powerline-bar {
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
}

/* Breadcrumbs Container & Strip */
.breadcrumbs-container {
  background: rgba(15, 23, 42, 0.65);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 0.6rem 0;
  backdrop-filter: blur(8px);
}

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

.breadcrumbs-container .powerline-bar,
.breadcrumbs-container .breadcrumbs {
  margin: 0;
}

/* ==========================================================================
   Universal Breadcrumbs Auto-Powerline Engine
   Automatically renders standard .breadcrumbs into interlocking Powerline bars
   ========================================================================== */
.breadcrumbs:not(.powerline-bar),
.subpage-breadcrumb:not(.powerline-bar) {
  display: inline-flex !important;
  align-items: stretch !important;
  flex-wrap: nowrap !important;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.35)) !important;
  margin: 0.5rem 0 1.5rem 0 !important;
  line-height: 1 !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  scrollbar-width: none !important;
  border-radius: 4px !important;
  padding: 0 !important;
}

.breadcrumbs:not(.powerline-bar)::-webkit-scrollbar,
.subpage-breadcrumb:not(.powerline-bar)::-webkit-scrollbar {
  display: none !important;
}

/* Hide plain separator characters like '/', '>', '›' */
.breadcrumbs:not(.powerline-bar) > span.breadcrumb-separator,
.breadcrumbs:not(.powerline-bar) > span:not([class]):not([id]),
.subpage-breadcrumb:not(.powerline-bar) > span.breadcrumb-separator,
.subpage-breadcrumb:not(.powerline-bar) > span:not([class]):not([id]) {
  display: none !important;
}

/* Auto-segment links and active items in standard .breadcrumbs */
.breadcrumbs:not(.powerline-bar) > a,
.subpage-breadcrumb:not(.powerline-bar) > a {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  padding: 0.45rem 1.45rem 0.45rem 1.15rem !important;
  font-family: var(--font-sans) !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  letter-spacing: normal !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%, 11px 50%) !important;
  margin-left: -10px !important;
  transition: filter var(--transition-fast), background var(--transition-fast), color var(--transition-fast) !important;
  background: #1e293b !important;
  color: #cbd5e1 !important;
  user-select: none !important;
  cursor: pointer !important;
}

/* First item in .breadcrumbs (usually Home) */
.breadcrumbs:not(.powerline-bar) > a:first-child,
.breadcrumbs:not(.powerline-bar) > a.lang-en:first-of-type,
.subpage-breadcrumb:not(.powerline-bar) > a:first-child,
.subpage-breadcrumb:not(.powerline-bar) > a.lang-en:first-of-type {
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%) !important;
  margin-left: 0 !important;
  padding-left: 0.95rem !important;
  border-top-left-radius: 4px !important;
  border-bottom-left-radius: 4px !important;
  background: #1d4ed8 !important;
  color: #ffffff !important;
}

/* In Spanish mode, if first visible child is a.lang-es */
html[lang="es"] .breadcrumbs:not(.powerline-bar) > a.lang-en:first-child + a.lang-es,
html[lang="es"] .subpage-breadcrumb:not(.powerline-bar) > a.lang-en:first-child + a.lang-es,
html[lang="es"] .breadcrumbs:not(.powerline-bar) > a.lang-es:first-child,
html[lang="es"] .subpage-breadcrumb:not(.powerline-bar) > a.lang-es:first-child {
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%) !important;
  margin-left: 0 !important;
  padding-left: 0.95rem !important;
  border-top-left-radius: 4px !important;
  border-bottom-left-radius: 4px !important;
  background: #1d4ed8 !important;
  color: #ffffff !important;
}

.breadcrumbs:not(.powerline-bar) > a:hover,
.subpage-breadcrumb:not(.powerline-bar) > a:hover {
  filter: brightness(1.22) !important;
  z-index: 5 !important;
  text-decoration: none !important;
}

/* Intermediate non-last breadcrumb-current elements */
.breadcrumbs:not(.powerline-bar) > span.breadcrumb-current:not(:last-of-type),
.subpage-breadcrumb:not(.powerline-bar) > span.breadcrumb-current:not(:last-of-type) {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  padding: 0.45rem 1.45rem 0.45rem 1.15rem !important;
  font-family: var(--font-sans) !important;
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 50%, calc(100% - 11px) 100%, 0 100%, 11px 50%) !important;
  margin-left: -10px !important;
  background: #1e293b !important;
  color: #cbd5e1 !important;
  user-select: none !important;
}

/* Current / last active item across all markup patterns */
.breadcrumbs:not(.powerline-bar) > span.current,
.breadcrumbs:not(.powerline-bar) > span.breadcrumb-current:last-of-type,
.breadcrumbs:not(.powerline-bar) > span:last-child:not(.breadcrumb-separator):not(a):not([class*="lang-"]),
.subpage-breadcrumb:not(.powerline-bar) > span.current,
.subpage-breadcrumb:not(.powerline-bar) > span.breadcrumb-current:last-of-type,
.subpage-breadcrumb:not(.powerline-bar) > span:last-child:not(a):not([class*="lang-"]),
html:not([lang="es"]) .breadcrumbs:not(.powerline-bar) > span.lang-en,
html:not([lang="es"]) .subpage-breadcrumb:not(.powerline-bar) > span.lang-en,
html[lang="es"] .breadcrumbs:not(.powerline-bar) > span.lang-es,
html[lang="es"] .subpage-breadcrumb:not(.powerline-bar) > span.lang-es {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.45rem !important;
  padding: 0.45rem 1.05rem 0.45rem 1.15rem !important;
  font-family: var(--font-sans) !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 11px 50%) !important;
  margin-left: -10px !important;
  background: #38bdf8 !important;
  color: #090d16 !important;
  border-top-right-radius: 4px !important;
  border-bottom-right-radius: 4px !important;
  user-select: none !important;
}

/* Strict Language Isolation within Breadcrumb Containers (high specificity) */
html:not([lang="es"]) .breadcrumbs:not(.powerline-bar) .lang-es,
html:not([lang="es"]) .breadcrumbs:not(.powerline-bar) > a.lang-es,
html:not([lang="es"]) .breadcrumbs:not(.powerline-bar) > span.lang-es,
html:not([lang="es"]) .subpage-breadcrumb:not(.powerline-bar) .lang-es,
html:not([lang="es"]) .subpage-breadcrumb:not(.powerline-bar) > a.lang-es,
html:not([lang="es"]) .subpage-breadcrumb:not(.powerline-bar) > span.lang-es {
  display: none !important;
}

html[lang="es"] .breadcrumbs:not(.powerline-bar) .lang-en,
html[lang="es"] .breadcrumbs:not(.powerline-bar) > a.lang-en,
html[lang="es"] .breadcrumbs:not(.powerline-bar) > span.lang-en,
html[lang="es"] .subpage-breadcrumb:not(.powerline-bar) .lang-en,
html[lang="es"] .subpage-breadcrumb:not(.powerline-bar) > a.lang-en,
html[lang="es"] .subpage-breadcrumb:not(.powerline-bar) > span.lang-en {
  display: none !important;
}




/* ==========================================================================
   Atlas 1765 - South Atlantic News & Counter-Dispatches Wire Styles
   ========================================================================== */

.news-wire-section {
  padding: 4.5rem 0;
  background: radial-gradient(circle at 50% 0%, rgba(30, 41, 59, 0.4) 0%, rgba(9, 13, 22, 0.95) 100%);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  transition: padding 0.35s ease;
}

.news-wire-section.is-collapsed {
  padding: 3rem 0;
}

.news-wire-section.is-collapsed .news-wire-collapsible {
  display: none;
}

.news-wire-section.is-expanded .news-wire-collapsible {
  display: block;
  animation: newsWireSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.news-wire-toggle-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.75rem;
}

.news-wire-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(16, 185, 129, 0.15);
  border: 1.5px solid rgba(16, 185, 129, 0.55);
  color: #10b981;
  padding: 0.8rem 1.85rem;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.2);
  transition: all 0.25s ease;
}

.news-wire-toggle-pill:hover {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  color: #34d399;
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.35);
}

.news-wire-toggle-pill .toggle-icon {
  font-size: 1.15rem;
  line-height: 1;
  transition: transform 0.3s ease;
}

.news-wire-section.is-collapsed .toggle-text-collapsed {
  display: inline;
}
.news-wire-section.is-collapsed .toggle-text-expanded {
  display: none;
}
.news-wire-section.is-collapsed .toggle-icon {
  transform: rotate(0deg);
}

.news-wire-section.is-expanded .toggle-text-collapsed {
  display: none;
}
.news-wire-section.is-expanded .toggle-text-expanded {
  display: inline;
}
.news-wire-section.is-expanded .toggle-icon {
  transform: rotate(180deg);
}

.news-wire-section.is-expanded .news-wire-toggle-pill {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.4);
  color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.news-wire-section.is-expanded .news-wire-toggle-pill:hover {
  background: rgba(148, 163, 184, 0.22);
  border-color: #f1f5f9;
  color: #ffffff;
}

.news-wire-footer-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.news-wire-collapse-footer-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #94a3b8;
  padding: 0.8rem 1.6rem;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.news-wire-collapse-footer-btn:hover {
  border-color: #cbd5e1;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}


.news-wire-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.news-wire-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.news-wire-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #34d399;
  margin-bottom: 1rem;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.news-wire-header h2 {
  font-size: 2.25rem;
  font-weight: 900;
  color: #f8fafc;
  margin-bottom: 0.75rem;
  letter-spacing: -0.025em;
}

.news-wire-subtitle {
  font-size: 1.05rem;
  color: #94a3b8;
  max-width: 820px;
  margin: 0 auto;
  line-height: 1.6;
}

/* Filter Bar */
.news-wire-filter-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
  margin-bottom: 3rem;
}

.news-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.55rem 1.15rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.news-filter-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border-color: #64748b;
}

.news-filter-btn.active {
  background: #1e293b;
  color: #f8fafc;
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

.filter-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.filter-dot.gold { background: #f59e0b; box-shadow: 0 0 6px #f59e0b; }
.filter-dot.red { background: #ef4444; box-shadow: 0 0 6px #ef4444; }
.filter-dot.blue { background: #3b82f6; box-shadow: 0 0 6px #3b82f6; }
.filter-dot.amber { background: #f97316; box-shadow: 0 0 6px #f97316; }
.filter-dot.purple { background: #a855f7; box-shadow: 0 0 6px #a855f7; }

/* Year Filter Bar */
.news-wire-year-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: -1.75rem;
  margin-bottom: 2.5rem;
}

.year-bar-label {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.25rem;
}

.news-year-btn {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #94a3b8;
  padding: 0.35rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.news-year-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: #94a3b8;
}

.news-year-btn.active {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.news-load-more-wrap, .archive-load-more-wrap {
  text-align: center;
  margin-top: 1rem;
  margin-bottom: 2.5rem;
}

.btn-news-load-more {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  padding: 0.75rem 1.8rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}

.btn-news-load-more:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.25);
}

/* 12-Card Grid */
.news-wire-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 1.75rem;
  margin-bottom: 3rem;
}

@media (max-width: 768px) {
  .news-wire-grid {
    grid-template-columns: 1fr;
  }
}

.news-wire-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
}

.news-wire-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

/* Tier Specific Badging & Borders */
.news-wire-card.tier-sovereign {
  border: 1.5px solid rgba(245, 158, 11, 0.6);
  background: linear-gradient(180deg, rgba(69, 26, 3, 0.15) 0%, rgba(20, 30, 51, 1) 100%);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.08);
}

.news-wire-card.tier-sovereign:hover {
  border-color: #f59e0b;
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.2);
}

.news-wire-card.tier-defence {
  border: 1.5px solid rgba(59, 130, 246, 0.5);
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.05);
}

.news-wire-card.tier-defence:hover {
  border-color: #60a5fa;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

.news-wire-card.tier-claim {
  border: 1.5px solid rgba(239, 68, 68, 0.5);
  background: linear-gradient(180deg, rgba(69, 10, 10, 0.15) 0%, rgba(20, 30, 51, 1) 100%);
}

.news-wire-card.tier-claim:hover {
  border-color: #ef4444;
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.15);
}

.news-wire-card.tier-energy {
  border: 1.5px solid rgba(168, 85, 247, 0.5);
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.05);
}

.news-wire-card.tier-energy:hover {
  border-color: #c084fc;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.15);
}

.news-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  gap: 0.5rem;
}

.news-source-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.news-source-badge {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.news-source-badge.tier-sovereign {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.news-source-badge.tier-defence {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

.news-source-badge.tier-claim {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.news-source-badge.tier-energy {
  background: rgba(168, 85, 247, 0.15);
  color: #d8b4fe;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.news-domain-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
}

.news-timestamp {
  font-size: 0.75rem;
  color: #64748b;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.news-card-headline {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.75rem;
  color: #f8fafc;
}

.news-card-headline a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

.news-card-headline a:hover {
  color: #38bdf8;
}

.news-card-summary {
  font-size: 0.88rem;
  color: #cbd5e1;
  line-height: 1.55;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

/* Embedded Fact-Check Box */
.news-fact-check-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-left: 4px solid #ef4444;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.82rem;
}

.fact-check-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.fact-check-title {
  font-weight: 800;
  color: #fca5a5;
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.verdict-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: #7f1d1d;
  color: #fee2e2;
  border: 1px solid #ef4444;
}

.fact-check-claim {
  color: #e2e8f0;
  margin-bottom: 0.5rem;
  padding-left: 0.5rem;
  border-left: 2px solid #64748b;
  font-style: italic;
  line-height: 1.4;
}

.fact-check-refutation {
  color: #94a3b8;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.fact-check-refutation strong {
  color: #38bdf8;
}

.fact-check-treaty {
  font-size: 0.75rem;
  color: #64748b;
  margin-bottom: 0.75rem;
  padding-top: 0.35rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
}

.fact-check-treaty strong {
  color: #94a3b8;
}

.fact-check-dossier-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: #38bdf8;
  text-decoration: none;
  background: rgba(56, 189, 248, 0.1);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  transition: all 0.2s ease;
}

.fact-check-dossier-link:hover {
  background: rgba(56, 189, 248, 0.2);
  color: #ffffff;
  border-color: #38bdf8;
  transform: translateX(2px);
}

.news-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.8rem;
}

.news-category-tag {
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 600;
}

.news-read-link {
  color: #38bdf8;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: color 0.15s ease;
}

.news-read-link:hover {
  color: #93c5fd;
  text-decoration: underline;
}

/* Footer Action & Legend */
.news-wire-footer-action {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.news-wire-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: #94a3b8;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.badge-legend {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.badge-legend.gold { background: #f59e0b; }
.badge-legend.blue { background: #3b82f6; }
.badge-legend.red { background: #ef4444; }

.news-wire-hub-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: #ffffff;
  padding: 0.85rem 2rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.3);
  transition: all 0.2s ease;
}

.news-wire-hub-btn:hover {
  background: linear-gradient(135deg, #2563eb 0%, #60a5fa 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.45);
}

/* Full News Archive Page Specifics */
.archive-controls-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
  background: var(--bg-surface);
  padding: 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  align-items: center;
  justify-content: space-between;
}

.archive-search-box {
  flex-grow: 1;
  min-width: 280px;
}

.archive-search-box input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.65rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.archive-filter-select select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.65rem 1rem;
  border-radius: 6px;
  font-size: 0.9rem;
}

.sources-directory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.source-dir-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.source-dir-card.tier-sovereign {
  border-left: 3px solid #f59e0b;
}

.source-dir-card.tier-defence {
  border-left: 3px solid #3b82f6;
}

.source-dir-card.tier-claim {
  border-left: 3px solid #ef4444;
}

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

.src-country-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: var(--bg-surface);
  color: #94a3b8;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.src-dir-name {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: #f8fafc;
}

.src-dir-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.45;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.src-dir-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.src-dir-footer a {
  color: #38bdf8;
  text-decoration: none;
}

/* ==========================================================================
   Small Mobile Viewport & Samsung Galaxy Ultra Optimization (<= 480px & <= 384px)
   ========================================================================== */
@media (max-width: 480px) {
  html {
    font-size: 14.5px;
  }

  body {
    padding-top: var(--header-height, 3.5rem);
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .container {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Compact typography on small viewports */
  h1, .hero-title, .subpage-title, .portal-hero h1 {
    font-size: clamp(1.25rem, 5.5vw, 1.6rem) !important;
    line-height: 1.25 !important;
    word-break: normal;
    overflow-wrap: break-word;
  }

  h2, .section-title, .portal-hub-card h2 {
    font-size: clamp(1.1rem, 4.5vw, 1.35rem) !important;
    line-height: 1.3 !important;
  }

  h3, .figure-name, .doc-title, .country-name-title {
    font-size: clamp(0.95rem, 3.8vw, 1.15rem) !important;
    line-height: 1.35 !important;
  }

  /* Scaled stat numbers */
  .stat-number, .country-stat-num, .docs-stat-number, .num, .metric-number {
    font-size: clamp(1.2rem, 5vw, 1.55rem) !important;
    line-height: 1.1 !important;
  }

  .country-stat-label, .docs-stat-label, .stat-label {
    font-size: 0.68rem !important;
  }

  /* Compact Site Header */
  header.site-header .container {
    padding: 0 0.5rem !important;
  }
  .site-logo {
    gap: 0.35rem !important;
  }
  .logo-icon {
    width: 1.85rem !important;
    height: 1.48rem !important;
  }
  .logo-text h1 {
    font-size: 0.95rem !important;
  }
  .logo-text span {
    font-size: 0.58rem !important;
  }
  .header-controls {
    gap: 0.35rem !important;
  }
  .lang-toggle {
    padding: 0.3rem 0.45rem !important;
    font-size: 0.72rem !important;
  }
  .mobile-menu-btn {
    width: 2.2rem !important;
    height: 2.2rem !important;
  }

  /* Powerline Breadcrumb Touch Horizontal Scrolling */
  .powerline-bar,
  .subpage-powerline,
  .powerline-bar.pl-slanted {
    display: flex !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
    margin-bottom: 1rem !important;
  }
  .powerline-bar::-webkit-scrollbar {
    display: none !important;
  }
  .powerline-segment {
    font-size: 0.68rem !important;
    padding: 0.32rem 0.85rem 0.32rem 0.65rem !important;
    flex-shrink: 0 !important;
  }

  /* Stat ribbons on small screens */
  .countries-stats-ribbon,
  .docs-stats-row {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0.5rem !important;
  }

  /* Standard single-entity catalogs wrap to 1 column on mobile */
  .documents-grid,
  .countries-grid,
  .figures-grid,
  .websites-grid,
  .propaganda-grid,
  .sources-grid,
  .sources-directory-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* STRICT IMMUTABLE REQUIREMENT: Comparative 2-column views NEVER degrade to 1 column */
  .demographics-split,
  .demographics-comparison-split,
  #demographics-comparison-split,
  .cabinet-filter-grid,
  .demographic-findings-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 0.4rem !important;
    width: 100% !important;
  }
}

@media (max-width: 360px) {
  html {
    font-size: 13.5px;
  }
  .container {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
  .countries-stats-ribbon {
    grid-template-columns: 1fr !important;
  }
  .demographics-split,
  .demographics-comparison-split,
  #demographics-comparison-split,
  .cabinet-filter-grid,
  .demographic-findings-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 0.3rem !important;
  }
}

/* ==========================================================================
   Universal Pillbox, Badge & Pill Button Overflow Protection
   Guarantees all pillboxes, tags, chips, and filter buttons adapt safely
   ========================================================================== */
.filter-btn,
.filter-pill,
.jump-ribbon-pill,
.btn-smart-action,
.btn-back-pill,
.btn-subpage-back,
.nav-pill-badge,
.glossary-pill,
.drawer-pill-btn,
.vault-pill-btn,
.news-wire-toggle-pill,
.src-country-pill,
.journal-verdict-pill,
.journal-wayback-pill,
.target-filter-pill,
.doc-pill,
.web-pill,
.badge-violation,
.badge-post,
.badge-mixed,
.badge-pre,
.person-badge {
  max-width: 100%;
  box-sizing: border-box;
}

.smart-nav-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  box-sizing: border-box;
}

.btn-smart-action {
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  line-height: 1.3;
}

@media (max-width: 640px) {
  .smart-nav-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  .smart-nav-buttons .btn-smart-action {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ==========================================================================
   Lightweight, No-Fuss Social Media Share Strip (Zero Bloat, Native & Intent)
   ========================================================================== */
.social-share-strip {
  width: 100%;
  background: var(--bg-surface, #0f172a);
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  border-bottom: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
  padding: 1.5rem 0;
  margin: 3rem 0 0 0;
  box-sizing: border-box;
}

.share-strip-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.share-strip-lead {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.share-strip-icon {
  font-size: 1.5rem;
  line-height: 1;
  flex-shrink: 0;
}

.share-strip-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.share-strip-title {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--text-primary, #f8fafc);
  letter-spacing: -0.01em;
}

.share-strip-subtitle {
  font-size: 0.82rem;
  color: var(--text-secondary, #94a3b8);
  line-height: 1.35;
}

.share-strip-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.btn-share-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary, #f8fafc);
  transition: all var(--transition-fast, 0.15s ease);
  user-select: none;
  box-sizing: border-box;
}

.btn-share-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-share-pill svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  flex-shrink: 0;
}

/* X / Twitter */
.btn-share-x:hover {
  background: #000000;
  border-color: #555555;
  color: #ffffff;
}

/* Facebook */
.btn-share-fb:hover {
  background: #1877f2;
  border-color: #1877f2;
  color: #ffffff;
}

/* WhatsApp */
.btn-share-wa:hover {
  background: #25d366;
  border-color: #25d366;
  color: #0b2e13;
}

/* Copy Link */
.btn-share-copy {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.35);
  color: #60a5fa;
}

.btn-share-copy:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.btn-share-copy.copied {
  background: #16a34a !important;
  border-color: #16a34a !important;
  color: #ffffff !important;
}

/* Native Mobile Share */
.btn-share-native {
  display: none;
  background: linear-gradient(135deg, #2563eb, #0284c7);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.btn-share-native:hover {
  background: linear-gradient(135deg, #1d4ed8, #0369a1);
}

/* Show native share button only when supported */
.has-native-share .btn-share-native {
  display: inline-flex;
}

@media (max-width: 640px) {
  .social-share-strip {
    padding: 1.15rem 0;
    margin: 2rem 0 0 0;
  }
  .share-strip-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.85rem;
  }
  .share-strip-lead {
    gap: 0.65rem;
  }
  .share-strip-title {
    font-size: 0.9rem;
  }
  .share-strip-subtitle {
    font-size: 0.78rem;
  }
  .share-strip-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
  }
  .has-native-share .share-strip-buttons {
    grid-template-columns: 1fr;
  }
  .has-native-share .btn-share-native {
    grid-column: 1 / -1;
    justify-content: center;
    padding: 0.65rem 1rem;
    font-size: 0.88rem;
  }
  .btn-share-pill {
    justify-content: center;
    padding: 0.45rem 0.6rem;
    font-size: 0.78rem;
  }
}

@media (max-width: 360px) {
  .btn-share-pill {
    font-size: 0.72rem;
    padding: 0.4rem 0.45rem;
  }
}


