@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;900&family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

:root {
  --white: #ffffff;
  --navy: #0A1628;
  --navy-mid: #1a2d4a;
  --teal: #00BFA5;
  --teal-light: #e0f7f4;
  --accent: #FF6B35;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-400: #adb5bd;
  --gray-600: #6c757d;
  --gray-800: #343a40;
  --text: #111827;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--white);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

/* ===== COOKIE POPUP ===== */
#cookie-popup {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(140px);
  background: var(--navy);
  color: white;
  padding: 18px 24px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 9999;
  max-width: 680px;
  width: calc(100% - 32px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 1px solid rgba(0,191,165,0.3);
}

#cookie-popup.visible {
  transform: translateX(-50%) translateY(0);
}

#cookie-popup p {
  font-size: 13px;
  color: rgba(255,255,255,0.82);
  flex: 1;
  line-height: 1.55;
  margin: 0;
}

#cookie-popup p a {
  color: var(--teal);
  text-decoration: underline;
}

.cookie-icon {
  font-size: 26px;
  flex-shrink: 0;
  line-height: 1;
}

.cookie-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-cookie-accept {
  background: var(--teal);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s;
  min-height: 44px;
  white-space: nowrap;
}

.btn-cookie-accept:hover { opacity: 0.85; }

.btn-cookie-decline {
  background: transparent;
  color: rgba(255,255,255,0.55);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 10px 16px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  min-height: 44px;
  white-space: nowrap;
}

.btn-cookie-decline:hover {
  border-color: rgba(255,255,255,0.45);
  color: rgba(255,255,255,0.8);
}

/* ===== COOKIE BLOCKED SCREEN ===== */
#cookie-blocked {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--navy);
  z-index: 99999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
}
#cookie-blocked.show { display: flex; }
#cookie-blocked .blocked-icon { font-size: 52px; margin-bottom: 20px; }
#cookie-blocked h2 {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 700;
  color: white;
  margin-bottom: 12px;
}
#cookie-blocked p {
  font-size: 15px;
  color: rgba(255,255,255,0.65);
  max-width: 440px;
  line-height: 1.75;
  margin-bottom: 28px;
}
#cookie-blocked .blocked-btn {
  background: var(--teal);
  color: white;
  border: none;
  padding: 13px 28px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: opacity 0.2s;
  min-height: 48px;
}
#cookie-blocked .blocked-btn:hover { opacity: 0.85; }
#cookie-blocked .blocked-note {
  margin-top: 16px;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
}

/* ===== NAVBAR ===== */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 12px;
}

.nav-logo {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 22px;
  color: var(--navy);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.5px;
}

.nav-logo .logo-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 6px;
  transition: all 0.2s;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--navy);
  background: var(--gray-100);
}

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--teal);
  border-radius: 50%;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  width: 24px;
  height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ===== HERO / PAGE HEADER ===== */
.page-header {
  background: var(--navy);
  padding: 80px 40px;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -10%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,191,165,0.15) 0%, transparent 70%);
  pointer-events: none;
}

.page-header::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: 5%;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,107,53,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.page-header .container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.page-header .eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  color: var(--teal);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-header .eyebrow::before {
  content: '';
  width: 30px;
  height: 1px;
  background: var(--teal);
}

.page-header h1 {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  color: white;
  line-height: 1.15;
  margin-bottom: 20px;
}

.page-header p {
  font-size: 18px;
  color: rgba(255,255,255,0.65);
  max-width: 600px;
  font-weight: 300;
}

/* ===== CONTAINERS & SECTIONS ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 40px;
}

.section {
  padding: 80px 0;
}

.section-alt {
  background: var(--gray-100);
}

.section-title {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
}

.section-sub {
  color: var(--gray-600);
  font-size: 17px;
  margin-bottom: 48px;
  font-weight: 300;
}

/* ===== CARDS ===== */
.card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  padding: 32px;
  transition: all 0.25s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 48px rgba(10,22,40,0.1);
  border-color: var(--teal);
}

.card-icon {
  width: 48px;
  height: 48px;
  background: var(--teal-light);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 20px;
}

.card h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}

.card p {
  color: var(--gray-600);
  font-size: 15px;
  line-height: 1.65;
}

/* ===== GRID ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* ===== BADGE ===== */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'DM Mono', monospace;
  letter-spacing: 0.05em;
}

