:root {
  --land: #1c1c1c;
  --land-hover: #2e2e2e;
  --selected: #333;
  --ring: #fff;
  /* Shared tokens come from site-common/theme.css; --star aliases its yellow. */
  --star: var(--yellow);
  --star-empty: #555;
  --visited: #a7c080;
  --visited-hover: #c2d6a3;
  --planned: #9c7a36;
  --planned-hover: #b18e4b;
  --wishlist-ink: #8aaad4;
  --wishlist-hover: #adc3e1;
  --wishlist-bg: #141414;
  /* Data URIs can't read variables: keep each stroke equal to its ink. */
  --wishlist-swatch: var(--wishlist-bg)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Cpath d='M-1 1l2-2M0 4l4-4M3 5l2-2' stroke='%238aaad4' stroke-width='1.25'/%3E%3C/svg%3E");
  /* Pair shades: 0 both, 1 and 2 the first and second traveller alone. */
  --visited-0: #c5e299;
  --visited-1: #a9ba91;
  --visited-2: #8b957f;
  --planned-0: #be9752;
  --planned-1: #9c7e4c;
  --planned-2: #856428;
  --wishlist-ink-0: #b0d4ff;
  --wishlist-ink-1: #8dadd7;
  --wishlist-ink-2: #6882a4;
  --wishlist-hatch-0: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Cpath d='M-1 1l2-2M-1 4l5-5M-1 7l8-8M2 7l5-5M5 7l2-2M-1 5l2 2M-1 2l5 5M-1-1l8 8M2-1l5 5M5-1l2 2' stroke='%23b0d4ff' stroke-width='0.75'/%3E%3C/svg%3E");
  --wishlist-hatch-1: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Cpath d='M-1 1l2-2M-1 4l5-5M-1 7l8-8M2 7l5-5M5 7l2-2' stroke='%238dadd7' stroke-width='1'/%3E%3C/svg%3E");
  --wishlist-hatch-2: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='6'%3E%3Cpath d='M-1 5l2 2M-1 2l5 5M-1-1l8 8M2-1l5 5M5-1l2 2' stroke='%236882a4' stroke-width='1'/%3E%3C/svg%3E");
  --dot-ring: color-mix(in srgb, var(--text-muted) 50%, transparent);
  --panel-w: 340px;
}
html {
  height: 100%;
  height: 100dvh;
}
body {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.emoji {
  filter: grayscale(1);
}

/* HEADER */
.header-left {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
}
.stats-bar {
  display: flex;
  gap: 20px;
  flex-shrink: 0;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}
.stat {
  display: flex;
  align-items: baseline;
  gap: 7px;
  white-space: nowrap;
}
.stat-num {
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.stat-label {
  font-size: 11px;
  color: var(--text-muted);
}
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.header-right button {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 12px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    color 0.15s,
    border-color 0.15s,
    background-color 0.15s;
}
.header-right button:hover {
  color: var(--text);
  border-color: var(--text-muted);
}
.header-right button.active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}
#export-btn.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* TRAVELLER TOGGLES (two or more travellers) */
.travellers {
  display: none;
}
html.multi header {
  justify-content: flex-start;
}
html.multi .header-right {
  margin-left: auto;
}
html.multi .travellers {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-left: 24px;
  border-left: 1px solid var(--line);
}
.traveller,
.traveller-both {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  font-size: 11px;
  white-space: nowrap;
}
.traveller {
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text);
  cursor: pointer;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.traveller:hover {
  border-color: var(--text-muted);
}
.traveller[aria-pressed="false"] {
  color: var(--text-dim);
  border-color: var(--line);
}
.traveller[aria-disabled="true"] {
  cursor: default;
}
.traveller-both {
  color: var(--text-muted);
}
.traveller-both[hidden] {
  display: none;
}
.strip {
  display: flex;
  gap: 1px;
}
.strip i {
  width: 5px;
  height: 10px;
  background: var(--c);
}
.strip i.wishlist {
  background: var(--swatch);
}
.traveller[aria-pressed="false"] .strip i {
  background: none;
  outline: 1px solid var(--c);
  outline-offset: -1px;
}

/* STATUS COLOURS: --c (and --swatch) per status and pair step */
.visited {
  --c: var(--visited);
}
.planned {
  --c: var(--planned);
}
.wishlist {
  --c: var(--wishlist-ink);
  --swatch: var(--wishlist-swatch);
}
.visited.s0 {
  --c: var(--visited-0);
}
.visited.s1 {
  --c: var(--visited-1);
}
.visited.s2 {
  --c: var(--visited-2);
}
.planned.s0 {
  --c: var(--planned-0);
}
.planned.s1 {
  --c: var(--planned-1);
}
.planned.s2 {
  --c: var(--planned-2);
}
.wishlist.s0 {
  --c: var(--wishlist-ink-0);
  --swatch: var(--wishlist-bg) var(--wishlist-hatch-0);
}
.wishlist.s1 {
  --c: var(--wishlist-ink-1);
  --swatch: var(--wishlist-bg) var(--wishlist-hatch-1);
}
.wishlist.s2 {
  --c: var(--wishlist-ink-2);
  --swatch: var(--wishlist-bg) var(--wishlist-hatch-2);
}

/* STATUS SWATCHES (header counts, detail status, list badges) */
.stat-num::before,
.my-status-pill::before,
.list-item-badge {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border: 1px solid transparent;
  background: var(--c);
}
.stat-num::before,
.my-status-pill::before {
  content: "";
  display: inline-block;
  margin-right: 8px;
  vertical-align: -1px;
}
.stat-num::before {
  width: 8px;
  height: 8px;
  margin-right: 6px;
  vertical-align: 1px;
}
.stat-num.wishlist::before,
.my-status-pill.wishlist::before,
.list-item-badge.wishlist {
  background: var(--swatch);
  border-color: var(--c);
}
/* A count covers every shade: a strip of steps 0 | 1 | 2. */
html.pair .stat-num::before {
  width: 17px;
  height: 10px;
  border: 0;
  mask: linear-gradient(
    90deg,
    #000 5px,
    transparent 0 6px,
    #000 0 11px,
    transparent 0 12px,
    #000 0
  );
}
html.pair .stat-num.visited::before {
  background: linear-gradient(
    90deg,
    var(--visited-0) 6px,
    var(--visited-1) 0 12px,
    var(--visited-2) 0
  );
}
html.pair .stat-num.planned::before {
  background: linear-gradient(
    90deg,
    var(--planned-0) 6px,
    var(--planned-1) 0 12px,
    var(--planned-2) 0
  );
}
html.pair .stat-num.wishlist::before {
  background:
    var(--wishlist-hatch-0) repeat-y,
    var(--wishlist-hatch-1) 6px 0 repeat-y,
    var(--wishlist-hatch-2) 12px 0 repeat-y,
    var(--wishlist-bg);
}

/* MAP */
.map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
  background: var(--bg);
}
#map-svg {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}
#map-svg:active {
  cursor: grabbing;
}
.ocean {
  fill: var(--bg);
}
pattern rect {
  fill: var(--wishlist-bg);
}
pattern line {
  stroke: var(--c);
}
.mesh,
.country,
.territory {
  stroke: var(--bg);
  stroke-width: 0.5px;
  vector-effect: non-scaling-stroke;
}
.mesh {
  fill: none;
  pointer-events: none;
}
.country,
.territory,
.dot-land {
  fill: var(--land);
}
.country,
.territory {
  pointer-events: visibleFill;
}
.territory {
  cursor: default;
}
.country {
  transition: fill 0.12s;
  cursor: pointer;
}
.country:hover {
  fill: var(--land-hover);
  stroke: var(--text);
  stroke-width: 1px;
}
.country:is(.visited, .planned) {
  fill: var(--c);
}
.country.visited:hover {
  fill: var(--visited-hover);
}
.country.planned:hover {
  fill: var(--planned-hover);
}
.country.wishlist {
  fill: url(#wishlist-hatch);
  stroke: var(--c);
  stroke-width: 0.75px;
}
.country.wishlist.s0 {
  fill: url(#wishlist-hatch-s0);
}
.country.wishlist.s1 {
  fill: url(#wishlist-hatch-s1);
}
.country.wishlist.s2 {
  fill: url(#wishlist-hatch-s2);
}
.country.wishlist:hover {
  stroke: var(--ring);
  stroke-width: 1.25px;
}
#map-svg .country.selected {
  fill: var(--selected);
  stroke: var(--ring);
  stroke-width: 2.5px;
}
.dot-land {
  pointer-events: none;
}
.dot-hit {
  fill: none;
  pointer-events: fill;
  cursor: pointer;
}
/* Dots: a bare ring when unvisited; filled dots keep their outline outside
   the fill, at --dot-k times the stated width. */
#map-svg circle.country {
  stroke: var(--dot-ring);
  stroke-width: calc(var(--dot-k) * 1px);
  fill-opacity: 0;
}
#map-svg circle.country.wishlist {
  fill: var(--c);
}
#map-svg circle.country.wishlist:not(.selected):hover {
  fill: var(--wishlist-hover);
}
/* Pair hover outlines only: a lighter fill would pass for another shade. */
html.pair .country:is(.visited, .planned):hover,
html.pair #map-svg circle.country.wishlist:not(.selected):hover {
  fill: var(--c);
}
#map-svg circle.country:is(:hover, .selected, .visited, .planned, .wishlist) {
  fill-opacity: 1;
  stroke: var(--bg);
  stroke-width: calc(var(--dot-k) * 2px);
  paint-order: stroke;
}
#map-svg circle.country:hover {
  stroke: var(--text);
}
#map-svg circle.country.selected {
  fill: var(--selected);
  stroke: var(--ring);
  stroke-width: calc(var(--dot-k) * 5px);
}

