[hidden] { display: none !important; }
:root {
  --bg: #0a0e16;
  --bg-2: #111725;
  --card: #151c2c;
  --line: #243049;
  --text: #f1eadc;
  --muted: #9aa3b5;
  --gold: #d9b26a;
  --gold-2: #f3d79c;
  --land: #1a2337;
  --land-hover: #2a3958;
  --radius: 16px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 700px at 20% -10%, #1a2440 0%, transparent 60%), var(--bg);
  color: var(--text); font: 15px/1.55 var(--sans); min-height: 100vh;
}
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* Header */
.top { display: flex; align-items: center; gap: 24px; padding: 18px 32px; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; background: rgba(10,14,22,.82); backdrop-filter: blur(12px); }
.brand { font: 600 24px var(--serif); color: var(--text); text-decoration: none; display: flex; align-items: baseline; gap: 8px; }
.brand .mark { color: var(--gold); }
.brand small { font: 500 11px var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.search { margin-left: auto; flex: 0 1 380px; }
.search input { width: 100%; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); }
.search input::placeholder { color: var(--muted); }

/* Layout */
.layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 0; min-height: calc(100vh - 69px); }
.map-wrap { position: sticky; top: 69px; height: calc(100vh - 69px); padding: 24px; }
#map { width: 100%; height: 100%; display: block; }
.map-note { position: absolute; left: 24px; bottom: 8px; margin: 0; font-size: 11px; color: var(--muted); opacity: .6; }
.panel { padding: 40px 48px 64px; border-left: 1px solid var(--line); }

