:root {
  --bg: #0b1220;
  --panel: #111827;
  --panel-2: #0f172a;
  --line: #1f2937;
  --ink: #e5e7eb;
  --ink-dim: #9ca3af;
  --accent: #38bdf8;
  --accent-2: #f59e0b;
  --good: #10b981;
  --warn: #f59e0b;
  --danger: #ef4444;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

/* Top nav */
.topnav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.85rem 1.5rem;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.topnav .brand {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.topnav .links {
  display: flex;
  gap: 1rem;
  margin-left: auto;
  flex-wrap: wrap;
}

.topnav .links a {
  color: var(--ink-dim);
  font-size: 0.9rem;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
}

.topnav .links a.active,
.topnav .links a:hover {
  color: var(--ink);
  background: var(--panel-2);
  text-decoration: none;
}

/* Homepage layout */
.home {
  display: grid;
  grid-template-columns: 1fr 420px;
  height: calc(100vh - 56px);
}

#map {
  width: 100%;
  height: 100%;
  background: #0b1220;
}

.sidebar {
  background: var(--panel);
  border-left: 1px solid var(--line);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
  position: sticky;
  top: 0;
  z-index: 5;
}

.sidebar-header h1 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.sidebar-header .sub {
  color: var(--ink-dim);
  font-size: 0.82rem;
  margin-top: 0.2rem;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}

.stat {
  text-align: center;
}

.stat strong {
  display: block;
  color: var(--accent);
  font-size: 1.05rem;
  line-height: 1.1;
}

.stat span {
  color: var(--ink-dim);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stops-list {
  padding: 0.5rem 0;
}

.stop-row {
  display: flex;
  gap: 0.85rem;
  padding: 0.7rem 1.25rem;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.12s;
}

.stop-row:hover {
  background: var(--panel-2);
}

.stop-row.active {
  background: rgba(56, 189, 248, 0.08);
  border-left: 3px solid var(--accent);
  padding-left: calc(1.25rem - 3px);
}

.stop-pin {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-top: 6px;
  flex-shrink: 0;
  border: 2px solid #0b1220;
  box-shadow: 0 0 0 2px currentColor;
}

.stop-content { flex: 1; min-width: 0; }

.stop-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.stop-title .name {
  font-weight: 600;
  font-size: 0.95rem;
}

.stop-title .nights {
  color: var(--ink-dim);
  font-size: 0.8rem;
  white-space: nowrap;
}

.stop-note {
  color: var(--ink-dim);
  font-size: 0.82rem;
  margin-top: 0.15rem;
}

.country-section {
  border-top: 1px solid var(--line);
}

.country-divider {
  list-style: none;
  cursor: pointer;
  padding: 0.85rem 1.25rem 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
}

.country-divider::-webkit-details-marker { display: none; }
.country-divider::marker { content: ""; }
.country-divider::after { content: "+"; color: var(--ink-dim); font-size: 1.1rem; }
.country-section[open] > .country-divider::after { content: "−"; }

.country-divider .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.country-divider .name {
  font-weight: 700;
  font-size: 0.95rem;
  flex: 1;
}

.country-divider .meta {
  color: var(--ink-dim);
  font-size: 0.78rem;
}

.country-divider .country-link { margin-left: 0.5rem; }

.country-divider a {
  color: var(--ink-dim);
  font-size: 0.78rem;
  margin-left: 0.5rem;
}

.note-row {
  margin: 0.35rem 1.25rem 0.7rem;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  font-size: 0.82rem;
  background: rgba(56, 189, 248, 0.1);
  border-left: 3px solid var(--accent);
  color: var(--ink);
}

.note-row.warn {
  background: rgba(239, 68, 68, 0.1);
  border-left-color: var(--danger);
}

/* Generic page layout */
.page {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.page h1 {
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
}

.page h2 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.5rem;
}

.page h3 {
  margin: 1rem 0 0.4rem;
  color: var(--accent);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.page .lead {
  color: var(--ink-dim);
  font-size: 0.95rem;
  margin: 0 0 1.25rem;
}

@media (min-width: 640px) {
  .page {
    padding: 2.5rem 1.5rem 4rem;
  }
  .page h1 { font-size: 2rem; }
  .page h2 { font-size: 1.4rem; margin: 2rem 0 0.75rem; }
  .page h3 { font-size: 1rem; margin: 1.25rem 0 0.5rem; }
  .page .lead { font-size: 1.05rem; margin: 0 0 1.5rem; }
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

/* Optional itinerary section */
.potential-card {
  border-color: var(--accent-2);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), var(--panel));
}

.potential-item {
  padding: 0.9rem 0;
  border-bottom: 1px dashed var(--line);
}

.potential-item:last-child { border: none; padding-bottom: 0; }

.potential-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.potential-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--accent-2);
}

.potential-meta {
  color: var(--ink-dim);
  font-size: 0.85rem;
  white-space: nowrap;
}

.potential-reason {
  margin-top: 0.4rem;
  font-size: 0.88rem;
  color: var(--ink-dim);
}

