:root {
  color-scheme: dark;
  --bg: #04060c;
  --ink: #f3efe6;
  --muted: #9aa3b5;
  --gold: #f5c46b;
  --panel: rgba(9, 13, 24, 0.74);
  --line: rgba(255, 255, 255, 0.09);
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --text: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#globe {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}
#globe:active { cursor: grabbing; }
body.no-globe { background: radial-gradient(circle at 62% 38%, #13213f 0%, var(--bg) 62%); }
body.no-globe #globe { display: none; }

.brand {
  position: fixed;
  top: 22px;
  left: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: none;
  z-index: 20; /* the Filters panel opens over the trip card */
}
.mark { font: 700 26px/1 var(--display); letter-spacing: -0.01em; }
.tag { color: var(--muted); font-size: 13px; letter-spacing: 0.03em; }

.length select {
  pointer-events: auto;
  appearance: none;
  -webkit-appearance: none;
  padding: 6px 30px 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(245, 196, 107, 0.35);
  background: rgba(9, 13, 24, 0.72)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23f5c46b' stroke-width='1.5'/%3E%3C/svg%3E")
    no-repeat right 12px center / 10px 6px;
  color: var(--gold);
  font: 600 13px var(--text);
  letter-spacing: 0.02em;
  cursor: pointer;
}
.origin input {
  pointer-events: auto;
  width: 210px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(245, 196, 107, 0.35);
  background: rgba(9, 13, 24, 0.72);
  color: var(--gold);
  font: 600 13px var(--text);
  letter-spacing: 0.02em;
}
.origin input::placeholder { color: rgba(245, 196, 107, 0.5); }
.origin input:hover, .length select:hover { border-color: rgba(245, 196, 107, 0.6); }
.origin input:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.length select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.length option { background: #0b1020; color: var(--ink); }

.filters { position: relative; pointer-events: auto; }
.filter-btn {
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(245, 196, 107, 0.35); background: rgba(9, 13, 24, 0.72);
  color: var(--gold); font: 600 13px var(--text); letter-spacing: 0.02em;
}
.filter-btn:hover { border-color: rgba(245, 196, 107, 0.6); }
.filter-btn.active { background: var(--gold); color: #1a1407; border-color: var(--gold); }
.filter-btn:focus-visible, .filter-panel button:focus-visible, .filter-panel select:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.filter-panel {
  position: absolute; top: calc(100% + 10px); left: 0; z-index: 30; width: 320px;
  padding: 14px; display: grid; gap: 12px;
  background: rgba(9, 13, 24, 0.94); border: 1px solid var(--line); border-radius: 14px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.filter-row { display: grid; gap: 6px; }
.filter-label { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.vibe-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vibe-chips button {
  padding: 4px 11px; border-radius: 999px; cursor: pointer; font: 600 12.5px var(--text);
  color: var(--ink); background: transparent; border: 1px solid var(--line);
}
.vibe-chips button[aria-pressed="true"] { background: var(--gold); color: #1a1407; border-color: var(--gold); }
.filter-panel select {
  padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line);
  background: #0b1020; color: var(--ink); font: 500 13.5px var(--text);
}
.filter-clear {
  justify-self: start; padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--muted); font: 500 12.5px var(--text); text-decoration: underline; text-underline-offset: 3px;
}
.filter-clear:hover { color: var(--ink); }

.minor-actions { display: flex; gap: 8px; margin-top: 10px; }
.mini {
  padding: 5px 12px; border-radius: 999px; cursor: pointer; font: 600 12.5px var(--text);
  color: var(--muted); background: transparent; border: 1px solid var(--line);
}
.mini:hover { color: var(--ink); border-color: rgba(255, 255, 255, 0.25); }
.mini[aria-pressed="true"] { color: var(--gold); border-color: rgba(245, 196, 107, 0.45); }
.mini:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.saved-panel { width: 280px; gap: 8px; left: auto; right: 0; }
.saved-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 50vh; overflow: auto; }
.saved-list li { display: flex; align-items: center; gap: 6px; }
.saved-list .go {
  flex: 1; text-align: left; padding: 7px 8px; border-radius: 8px; cursor: pointer;
  background: transparent; border: 0; color: var(--ink); font: 500 13.5px var(--text);
}
.saved-list .go:hover { background: rgba(255, 255, 255, 0.06); }
.saved-list .go small { color: var(--muted); margin-left: 6px; }
.saved-list .rm { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 4px 6px; }
.saved-list .rm:hover { color: var(--ink); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.card {
  position: fixed;
  left: 24px;
  bottom: 24px;
  width: min(380px, calc(100% - 48px));
  max-height: calc(100% - 96px);
  overflow: auto;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  transition: opacity 0.2s;
}
.card.busy { opacity: 0.65; }

.route {
  margin: 0 0 4px;
  display: flex;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.route .arrow { color: var(--gold); }
h1 { margin: 0; font: 700 34px/1.05 var(--display); letter-spacing: -0.015em; }
.country { margin: 4px 0 0; color: var(--muted); }
.country:empty { display: none; }

.why { margin: 10px 0 0; font: 500 15.5px/1.4 var(--display); color: var(--ink); opacity: 0.92; }
.guide { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.guide span {
  padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--muted); border: 1px solid var(--line); text-transform: capitalize;
}
.guide .season { color: var(--muted); text-transform: none; }
.guide .season.good { color: #7fe0a6; border-color: rgba(127, 224, 166, 0.35); background: rgba(127, 224, 166, 0.08); }

.flight, .fare { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.price { display: flex; flex-direction: column; }
.from { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.price strong { font: 700 44px/1.05 var(--display); color: var(--gold); font-variant-numeric: lining-nums; }
.flight-sub { margin-top: 3px; font-size: 12.5px; color: var(--muted); }
.flight-sub:empty { display: none; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 14px 0 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.facts dd { margin: 2px 0 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facts .wide { grid-column: 1 / -1; }
.facts .wide dd { white-space: normal; }

.note {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(245, 196, 107, 0.08);
  border: 1px solid rgba(245, 196, 107, 0.22);
  font-size: 13px;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.btn {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: 600 14px var(--text);
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { border-color: rgba(255, 255, 255, 0.25); }
.btn.primary { background: var(--gold); border-color: var(--gold); color: #1a1406; }
.btn.primary:hover { filter: brightness(1.06); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.fine { margin: 14px 0 0; font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.fine:empty { display: none; }

/* ---------- See and Eat ---------- */
.local {
  position: fixed;
  top: 24px;
  right: 24px;
  width: clamp(300px, 27vw, 400px);
  max-height: calc(100% - 48px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.local .fine { margin: 0; }
.widget h2 { margin: 0; font: 700 22px/1.1 var(--display); letter-spacing: -0.01em; }
.widget-sub { margin: 3px 0 12px; font-size: 12.5px; color: var(--muted); }

.sights { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 12px; }
.sight { display: flex; flex-direction: column; min-width: 0; }
.sight-show {
  display: flex;
  flex-direction: column;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.sight-show:disabled { cursor: default; }
.sight.active img { box-shadow: 0 0 0 2px var(--gold); }
.sight-more { margin-top: 3px; font-size: 11.5px; color: var(--gold); text-decoration: none; }
.sight-more:hover { text-decoration: underline; }
.sight img, .sk-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  transition: filter 0.2s;
}
.sight-show:hover img { filter: brightness(1.12); }
.sight-name { margin-top: 7px; font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.sight-desc {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.3;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dishes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dish {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  text-decoration: none;
}
.dish img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.dish:hover img { transform: scale(1.06); }
.dish-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 8px 7px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
}
.sight-show:focus-visible, .sight-more:focus-visible, .dish:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 10px; }

.placeholder { pointer-events: none; }
.sk-line { display: block; height: 10px; margin-top: 9px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); }
.sk-line.short { width: 60%; margin-top: 6px; }
.sk-photo, .sk-line, .dish.placeholder { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.4; } }
@media (prefers-reduced-motion: reduce) {
  .sk-photo, .sk-line, .dish.placeholder { animation: none; }
  .sight img, .dish img { transition: none; }
}

/* Too narrow for two panels beside the globe: stack them in one bottom sheet. */
@media (max-width: 900px) {
  .panels {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-height: 62%;
    overflow: auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
  }
  .card, .local {
    position: static;
    width: auto;
    max-height: none;
    overflow: visible;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .local { padding: 18px 22px 22px; border-top: 1px solid var(--line); }
}

@media (max-width: 720px) {
  .brand { top: 16px; left: 16px; right: 16px; flex-wrap: wrap; gap: 8px 10px; }
  .tag { display: none; }
  /* Header pills wrap to two rows here, so the panels drop below them, full width. */
  .filter-panel, .saved-panel { position: fixed; top: 96px; left: 16px; right: 16px; width: auto; }
  .origin input { width: 132px; }
  .card { padding: 18px; }
  .local { padding: 16px 18px 18px; }
  h1 { font-size: 28px; }
  .price strong { font-size: 36px; }
}