.badge-global { background: #e8f5e9; color: #2e7d32; }
.badge-national { background: #e3f2fd; color: #1565c0; }
.badge-exotic { background: #fce4ec; color: #c62828; }
.badge-teal { background: var(--teal-light); color: #007a6e; }

/* ===== TABLE ===== */
.table-wrapper {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--gray-200);
}

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

thead {
  background: var(--navy);
  color: white;
}

thead th {
  padding: 14px 20px;
  text-align: left;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.1em;
  font-weight: 500;
}

tbody tr:nth-child(even) { background: var(--gray-100); }
tbody tr:hover { background: var(--teal-light); }

tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-200);
  color: var(--gray-800);
}

tbody td:first-child {
  font-family: 'DM Mono', monospace;
  font-weight: 500;
  color: var(--navy);
}

/* ===== CTA BUTTON ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--teal);
  color: white;
}

.btn-primary:hover {
  background: #009d8a;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,191,165,0.3);
}

.btn-outline {
  background: transparent;
  color: white;
  border: 1px solid rgba(255,255,255,0.4);
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
  border-color: white;
}

/* ===== ALERT BOX ===== */
.alert {
  padding: 20px 24px;
  border-radius: 8px;
  border-left: 4px solid;
  margin: 24px 0;
  font-size: 15px;
}

.alert-info { background: #e3f2fd; border-color: #1565c0; color: #1565c0; }
.alert-warning { background: #fff8e1; border-color: #f9a825; color: #795800; }
.alert-danger { background: #fce4ec; border-color: #c62828; color: #c62828; }
.alert-success { background: #e8f5e9; border-color: #2e7d32; color: #2e7d32; }

/* ===== FOOTER ===== */
footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  padding: 60px 40px 30px;
}

.footer-grid {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-brand .nav-logo {
  color: white;
  margin-bottom: 16px;
  display: inline-flex;
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.7;
  max-width: 260px;
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 600;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 16px;
  font-family: 'DM Mono', monospace;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.footer-col ul li a:hover {
  color: var(--teal);
}

.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  flex-wrap: wrap;
}

.footer-bottom a {
  color: rgba(255,255,255,0.4);
  text-decoration: none;
}

.footer-bottom a:hover { color: var(--teal); }

/* ===== ACCORDION ===== */
.accordion-item {
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}

.accordion-header {
  padding: 20px 24px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  color: var(--navy);
  background: white;
  transition: background 0.2s;
  user-select: none;
}

.accordion-header:hover { background: var(--gray-100); }

.accordion-header.open { background: var(--navy); color: white; }

.accordion-icon {
  font-size: 18px;
  transition: transform 0.3s;
  flex-shrink: 0;
}

.accordion-header.open .accordion-icon { transform: rotate(45deg); }

.accordion-body {
  display: none;
  padding: 24px;
  background: var(--gray-100);
  font-size: 15px;
  color: var(--gray-800);
  line-height: 1.75;
  border-top: 1px solid var(--gray-200);
}

.accordion-body.open { display: block; }

/* ===== STEPS ===== */
.steps {
  counter-reset: step;
}

.step {
  display: flex;
  gap: 24px;
  margin-bottom: 32px;
  position: relative;
}

.step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 19px;
  top: 44px;
  width: 2px;
  height: calc(100% - 20px);
  background: var(--gray-200);
}

.step-num {
  counter-increment: step;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 500;
  flex-shrink: 0;
}

.step-content h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
  padding-top: 8px;
}

.step-content p {
  color: var(--gray-600);
  font-size: 15px;
}

/* ===== TABS ===== */
.tabs-nav {
  display: flex;
  gap: 4px;
  border-bottom: 2px solid var(--gray-200);
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 10px 20px;
  border: none;
  background: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  position: relative;
  bottom: -2px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab-btn:hover { color: var(--navy); }

.tab-btn.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  nav { padding: 0 16px; }
  .nav-links {
    display: none;
    position: fixed;
    top: 64px;
    left: 0; right: 0;
    background: white;
    flex-direction: column;
    padding: 12px 16px 16px;
    border-bottom: 1px solid var(--gray-200);
    gap: 2px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 11px 14px; font-size: 15px; }
  .hamburger { display: flex; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
  .section { padding: 48px 0; }
  .page-header { padding: 48px 16px; }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }

  /* Cookie popup — full width, stacked, thumb-friendly */
  #cookie-popup {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    transform: translateY(100%);
    border-radius: 16px 16px 0 0;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 20px 20px 28px;
    text-align: left;
    border-bottom: none;
  }
  #cookie-popup.visible { transform: translateY(0); }
  #cookie-popup .cookie-icon { display: none; }
  #cookie-popup p { font-size: 14px; }
  .cookie-buttons {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  .btn-cookie-accept,
  .btn-cookie-decline {
    width: 100%;
    justify-content: center;
    min-height: 50px;
    font-size: 15px;
    border-radius: 10px;
  }
}

/* ===== RESPONSIVE TABLES — MOBILE CARD VIEW ===== */
@media (max-width: 640px) {
  .table-wrapper {
    border: none;
    background: transparent;
  }
  table {
    display: block;
  }
  thead {
    display: none;
  }
  tbody {
    display: grid;
    gap: 12px;
  }
  tbody tr {
    display: grid;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    padding: 16px;
    gap: 6px;
  }
  tbody tr:nth-child(even) { background: white; }
  tbody tr:hover { background: var(--teal-light); }
  tbody td {
    display: flex;
    border-bottom: none;
    padding: 0;
    font-size: 13px;
    align-items: baseline;
    gap: 6px;
  }
  tbody td::before {
    content: attr(data-label);
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    min-width: 72px;
    flex-shrink: 0;
  }
  tbody td:first-child {
    font-size: 16px;
    font-weight: 700;
    color: var(--navy);
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 8px;
    margin-bottom: 4px;
  }
  tbody td:first-child::before { display: none; }
}

/* ===== TOUCH TARGETS — 48px minimum ===== */
.nav-links a,
.tab-btn,
.btn-cookie-accept,
.btn-cookie-decline,
.hamburger {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.footer-col ul li a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* ===== TABLET GRID — 2 col at 640-900px ===== */
@media (max-width: 900px) and (min-width: 641px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
}

/* ===== SVG SCALING ===== */
nav svg, .footer-brand svg, .logo-icon svg {
  max-width: 100%;
  height: auto;
}

/* ===== SCROLL MARGIN FOR ANCHOR LINKS ===== */
[id] { scroll-margin-top: 80px; }

/* ===== GLOBAL NAV SEARCH ===== */
.nav-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  color: var(--gray-600);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  min-height: 36px;
  margin-right: 8px;
}
.nav-search-btn:hover { border-color: var(--teal); color: var(--navy); }
.nav-search-btn svg { flex-shrink: 0; }
.nav-search-btn kbd {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  color: var(--gray-400);
  line-height: 1.4;
}

/* Search Modal */
.search-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,22,40,0.55);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}
.search-overlay.open { opacity: 1; pointer-events: all; }

.search-modal {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 580px;
  margin: 0 20px;
  box-shadow: 0 28px 80px rgba(0,0,0,0.22);
  overflow: hidden;
  transform: translateY(-8px);
  transition: transform 0.18s;
}
.search-overlay.open .search-modal { transform: translateY(0); }

.search-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gray-200);
}
.search-modal-header svg { color: var(--gray-400); flex-shrink: 0; }
.search-modal-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  color: var(--navy);
  background: transparent;
}
.search-modal-input::placeholder { color: var(--gray-400); }
.search-modal-esc {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: var(--gray-400);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
}

