/* ════════════════════════════════════════════════════════════════════════
   The Sureway Guide — design system
   1. Tokens (light + dark)      4. Flag backdrop & page accent
   2. Base & typography          5. Components
   3. Layout (header/footer)     6. Pages (home / countries / country /
                                    advice / rankings / 404)
   ════════════════════════════════════════════════════════════════════════ */

/* ── 1. Tokens ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Surfaces */
  --bg: #e9e7e1;
  --surface: #fdfcf9;
  --surface-2: #f0efea;
  --border: #e5e3dc;
  --shadow-sm: 0 1px 2px rgb(24 24 27 / .06);
  --shadow-md: 0 6px 24px rgb(24 24 27 / .09);

  /* Ink */
  --text: #1c1c21;
  --muted: #62626c;

  /* Brand */
  --brand: #0d7a5f;
  --brand-strong: #0a5f4a;
  --brand-tint: color-mix(in srgb, var(--brand) 9%, var(--surface));
  --link: #0b6e9e;

  /* Per-page accent — flag-accent.js may override; purely decorative */
  --page-accent: var(--brand);

  /* Status vocabulary — the map's country fills (.status-* in world-map
     section) read these tokens directly, so they stay aligned by construction */
  --status-green: #1a7f37;  --status-green-tint: #e3f2e7;  --status-green-ink: #135d28;
  --status-orange: #e36209; --status-orange-tint: #fcefe2; --status-orange-ink: #a94a08;
  --status-amber: #bf8700;  --status-amber-tint: #faf3d7;  --status-amber-ink: #7a5c00;
  --status-red: #cf222e;    --status-red-tint: #fde9e8;    --status-red-ink: #a40e26;
  --status-gray: #c9cdd3;   --status-gray-tint: #eff1f3;   --status-gray-ink: #62626c;
  --map-nodata: #dcdad3;
  --map-stroke: #ffffff;
  /* Antique-chart palette (world map): pastel parchment ocean + sepia ink */
  --map-ocean-1: #e9f0ec;
  --map-ocean-2: #d2e2dc;
  --map-ink: #6b6152;
  --map-river: #a9c4bd;
  /* Extra tier steps used only by the passport-strength scale */
  --tier-2: #d4a017;
  --tier-4: #2da44e;

  /* Shape & rhythm */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  /* Type */
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-display: "Public Sans", var(--font-body);

  color-scheme: light;
}

/* Dark tokens apply when the OS asks for dark AND the user hasn't forced light,
   or whenever the user explicitly picks dark via the header toggle. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131316;
    --surface: #1d1d22;
    --surface-2: #27272e;
    --border: #35353e;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .45);
    --shadow-md: 0 6px 24px rgb(0 0 0 / .55);
    --text: #ecebe8;
    --muted: #a5a4ae;
    --brand: #37c69d;
    --brand-strong: #5cd6b1;
    --brand-tint: color-mix(in srgb, var(--brand) 14%, var(--surface));
    --link: #6ec3ec;
    --status-green: #3fb950;  --status-green-tint: #14261a;  --status-green-ink: #6fdd84;
    --status-orange: #f0883e; --status-orange-tint: #2c1e11; --status-orange-ink: #f8b184;
    --status-amber: #d4a72c;  --status-amber-tint: #2a2410;  --status-amber-ink: #e6c95c;
    --status-red: #f85149;    --status-red-tint: #2e1617;    --status-red-ink: #ff8b84;
    --status-gray: #4b515a;   --status-gray-tint: #22262c;   --status-gray-ink: #a5a4ae;
    --map-nodata: #33333b;
    --map-stroke: #1d1d22;
    --map-ocean-1: #1c2528;
    --map-ocean-2: #141b1e;
    --map-ink: #9b9484;
    --map-river: #3e5b63;
    --tier-2: #e0b73f;
    --tier-4: #46c463;
    color-scheme: dark;
  }
}
/* User explicitly chose dark via the header toggle (wins over OS preference). */
:root[data-theme="dark"] {
  --bg: #131316;
  --surface: #1d1d22;
  --surface-2: #27272e;
  --border: #35353e;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .45);
  --shadow-md: 0 6px 24px rgb(0 0 0 / .55);
  --text: #ecebe8;
  --muted: #a5a4ae;
  --brand: #37c69d;
  --brand-strong: #5cd6b1;
  --brand-tint: color-mix(in srgb, var(--brand) 14%, var(--surface));
  --link: #6ec3ec;
  --status-green: #3fb950;  --status-green-tint: #14261a;  --status-green-ink: #6fdd84;
  --status-orange: #f0883e; --status-orange-tint: #2c1e11; --status-orange-ink: #f8b184;
  --status-amber: #d4a72c;  --status-amber-tint: #2a2410;  --status-amber-ink: #e6c95c;
  --status-red: #f85149;    --status-red-tint: #2e1617;    --status-red-ink: #ff8b84;
  --status-gray: #4b515a;   --status-gray-tint: #22262c;   --status-gray-ink: #a5a4ae;
  --map-nodata: #33333b;
  --map-stroke: #1d1d22;
  --map-ocean-1: #1c2528;
  --map-ocean-2: #141b1e;
  --map-ink: #9b9484;
  --map-river: #3e5b63;
  --tier-2: #e0b73f;
  --tier-4: #46c463;
  color-scheme: dark;
}