.potential-link {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--accent);
}

.country-hero {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--country-color), transparent 80%), var(--panel);
  border: 1px solid var(--line);
  margin-bottom: 1.5rem;
}

.country-hero .flag { font-size: 2.5rem; }
.country-hero h1 { margin: 0; }
.country-hero .meta { color: var(--ink-dim); font-size: 0.95rem; }

.stops-table {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
}

.stops-table li {
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--line);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}

.stops-table li:last-child { border: none; }

.stops-table .name { font-weight: 600; }
.stops-table .note { color: var(--ink-dim); font-size: 0.9rem; flex: 1; margin-left: 0.5rem; }
.stops-table .nights { color: var(--ink-dim); font-size: 0.85rem; white-space: nowrap; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

th, td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-dim);
  font-weight: 600;
}

td:nth-child(n+2), th:nth-child(n+2) { text-align: right; }

tr.subtotal td {
  background: rgba(56, 189, 248, 0.06);
  font-weight: 700;
}

tr.total td {
  border-top: 2px solid var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  padding-top: 0.85rem;
}

.country-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.country-link {
  display: block;
  padding: 1.25rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  transition: transform 0.12s, border-color 0.12s;
}

.country-link:hover {
  text-decoration: none;
  border-color: var(--accent);
  transform: translateY(-2px);
}

.country-link .flag { font-size: 1.8rem; }
.country-link h3 {
  margin: 0.4rem 0 0.2rem;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
  font-size: 1.15rem;
}

.country-link .meta { color: var(--ink-dim); font-size: 0.85rem; }

footer {
  text-align: center;
  color: var(--ink-dim);
  font-size: 0.85rem;
  padding: 1.5rem;
  border-top: 1px solid var(--line);
}

/* MapLibre popup styling */
.maplibregl-popup-content {
  background: var(--panel) !important;
  color: var(--ink) !important;
  border: 1px solid var(--line);
  border-radius: 8px !important;
  font-family: inherit;
  padding: 0.6rem 0.85rem !important;
}