.search-results-list { max-height: 380px; overflow-y: auto; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 18px;
  text-decoration: none;
  color: var(--navy);
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.12s;
}
.search-result-item:hover, .search-result-item.focused {
  background: var(--teal-light);
}
.search-result-type {
  font-size: 10px;
  font-family: 'DM Mono', monospace;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  min-width: 52px;
}
.search-result-title { font-size: 14px; font-weight: 500; }
.search-result-desc { font-size: 12px; color: var(--gray-600); margin-top: 1px; }
.search-no-results { padding: 28px 18px; text-align: center; color: var(--gray-400); font-size: 14px; }
.search-footer {
  padding: 10px 18px;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: 16px;
  font-size: 11px;
  color: var(--gray-400);
  font-family: 'DM Mono', monospace;
}
.search-footer kbd {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 3px;
  padding: 1px 5px;
  margin-right: 4px;
}

/* ===== WIKI LAYOUT ===== */
.wiki-layout {
  display: grid;
  grid-template-columns: 216px 1fr;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 40px;
  align-items: start;
}

.wiki-sidebar {
  position: sticky;
  top: 84px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 14px;
  margin-right: 32px;
}

.wiki-sidebar-title {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}

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

.toc-list li { counter-increment: toc-item; }

.toc-list a {
  display: block;
  padding: 5px 8px;
  font-size: 13px;
  color: var(--gray-600);
  text-decoration: none;
  border-radius: 4px;
  border-left: 2px solid transparent;
  transition: all 0.12s;
  line-height: 1.4;
}