/* ── 2. Base & typography ── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  position: relative;           /* anchors the flag backdrop */
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; width: 100%; }

h1, h2, h3, .logo, .rank-score {
  font-family: var(--font-display);
  line-height: 1.2;
}
h1 {
  font-size: clamp(1.85rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0.5rem 0 0.75rem;
}
h2 { font-weight: 700; }
h3 { font-weight: 700; }

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible {
  /* Transparent outline stays invisible normally but is forced visible by
     Windows high-contrast / forced-colors mode (where box-shadow is dropped),
     so keyboard focus is never lost. The ring is the everyday indicator. */
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 55%, transparent);
  border-radius: var(--radius-sm);
}

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

table { font-variant-numeric: tabular-nums; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── 3. Layout: header, ticker, footer ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
          backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 65%, transparent);
  padding: 0.65rem 0;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header { background: var(--surface); }
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.header-left { display: flex; align-items: center; gap: 1rem; }
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}
.logo-mark { width: 30px; height: 30px; flex: none; display: block; }
/* Compass needle north half uses --brand, south half --brand-strong; ring +
   ticks use --brand. Driven by CSS tokens so it recolours per theme (matching
   logomark.svg / logomark-dark.svg) without swapping asset files. */
.logo-mark .lm-line { stroke: var(--brand); }
.logo-mark .lm-north { fill: var(--brand); }
.logo-mark .lm-south { fill: var(--brand-strong); }
.logo:hover { text-decoration: none; color: var(--brand); }

.site-header nav { display: flex; align-items: center; gap: 0.25rem; }
.site-header nav a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  transition: background 0.15s, color 0.15s;
}
.site-header nav a:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.site-header nav a.active {
  background: var(--brand-tint);
  color: var(--brand-strong);
}

.passport-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.25rem 0.7rem 0.25rem 0.6rem;
}
.passport-badge span {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}
.passport-flag {
  border-radius: 3px;
  display: block;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent);
}

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.theme-toggle:hover { color: var(--brand); }
.theme-toggle:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 40%, transparent);
}
.theme-toggle svg { width: 18px; height: 18px; display: block; }
/* Show the sun in dark mode (tap to go light), the moon in light mode. */
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-sun,
.theme-toggle[data-resolved="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon,
.theme-toggle[data-resolved="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

@media (max-width: 700px) {
  .site-header .container { flex-wrap: wrap; gap: 0.5rem 1rem; }
  .site-header nav { flex-wrap: wrap; }
}

/* Advice ticker */
.advice-banner {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 0.45rem 0;
  font-size: 0.88rem;
  overflow: hidden;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(to right, transparent, black 2.5%, black 97.5%, transparent);
          mask-image: linear-gradient(to right, transparent, black 2.5%, black 97.5%, transparent);
}
.advice-ticker {
  display: inline-flex;
  align-items: center;
  /* Duration set inline per-render (see base.html); 90s is a fallback. */
  animation: advice-scroll 90s linear infinite;
  will-change: transform;
}
.advice-banner:hover .advice-ticker { animation-play-state: paused; }
.advice-ticker-run {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  padding-right: 0.85rem;
}
.advice-ticker-label {
  font-weight: 700;
  color: var(--brand);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.advice-ticker-label::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--brand);
  animation: ticker-pulse 2.4s ease-in-out infinite;
}
.advice-ticker a { white-space: nowrap; color: var(--text); }
.advice-ticker a strong { font-weight: 600; }
.advice-ticker a:hover { color: var(--link); }
.advice-ticker-all { font-weight: 600; color: var(--link) !important; }
.advice-ticker-sep { color: color-mix(in srgb, var(--muted) 55%, transparent); }

@keyframes advice-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes ticker-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 1.75rem 0;
  margin-top: 3rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--muted);
}
.disclaimer { margin-bottom: 0.4rem; max-width: 720px; margin-left: auto; margin-right: auto; }

/* ── 4. Flag backdrop & page accent ── */
.flag-backdrop {
  position: absolute;
  inset: 0 0 auto 0;
  height: min(48vh, 440px);
  z-index: -1;
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  opacity: 0.17;
  filter: blur(30px) saturate(1.15);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 30%, transparent 100%);
          mask-image: linear-gradient(to bottom, black 0%, black 30%, transparent 100%);
  pointer-events: none;
}
@media (prefers-color-scheme: dark) {
  .flag-backdrop { opacity: 0.24; filter: blur(30px) saturate(0.9) brightness(0.8); }
}
@media (prefers-contrast: more), (forced-colors: active) {
  .flag-backdrop { display: none; }
}