/* Part II banner */
.pt2-banner {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0 1.25rem 1rem;
  padding: 0.9rem 1rem;
  border-radius: 10px;
  background: linear-gradient(135deg, #065f46 0%, #0f766e 60%, #0e7490 100%);
  border: 1px solid #10b981;
  color: var(--ink) !important;
  text-decoration: none !important;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.pt2-banner:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(16, 185, 129, 0.25);
  text-decoration: none !important;
}
.pt2-banner .pt2-label {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #a7f3d0;
  font-weight: 600;
}
.pt2-banner .pt2-title {
  font-weight: 700;
  font-size: 1rem;
}
.pt2-banner .pt2-sub {
  font-size: 0.82rem;
  color: #d1fae5;
}

/* Nav — Pt II link accent (last item) */
.topnav .links a[href="americas.html"] {
  color: #6ee7b7;
  font-weight: 600;
}

.maplibregl-popup-tip { border-top-color: var(--panel) !important; border-bottom-color: var(--panel) !important; }
.maplibregl-popup-content .pop-name { font-weight: 700; }
.maplibregl-popup-content .pop-meta { color: var(--ink-dim); font-size: 0.85rem; }

@media (max-width: 880px) {
  .home { grid-template-columns: 1fr; height: auto; }
  #map { height: 60vh; /* sticky removed — scrolls away on mobile */ }
  .sidebar { max-height: none; border-left: none; border-top: 1px solid var(--line); }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .topnav {
    padding: 0.6rem 0.75rem;
    gap: 0.5rem;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .topnav::-webkit-scrollbar { display: none; }
  .topnav .brand { font-size: 0.9rem; white-space: nowrap; }
  .topnav .links {
    gap: 0.15rem;
  }
  .topnav .links a {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    white-space: nowrap;
  }
}

/* Seasonal calendar */
.seasons-page { max-width: 1180px; }
.seasons-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1rem;
}
.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.seasons-hero h1 { margin-bottom: 0.35rem; }
.seasons-hero .lead { max-width: 700px; margin-bottom: 0; }
.season-key { display: flex; flex-wrap: wrap; gap: 0.45rem 0.8rem; color: var(--ink-dim); font-size: 0.8rem; justify-content: flex-end; }
.season-key span { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
.season-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.season-swatch.dry { background: #10b981; }
.season-swatch.transition { background: #f59e0b; }
.season-swatch.rain { background: #3b82f6; }
.season-swatch.mixed { background: #8b5cf6; }
.season-callout {
  margin: 1rem 0 1.25rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: 8px;
  color: var(--ink-dim);
  background: rgba(56, 189, 248, 0.06);
  font-size: 0.88rem;
}
.season-callout strong { color: var(--ink); }
.season-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.season-table { min-width: 840px; margin: 0; font-size: 0.78rem; border-collapse: separate; border-spacing: 0; }
.season-table th, .season-table td { border: 0; padding: 0; text-align: center; }
.season-table thead th { height: 38px; background: var(--panel-2); border-bottom: 1px solid var(--line); color: var(--ink-dim); position: sticky; top: 56px; z-index: 2; }
.season-table .season-country-heading { min-width: 185px; padding-left: 1rem; text-align: left; position: sticky; left: 0; z-index: 4; }
.season-country-heading span { color: var(--ink-dim); font-weight: 400; }
.season-country { min-width: 185px; padding: 0.55rem 0.8rem !important; text-align: left !important; background: var(--panel); border-bottom: 1px solid var(--line) !important; position: sticky; left: 0; z-index: 1; }
.season-country span { font-size: 1rem; margin-right: 0.4rem; }
.season-country strong { font-size: 0.84rem; }
.season-country small { display: block; margin: 0.1rem 0 0 1.4rem; color: var(--ink-dim); font-size: 0.68rem; font-weight: 400; }
.season-cell { width: 65px; height: 55px; border-left: 1px solid var(--panel) !important; border-bottom: 1px solid var(--panel) !important; position: relative; }
.season-cell-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.season-cell.dry { background: rgba(16, 185, 129, 0.72); }
.season-cell.transition { background: rgba(245, 158, 11, 0.74); }
.season-cell.rain { background: rgba(59, 130, 246, 0.72); }
.season-cell.mixed { background: rgba(139, 92, 246, 0.72); }
.season-cell.hot { background: rgba(249, 115, 22, 0.77); }
.season-cell.haze { background: rgba(120, 113, 108, 0.82); }
.season-cell.travelling::after { content: ""; position: absolute; inset: 4px; border: 2px solid #fff; border-radius: 4px; box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.45); }
.season-section th { padding: 0.5rem 0.8rem; text-align: left; background: #172033; border-bottom: 1px solid var(--line); color: var(--accent); font-size: 0.73rem; letter-spacing: 0.08em; text-transform: uppercase; }
.season-route { margin-top: 2.25rem; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 0.75rem; }
.section-heading h2 { margin: 0; }
.season-badge { padding: 0.25rem 0.5rem; border-radius: 99px; background: rgba(255, 255, 255, 0.08); color: var(--ink-dim); font-size: 0.72rem; white-space: nowrap; }
.season-advice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
.season-advice-card { padding: 0.85rem 0.95rem; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.season-advice-card > div { display: flex; align-items: baseline; gap: 0.65rem; }
.season-advice-card h3 { margin: 0; color: var(--ink); font-size: 0.9rem; letter-spacing: 0; text-transform: none; }
.season-advice-card p { margin: 0.45rem 0 0; color: var(--ink-dim); font-size: 0.82rem; line-height: 1.45; }
.season-months { padding: 0.12rem 0.35rem; border-radius: 4px; background: rgba(255, 255, 255, 0.09); color: var(--ink); font-size: 0.7rem; font-weight: 700; white-space: nowrap; }
.season-notes { margin-top: 1.5rem; }
.season-notes h2 { margin-top: 0; }
.season-notes ul { margin: 0; padding-left: 1.2rem; color: var(--ink-dim); font-size: 0.9rem; }
.season-notes li + li { margin-top: 0.45rem; }
.season-notes strong { color: var(--ink); }

.season-timeline-section { margin: 1.25rem 0; padding: 1rem; }
.season-timeline-section h2 { margin: 0; }
.timeline-caption { margin: 0.35rem 0 1rem; color: var(--ink-dim); font-size: 0.82rem; }
.timeline-axis, .timeline-row { display: grid; grid-template-columns: 145px minmax(0, 1fr); gap: 0.8rem; align-items: center; }
.timeline-months { display: flex; color: var(--ink-dim); font-size: 0.72rem; }
.timeline-months span { text-align: center; border-left: 1px solid var(--line); }
.timeline-row { min-height: 34px; }
.timeline-label { font-size: 0.8rem; }
.timeline-label small { display: block; color: var(--ink-dim); font-size: 0.68rem; }
.timeline-track { position: relative; height: 15px; border-radius: 99px; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(14.285% - 1px), var(--line) calc(14.285% - 1px), var(--line) 14.285%); }
.timeline-bar { position: absolute; top: 1px; height: 13px; min-width: 3px; border-radius: 99px; background: linear-gradient(90deg, #38bdf8, #10b981); box-shadow: 0 0 0 1px rgba(255,255,255,.3); }
.timeline-total { margin: 0.7rem 0 0; color: var(--ink-dim); text-align: right; font-size: 0.75rem; }
@media (max-width: 700px) {
  .seasons-hero { align-items: flex-start; flex-direction: column; gap: 0.75rem; }
  .season-key { justify-content: flex-start; }
  .season-table thead th { top: 47px; }
  .timeline-axis, .timeline-row { grid-template-columns: 92px minmax(0, 1fr); gap: 0.4rem; }
  .timeline-label { font-size: 0.7rem; }
  .timeline-label small { font-size: 0.62rem; }
  .season-advice-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 0.5rem; }
}

/* Must-haves */
.must-page { max-width: 1100px; }
.must-hero { margin-bottom: 2rem; }
.must-hero h1 { margin-bottom: 0.35rem; }
.must-rule {
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--accent-2);
  border-radius: 0 8px 8px 0;
  background: rgba(245, 158, 11, 0.08);
  color: var(--ink-dim);
  font-size: 0.9rem;
}
.must-rule { margin-top: 1.25rem; max-width: 760px; }
.must-rule strong { color: var(--ink); }
.country-must-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.85rem; }
.country-must-card { padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
.country-must-header { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--line); }
.country-must-header h3 { margin: 0; color: var(--ink); font-size: 1rem; letter-spacing: 0; text-transform: none; }
.country-must-header h3 span { font-size: 1.15rem; }
.country-must-period { color: var(--ink-dim); font-size: 0.72rem; font-weight: 700; text-align: right; white-space: nowrap; }
.country-must-points { display: grid; gap: 0.65rem; margin: 0.85rem 0 0; padding: 0; list-style: none; counter-reset: must-point; }
.country-must-points li { position: relative; padding-left: 1.55rem; color: var(--ink-dim); font-size: 0.87rem; line-height: 1.45; }
.country-must-points li::before { counter-increment: must-point; content: counter(must-point); position: absolute; left: 0; top: 0.1rem; display: grid; place-items: center; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: rgba(56, 189, 248, 0.14); color: var(--accent); font-size: 0.65rem; font-weight: 800; }
.must-next { margin-top: 1.5rem; }
.must-next h2 { margin-top: 0; }
.must-next p { margin-bottom: 0; color: var(--ink-dim); }

@media (max-width: 700px) {
  .country-must-grid { grid-template-columns: 1fr; }
  .country-must-header { align-items: flex-start; flex-direction: column; gap: 0.25rem; }
  .country-must-period { text-align: left; }
}

/* Keep the country details link compact inside the accordion summary. */
.country-divider .country-link {
  display: block;
  flex: 0 0 auto;
  margin-left: 0.5rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-dim);
  transform: none;
}

.country-divider .country-link:hover {
  border-color: transparent;
  transform: none;
}

.country-divider .country-link a {
  display: inline-block;
  margin: 0;
  color: inherit;
  font-size: 0.78rem;
  white-space: nowrap;
}

.country-divider .meta { flex: 0 1 auto; }

@media (max-width: 700px) {
  .country-divider { flex-wrap: wrap; gap: 0.4rem 0.6rem; }
  .country-divider .name { flex: 1 1 auto; }
  .country-divider .meta { order: 3; margin-left: 1.6rem; }
  .country-divider .country-link { order: 4; margin-left: auto; }
}

/* Primary navigation dropdowns and itinerary overview */
.topnav .links { align-items: center; }
.topnav .links > a { white-space: nowrap; }
.nav-dropdown { position: relative; color: var(--ink-dim); font-size: 0.9rem; }
.nav-dropdown > summary {
  list-style: none; cursor: pointer; padding: 0.3rem 0.6rem; border-radius: 6px;
  user-select: none; white-space: nowrap;
}
.nav-dropdown > summary::-webkit-details-marker { display: none; }
.nav-dropdown > summary:hover, .nav-dropdown[open] > summary,
.nav-dropdown > summary.active { color: var(--ink); background: var(--panel-2); }
.dropdown-menu {
  position: absolute; top: calc(100% + 0.45rem); left: 0; z-index: 1100;
  min-width: 190px; max-height: min(70vh, 460px); overflow-y: auto;
  padding: 0.4rem; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel); box-shadow: 0 14px 34px rgba(0,0,0,.35);
}
.topnav .dropdown-menu a { display: block; padding: 0.45rem 0.65rem; }
.itinerary-page { max-width: 1000px; }
.itinerary-list { display: grid; gap: 0.75rem; margin-top: 1.5rem; }
.itinerary-stop {
  display: grid; grid-template-columns: 2.5rem minmax(0,1fr) auto; align-items: center; gap: 1rem;
  padding: 1rem 1.1rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
}
.itinerary-number { color: var(--accent); font-weight: 800; font-size: 1.1rem; }
.itinerary-country { display:flex; align-items:center; gap:.65rem; margin:0; font-size:1.05rem; }
.itinerary-country a { color: var(--ink); }
.itinerary-period, .itinerary-days { color: var(--ink-dim); font-size:.9rem; white-space:nowrap; }
.itinerary-blurb { color: var(--ink-dim); margin:.35rem 0 0; font-size:.9rem; }
@media (max-width: 640px) {
  .nav-dropdown { font-size: .75rem; }
  .nav-dropdown > summary { padding: .2rem .4rem; }
  .dropdown-menu { position: fixed; top: auto; left: auto; right: .5rem; margin-top: .4rem; }
  .itinerary-stop { grid-template-columns: 1.8rem minmax(0,1fr); gap:.55rem; padding:.85rem; }
  .itinerary-period, .itinerary-days { grid-column: 2; white-space: normal; }
  .itinerary-period { margin-top:-.45rem; }
}

/* --- Hugo migration additions --- */
/* Rendered Markdown (country planning notes, plan page, budget notes) */
.prose { line-height: 1.6; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h2, .prose h3 { margin: 1.25rem 0 0.5rem; }
.prose h3 { font-size: 1rem; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0.5rem 0 1rem; }
.prose li { margin: 0.25rem 0; }
.prose table td, .prose table th { text-align: left; }
.prose table th[style*="right"], .prose table td[style*="right"] { text-align: right !important; }
.prose code { background: var(--panel-2); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.9em; }
/* Tables whose columns are text, not numbers */
table.text-left th, table.text-left td { text-align: left; }
.budget-note { color: var(--ink-dim); font-size: 0.85rem; margin: 0.75rem 0 0; }

/* --- Itinerary timeline & travel legs --- */
.chip-verify, .chip-tbd {
  display: inline-block; font-size: 0.66rem; line-height: 1.5; letter-spacing: 0.06em; text-transform: uppercase;
  border-radius: 999px; padding: 0 0.5rem; margin-left: 0.35rem; white-space: nowrap; vertical-align: 1px;
}
.chip-verify { color: var(--warn); border: 1px solid rgba(245, 158, 11, 0.5); background: rgba(245, 158, 11, 0.08); }
.chip-tbd { color: var(--ink-dim); border: 1px dashed var(--ink-dim); margin-left: 0; }
.stops-table li.leg { justify-content: flex-start; gap: 0.5rem; color: var(--ink-dim); font-size: 0.85rem; border-bottom: none; padding: 0.35rem 0 0.35rem 0.5rem; }

.tl-page { max-width: 860px; }
.tl-progress { color: var(--ink-dim); font-size: 0.9rem; margin: 0 0 1rem; }
.tl-progress strong { color: var(--ink); }
.tl-nav {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.6rem; padding: 0.5rem 0;
  position: sticky; top: 56px; z-index: 20; background: var(--bg);
}
.tl-nav a { border: 1px solid var(--line); border-radius: 999px; padding: 0.2rem 0.7rem; font-size: 0.82rem; color: var(--ink-dim); }
.tl-nav a:hover { color: var(--ink); background: var(--panel-2); text-decoration: none; }
.tl-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; color: var(--ink-dim); font-size: 0.8rem; margin: 0 0 0.5rem; }

.tl-country { scroll-margin-top: 7.5rem; }
.tl-country-head {
  display: flex; align-items: center; gap: 0.85rem; padding: 0.85rem 1.1rem;
  border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: 12px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--c) 16%, var(--panel)), var(--panel) 70%);
}
.tl-flag { font-size: 2rem; line-height: 1; }
.tl-country-head h2 { margin: 0; font-size: 1.25rem; }
.tl-country-head h2 a { color: var(--ink); }
.tl-meta { color: var(--ink-dim); font-size: 0.85rem; }
.tl-more { margin-left: auto; font-size: 0.85rem; white-space: nowrap; }

.tl { list-style: none; margin: 0; padding: 0.25rem 0 0.5rem; position: relative; }
.tl::before { content: ""; position: absolute; left: 15px; top: 0; bottom: 0; width: 2px; background: var(--c); opacity: 0.4; }
.tl > li { position: relative; padding-left: 3rem; }
.tl-section { padding-top: 1.1rem; padding-bottom: 0.2rem; font-size: 0.95rem; color: var(--ink-dim); }
.tl-week { color: var(--c); font-weight: 700; }
.tl-stop { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.tl-stop::before {
  content: ""; position: absolute; left: 7px; top: 0.85rem; width: 18px; height: 18px; border-radius: 50%;
  background: var(--c); border: 2px solid var(--c); box-shadow: inset 0 0 0 3px var(--bg); z-index: 1;
}
.tl-stop-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.tl-name { font-weight: 700; font-size: 1.02rem; }
.tl-nights { color: var(--ink-dim); font-size: 0.85rem; white-space: nowrap; }
.tl-note { color: var(--ink-dim); font-size: 0.9rem; }

.tl-leg { padding-top: 0.2rem; padding-bottom: 0.2rem; }
.tl-leg-icon {
  position: absolute; left: 2px; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; z-index: 1;
  display: grid; place-items: center; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); font-size: 0.9rem;
}
.tl-leg-body {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.5rem; padding: 0.45rem 0.75rem; border-radius: 6px;
  font-size: 0.85rem; background: rgba(56, 189, 248, 0.1); border-left: 3px solid var(--accent); color: var(--ink);
}
.tl-leg-tbd .tl-leg-icon { color: var(--ink-dim); border-style: dashed; }
.tl-leg-tbd .tl-leg-body { background: transparent; border-left: 3px dashed var(--line); color: var(--ink-dim); font-style: italic; }
.tl > .tl-warn { margin: 0.4rem 0 0.4rem 3rem; padding: 0.45rem 0.75rem; font-size: 0.85rem; color: var(--ink); background: rgba(239, 68, 68, 0.1); border-left: 3px solid var(--danger); border-radius: 6px; }

.tl-connector { position: relative; padding: 1rem 0 1rem 3rem; }
.tl-connector::before {
  content: ""; position: absolute; left: 15px; top: 0; bottom: 0; width: 2px;
  background: repeating-linear-gradient(to bottom, var(--ink-dim) 0 6px, transparent 6px 12px); opacity: 0.55;
}
.tl-conn-card {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.9rem; border-radius: 10px;
  background: var(--panel-2); border: 1px solid var(--line); border-left: 4px solid var(--accent);
}
.tl-conn-icon {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; z-index: 1;
  display: grid; place-items: center; border-radius: 50%; background: var(--panel); border: 2px solid var(--accent); font-size: 1rem;
}
.tl-conn-text { font-weight: 600; font-size: 0.95rem; }

@media (max-width: 560px) {
  .tl-country-head { flex-wrap: wrap; }
  .tl-more { margin-left: 0; }
  .tl-stop-head { flex-direction: column; gap: 0; }
}

/* --- Country page: entry & climate --- */
.entry-visa { margin-bottom: 0.6rem; }
.chip-warn { display: inline-block; margin-left: 0.4rem; font-size: 0.75rem; color: var(--warn); border: 1px solid rgba(245,158,11,.5); background: rgba(245,158,11,.08); border-radius: 999px; padding: 0 0.6rem; }
.cl-row { display: grid; grid-template-columns: 200px 1fr; gap: 0.2rem 1rem; align-items: center; padding: 0.35rem 0; border-top: 1px solid var(--line); }
.cl-region { font-size: 0.88rem; }
.cl-strip { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; }
.cl-m { text-align: center; font-size: 0.7rem; line-height: 1.7; border-radius: 4px; color: #0b1220; opacity: 0.55; border: 2px solid transparent; }
.cl-m.on { opacity: 1; border-color: var(--ink); font-weight: 700; }
.cl-m.dry, .cl-m.hot { background: #10b981; } .cl-m.transition { background: #f59e0b; } .cl-m.rain { background: #3b82f6; }
.cl-m.mixed, .cl-m.haze { background: #8b5cf6; }
.cl-advice { grid-column: 2; color: var(--ink-dim); font-size: 0.8rem; }
@media (max-width: 640px) { .cl-row { grid-template-columns: 1fr; } .cl-advice { grid-column: 1; } }

.tl-date { color: var(--ink-dim); font-weight: 600; font-size: 0.9rem; }
.tl-hl { color: var(--ink-dim); font-size: 0.82rem; padding-left: 0.9rem; position: relative; }
.tl-hl::before { content: "•"; position: absolute; left: 0.2rem; color: var(--c); }

/* --- Budget bars --- */
:root { --c-sleep: #60a5fa; --c-food: #34d399; --c-transport: #f59e0b; --c-act: #a78bfa; --c-prep: #94a3b8; --c-cont: #64748b; }
.bud-overview { margin: 1rem 0 1.5rem; }
.bud-overview h2 { margin-bottom: 0.4rem; }
.bud-bars { display: grid; gap: 0.7rem; margin-top: 1rem; }
.bud-row { display: grid; grid-template-columns: 170px 1fr 80px; gap: 1rem; align-items: center; }
.bud-label { font-size: 0.95rem; }
.bud-label a { color: var(--ink); }
.bud-track { height: 14px; border-radius: 999px; background: rgba(255,255,255,0.07); overflow: hidden; }
.bud-fill { display: block; height: 100%; border-radius: 999px; }
.bud-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.sleep { background: var(--c-sleep); } .food { background: var(--c-food); } .transport { background: var(--c-transport); }
.act { background: var(--c-act); } .prep { background: var(--c-prep); } .cont { background: var(--c-cont); }
.bud-stack { display: flex; height: 100%; gap: 2px; }
.bud-seg { display: block; height: 100%; min-width: 2px; }
.bud-seg:first-child { border-radius: 999px 0 0 999px; } .bud-seg:last-child { border-radius: 0 999px 999px 0; }
.bud-legend { display: flex; gap: 1.2rem; flex-wrap: wrap; color: var(--ink-dim); font-size: 0.85rem; margin-top: 0.4rem; }
.bud-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 0.4rem; }
.bud-total .bud-label, .bud-total .bud-val { border-top: 1px solid var(--line); padding-top: 0.6rem; }
.bud-details { margin-top: 1rem; } .bud-details summary { cursor: pointer; color: var(--ink-dim); font-size: 0.85rem; }
@media (max-width: 640px) { .bud-row { grid-template-columns: 1fr 70px; } .bud-track { grid-column: 1 / -1; order: 3; } }

/* --- Highlights list --- */
.hl-page { max-width: 900px; }
.hl-country { margin-top: 2.2rem; scroll-margin-top: 7.5rem; }
.hl-country h2 { display: flex; align-items: baseline; gap: 0.5rem; font-size: 1.3rem; border-bottom: 2px solid var(--c); padding-bottom: 0.4rem; margin-bottom: 0.2rem; }
.hl-country h2 a { color: var(--ink); } .hl-country h2 small { margin-left: auto; color: var(--ink-dim); font-weight: 400; font-size: 0.8rem; }
.hl-list { list-style: none; margin: 0; padding: 0; }
.hl-item { display: grid; grid-template-columns: 128px 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.hl-thumb { width: 128px; height: 96px; border-radius: 12px; overflow: hidden; display: grid; place-items: center;
  background: linear-gradient(135deg, color-mix(in srgb, var(--c) 45%, var(--panel)), var(--panel-2)); font-size: 2.4rem; }
.hl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hl-body h3 { margin: 0 0 0.15rem; font-size: 1.05rem; }
.hl-meta { color: var(--ink-dim); font-size: 0.85rem; margin-bottom: 0.35rem; }
.hl-status { font-weight: 600; } .hl-status.included { color: #34d399; } .hl-status.add { color: #60a5fa; } .hl-status.detour { color: #f59e0b; }
.hl-body p { margin: 0; color: var(--ink); line-height: 1.5; }
@media (max-width: 560px) { .hl-item { grid-template-columns: 88px 1fr; } .hl-thumb { width: 88px; height: 72px; font-size: 1.8rem; } }
.hl-body h3 { text-transform: none; letter-spacing: 0; color: var(--ink); font-size: 1.05rem; }

.hl-thumb { position: relative; }
.hl-thumb img { position: absolute; inset: 0; }
.hl-credit { margin-top: 0.3rem; font-size: 0.72rem; color: var(--ink-dim); }
.hl-credit a { color: var(--ink-dim); text-decoration: underline; }

/* actual vs planned */
.bud-plan { position: relative; overflow: visible; }
.bud-plan .bud-stack { border-radius: 999px; overflow: hidden; }
.bud-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: 0.7; }
.bud-val.over { color: #f87171; }

/* Header second row: direct country links */
.topnav { display: block; }
.topnav-main { display: flex; align-items: center; gap: 1.25rem; }
.subnav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.1rem 0.8rem; padding-top: 0.35rem; margin-top: 0.3rem; border-top: 1px solid var(--line); font-size: 0.72rem; }
.subnav a { color: var(--ink-dim); padding: 0.1rem 0.35rem; border-radius: 4px; white-space: nowrap; }
.subnav a:hover, .subnav a.active { color: var(--ink); background: var(--panel-2); text-decoration: none; }
@media (max-width: 640px) {
  .topnav { overflow-x: visible; }
  .topnav-main { gap: 0.5rem; overflow-x: auto; scrollbar-width: none; }
  .topnav-main .links { flex-wrap: nowrap; margin-left: 0; }
  .topnav-main .brand { flex: none; }
  .topnav-main::-webkit-scrollbar { display: none; }
  .subnav { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; font-size: 0.7rem; }
  .subnav::-webkit-scrollbar { display: none; }
}

/* budget cleanup */
.bud-cell { display: grid; gap: 4px; }
.bud-act-track { height: 5px; border-radius: 999px; background: rgba(255,255,255,0.05); overflow: hidden; }
.bud-act { display: block; height: 100%; border-radius: 999px; background: var(--ink); opacity: 0.9; }
.bud-act.over { background: #f87171; }
.bud-actual-key { background: var(--ink); height: 4px !important; margin-top: 3px; }
.bud-country .bud-row { grid-template-columns: 170px 1fr 120px; }
.bud-notes summary { cursor: pointer; color: var(--ink-dim); }
.bud-total .bud-track { background: none; }
.bud-overview .bud-details { margin-bottom: 1.2rem; }

/* budget rows on phones: label and value on one line, bar underneath */
.bud-row > * { min-width: 0; }
@media (max-width: 640px) {
  .bud-row, .bud-country .bud-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "label val" "bar bar";
    gap: 0.35rem 0.75rem;
  }
  .bud-row > .bud-label { grid-area: label; }
  .bud-row > .bud-val { grid-area: val; white-space: nowrap; }
  .bud-row > .bud-track, .bud-row > .bud-cell { grid-area: bar; }
  .bud-total .bud-track { display: none; }
  .bud-total { grid-template-areas: "label val"; }
  .bud-card, .card { overflow-x: auto; }
}

/* on track panel */
.bud-ontrack h2 { margin: 0 0 0.3rem; }
.bud-fill.ok { background: var(--c-food); }
.bud-fill.over { background: #f87171; }
.bud-status { margin: 0.9rem 0 0.4rem; font-weight: 600; }
.bud-status.ok { color: #34d399; } .bud-status.over { color: #f87171; }
.bud-wk small { display: block; color: var(--ink-dim); font-size: 0.72rem; }
.bud-wk.future { opacity: 0.6; }
.bud-wk.current { outline: 1px solid var(--accent); outline-offset: 6px; border-radius: 6px; }
.bud-weeks { margin-top: 0.8rem; gap: 0.9rem; }
.bud-travel { margin-top: 1rem; }
.bud-full { margin-top: 1.2rem; }
.bud-full > summary { cursor: pointer; padding: 0.7rem 0; color: var(--ink-dim); font-weight: 600; }
/* checklist (Mala page) */
.chk-list { list-style: none; padding: 0; margin: 0.5rem 0 0; }
.chk-list li { margin: 0; border-bottom: 1px solid var(--line); }
.chk-list li:last-child { border-bottom: 0; }
.chk-list label { display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0.2rem; cursor: pointer; }
.chk-list input { width: 1.2rem; height: 1.2rem; flex: none; accent-color: #4ade80; }
.chk-list li.done span { color: var(--ink-dim); text-decoration: line-through; }
.chk-count { font-size: 0.8rem; font-weight: 400; color: var(--ink-dim); margin-left: 0.4rem; }

/* Homepage: interactive map overlays (stop card, day slider, colour layers) */
.map-wrap { position: relative; min-height: 0; }
.map-layers { position: absolute; top: 10px; right: 10px; z-index: 3; display: flex; gap: 2px; background: rgba(15, 23, 42, 0.92); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.map-layers button { background: none; border: 0; color: var(--ink-dim); font: inherit; font-size: 0.78rem; padding: 0.3rem 0.65rem; border-radius: 999px; cursor: pointer; }
.map-layers button.on { background: var(--accent); color: #0b1220; font-weight: 700; }
.map-legend { position: absolute; top: 48px; right: 10px; z-index: 3; max-width: 260px; display: flex; flex-wrap: wrap; gap: 0.2rem 0.7rem; background: rgba(15, 23, 42, 0.92); border: 1px solid var(--line); border-radius: 10px; padding: 0.45rem 0.65rem; font-size: 0.74rem; color: var(--ink-dim); }
.map-legend:empty { display: none; }
.lg-title { width: 100%; color: var(--ink); font-weight: 600; }
.lg-note { width: 100%; font-style: italic; }
.lg-item { display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap; }
.lg-item i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.map-time { position: absolute; left: 10px; right: 10px; bottom: 26px; z-index: 3; background: rgba(15, 23, 42, 0.92); border: 1px solid var(--line); border-radius: 10px; padding: 0.4rem 0.75rem 0.5rem; }
.map-time-label { display: block; font-size: 0.8rem; color: var(--ink-dim); margin-bottom: 0.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-time-label strong { color: var(--ink); }
.map-time input[type=range] { width: 100%; accent-color: var(--accent); margin: 0; }
.stop-card { position: absolute; left: 10px; bottom: 96px; z-index: 4; width: min(360px, calc(100% - 20px)); max-height: calc(100% - 160px); overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0.75rem 0.9rem 0.6rem; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45); }
.stop-card[hidden] { display: none; }
.sc-top { display: flex; justify-content: space-between; align-items: center; border-left: 3px solid var(--c); padding-left: 0.5rem; }
.sc-country { font-size: 0.78rem; color: var(--ink-dim); }
.sc-close { background: none; border: 0; color: var(--ink-dim); font-size: 1.3rem; line-height: 1; cursor: pointer; padding: 0 0.2rem; }
.sc-name { margin: 0.3rem 0 0; font-size: 1.25rem; }
.sc-meta { color: var(--ink-dim); font-size: 0.84rem; }
.sc-leg { margin-top: 0.5rem; font-size: 0.85rem; background: var(--panel-2); border-radius: 8px; padding: 0.35rem 0.55rem; }
.sc-tbd { color: var(--ink-dim); font-style: italic; }
.sc-note { margin: 0.5rem 0 0; font-size: 0.9rem; }
.sc-climate { margin-top: 0.45rem; font-size: 0.82rem; display: flex; align-items: center; gap: 0.35rem; }
.sc-climate i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.sc-climate span { color: var(--ink-dim); }
.sc-hl { list-style: none; margin: 0.5rem 0 0; padding: 0; font-size: 0.86rem; }
.sc-hl li { padding: 0.12rem 0; }
.sc-tag { font-size: 0.7rem; color: var(--ink-dim); border: 1px solid var(--line); border-radius: 999px; padding: 0 0.35rem; }
.sc-nav { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-top: 0.65rem; padding-top: 0.5rem; border-top: 1px solid var(--line); }
.sc-nav button { background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); border-radius: 8px; width: 2.6rem; height: 2.1rem; font-size: 1.05rem; cursor: pointer; }
.sc-nav button:disabled { opacity: 0.35; cursor: default; }
.sc-more { font-size: 0.85rem; }
@media (max-width: 880px) {
  .map-wrap #map { height: 72vh; }
  .map-layers { left: 50px; right: 10px; justify-content: space-between; overflow-x: auto; }
  .map-legend { left: 50px; right: 10px; max-width: none; }
  .map-time { bottom: 22px; }
  .stop-card { left: 8px; right: 8px; width: auto; bottom: 88px; max-height: 42%; padding: 0.6rem 0.75rem 0.5rem; }
}
@media (max-width: 880px) { .map-legend.lg-route { display: none; } }