/* PANELS (side panels on desktop, bottom sheets on mobile) */
.panel {
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--panel-w);
  background: var(--bg);
  z-index: 50;
  overflow-y: auto;
  visibility: hidden;
  transition:
    transform 0.28s var(--ease),
    visibility 0s 0.28s;
}
.panel.open {
  transform: none;
  visibility: visible;
  transition-delay: 0s;
}
.panel-body {
  padding: 28px 24px;
}
.sheet-handle-wrap {
  display: none;
  justify-content: center;
  padding: 10px 0 14px;
}
.sheet-handle {
  width: 32px;
  height: 2px;
  background: var(--line-strong);
}
.panel-close,
.list-close-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  transition:
    color 0.15s,
    border-color 0.15s;
}
.panel-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 1;
}
.panel-close:hover,
.list-close-btn:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

/* DETAIL PANEL */
.detail {
  right: 0;
  border-left: 1px solid var(--line-strong);
  transform: translateX(100%);
}
.country-flag {
  font-size: 40px;
  line-height: 1;
  margin-bottom: 18px;
}
.country-flag img {
  display: block;
  height: 36px;
}
.list-item-flag img,
.search-flag img {
  display: block;
  width: 24px;
  height: 16px;
  object-fit: cover;
}
.country-flag img,
.list-item-flag img,
.search-flag img {
  outline: 1px solid var(--line-strong);
}
.country-flag,
.list-item-flag,
.search-flag {
  filter: saturate(0.75);
}
.country-name {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 6px;
}
.country-region {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 24px;
}
/* Names and regions read lowercase; the DOM keeps their real case. */
.country-name,
.country-region,
.region-value,
.cont-name,
.list-item-name,
.search-result-item,
#tooltip {
  text-transform: lowercase;
}
.data-grid {
  border-top: 1px solid var(--line);
}
.data-cell {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.data-cell-label,
.panel-section-label,
.section-label {
  font-size: 11px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.data-cell-value {
  text-align: right;
  min-width: 0;
}
.panel-section-label {
  margin: 28px 0 10px;
}
.panel-section-label + .data-cell {
  border-top: 1px solid var(--line);
}
.my-rating {
  color: var(--star);
  letter-spacing: 3px;
}
.my-rating .dim {
  color: var(--star-empty);
}
.my-notes-wrap {
  padding: 9px 0 24px;
  border-bottom: 1px solid var(--line);
}
.my-notes-wrap .data-cell-label {
  margin-bottom: 6px;
}
.my-notes {
  line-height: 1.6;
  white-space: pre-wrap;
}
/* Two or more travellers: a row per traveller, details indented below. */
.traveller-row .data-cell-label {
  color: var(--text);
}
.sub .data-cell-label,
.my-notes-wrap.sub .my-notes {
  padding-left: 12px;
}
.none,
.off .data-cell-label,
.off .data-cell-value,
.off .my-rating,
.off .my-notes {
  color: var(--text-dim);
}

/* STATS PANEL */
.stats {
  left: 0;
  border-right: 1px solid var(--line-strong);
  transform: translateX(-100%);
}
.sp-title,
.list-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
}
.sp-title {
  margin-bottom: 28px;
}
.world-ring-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 28px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.ring-svg {
  flex-shrink: 0;
}
.ring-bg,
.ring-fill {
  fill: none;
  stroke-width: 3;
}
.ring-bg {
  stroke: var(--line);
}
.ring-fill {
  stroke: var(--visited);
  transition:
    stroke-dasharray 1s var(--ease),
    stroke-dashoffset 1s var(--ease);
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}
.ring-fill.visited {
  stroke: var(--c);
}
.ring-text-wrap {
  flex: 1;
}
.ring-pct {
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
}
.ring-pct span {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 2px;
}
.ring-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}
.ring-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}
.continent-section {
  margin-bottom: 8px;
}
.section-label {
  margin-bottom: 16px;
}
.continent-row {
  margin-bottom: 16px;
}
.cont-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
}
.cont-count {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.cont-bar-bg {
  height: 2px;
  background: var(--line);
  overflow: hidden;
}
.cont-bar-fill {
  height: 100%;
  transition: width 1s var(--ease);
}
/* Two or more travellers shown: per-traveller rows and continent bars. */
.who-stats {
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.who-stats:empty {
  display: none;
}
.who-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
.who-sw {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  background: var(--c, transparent);
}
.who-name {
  flex: 1;
}
.who-n {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.cont-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px;
}
.cont-who {
  width: 64px;
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
}
.cont-sub .cont-bar-bg {
  flex: 1;
}
.cont-bar-fill.visited {
  background: var(--c);
}

/* TOOLTIP */
#tooltip {
  position: absolute;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  padding: 4px 8px;
  font-size: 11px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 200;
  white-space: nowrap;
}
#tooltip.show {
  opacity: 1;
}