/* Decorative accent hooks (never functional colour) */
.page-accented h1 {
  position: relative;
  padding-bottom: 0.35rem;
}
.page-accented h1::after {
  content: "";
  position: absolute;
  left: 0; bottom: -0.25rem;
  width: 64px; height: 4px;
  border-radius: var(--radius-pill);
  background: var(--page-accent);
}
.page-accented .entry-card { border-top: 3px solid color-mix(in srgb, var(--page-accent) 65%, var(--border)); }

/* ── 5. Components ── */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.25rem;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  text-align: center;
}
.btn-primary {
  background: var(--brand);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--brand-strong);
  color: #ffffff;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
@media (prefers-color-scheme: dark) {
  .btn-primary { color: #10231d; }
  .btn-primary:hover { color: #10231d; }
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--muted) 40%, var(--border));
  text-decoration: none;
  transform: translateY(-1px);
}
.btn-large { padding: 0.8rem 1.6rem; font-size: 1.02rem; }

/* Status pills */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
}
.pill::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}
.pill-green  { background: var(--status-green-tint);  color: var(--status-green-ink); }
.pill-orange { background: var(--status-orange-tint); color: var(--status-orange-ink); }
.pill-amber  { background: var(--status-amber-tint);  color: var(--status-amber-ink); }
.pill-red    { background: var(--status-red-tint);    color: var(--status-red-ink); }
.pill-gray   { background: var(--status-gray-tint);   color: var(--status-gray-ink); }
.pill-lg { font-size: 0.98rem; padding: 0.4rem 1.05rem; }

/* Neutral chip */
.chip, .passport-tag, .verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.18rem 0.7rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Legend dots & pills */
.legend-dot {
  display: inline-block;
  width: 11px; height: 11px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-green  { background: var(--status-green); }
.legend-orange { background: var(--status-orange); }
.legend-amber  { background: var(--status-amber); }
.legend-red    { background: var(--status-red); }
.legend-gray   { background: var(--status-gray); }

.map-legend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.85rem;
}
/* Legend pills are buttons: clicking one spotlights that colour on the map
   (world-map.js toggles aria-pressed + a spotlight-* class on the svg). */
.legend-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.2rem 0.7rem;
  white-space: nowrap;
  font: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.legend-pill:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.legend-pill:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.legend-pill[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand-tint);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--brand);
}
/* Small-caps cartouche heading — shown only inside the hero overlay card */
.map-legend-heading {
  display: none;
  width: 100%;
  font-family: "IM Fell English SC", var(--font-display);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.map-hero-overlay .map-legend-heading { display: block; }

/* Cards */
.card,
.option-card, .country-card, .entry-card, .advice-item, .advice-card,
.no-data-block, .advice-empty, .travel-advice, .sources, .rank-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* Hero */
.hero { text-align: center; padding: 2.75rem 0 1.75rem; }
.hero h1 { margin-bottom: 0.75rem; }
.hero-sub { color: var(--muted); max-width: 640px; margin: 0 auto; font-size: 1.05rem; }
.hero-eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 0.25rem;
}
.trust-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}
.trust-chips .chip { font-size: 0.85rem; padding: 0.3rem 0.9rem; background: var(--surface); }

/* Breadcrumb */
.breadcrumb { color: var(--muted); font-size: 0.88rem; margin: 1.4rem 0 0.25rem; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--link); }

/* Forms & search inputs */
.search-form { display: flex; flex-direction: column; gap: 1rem; }
.search-field { display: flex; flex-direction: column; gap: 0.4rem; }
.search-field label { font-size: 0.88rem; font-weight: 600; color: var(--muted); }
.search-field input,
.country-search input,
.destination-jump input {
  padding: 0.7rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-field input:focus,
.country-search input:focus,
.destination-jump input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
.search-field input::placeholder,
.country-search input::placeholder,
.destination-jump input::placeholder { color: color-mix(in srgb, var(--muted) 75%, transparent); }

.country-search { margin: 1.75rem 0 0; }
.country-search input { width: 100%; border-radius: var(--radius-pill); }
.country-search .no-results,
.search-field .no-results,
.destination-jump .no-results { color: var(--muted); padding: 1rem 0 0; }
.search-field .no-results,
.destination-jump .no-results { font-size: 0.85rem; padding: 0.35rem 0 0; margin: 0; }
.destination-jump input { min-width: 230px; border-radius: var(--radius-pill); padding: 0.5rem 1.1rem; font-size: 0.92rem; }

/* CTA banner */
.cta-banner {
  background: var(--brand-tint);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--border));
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.cta-banner p { font-weight: 500; margin: 0; max-width: 56ch; }
.cta-repeat {
  text-align: center;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

/* Advisory banner */
.advisory-banner {
  background: var(--status-red-tint);
  border: 1px solid color-mix(in srgb, var(--status-red) 35%, var(--border));
  border-left: 4px solid var(--status-red);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.4rem;
  margin: 1.4rem 0;
}
.advisory-banner-heading {
  font-weight: 700;
  color: var(--status-red-ink);
  margin: 0 0 0.7rem;
  font-size: 1.02rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.advisory-icon { flex-shrink: 0; margin-top: 0.2em; }
.advisory-banner-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 0;
}
.advisory-banner-date { color: var(--muted); font-size: 0.88rem; }
.advisory-banner-amber {
  background: var(--status-amber-tint);
  border-color: color-mix(in srgb, var(--status-amber) 40%, var(--border));
  border-left-color: var(--status-amber);
}
.advisory-banner-amber .advisory-banner-heading { color: var(--status-amber-ink); }

/* Entry card + glance row + grouped details */
.entry-card { padding: 1.6rem 1.75rem; margin-bottom: 1.4rem; }
.entry-card-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.entry-card-head h2 { font-size: 1.25rem; margin: 0; }

.glance {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}
.glance-item {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.95rem;
}
.glance-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.glance-value { font-weight: 600; font-size: 0.98rem; line-height: 1.4; }
.glance-sub { display: block; font-weight: 400; font-size: 0.82rem; color: var(--muted); }

.info-group { margin-top: 1.1rem; }
.info-group-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.info-group-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.info-grid {
  display: grid;
  grid-template-columns: minmax(150px, 32%) 1fr;
  row-gap: 0.45rem;
  column-gap: 1rem;
  font-size: 0.95rem;
}
.info-grid dt { color: var(--muted); font-weight: 500; }
.info-grid dd { margin: 0; }
.info-grid .btn { margin: 0.15rem 0.35rem 0.15rem 0; font-size: 0.88rem; padding: 0.4rem 0.95rem; }
@media (max-width: 560px) {
  .info-grid { grid-template-columns: 1fr; row-gap: 0.15rem; }
  .info-grid dd { margin-bottom: 0.55rem; }
}

/* Legacy info table (kept for safety) */
.info-table { width: 100%; border-collapse: collapse; }
.info-table th, .info-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
}
.info-table th { width: 35%; color: var(--muted); font-weight: 500; }