.toc-list a:hover { color: var(--navy); background: var(--gray-200); }
.toc-list a.toc-active {
  color: var(--teal);
  background: var(--teal-light);
  border-left-color: var(--teal);
  font-weight: 600;
}

.wiki-content { min-width: 0; }

/* ===== BREADCRUMBS ===== */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--gray-400);
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.breadcrumbs a { color: var(--teal); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { color: var(--gray-400); }

/* ===== WIKI INFOBOX ===== */
.wiki-infobox {
  float: right;
  margin: 4px 0 20px 24px;
  width: 240px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
  font-size: 13px;
  clear: right;
}
.wiki-infobox-header {
  background: var(--navy);
  color: white;
  padding: 9px 13px;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.wiki-infobox-tld {
  font-family: 'DM Mono', monospace;
  font-size: 22px;
  text-align: center;
  padding: 12px;
  background: rgba(0,191,165,0.12);
  border-bottom: 1px solid rgba(0,191,165,0.2);
  color: var(--teal);
  letter-spacing: 0.02em;
}
.wiki-infobox-row {
  display: flex;
  border-bottom: 1px solid var(--gray-200);
}
.wiki-infobox-row:last-child { border-bottom: none; }
.wiki-infobox-label {
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-600);
  background: var(--gray-100);
  min-width: 90px;
  display: flex;
  align-items: center;
}
.wiki-infobox-value {
  padding: 7px 10px;
  font-size: 12px;
  color: var(--navy);
  font-weight: 500;
  background: white;
  flex: 1;
  display: flex;
  align-items: center;
}

/* ===== WIKI ARTICLE TYPOGRAPHY ===== */
.wiki-article h2 {
  font-family: 'DM Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  margin: 32px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gray-200);
}
.wiki-article h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin: 20px 0 8px;
}
.wiki-article p {
  color: var(--gray-800);
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 14px;
}
.wiki-article .section-eyebrow {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--teal);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: 4px;
  display: block;
}
.wiki-article .wiki-section {
  margin-bottom: 40px;
  scroll-margin-top: 84px;
}
.wiki-article .history-block {
  border-left: 3px solid var(--teal);
  padding-left: 18px;
  margin: 12px 0;
}
.wiki-article .eligibility-list {
  list-style: none;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 16px 20px;
}
.wiki-article .eligibility-list li {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--gray-800);
  line-height: 1.6;
}
.wiki-article .eligibility-list li:last-child { margin-bottom: 0; }

/* Duration grid compact */
.wiki-article .duration-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.wiki-article .duration-cell {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 12px 14px;
}
.wiki-article .duration-cell.highlight {
  background: var(--navy);
  border-color: var(--navy);
}
.wiki-article .duration-cell .dc-label {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  color: var(--gray-400);
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.wiki-article .duration-cell.highlight .dc-label { color: var(--teal); }
.wiki-article .duration-cell .dc-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
}
.wiki-article .duration-cell.highlight .dc-value { color: white; }

/* authinfo steps compact */
.wiki-article .authinfo-step {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
  align-items: flex-start;
}
.wiki-article .authinfo-num {
  width: 28px; height: 28px;
  background: var(--teal);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'DM Mono', monospace;
  font-size: 12px; font-weight: 600;
  color: white;
  flex-shrink: 0;
}
.wiki-article .authinfo-content h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 700;
  color: var(--navy);
  margin-bottom: 3px;
  padding-top: 4px;
}
.wiki-article .authinfo-content p {
  color: var(--gray-600);
  font-size: 13px;
  line-height: 1.65;
  margin-bottom: 0;
}

/* Compact code / note blocks */
.wiki-note {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-left: 3px solid var(--teal);
  border-radius: 6px;
  padding: 12px 16px;
  font-size: 14px;
  color: var(--gray-800);
  margin: 14px 0;
}
.wiki-note.warning {
  border-left-color: #f9a825;
  background: #fffdf0;
}
.wiki-note.success {
  border-left-color: #2e7d32;
  background: #f4fbf4;
}