/* SEARCH */
.search-wrap {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  transition: left 0.28s var(--ease);
}
/* The input is grayscaled (for its emoji), so its focus border sits on top. */
.search-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--accent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.search-wrap:focus-within::after {
  opacity: 1;
}
.search-input,
.list-search {
  height: 32px;
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: 0;
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.search-input {
  width: 280px;
  filter: grayscale(1);
}
.search-input::placeholder,
.list-search::placeholder {
  color: var(--text-dim);
}
.search-results {
  position: absolute;
  bottom: calc(100% - 1px);
  left: 0;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  max-height: 290px;
  overflow-y: auto;
  display: none;
}
.search-results.show {
  display: block;
}
.search-result-item {
  display: flex;
  align-items: center;
  padding: 9px 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.12s;
}
.search-result-item:last-child {
  border-bottom: none;
}
.search-result-item:hover,
.list-item:hover {
  background: var(--hover-bg);
}
.search-flag {
  display: inline-flex;
  justify-content: center;
  width: 24px;
  margin-right: 10px;
  flex-shrink: 0;
}

/* ZOOM */
.zoom-controls {
  position: absolute;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  z-index: 50;
  transition:
    right 0.28s var(--ease),
    bottom 0.28s var(--ease);
}
.zoom-btn {
  width: 32px;
  height: 32px;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    color 0.15s,
    background-color 0.15s;
}
.zoom-btn + .zoom-btn {
  border-top: none;
}
.zoom-btn:hover {
  color: var(--text);
  background: var(--hover-bg);
}
#zoom-reset {
  font-size: 13px;
}
/* Keep the map controls clear of an open side panel. */
@media (min-width: 641px) {
  .detail.open ~ .zoom-controls {
    right: calc(var(--panel-w) + 24px);
  }
  .detail.open ~ .search-wrap {
    left: calc(50% - var(--panel-w) / 2);
  }
  .stats.open ~ .search-wrap {
    left: calc(50% + var(--panel-w) / 2);
  }
}
@media (min-width: 641px) and (max-width: 820px) {
  .panel.open ~ .zoom-controls {
    bottom: 72px;
  }
}