/* Disclosures (shared details styling) */
.disclosure > summary,
.continent-heading,
.advice-section > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 600;
}
.disclosure > summary::-webkit-details-marker,
.continent-heading::-webkit-details-marker,
.advice-section > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before,
.continent-heading::before,
.advice-section > summary::before {
  content: "▸";
  color: var(--muted);
  font-size: 0.8em;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.disclosure[open] > summary::before,
.continent-section[open] > .continent-heading::before,
.advice-section[open] > summary::before { transform: rotate(90deg); }

/* No data */
.no-data { text-align: center; color: var(--muted); padding: 3rem 0; }
.no-data-block { padding: 1.75rem; margin: 1.5rem 0; }
.no-data-block p { margin-bottom: 1.1rem; }
.card-actions { display: flex; gap: 0.6rem; margin-top: 1rem; flex-wrap: wrap; }

/* ── 6. Pages ── */

/* Home */
.home-explore {
  display: grid;
  grid-template-columns: minmax(300px, 2fr) 3fr;
  gap: 1.75rem;
  align-items: start;
  padding: 0.5rem 0 3rem;
}
.option-card { padding: 1.75rem; }
.option-card h2 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.option-card > p { color: var(--muted); margin-bottom: 1.35rem; font-size: 0.95rem; }
.entry-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0 3rem;
}
.home-map { display: flex; flex-direction: column; gap: 0.85rem; }
.home-map .map-controls { display: flex; justify-content: center; flex-wrap: wrap; }
.home-map #world-map { height: 440px; width: 100%; }
.home-map .btn { align-self: center; }
@media (max-width: 800px) {
  .home-explore { grid-template-columns: 1fr; }
}

.home-growing {
  text-align: center;
  padding: 0 0 3rem;
}
.home-growing p {
  display: inline-block;
  max-width: 640px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.map-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem 0.9rem;
  font-size: 0.88rem;
}

#world-map {
  height: 420px;
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

/* ── World map (world-map.js): antique-chart rendering ── */
#world-map { position: relative; }
#world-map svg.world-map-svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* NOTE: stroke widths for map layers are set as attributes by world-map.js
   (base/k on zoom) — do not add stroke-width rules here, CSS would win and
   break the hairline correction. vector-effect is deliberately avoided: it
   defeats GPU compositing of the zoom transform. */