/* Map */
#zoom { transition: transform .8s cubic-bezier(.2,.7,.1,1); transform-origin: 0 0; }
.state { fill: var(--land); stroke: #3a4a6b; stroke-width: .6; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill .25s, opacity .4s; }
.state:hover, .state:focus-visible { fill: var(--land-hover); outline: none; }
.state.on { fill: url(#goldFill); stroke: var(--gold-2); stroke-width: 1.2; }
.dim .state:not(.on) { opacity: .35; }
.pin circle { fill: var(--gold); stroke: var(--bg); vector-effect: non-scaling-stroke; stroke-width: 2; cursor: pointer; transition: r .2s; }
.pin.hot circle { fill: #fff; }
.pin text { fill: var(--text); font-family: var(--sans); paint-order: stroke; stroke: var(--bg); stroke-linejoin: round; pointer-events: none; }
.tip { position: absolute; pointer-events: none; padding: 6px 12px; border-radius: 8px; background: #000c; border: 1px solid var(--line); font-size: 13px; white-space: nowrap; transform: translate(-50%, -140%); }
.reset { position: absolute; top: 28px; left: 28px; padding: 8px 14px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); cursor: pointer; }
.reset:hover { border-color: var(--gold); }

/* Type */
.eyebrow { font-size: 12px; letter-spacing: .16em; text-transform: uppercase; color: var(--gold); margin: 0 0 12px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; margin: 0; letter-spacing: -.01em; }
h1 { font-size: clamp(34px, 4vw, 52px); line-height: 1.05; }
h2 { font-size: 22px; margin: 32px 0 14px; }
h3 { font-size: 18px; }
.lede { color: var(--muted); font-size: 17px; max-width: 46ch; margin: 14px 0 0; }
.muted { color: var(--muted); }

/* Home */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 32px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.stat b { display: block; font: 600 26px var(--serif); color: var(--gold-2); }
.stat span { color: var(--muted); font-size: 13px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; cursor: pointer; font-size: 13px; }
.chip:hover { border-color: var(--gold); color: var(--gold-2); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.steps li { counter-increment: s; display: flex; gap: 12px; color: var(--muted); }
.steps li::before { content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold); font-size: 12px; display: grid; place-items: center; }

/* State header */
.meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 18px; font-size: 13px; color: var(--muted); }
.meta b { color: var(--text); font-weight: 500; }
.tabs { display: flex; gap: 4px; margin: 28px 0 8px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab { background: none; border: 0; padding: 12px 16px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--text); border-color: var(--gold); }

/* Cards */
.grid { display: grid; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; transition: border-color .2s, transform .2s; }
.card.dest { cursor: pointer; }
.card.dest:hover, .card.dest:focus-visible { border-color: var(--gold); transform: translateY(-1px); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.tag { white-space: nowrap; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); border: 1px solid #d9b26a55; padding: 3px 9px; border-radius: 999px; }
.days { font-size: 13px; color: var(--muted); white-space: nowrap; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.callout { border-left: 2px solid var(--gold); padding: 4px 0 4px 16px; color: var(--muted); margin: 24px 0 0; }
.food { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.food .card b { display: block; font-family: var(--serif); font-size: 17px; margin-bottom: 4px; }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.tiers .card b { display: block; font: 600 22px var(--serif); color: var(--gold-2); margin-top: 6px; }

/* Planner */
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; margin-top: 8px; }
.field { display: grid; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field > span { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
select, input[type=number] { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); width: 100%; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; transition: .2s; }
.seg input:checked + span { background: var(--gold); color: #1a1407; border-color: var(--gold); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--gold-2); outline-offset: 2px; }
.result { margin-top: 28px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kpis .stat b { font-size: 22px; }
.bars { display: grid; gap: 10px; }
.bar { display: grid; grid-template-columns: 150px 1fr 90px; gap: 12px; align-items: center; font-size: 14px; }
.bar i { display: block; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--gold), var(--gold-2)); }
.bar .track { background: var(--bg-2); border-radius: 4px; }
.bar .amt { text-align: right; font-variant-numeric: tabular-nums; }
.legs { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.legs b { color: var(--text); font-weight: 500; }
.notes { margin: 16px 0 0; padding: 12px 16px; border-radius: 12px; background: #d9b26a14; border: 1px solid #d9b26a40; font-size: 14px; }
.notes p { margin: 4px 0; }
.timeline { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); margin-left: 10px; }
.timeline > li { position: relative; padding: 0 0 20px 24px; }
.timeline > li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px var(--bg); }
.timeline > li.travel::before { background: var(--bg); border: 1px solid var(--gold); }
.timeline h4 { margin: 0 0 4px; font: 600 15px var(--sans); }
.timeline h4 small { color: var(--gold); font-weight: 500; margin-right: 8px; }
.timeline ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; }
.actions { display: flex; gap: 10px; margin-top: 20px; }
.btn { padding: 10px 18px; border-radius: 999px; border: 1px solid var(--gold); background: transparent; color: var(--gold-2); cursor: pointer; }
.btn:hover { background: var(--gold); color: #1a1407; }
.fine { font-size: 12px; color: var(--muted); margin-top: 16px; }

/* Responsive */
@media (max-width: 960px) {
  .top { padding: 14px 16px; gap: 12px; }
  .brand small { display: none; }
  .layout { grid-template-columns: 1fr; }
  .map-wrap { position: relative; top: 0; height: 62vh; padding: 12px; }
  .panel { padding: 28px 16px 48px; border-left: 0; border-top: 1px solid var(--line); }
  .kpis { grid-template-columns: 1fr 1fr; }
  .bar { grid-template-columns: 110px 1fr 80px; }
}
@media (max-width: 560px) {
  .form, .food, .tiers { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr 1fr; }
  .stat { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { #zoom, .card { transition: none; } }

/* Print = a clean take-along itinerary */
@media print {
  body { background: #fff; color: #111; }
  .top, .map-wrap, .tabs, .form, .actions, .reset { display: none !important; }
  .layout { display: block; }
  .panel { border: 0; padding: 0; }
  .card, .stat { background: #fff; border-color: #ccc; }
  .muted, .card p, .timeline ul, .legs { color: #333; }
}

/* Destination detail */
.back { background: none; border: 0; color: var(--gold); cursor: pointer; padding: 0; margin-bottom: 20px; font-size: 14px; }
.back:hover { color: var(--gold-2); }
.link { color: var(--gold-2); text-decoration: none; }
.link:hover { text-decoration: underline; }
.card a, .hotels a { color: var(--text); text-decoration: none; border-bottom: 1px dotted #d9b26a80; }
.card a:hover, .hotels a:hover { color: var(--gold-2); }
.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.place { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; color: var(--text); text-decoration: none; transition: border-color .2s; }
.place:hover { border-color: var(--gold); }
.place b { display: block; font-weight: 600; font-size: 14px; }
.place span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.stays { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.hotels { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; font-size: 14px; color: var(--muted); }
.hotels b { color: var(--text); font-weight: 500; }
.stay-tier { margin-top: 12px; }
.card-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.more { color: var(--gold); font-size: 13px; background: none; border: 0; cursor: pointer; padding: 0; white-space: nowrap; }
.btn.solid { background: var(--gold); color: #1a1407; font-weight: 600; }
.btn.solid:hover { background: var(--gold-2); }
.actions { flex-wrap: wrap; }

/* ---------- 3D mode (added by map3d.js when WebGL is available) ---------- */
.state-pick { padding: 10px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); max-width: 200px; }
.map-hint { display: none; }
body.is-3d { background: radial-gradient(1400px 900px at 30% 10%, #1b2645 0%, #0a0e16 55%, #06080d 100%) fixed; }
.is-3d .top { background: linear-gradient(#06080dcc, #06080d00); border-bottom: 0; backdrop-filter: none; }
.is-3d .layout { display: block; min-height: 0; }
.is-3d .map-wrap { position: fixed; inset: 0; height: 100vh; padding: 0; z-index: 0; }
.is-3d #map, .is-3d #tip { display: none; }
.gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; }
.gl-labels { position: absolute; inset: 0; pointer-events: none; }
.is-3d .panel { position: relative; z-index: 2; margin-left: auto; width: min(500px, 100%); min-height: calc(100vh - 69px);
  background: rgba(9, 12, 20, .78); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-left: 1px solid #d9b26a26; padding: 32px 36px 64px; }
.is-3d .reset { top: 88px; z-index: 3; }
.is-3d .map-note { z-index: 3; bottom: 10px; left: 16px; max-width: 46%; }
.is-3d .map-hint { display: block; position: absolute; left: 16px; bottom: 30px; margin: 0; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); opacity: .8; z-index: 3; }
.is-3d .kpis { grid-template-columns: 1fr 1fr; }
.is-3d .bar { grid-template-columns: 120px 1fr 84px; }

/* Destination labels on the 3D map */
.pin3d { pointer-events: auto; transform: translateY(-50%); font: 600 12px var(--sans); color: var(--text); background: rgba(10, 14, 22, .85);
  border: 1px solid var(--gold); padding: 5px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap; transition: background .2s, color .2s; }
.pin3d:hover, .pin3d:focus-visible, .pin3d.hot { background: var(--gold); color: #1a1407; }

/* Hover card */
.hovercard { position: fixed; z-index: 4; width: 340px; max-width: calc(100vw - 24px); pointer-events: none; overflow: hidden;
  background: rgba(10, 14, 22, .9); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid #d9b26a55; border-radius: 16px; box-shadow: 0 24px 60px -20px #000c; }
.hovercard.pinned { pointer-events: auto; border-color: var(--gold); }
.hc-img { display: block; width: 100%; height: 150px; object-fit: cover; }
.hc-body { padding: 14px 18px 16px; }
.hc-eyebrow { margin: 0 0 4px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.hc-title { font-size: 22px; }
.hc-meta { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.hc-text { margin: 10px 0 0; font-size: 13.5px; line-height: 1.55; color: #d7d0c2; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.hc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hc-chips span, .hc-chips button { font-size: 11px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: none; }
.hc-chips button { color: var(--gold-2); border-color: var(--gold); cursor: pointer; }
.hc-more { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--gold-2); }
.hc-hint { margin: 8px 0 0; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.hc-hint:empty { display: none; }

/* Wikipedia block in the panel */
.wiki { display: grid; grid-template-columns: 112px 1fr; gap: 16px; margin: 22px 0 0; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #ffffff05; }
.wiki img { width: 112px; height: 112px; object-fit: cover; border-radius: 10px; }
.wiki p { margin: 0; font-size: 14px; color: #d7d0c2; display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.wiki:not(:has(img)) { grid-template-columns: 1fr; }
.credit { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--gold-2); }
.word { display: inline-block; overflow: hidden; vertical-align: bottom; }
.word > span { display: inline-block; }

@media (max-width: 960px) {
  .state-pick { display: none; }
  .is-3d .map-wrap { height: 100vh; }
  .is-3d .panel { width: 100%; margin-top: 50vh; min-height: 50vh; border-left: 0; border-top: 1px solid #d9b26a40; border-radius: 22px 22px 0 0; padding: 26px 16px 48px; }
  .is-3d .map-note { display: none; }
  .is-3d .map-hint { display: none; }
  .hovercard { width: 300px; }
  .wiki { grid-template-columns: 80px 1fr; }
  .wiki img { width: 80px; height: 80px; }
}
.legs li { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; transform: translateY(-1px); }
.state-label { pointer-events: none; font: 600 9.5px var(--sans); letter-spacing: .16em; text-transform: uppercase; color: #c9c2b4; opacity: .7;
  text-shadow: 0 1px 6px #000; transition: color .2s, opacity .2s; white-space: nowrap; }
.state-label.hot { color: var(--gold-2); opacity: 1; }
.pin3d.start { border-color: #fff; color: #fff; pointer-events: none; }
.will-3d body:not(.is-3d) #map { visibility: hidden; }
.will-3d body:not(.is-3d) .map-wrap::after { content: "Preparing the 3D map…"; position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--gold); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; }
.gl-labels.route .pin3d:not(.start) { font-size: 0; padding: 5px; }