/* LIST VIEW */
.list-overlay,
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.list-overlay {
  z-index: 600;
}
.sheet-overlay {
  display: none;
  z-index: 300;
}
.list-overlay.show,
.sheet-overlay.show {
  opacity: 1;
  pointer-events: all;
}
.list-panel {
  position: fixed;
  top: calc(var(--header-h) + env(safe-area-inset-top));
  right: 0;
  bottom: 0;
  width: var(--panel-w);
  max-width: 100vw;
  background: var(--bg);
  border-left: 1px solid var(--line-strong);
  z-index: 700;
  transform: translateX(100%);
  transition: transform 0.28s var(--ease);
  display: flex;
  flex-direction: column;
}
.list-panel.open {
  transform: none;
}
.list-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.list-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 -6px 18px 0;
}
.list-tabs {
  display: flex;
}
.list-tab {
  flex: 1;
  height: 32px;
  padding: 0 4px;
  white-space: nowrap;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  transition: color 0.15s;
}
.list-tab + .list-tab {
  border-left: none;
}
.list-tab:hover {
  color: var(--text);
}
.list-tab:focus-visible,
.zoom-btn:focus-visible {
  position: relative;
  z-index: 1;
}
.list-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
/* Tints the grayscale emoji teal: multiplies over the tab's own opaque fill. */
.list-tab.active .emoji {
  mix-blend-mode: multiply;
}
.list-search {
  width: 100%;
  margin-top: 12px;
  transition: border-color 0.15s;
}
.list-search:focus {
  border-color: var(--accent);
}
.list-body {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 24px;
}
.list-empty {
  color: var(--text-muted);
  padding: 40px 24px;
  line-height: 1.7;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 13px 24px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background-color 0.12s;
}
.list-item-flag {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  width: 26px;
  display: flex;
  justify-content: center;
}
.list-item-info {
  flex: 1;
  min-width: 0;
}
.list-item-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.list-item-sub {
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-muted);
  margin-top: 3px;
}
.list-item-stars {
  font-size: 11px;
  color: var(--star);
  flex-shrink: 0;
  letter-spacing: 1px;
}
.list-item-who {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* WIKIPEDIA */
.wiki-content {
  margin-top: 24px;
}
.wiki-excerpt {
  color: var(--text-muted);
  line-height: 1.7;
  border-left: 1px solid var(--line-strong);
  padding-left: 14px;
  margin-bottom: 14px;
}
.wiki-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-dim);
  padding-bottom: 2px;
  transition: border-color 0.15s;
}
.wiki-link:hover {
  border-color: var(--accent);
}
.wiki-empty,
.wiki-note {
  font-size: 11px;
}
.wiki-note {
  color: var(--text-muted);
  padding: 4px 0;
}