/* Ocean: flat pastel parchment gradient sphere — deliberately untextured. */
.map-ocean { fill: url(#ocean-gradient); stroke: color-mix(in srgb, var(--map-ink) 35%, transparent); }
.map-graticule {
  fill: none;
  stroke: color-mix(in srgb, var(--map-ink) 16%, transparent);
  pointer-events: none;
}

/* Engraved coastline: wide faint halo under the land, thin ink line over it */
.map-coast-halo {
  fill: none;
  stroke: color-mix(in srgb, var(--map-ink) 20%, transparent);
  pointer-events: none;
}
.map-coast-line {
  fill: none;
  stroke: color-mix(in srgb, var(--map-ink) 45%, transparent);
  pointer-events: none;
}
.map-borders {
  fill: none;
  stroke: var(--map-stroke);
  pointer-events: none;
}

/* Country fills are classes over the status tokens — theme flips (OS or
   header toggle) recolour with zero JS. Countries carry no stroke of their
   own: interior lines come from .map-borders, coasts from .map-coast-line. */
.country { stroke: none; }
.country, .micro-marker { transition: fill 0.25s ease, opacity 0.25s ease, fill-opacity 0.15s ease; }
.country.status-green,  .micro-marker.status-green  { fill: var(--status-green); }
.country.status-orange, .micro-marker.status-orange { fill: var(--status-orange); }
.country.status-amber,  .micro-marker.status-amber  { fill: var(--status-amber); }
.country.status-red,    .micro-marker.status-red    { fill: var(--status-red); }
.country.status-nodata, .micro-marker.status-nodata { fill: var(--map-nodata); }
.country.is-covered { cursor: pointer; }
.country.is-covered:hover { fill-opacity: 0.75; }
.country.is-home { cursor: default; }

/* Micro-states: always-visible tap targets for sub-pixel countries */
.micro-marker { stroke: var(--surface); }
.micro-marker.is-covered { cursor: pointer; }
.micro-marker.is-covered:hover { fill-opacity: 0.75; }

/* Spotlight (legend buttons): everything NOT the chosen colour fades out */
.spotlight-green  .country:not(.status-green),   .spotlight-green  .micro-marker:not(.status-green)  { fill: var(--map-nodata); opacity: 0.4; }
.spotlight-orange .country:not(.status-orange),  .spotlight-orange .micro-marker:not(.status-orange) { fill: var(--map-nodata); opacity: 0.4; }
.spotlight-amber  .country:not(.status-amber),   .spotlight-amber  .micro-marker:not(.status-amber)  { fill: var(--map-nodata); opacity: 0.4; }
.spotlight-red    .country:not(.status-red),     .spotlight-red    .micro-marker:not(.status-red)    { fill: var(--map-nodata); opacity: 0.4; }
.spotlight-gray   .country:not(.status-nodata),  .spotlight-gray   .micro-marker:not(.status-nodata) { fill: var(--map-nodata); opacity: 0.4; }

/* Country labels: old-atlas face, halo for legibility, revealed by zoom band */
.map-label {
  font-family: "IM Fell English SC", var(--font-display);
  fill: var(--map-ink);
  text-anchor: middle;
  paint-order: stroke;
  stroke: color-mix(in srgb, var(--map-ocean-1) 85%, transparent);
  stroke-width: 2.5px;
  pointer-events: none;
  visibility: hidden; /* skips paint + hit-testing entirely at world zoom */
  opacity: 0;
  transition: opacity 0.4s ease;
}
svg[data-zoom-band="2"] .map-label.label-tier-1 { visibility: visible; opacity: 0.85; }
svg[data-zoom-band="3"] .map-label { visibility: visible; opacity: 0.9; }

/* Decorative geography (mountain carets, dune stipple, rivers) — hero only,
   fades in once zoomed. Pure illustration, renaissance-atlas style. */
.map-decor { visibility: hidden; opacity: 0; transition: opacity 0.5s ease; pointer-events: none; }
svg[data-zoom-band="2"] .map-decor, svg[data-zoom-band="3"] .map-decor { visibility: visible; opacity: 0.55; }
.map-decor path, .map-decor use {
  fill: none;
  stroke: var(--map-ink);
  stroke-linecap: round;
  stroke-linejoin: round;
}
.map-decor circle { fill: var(--map-ink); stroke: none; }
.map-decor .map-river { stroke: var(--map-river); }

/* Compass rose — the brand logomark compass, screen-fixed, bottom-right.
   Brand teal (needle two-tone --brand / --brand-strong) so it recolours per
   theme, matching the header logo. */
.compass-rose { pointer-events: none; opacity: 1; }
.compass-rose .compass-ring { fill: none; stroke: var(--brand); stroke-width: 3; }
.compass-rose .compass-tick { stroke: var(--brand); stroke-width: 2.5; }
.compass-rose .compass-needle-n { fill: var(--brand); }
.compass-rose .compass-needle-s { fill: var(--brand-strong); }
.compass-rose .compass-n {
  font-family: "IM Fell English SC", var(--font-display);
  font-size: 13px;
  fill: var(--brand);
  text-anchor: middle;
}

/* Ambient actors (ship / fish / whale / birds) — sepia ink, never interactive */
.map-ambient { pointer-events: none; }
.ambient-route { fill: none; stroke: none; }
.map-ambient .actor-ink { fill: var(--map-ink); stroke: none; }
.map-ambient .actor-line { fill: none; stroke: var(--map-ink); stroke-width: 1; stroke-linecap: round; }
.map-ambient .actor-sail { fill: var(--surface); stroke: var(--map-ink); stroke-width: 0.8; }
.map-ambient .ambient-splash { fill: none; stroke-width: 0.8; }

/* Tooltip (replaces the old .jvm-tooltip) */
.map-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 6;
  pointer-events: none;
  max-width: 260px;
  font-family: var(--font-body);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
  line-height: 1.45;
}
.map-tooltip[hidden] { display: none; }
.map-tooltip .tip-status {
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
}
.tip-status-green  { color: var(--status-green-ink); }
.tip-status-orange { color: var(--status-orange-ink); }
.tip-status-amber  { color: var(--status-amber-ink); }
.tip-status-red    { color: var(--status-red-ink); }
.tip-status-gray   { color: var(--status-gray-ink); }

/* Zoom controls: +/− buttons, vertical slider (the mouse-free zoom path),
   and reset. Right edge, below the hero breadcrumb. */
.map-zoom-controls {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.45rem;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}
.map-zoom-btn {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.map-zoom-btn:hover { border-color: var(--brand); }
.map-zoom-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.map-zoom-reset { font-size: 0.85rem; }
.map-zoom-slider {
  writing-mode: vertical-rl;
  direction: rtl;
  width: 24px;
  height: 120px;
  margin: 0.1rem 0;
  accent-color: var(--brand);
  cursor: pointer;
}
.map-zoom-slider:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Countries page: near-fullscreen map hero */
.map-hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  height: calc(100vh - 150px);
  min-height: 520px;
  max-height: 980px;
}
.map-hero #world-map {
  position: absolute;
  inset: 0;
  height: 100%;
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  background:
    radial-gradient(ellipse at center, color-mix(in srgb, var(--brand) 4%, var(--bg)) 0%, var(--bg) 75%);
}
/* (The map clears the top-left overlay card because world-map.js sets
   preserveAspectRatio="xMaxYMid" on the desktop hero, aligning the fixed
   viewBox to the right edge — no CSS transform needed.) */