/* Compact guide hero */
.guide-hero-compact {
  background: var(--navy);
  padding: 22px 40px 20px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.guide-hero-compact::before {
  content: '';
  position: absolute;
  top: -80%;
  right: -5%;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0,191,165,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.guide-hero-compact .container {
  max-width: 1200px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  z-index: 1;
}
.guide-hero-compact .tld-pill {
  font-family: 'DM Mono', monospace;
  font-size: 20px;
  font-weight: 500;
  color: var(--teal);
  background: rgba(0,191,165,0.12);
  border: 1px solid rgba(0,191,165,0.35);
  border-radius: 6px;
  padding: 4px 14px;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.guide-hero-compact .hero-text h1 {
  font-family: 'DM Sans', sans-serif;
  font-size: clamp(18px, 2.5vw, 24px);
  font-weight: 700;
  color: white;
  margin: 0 0 3px;
  line-height: 1.2;
}
.guide-hero-compact .hero-text p {
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  margin: 0;
  font-weight: 400;
}
.guide-hero-compact .hero-badges {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-left: auto;
  flex-wrap: wrap;
}
.guide-hero-compact .meta-pill {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.guide-hero-compact .meta-pill .ml { font-family: 'DM Mono', monospace; font-size: 9px; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: .12em; }
.guide-hero-compact .meta-pill .mv { font-size: 12px; font-weight: 600; color: var(--teal); }

/* ===== RESPONSIVE WIKI LAYOUT ===== */
@media (max-width: 860px) {
  .wiki-layout {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .wiki-sidebar {
    position: static;
    margin-right: 0;
    margin-bottom: 20px;
  }
  .wiki-infobox {
    float: none;
    width: 100%;
    margin: 0 0 20px;
  }
  .guide-hero-compact { padding: 16px 20px; }
  .guide-hero-compact .hero-badges { display: none; }
}

@media (max-width: 640px) {
  .nav-search-btn span { display: none; }
  .nav-search-btn kbd { display: none; }
}

/* ===== GLOBAL MOBILE IMPROVEMENTS ===== */

/* Prevent horizontal overflow on all pages */
body { overflow-x: hidden; }

/* Better tap targets for all interactive elements */
@media (max-width: 640px) {
  /* Nav search button — icon only on mobile */
  .nav-search-btn span,
  .nav-search-btn kbd { display: none; }
  .nav-search-btn { padding: 8px 10px; min-height: 40px; }

  /* Navbar logo font slightly smaller */
  .nav-logo { font-size: 19px; }

  /* Cards — reduce padding on mobile */
  .card { padding: 20px; }
  .card-icon { width: 40px; height: 40px; font-size: 18px; margin-bottom: 14px; }

  /* Section titles */
  .section-title { font-size: 20px; }
  .section-sub { font-size: 15px; margin-bottom: 28px; }

  /* Buttons in hero — stack them */
  .page-header .container > div[style*="display:flex"] {
    flex-direction: column;
  }
  .btn { width: 100%; justify-content: center; min-height: 50px; font-size: 15px; }

  /* Footer column spacing */
  .footer-col { margin-bottom: 8px; }
  .footer-col ul li a { min-height: 40px; }

  /* Accordion easier to tap */
  .accordion-header { padding: 16px 18px; min-height: 54px; }

  /* Steps tighter on mobile */
  .step { gap: 14px; }
  .step-num { width: 34px; height: 34px; font-size: 13px; }

  /* Table card view refinement */
  .table-wrapper { border-radius: 8px; }

  /* Wiki layout on mobile */
  .wiki-layout { padding: 16px; }
  .wiki-infobox { width: 100%; float: none; margin: 0 0 16px; }

  /* Search modal */
  .search-modal { margin: 0 12px; }
  .search-result-item { padding: 10px 14px; }

  /* Registry pill nav */
  .reg-pill-nav { padding: 10px 16px; top: 64px; }
  .reg-pill { padding: 6px 12px; font-size: 12px; }
  .reg-section { padding: 36px 0 24px; }
  .wiki-layout { padding: 16px 16px 40px; }
}

@media (max-width: 900px) {
  /* Tablet: page header less tall */
  .page-header { padding: 56px 32px; }

  /* Tablet: nav with some search button */
  nav { padding: 0 24px; }

  /* Compact guide hero on tablet */
  .guide-hero-compact { padding: 18px 24px; }
}

/* Improve text readability on small screens */
@media (max-width: 480px) {
  body { font-size: 15px; }
  .page-header h1 { font-size: 26px; }
  .page-header p { font-size: 15px; }
  .section-title { font-size: 19px; }
  .card p { font-size: 14px; }

  /* Stats bar 2 columns */
  div[style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: repeat(2,1fr) !important;
  }
}