/* MOBILE NAV */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg);
  border-top: 1px solid var(--line);
  z-index: 200;
}
.mobile-nav-btn {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  padding: 0 20px;
  transition: color 0.15s;
}
.mobile-nav-btn svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  stroke-width: 1.5;
}
.mobile-nav-btn.active {
  color: var(--accent);
}
.mobile-nav-btn.active::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  width: 32px;
  margin-left: -16px;
  height: 1px;
  background: var(--accent);
}

/* RESPONSIVE */
@media (max-width: 1000px) {
  .stats-bar {
    gap: 16px;
  }
  .stat {
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
  }
}
@media (max-width: 860px) {
  .header-right button {
    width: 32px;
    padding: 0;
    gap: 0;
    justify-content: center;
    font-size: 0;
  }
}
@media (max-width: 640px) {
  .header-left {
    flex: 1;
    justify-content: space-between;
    gap: 12px;
  }
  .header-right,
  .zoom-controls,
  #tooltip {
    display: none;
  }
  .stats-bar {
    gap: 14px;
    padding-left: 0;
    border-left: none;
  }
  .stat-num {
    font-size: 13px;
  }
  .country.wishlist {
    fill: url(#wishlist-hatch-sm);
  }
  .country.wishlist.s0 {
    fill: url(#wishlist-hatch-s0-sm);
  }
  .country.wishlist.s1 {
    fill: url(#wishlist-hatch-s1-sm);
  }
  .country.wishlist.s2 {
    fill: url(#wishlist-hatch-s2-sm);
  }
  .search-wrap {
    bottom: calc(72px + env(safe-area-inset-bottom));
  }
  .search-input {
    width: 240px;
  }
  .search-input,
  .list-search {
    font-size: 16px;
  }
  .search-input,
  .list-search,
  .list-tab {
    height: 40px;
  }

  /* bottom sheets */
  .sheet-overlay {
    display: block;
  }
  .panel {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    width: auto;
    border: none;
    border-top: 1px solid var(--line-strong);
    padding-bottom: env(safe-area-inset-bottom);
    z-index: 400;
    transform: translateY(100%);
    transition:
      transform 0.3s var(--ease),
      visibility 0s 0.3s;
    max-height: 90dvh;
  }
  .stats {
    z-index: 401;
  }
  .sheet-handle-wrap {
    display: flex;
  }
  .panel-body {
    padding: 6px 20px 32px;
  }
  .panel-close {
    display: none;
  }
  .stats .sp-title {
    margin-bottom: 16px;
  }

  .list-panel {
    width: 100vw;
    border-left: none;
    border-top: 1px solid var(--line-strong);
    top: auto;
    height: 90dvh;
    transform: translateY(100%);
  }
  .list-header {
    padding: 14px 20px 18px;
  }
  .list-item {
    padding: 13px 20px;
  }

  .mobile-nav {
    display: flex;
  }
}
@media (max-width: 374px) {
  .logo {
    font-size: 12px;
  }
  .header-left,
  .stats-bar {
    gap: 10px;
  }
}
@media (max-width: 359px) {
  .logo {
    font-size: 11px;
  }
  .stat-label {
    font-size: 10px;
  }
  .header-left,
  .stats-bar {
    gap: 8px;
  }
}
@media (pointer: coarse) {
  .search-input,
  .list-search {
    font-size: 16px;
  }
}

/* TRAVELLER TOGGLES: layout. Overlays start under the header so the
   toggles stay reachable while the list or a sheet is open. */
html.multi .list-overlay,
html.multi .sheet-overlay {
  top: calc(var(--header-h) + env(safe-area-inset-top));
}
@media (max-width: 1200px) {
  html.multi .header-right button {
    width: 32px;
    padding: 0;
    gap: 0;
    justify-content: center;
    font-size: 0;
  }
}
@media (max-width: 1000px) {
  html.multi {
    --header-h: 100px;
  }
  html.multi header {
    flex-wrap: wrap;
    align-content: flex-start;
    row-gap: 0;
  }
  html.multi .header-left,
  html.multi .header-right {
    height: 59px;
  }
  html.multi .travellers {
    order: 3;
    flex-basis: calc(100% + 48px);
    height: 41px;
    margin: 0 -24px;
    padding: 0 24px;
    border-left: none;
    border-top: 1px solid var(--line);
  }
}
@media (max-width: 640px) {
  html.multi .travellers {
    flex-basis: calc(100% + 32px);
    margin: 0 -16px;
    padding: 0 16px;
    overflow-x: auto;
  }
  html.multi .panel,
  html.multi .list-panel {
    max-height: min(
      90dvh,
      calc(100dvh - var(--header-h) - env(safe-area-inset-top))
    );
  }
  html.multi .list-panel {
    height: min(
      90dvh,
      calc(100dvh - var(--header-h) - env(safe-area-inset-top))
    );
  }
}
@media (max-width: 359px) {
  html.multi .travellers {
    flex-basis: calc(100% + 24px);
    margin: 0 -12px;
    padding: 0 12px;
  }
}