.map-hero-overlay {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 5;
  max-width: 400px;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
          backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.5rem 1.6rem;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .map-hero-overlay { background: var(--surface); }
}
.map-hero-overlay h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 0 0 0.4rem; }
.map-hero-overlay .map-hero-sub {
  color: var(--muted);
  font-size: 0.92rem;
  margin-bottom: 0.9rem;
}
.map-hero-overlay .map-legend { margin-bottom: 1rem; }
.map-hero-overlay .destination-jump input { width: 100%; min-width: 0; }
.map-hero-cue {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--link);
}

/* Focus panel: minimal country facts, shown when the jump input picks a
   destination (the overlay card hides while it's open — see .is-focused) */
.map-focus-panel {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  z-index: 6;
  width: min(340px, calc(100vw - 3rem));
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
          backdrop-filter: blur(16px) saturate(1.3);
  border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 1.4rem 1.5rem 1.2rem;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .map-focus-panel { background: var(--surface); }
}
.map-focus-panel[hidden] { display: none; }
.map-hero.is-focused .map-hero-overlay { display: none; }
.map-focus-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  line-height: 1;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.map-focus-close:hover { color: var(--text); border-color: var(--brand); }
.map-focus-close:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.map-focus-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 1.6rem 0.6rem 0;
}
.map-focus-flag {
  border-radius: 3px;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.map-focus-name {
  font-size: 1.3rem;
  margin: 0;
}
.map-focus-facts {
  margin: 0.9rem 0 1rem;
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
}
.map-focus-facts div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.35rem;
}
.map-focus-facts dt { color: var(--muted); }
.map-focus-facts dd { margin: 0; font-weight: 600; text-align: right; }
.map-focus-more { display: block; text-align: center; }
.map-focus-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0.7rem 0 0;
}
.map-hero-breadcrumb {
  position: absolute;
  top: 0.6rem;
  right: 1.5rem;
  z-index: 5;
  font-size: 0.85rem;
  color: var(--muted);
}
@media (max-width: 760px) {
  .map-hero { height: auto; min-height: 0; }
  .map-hero #world-map { position: static; height: 340px; }
  .map-hero-overlay {
    position: static;
    max-width: none;
    margin: 1rem 1.5rem;
    box-shadow: var(--shadow-sm);
  }
  .map-hero-breadcrumb { display: none; }
  /* Pinch replaces the slider on touch; compass would crowd the small map */
  .map-zoom-slider { display: none; }
  .map-zoom-controls { right: 10px; padding: 0.4rem 0.35rem; }
  .compass-rose { display: none; }
  /* Focus panel sits below the (static) map instead of over it */
  .map-focus-panel {
    position: static;
    width: auto;
    margin: 1rem 1.5rem 0;
    box-shadow: var(--shadow-sm);
  }
}

/* Countries page: grid & sections */
.countries-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.destination-jump { margin-left: auto; }

.continent-section {
  margin-top: 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 0 1.4rem;
}
.continent-section .country-grid { padding-bottom: 1.4rem; }
.continent-heading {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  padding: 1.05rem 0;
}
.continent-count {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.82rem;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  padding: 0.1rem 0.65rem;
}

.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 1.1rem;
  padding: 0.25rem 0 1.5rem;
}
.country-card {
  padding: 1.2rem 1.3rem;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: box-shadow 0.18s, transform 0.18s, border-color 0.18s;
}
.country-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--muted) 30%, var(--border));
}
.country-card h2 { font-size: 1.12rem; margin: 0; padding-right: 2.4rem; }
.country-card-flag {
  position: absolute;
  top: 1.1rem;
  right: 1.15rem;
  width: 30px;
  height: 22.5px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent);
}
.country-card-home {
  border-color: color-mix(in srgb, var(--status-green) 45%, var(--border));
  background: color-mix(in srgb, var(--status-green) 5%, var(--surface));
}
.entry-type { font-size: 0.88rem; color: var(--muted); margin: 0; }
.entry-type .legend-dot { vertical-align: middle; margin-right: 0.4rem; }
.entry-type.no-info { font-style: italic; opacity: 0.85; }
.country-card .card-actions { margin-top: auto; padding-top: 0.5rem; }
.country-card .btn { font-size: 0.86rem; padding: 0.42rem 0.95rem; }

/* Country detail & requirements */
.sources { margin: 2rem 0 1rem; padding: 1.15rem 1.4rem; }
.sources summary { font-size: 0.98rem; }
.sources-body { padding-top: 0.75rem; }
.sources ul { padding-left: 1.25rem; margin: 0.5rem 0; }
.sources li { font-size: 0.88rem; margin-bottom: 0.3rem; word-break: break-all; }
.sources-note { font-size: 0.85rem; color: var(--muted); margin-top: 0.75rem; }

.travel-advice { padding: 1.4rem 1.6rem; margin: 1.75rem 0; }
.travel-advice h3 { margin: 0 0 0.6rem; font-size: 1.15rem; }
.advice-lead {
  font-weight: 500;
  background: var(--surface-2);
  border-left: 3px solid var(--page-accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.65rem 1rem;
  margin: 0 0 0.85rem;
}
.advice-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin: 0.5rem 0;
  background: var(--surface);
}
.advice-section > summary { padding: 0.75rem 1rem; }
.advice-body { padding: 0 1.1rem 1.1rem; border-top: 1px solid var(--border); font-size: 0.95rem; }
.advice-body :first-child { margin-top: 0.85rem; }
.advice-body :last-child { margin-bottom: 0; }
.advice-body img { max-width: 100%; height: auto; }
.advice-body a { word-break: break-word; }
.travel-advice-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0.85rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}
.travel-advice-date { color: var(--muted); font-size: 0.88rem; }

/* Advice page */
.advice-list { margin: 0.75rem 0 2rem; }
.advice-item { padding: 1.25rem 1.5rem; }
.advice-item + .advice-item { margin-top: 0.9rem; }
.advice-item-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}
.advice-item-header h2 { font-size: 1.12rem; margin: 0; }
.advice-item-date {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.65rem;
}
.advice-item-source { color: var(--muted); font-size: 0.83rem; margin-top: 0.6rem; }
.advice-empty { padding: 1.5rem; margin: 1.5rem 0; }

/* Global travel-advice page — engaging card grid with a country silhouette. */
.advice-hero { padding-bottom: 0.5rem; }
.advice-search { max-width: 460px; margin-left: auto; margin-right: auto; }

.advice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.1rem;
  margin: 1.75rem 0 1rem;
}

.advice-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.advice-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: color-mix(in srgb, var(--page-accent) 45%, var(--border));
}

/* The silhouette sits in a tinted "map window" banner at the top of the card. */
.advice-card-map {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 118px;
  background:
    radial-gradient(120% 130% at 50% 0%,
      color-mix(in srgb, var(--page-accent) 12%, var(--surface)) 0%,
      var(--surface-2) 100%);
  border-bottom: 1px solid var(--border);
}
.advice-card-map-fallback { font-size: 2.4rem; opacity: 0.55; }
.advice-card-silhouette {
  width: 82%;
  height: 82%;
  overflow: visible;
}
.advice-card-silhouette path {
  fill: color-mix(in srgb, var(--page-accent) 62%, var(--surface));
  stroke: color-mix(in srgb, var(--page-accent) 80%, #000 8%);
  stroke-width: 0.7;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* Tier accents: a coloured top strip + silhouette recolour for advisories. */
.advice-card-red { border-color: color-mix(in srgb, var(--status-red) 45%, var(--border)); }
.advice-card-amber { border-color: color-mix(in srgb, var(--status-amber) 45%, var(--border)); }
.advice-card-red .advice-card-map {
  background: radial-gradient(120% 130% at 50% 0%,
    var(--status-red-tint) 0%, var(--surface-2) 100%);
}
.advice-card-amber .advice-card-map {
  background: radial-gradient(120% 130% at 50% 0%,
    var(--status-amber-tint) 0%, var(--surface-2) 100%);
}
.advice-card-red .advice-card-silhouette path {
  fill: color-mix(in srgb, var(--status-red) 55%, var(--surface));
  stroke: var(--status-red-ink);
}
.advice-card-amber .advice-card-silhouette path {
  fill: color-mix(in srgb, var(--status-amber) 60%, var(--surface));
  stroke: var(--status-amber-ink);
}

.advice-tier-badge {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  z-index: 1;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}
.advice-tier-red { background: var(--status-red); color: #fff; }
.advice-tier-amber { background: var(--status-amber); color: #fff; }

.advice-card-body { padding: 1rem 1.15rem 1.15rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.advice-card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
}
.advice-card-country { font-size: 1.08rem; margin: 0; line-height: 1.25; }
.advice-card-country a { color: var(--text); text-decoration: none; }
.advice-card-country a:hover { color: var(--link); }
.advice-card-date {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.advice-card-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}
.advice-source-note {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0.5rem 0 2rem;
}

@media (prefers-reduced-motion: reduce) {
  .advice-card:hover { transform: none; }
}

/* Passport strength (rankings) */
.rank-board { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 1.5rem; }
.rank-card { display: flex; gap: 1.1rem; align-items: stretch; padding: 1.1rem 1.4rem; }
.rank-card-podium { border-left: 4px solid var(--brand); }
.rank-pos {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--muted);
  min-width: 2.2rem;
  text-align: center;
  align-self: center;
}
.rank-card-podium .rank-pos { color: var(--brand); }
.rank-body { flex: 1; min-width: 0; }
.rank-head { display: flex; justify-content: space-between; align-items: baseline; gap: 0.75rem; }
.rank-head h2 { font-size: 1.2rem; margin: 0; }
.rank-score { font-size: 1.45rem; font-weight: 800; color: var(--brand); }
.rank-meta { color: var(--muted); font-size: 0.92rem; margin: 0.15rem 0 0.6rem; }
.rank-n { color: var(--muted); font-size: 0.84rem; }

.tier-bar { display: flex; height: 20px; border-radius: var(--radius-pill); overflow: hidden; }
.tier-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 4px;
}
/* Tier colours — keyed by tier score; shared by the bar and the maths key. */
.tier-0 { background: var(--status-red); }
.tier-1 { background: var(--status-orange); }
.tier-2 { background: var(--tier-2); }
.tier-3 { background: var(--status-amber); }
.tier-4 { background: var(--tier-4); }
.tier-5 { background: var(--status-green); }

.strength-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  margin-top: 0.55rem;
  overflow: hidden;
}
.strength-bar span { display: block; height: 100%; background: var(--brand); border-radius: var(--radius-pill); }

.rank-note, .mk-foot { color: var(--muted); font-size: 0.92rem; margin-top: 1rem; }

.h2h { margin-top: 2.5rem; }
.h2h-sub { font-weight: 400; color: var(--muted); font-size: 0.95rem; }
.h2h-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  margin-top: 0.75rem;
}
.h2h-table, .mk-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.mk-table {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.h2h-table th, .h2h-table td, .mk-table th, .mk-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0.85rem;
  text-align: left;
  font-size: 0.93rem;
}
.h2h-table thead th, .mk-table thead th {
  background: var(--surface-2);
  position: sticky;
  top: 0;
  font-weight: 600;
}
.h2h-table tbody tr:nth-child(even) td, .mk-table tbody tr:nth-child(even) td {
  background: color-mix(in srgb, var(--surface-2) 45%, var(--surface));
}
.h2h-table tbody td:first-child, .h2h-table thead th:first-child {
  position: sticky;
  left: 0;
  background: var(--surface);
}
.h2h-table thead th:first-child { background: var(--surface-2); }
.h2h-table tbody tr:nth-child(even) td:first-child {
  background: color-mix(in srgb, var(--surface-2) 45%, var(--surface));
}
.h2h-score { text-align: center; }
.h2h-foot { color: var(--muted); font-size: 0.9rem; margin-top: 0.5rem; }

.maths-key { margin-top: 2.75rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.maths-key h3 { margin: 1.4rem 0 0.4rem; font-size: 1.08rem; }
.mk-formula { font-weight: 400; color: var(--muted); font-size: 0.92rem; }
.mk-eq {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.95rem;
  display: inline-block;
}
.mk-table .legend-dot { vertical-align: middle; margin-right: 0.45rem; }
.mk-worked {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.25rem;
  margin-top: 0.75rem;
}
.mk-worked-title { font-weight: 600; }
.mk-worked-type { font-weight: 400; color: var(--muted); }
.mk-worked-table { margin-top: 0.6rem; }
.mk-worked-table .mk-total td { border-top: 2px solid var(--text); font-size: 1.02rem; }
.mk-n-list { margin: 0.5rem 0 0 1.25rem; }
.mk-n-list li { font-variant-numeric: tabular-nums; }

/* Error page */
.error-page { text-align: center; padding: 5rem 0; }
.error-page h1 { margin-bottom: 1rem; }
.error-page p { color: var(--muted); margin-bottom: 1.75rem; }

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .advice-banner { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .advice-ticker { animation: none; }
  .advice-ticker-label::before { animation: none; }
  /* Static mode: the duplicated run is redundant noise, so hide it. */
  .advice-ticker-run[aria-hidden="true"] { display: none; }
  .btn, .country-card { transition: none; }
  .btn:hover, .btn-secondary:hover, .country-card:hover { transform: none; }
  /* Map: instant recolours; ambient animations are skipped in world-map.js */
  .country, .micro-marker, .map-label, .map-decor, .legend-pill { transition: none; }
}
