:root {
  --sand: #f6efe2;
  --sand-2: #ece0c8;
  --card: #fffaf1;
  --ink: #1d2733;
  --muted: #5d6673;
  --nile: #14324a;
  --nile-2: #1f6f8b;
  --accent: #1f6f8b; /* links and highlighted text; lighter in dark mode so it stays readable */
  --gold: #c8902e;
  --line: #e2d5bb;
  --radius: 16px;
  --shadow: 0 2px 10px rgba(29, 39, 51, .08);
  --tabbar-h: 64px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --sand: #12171d;
    --sand-2: #1b222b;
    --card: #1d252f;
    --ink: #eee6d6;
    --muted: #a5adb8;
    --nile: #0d2233;
    --line: #2c3743;
    --shadow: 0 2px 10px rgba(0, 0, 0, .35);
    --accent: #6cc3df;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--sand);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; line-height: 1.15; margin: 0 0 .4em; }
button { font: inherit; cursor: pointer; }
main { outline: none; padding-bottom: calc(var(--tabbar-h) + 24px + env(safe-area-inset-bottom)); }

/* ---------- top & bottom navigation ---------- */
.topbar {
  position: sticky; top: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--nile); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: Fraunces, Georgia, serif; font-size: 1.3rem; font-weight: 700; }
.topnav { display: none; gap: 4px; }
.topnav a { text-decoration: none; padding: 8px 12px; border-radius: 999px; opacity: .85; white-space: nowrap; }
.topnav a.active, .topnav a:hover { background: rgba(255,255,255,.12); opacity: 1; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
  display: grid; grid-template-columns: repeat(6, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card); border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-decoration: none; font-size: .66rem; white-space: nowrap; color: var(--muted); }
.tabbar a span { font-size: 1.25rem; filter: grayscale(1); opacity: .7; }
.tabbar a.active { color: var(--accent); font-weight: 600; }
.tabbar a.active span { filter: none; opacity: 1; }

@media (min-width: 1050px) {
  .topnav { display: flex; }
  .tabbar { display: none; }
  main { padding-bottom: 48px; }
}

/* ---------- layout ---------- */
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.section { margin: 32px auto; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 { font-size: 1.5rem; margin: 0; }
.section-head a { color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
.muted { color: var(--muted); }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 210, 120, .55), transparent 40%),
    linear-gradient(180deg, #1c4d6b 0%, #c98a3a 70%, #e7b56a 100%);
  padding: 48px 0 120px;
}
.hero .wrap { position: relative; z-index: 2; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.6rem); max-width: 14ch; }
.hero p { font-size: 1.1rem; max-width: 46ch; opacity: .95; margin: 0 0 22px; }
.hero svg { position: absolute; bottom: 0; left: 0; width: 100%; height: 140px; z-index: 1; }

.search {
  display: flex; align-items: center; gap: 8px; max-width: 560px;
  background: #fff; color: #1d2733; border-radius: 999px; padding: 6px 6px 6px 18px; box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
.search input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 1rem; background: transparent; min-width: 0; color: inherit; }
.search button { border: 0; border-radius: 999px; background: var(--nile); color: #fff; padding: 10px 18px; font-weight: 600; }

/* ---------- category grid ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cat {
  display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--radius);
  text-decoration: none; background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--line);
  border-top: 4px solid var(--c);
  transition: transform .15s ease;
}
.cat:hover { transform: translateY(-2px); }
.cat .ic { font-size: 1.8rem; }
.cat strong { font-size: .98rem; }
.cat small { color: var(--muted); font-size: .8rem; }

/* ---------- place cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.scroller { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 300px); gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; }
.scroller > * { scroll-snap-align: start; }
.card {
  position: relative; display: flex; flex-direction: column; text-decoration: none;
  background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.card .art {
  position: relative; height: 130px; display: grid; place-items: center; font-size: 3rem;
  background:
    radial-gradient(circle at 25% 30%, rgba(255,255,255,.35), transparent 45%),
    linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #1d2733));
}
.card .art .alt { position: absolute; inset-inline-end: 12px; bottom: 8px; font-size: .95rem; color: #fff; opacity: .9; }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card h3 { font-size: 1.08rem; margin: 0; }
.card p { margin: 0; font-size: .9rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: .78rem; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: var(--sand-2); color: var(--ink); white-space: nowrap; }
.pill.check { background: #fff1cc; color: #7a5300; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pill.check { background: #3d3216; color: #f2d48a; } }

.fav {
  position: absolute; top: 10px; right: 10px; z-index: 2; width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.92); font-size: 1.1rem; display: grid; place-items: center; box-shadow: var(--shadow);
}

/* ---------- chips & filters ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 7px 14px; border-radius: 999px; font-size: .88rem; text-decoration: none; white-space: nowrap;
}
.chip.on { background: var(--nile); border-color: var(--nile); color: #fff; }

.filters { position: sticky; top: 56px; z-index: 500; background: var(--sand); padding: 12px 0 4px; }
.filters .search { box-shadow: none; border: 1px solid var(--line); max-width: none; margin-bottom: 8px; }
.filters select {
  font: inherit; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
}
.result-count { font-size: .9rem; color: var(--muted); margin: 6px 0 14px; }

/* ---------- place detail ---------- */
.detail-hero {
  position: relative; color: #fff; padding: 36px 0 28px;
  background:
    radial-gradient(circle at 85% 20%, rgba(255,255,255,.25), transparent 40%),
    linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 45%, #0d1a26));
}
.detail-hero .big { font-size: 3.2rem; }
.detail-hero h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); margin-top: 8px; }
.detail-hero .alt { font-size: 1.3rem; opacity: .95; }
.detail-hero .meta .pill { background: rgba(255,255,255,.18); color: #fff; }
.back { display: inline-block; color: #fff; text-decoration: none; opacity: .9; margin-bottom: 8px; }
.detail-grid { display: grid; gap: 20px; margin-top: 20px; }
@media (min-width: 900px) { .detail-grid { grid-template-columns: 1.2fr 1fr; } }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel h2 { font-size: 1.15rem; }
.panel p { margin: 0 0 10px; }
.tip { border-left: 4px solid var(--gold); padding: 10px 14px; background: var(--sand-2); border-radius: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); text-decoration: none; font-weight: 600; font-size: .92rem;
}
.btn.primary { background: var(--nile-2); border-color: var(--nile-2); color: #fff; }
.mini-map { height: 280px; border-radius: 12px; overflow: hidden; }

/* ---------- full map ---------- */
.map-page { position: relative; }
#bigmap { height: calc(100vh - 56px - var(--tabbar-h) - 64px); min-height: 360px; border-radius: 0; }
@media (min-width: 1050px) { #bigmap { height: calc(100vh - 56px - 70px); } }
.map-page .chips { padding: 10px 16px; background: var(--sand); }
.leaflet-popup-content { font-family: Inter, system-ui, sans-serif; }
.leaflet-popup-content a { color: var(--accent); font-weight: 600; }
.pin {
  width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--c); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); display: grid; place-items: center;
}
.pin span { transform: rotate(45deg); font-size: 14px; }

/* ---------- guide ---------- */
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.guide-grid .panel .ic { font-size: 1.6rem; }
.page-head { padding: 28px 0 8px; }
.page-head h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.empty .ic { font-size: 3rem; }

.install {
  display: none; align-items: center; gap: 12px; margin-top: 16px; padding: 12px 16px; border-radius: var(--radius);
  background: rgba(255,255,255,.16); max-width: 560px;
}
.install.show { display: flex; }
.install button { margin-left: auto; border: 0; border-radius: 999px; padding: 8px 14px; background: #fff; color: var(--nile); font-weight: 600; }
footer.site { text-align: center; color: var(--muted); font-size: .85rem; padding: 24px 16px; }

/* ---------- photos ---------- */
.card .art.photo { background: var(--sand-2); }
.card .art.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .art.photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.55)); }
.card .art.photo .alt { z-index: 1; }
.card .art { height: 150px; }
.detail-hero.photo {
  background: linear-gradient(180deg, rgba(10,20,30,.35), rgba(10,20,30,.8)), var(--img) center / cover no-repeat, var(--c);
  padding-top: 120px;
}
.credit { font-size: .75rem; color: var(--muted); margin: 10px 0 0; }
.credit a { color: inherit; }
.pill.strong { background: var(--nile-2); color: #fff; }

/* ---------- road trip ---------- */
.trip-promo {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--radius); text-decoration: none; color: #fff;
  background: linear-gradient(120deg, var(--nile), var(--nile-2));
  box-shadow: var(--shadow);
}
.trip-promo .ic { font-size: 2.4rem; }
.trip-promo .go { margin-left: auto; font-weight: 600; white-space: nowrap; }
@media (max-width: 600px) { .trip-promo { flex-wrap: wrap; } .trip-promo .go { margin-left: 0; } }
.trip-head { background: linear-gradient(160deg, #1c4d6b, #c98a3a); color: #fff; padding: 28px 0 18px; }
.trip-head h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); }
.trip-head p { max-width: 60ch; opacity: .95; }
.trip-form { display: grid; gap: 10px; grid-template-columns: 1fr; align-items: end; margin: 16px 0 8px; }
@media (min-width: 900px) { .trip-form { grid-template-columns: 1.2fr auto 1.2fr 1.2fr 1fr auto; } }
.trip-form label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; }
.trip-form input, .trip-form select {
  font: inherit; font-size: 1rem; padding: 10px 12px; border-radius: 12px; border: 0; background: #fff; color: #1d2733; min-width: 0;
}
.trip-form .chip { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.35); justify-self: start; }
.trip-head .presets .chip { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.3); }
.trip-summary { margin: 18px 0; }
.trip-layout { display: grid; gap: 16px; }
@media (min-width: 900px) { .trip-layout { grid-template-columns: 1.3fr 1fr; align-items: start; } .trip-layout > :first-child { position: sticky; top: 70px; } }
#trip-map { height: 420px; border-radius: 12px; overflow: hidden; }
@media (min-width: 900px) { #trip-map { height: calc(100vh - 110px); } }
.tip-panel { margin-bottom: 10px; }
.tip-panel a { color: var(--accent); font-weight: 600; }
.timeline { list-style: none; margin: 8px 0 0; padding: 0 0 0 18px; border-left: 3px solid var(--line); }
.timeline li { position: relative; display: flex; flex-direction: column; padding: 8px 0 12px 12px; }
.timeline li::before { content: ""; position: absolute; left: -26px; top: 13px; width: 13px; height: 13px; border-radius: 50%; background: var(--c, var(--muted)); border: 2px solid var(--sand); }
.timeline .km { font-size: .75rem; font-weight: 600; color: var(--accent); }
.timeline a { text-decoration: none; }
.timeline .muted { font-size: .85rem; }
.timeline li.stop { padding-top: 12px; }
.timeline li.stop::before { background: var(--ink); width: 15px; height: 15px; left: -27px; }
.timeline li.night::before { background: var(--gold); }
.timeline li.night a { color: var(--accent); font-weight: 600; font-size: .9rem; }
.timeline details { margin-top: 4px; }
.timeline summary { cursor: pointer; color: var(--accent); font-size: .88rem; font-weight: 600; }
.timeline.inner { border-left: 0; padding-left: 0; }
.timeline.inner li::before { display: none; }
.timeline.inner li { padding-left: 0; }
.trip-layout > * { min-width: 0; }
.timeline li.empty-road::before { background: var(--sand-2); border-color: var(--gold); }

/* ---------- v3: language, itineraries, planner, stop picking ---------- */
.lang-btn { border: 1px solid rgba(255,255,255,.35); background: transparent; color: #fff; border-radius: 999px; padding: 6px 14px; font-weight: 600; margin-inline-start: 8px; }
.topbar { gap: 8px; }
.topbar .brand { margin-inline-end: auto; }
html[dir="rtl"] body { font-family: Cairo, Inter, system-ui, sans-serif; }
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 { font-family: Cairo, Fraunces, Georgia, serif; }
.card-link { text-decoration: none; display: flex; flex-direction: column; flex: 1; }
.fav { right: auto; inset-inline-end: 10px; }
.meta a.pill { text-decoration: none; }
.small { font-size: .85rem; }
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .88rem; }
.hours { background: var(--sand-2); border-radius: 8px; padding: 10px 14px; }
.warn { color: #b0442b; }

.itin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-bottom: 20px; }
.itin-card { display: flex; flex-direction: column; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.itin-art { height: 120px; background: linear-gradient(135deg, var(--nile), var(--gold)) center / cover; position: relative; }
.itin-art .pill { position: absolute; top: 10px; inset-inline-start: 10px; background: rgba(255,255,255,.92); color: #1d2733; }
.itin-card .body { padding: 12px 14px; }
.itin-card h3 { font-size: 1.05rem; margin: 0 0 4px; }
.itin-card p { margin: 0; font-size: .88rem; }
.itin-day .tip { margin: 0; }
.small-btn { padding: 8px 14px; font-size: .85rem; }

.planner { margin-bottom: 8px; }
.planner-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; }
.planner-head select { font: inherit; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.days { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 12px; }
.day { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--sand); }
.day h3 { font-size: 1rem; margin: 0 0 6px; }
.day ol { margin: 0 0 12px; padding-inline-start: 20px; }
.day li { margin: 3px 0; }
.day a { text-decoration: none; }

.pick-hint { font-size: .88rem; color: var(--muted); margin: 6px 0; }
.timeline li { padding-inline-start: 44px; }
.timeline li.stop, .timeline li.night, .timeline li.empty-road, .timeline li.muted { padding-inline-start: 12px; }
.timeline .pick { position: absolute; inset-inline-start: 10px; top: 14px; }
.timeline .pick input { width: 22px; height: 22px; accent-color: var(--nile-2); cursor: pointer; }
.timeline li.picked { background: color-mix(in srgb, var(--nile-2) 10%, transparent); border-radius: 10px; }
.timeline.inner li { padding-inline-start: 44px; }
.pin.picked { outline: 3px solid var(--nile-2); outline-offset: 2px; transform: rotate(-45deg) scale(1.15); }
.pick-bar {
  position: sticky; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); z-index: 1001; margin-top: 16px;
  background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0,0,0,.12);
}
@media (min-width: 1050px) { .pick-bar { bottom: 0; } }
.pick-bar .wrap { display: flex; align-items: center; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
.pick-info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pick-info #pick-names { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-bar:not(.has-picks) #pick-clear { display: none; }
html[dir="rtl"] .timeline { border-left: 0; border-right: 3px solid var(--line); padding: 0 18px 0 0; }
html[dir="rtl"] .timeline li::before { left: auto; right: -26px; }
html[dir="rtl"] .timeline li.stop::before { right: -27px; }
html[dir="rtl"] .timeline.inner { border-right: 0; padding: 0; }
html[dir="rtl"] .tip { border-left: 0; border-right: 4px solid var(--gold); }
html[dir="rtl"] .search { padding: 6px 18px 6px 6px; }
.tabbar a span.label { font-size: .66rem; filter: none; opacity: 1; }
.pick-info strong { white-space: nowrap; }
@media (max-width: 480px) { .pick-bar .btn { padding: 9px 12px; } #pick-names { display: none; } }

/* ---------- v4: seasons, events, trip tools, offline ---------- */
.season { margin: 14px 0; }
.season h3 { font-size: 1rem; margin: 0 0 8px; }
.months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 3px; margin-bottom: 6px; }
.months span { text-align: center; font-size: .7rem; padding: 6px 0; border-radius: 6px; background: var(--sand-2); color: var(--muted); }
.months span.good { background: color-mix(in srgb, #3f8a4e 75%, transparent); color: #fff; font-weight: 600; }
.months span.now { outline: 2px solid var(--ink); outline-offset: 1px; }
.event { margin-top: 14px; }
.event.soon { border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 40%, transparent); }
.event h3 { margin: 6px 0 4px; font-size: 1.05rem; }
.event a { color: var(--accent); font-weight: 600; text-decoration: none; }
.event-when { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.event-banner { display: inline-block; margin: 0 0 14px; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,.18); color: #fff; text-decoration: none; font-weight: 600; }
.trip-tools { display: grid; gap: 12px; margin-bottom: 16px; }
@media (min-width: 900px) { .trip-tools { grid-template-columns: 1fr 1fr; } }
.trip-tools h3 { margin: 0 0 10px; font-size: 1.05rem; }
.tool-row { display: flex; flex-wrap: wrap; gap: 12px; }
.tool-row label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); }
.tool-row input { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); width: 150px; }
.offline-box { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ok { color: #2e7d3e; margin: 0 0 8px; }
.offline-note { background: #fff1cc; color: #7a5300; padding: 10px 14px; border-radius: 10px; margin: 16px 0 0; }
.fuel-toggle { display: flex; gap: 6px; align-items: center; padding: 8px 6px 2px; }
.timeline li.fuel { padding-inline-start: 12px; }
.timeline li.fuel::before { background: #d0643a; width: 9px; height: 9px; top: 15px; }
.timeline li.fuel-gap { padding-inline-start: 12px; }
.timeline li.fuel-gap::before { background: #b0442b; }
.timeline li.fuel-gap strong { color: #b0442b; }
.trips-saved { margin-bottom: 20px; }
.trips-saved h2 { font-size: 1.15rem; }
.trip-list { list-style: none; margin: 0; padding: 0; }
.trip-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.trip-list li a { font-weight: 600; color: var(--accent); text-decoration: none; flex: 1; min-width: 180px; }

/* ---------- road trip search boxes ---------- */
.suggest { position: relative; }
.suggest input { width: 100%; padding-inline-end: 36px; }
.suggest-clear { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); border: 0; background: transparent; color: #5d6673; font-size: 1rem; padding: 6px; visibility: hidden; }
.suggest-list {
  display: none; position: absolute; z-index: 1100; inset-inline: 0; top: calc(100% + 4px); margin: 0; padding: 4px 0; list-style: none;
  background: #fff; color: #1d2733; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); max-height: 320px; overflow-y: auto;
}
.suggest-list.open { display: block; }
.suggest-list li { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; font-size: .95rem; }
.suggest-list li + li { border-top: 1px solid #eee5d3; }
.suggest-list li.active, .suggest-list li:hover { background: #f3ead8; }
.suggest-list .ic { flex: none; font-size: 1.1rem; }
.suggest-list .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-list .alt { flex: none; font-size: .8rem; color: #5d6673; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest-list .none { cursor: default; }

/* ---------- v5: multi-stop form, day plan, budget, journal, reviews, badges, hub ---------- */
.via-list { display: grid; gap: 10px; }
.via-row { display: flex; align-items: flex-end; gap: 6px; }
.via-row label { flex: 1; min-width: 0; }
.via-btns { display: flex; gap: 4px; padding-bottom: 2px; }
.icon-btn { width: 38px; height: 40px; border-radius: 10px; border: 0; background: rgba(255,255,255,.18); color: #fff; font-size: 1rem; }
.trip-form #add-stop, .trip-form #round-trip { justify-self: start; }
@media (min-width: 900px) { .trip-form { grid-template-columns: 1fr 1fr; } .trip-form .via-list { grid-column: 1 / -1; } }
.day-plan { margin: 16px 0; }
.plan-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.plan-head h2 { margin: 0; }
.plan-head select, .tool-row select { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
#day-plan { display: grid; gap: 12px; margin: 12px 0; }
@media (min-width: 900px) { #day-plan { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); } }
.day-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--sand); display: flex; flex-direction: column; gap: 6px; }
.day-top { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.day-route { font-family: Fraunces, Georgia, serif; font-size: 1.1rem; }
html[dir="rtl"] .day-route { font-family: Cairo, sans-serif; }
.day-stops { margin: 0; padding-inline-start: 20px; }
.day-stops a, .day-card p a { color: var(--accent); text-decoration: none; font-weight: 600; }
.day-card .btn { align-self: flex-start; }
.weather { font-size: .88rem; }
.budget { width: 100%; border-collapse: collapse; font-size: .92rem; margin-top: 8px; }
.budget td { padding: 4px 0; border-bottom: 1px solid var(--line); }
.budget td:last-child { text-align: end; font-weight: 600; }
.budget tr.total td { font-size: 1.05rem; border-bottom: 2px solid var(--ink); }
.trip-tools textarea, .review-panel textarea, .contact-form input, .contact-form select {
  width: 100%; font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); margin: 6px 0;
}
.file-btn { cursor: pointer; }
.journal-item { border-top: 1px solid var(--line); padding: 8px 0; }
.journal-item p { margin: 4px 0; }
.journal-item img, #review-img { max-width: 100%; border-radius: 10px; margin-top: 6px; }
.link-btn { border: 0; background: none; color: var(--muted); text-decoration: underline; padding: 0; }
.safety-list { list-style: none; padding: 0; margin: 6px 0; font-size: .88rem; }
.safety-list li { padding: 3px 0; }
.safety-list .km { font-weight: 600; color: var(--accent); margin-inline-end: 6px; }
.review-panel { margin-top: 14px; }
.stars { display: flex; gap: 4px; }
.stars button { border: 0; background: none; font-size: 1.8rem; color: var(--gold); padding: 0 2px; cursor: pointer; }
.hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 8px 0 24px; }
.hub-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-decoration: none; box-shadow: var(--shadow); }
.hub-card .ic { font-size: 1.8rem; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 16px 12px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); opacity: .75; }
.badge.earned { opacity: 1; border-color: var(--gold); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gold) 40%, transparent); }
.badge-ic { font-size: 2.4rem; filter: grayscale(1); }
.badge.earned .badge-ic { filter: none; }
.bar { width: 100%; height: 6px; border-radius: 99px; background: var(--sand-2); overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--gold); }
.badge-link { display: block; margin-bottom: 16px; padding: 12px 16px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.tips { padding-inline-start: 20px; }
.tips li { margin: 6px 0; }
.notice { margin: 14px 0; border-style: dashed; }
.contact-form { display: grid; gap: 4px; max-width: 520px; }
.contact { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.contact .actions { margin: 0; }

@media print {
  .topbar, .tabbar, .trip-head, .trip-layout, .pick-bar, .trip-tools, .offline-box, .day-plan .actions, .day-card .btn { display: none !important; }
  body { background: #fff; color: #000; }
  main { padding: 0; }
  .day-card { break-inside: avoid; }
}

/* ---------- music & audio briefs ---------- */
.listen-panel { margin-top: 14px; }
.listen-panel h3 { margin: 16px 0 6px; font-size: 1rem; }
.tracks { list-style: none; margin: 0; padding: 0; }
.track { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.track > div:first-child { flex: 1; min-width: 200px; }
.track-links { display: flex; gap: 10px; align-items: center; }
.track-links a { color: var(--accent); font-weight: 600; text-decoration: none; font-size: .88rem; white-space: nowrap; }
.brief-btn { border: 0; background: var(--sand-2); border-radius: 999px; padding: 2px 8px; cursor: pointer; font-size: .85rem; }
[data-brief].playing { background: var(--gold); color: #fff; }
.day-music summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .9rem; }

/* ---------- v7: Nile planner, road alerts, surprise ---------- */
.cruise-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.cruise-top { display: flex; gap: 10px; align-items: flex-start; }
.cruise-top .ic { font-size: 2rem; }
.cruise-top h3 { margin: 0 0 4px; font-size: 1.05rem; }
.cruise a { color: var(--accent); text-decoration: none; }
.cruise .btn { color: var(--ink); }
.felucca-form { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.felucca-form select, .felucca-form input { font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.big-time { font-size: 1.5rem; font-weight: 700; margin: 0 0 6px; }
.sun-table { width: 100%; max-width: 520px; border-collapse: collapse; margin-top: 12px; font-size: .92rem; }
.sun-table th, .sun-table td { text-align: start; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.alert-item { border-top: 1px solid var(--line); padding: 8px 0; display: flex; flex-direction: column; gap: 2px; }
.alert-item .actions { margin: 4px 0 0; }
.alert-pin { width: 30px; height: 30px; border-radius: 50%; background: #fff; border: 2px solid #b0442b; display: grid; place-items: center; font-size: 16px; box-shadow: 0 2px 6px rgba(0,0,0,.3); }
#alert-note { width: 100%; font: inherit; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); margin: 6px 0; }
.surprise-btn { margin: 0 0 14px; background: rgba(255,255,255,.18); color: #fff; border-color: rgba(255,255,255,.4); }
.surprise-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; justify-content: space-between; margin: 16px 0 0; padding: 12px 16px; border-radius: var(--radius); background: color-mix(in srgb, var(--gold) 20%, var(--card)); border: 1px solid var(--gold); font-weight: 600; }

/* search lists: room to scroll above the phone keyboard */
.suggest-list { max-height: 45vh; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
body.suggest-open main { padding-bottom: 75vh; }
.narration { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.narration .recording { background: #b0442b; color: #fff; border-color: #b0442b; }
.rec-script { background: var(--sand-2); border-radius: 8px; padding: 10px 12px; line-height: 1.8; }

/* ---------- v8: tickets, photo spots, tags, prayer, currency ---------- */
.tickets, .photo-tip { margin: 14px 0; padding: 12px 14px; border-radius: 10px; background: var(--sand-2); }
.tickets h3, .photo-tip h3 { margin: 0 0 8px; font-size: 1rem; }
.photo-tip p { margin: 0 0 8px; }
.ticket-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.ticket-table th, .ticket-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: start; }
.ticket-table td:not(:first-child), .ticket-table th:not(:first-child) { text-align: end; }
.pill.tag { background: rgba(255,255,255,.18); color: inherit; }
.card .pill.tag { background: var(--sand-2); }
.tag-chips { padding-top: 0; }
.prayer-grid { display: grid; gap: 14px; margin-top: 12px; }
@media (min-width: 800px) { .prayer-grid { grid-template-columns: 1fr 1fr; } }
.prayer-table { width: 100%; border-collapse: collapse; font-size: 1.05rem; }
.prayer-table td { padding: 10px 6px; border-bottom: 1px solid var(--line); }
.prayer-table td:last-child { text-align: end; font-weight: 600; }
.prayer-table tr.next td { color: var(--accent); font-weight: 700; }
.qibla { text-align: center; }
.compass { display: grid; place-items: center; margin: 10px 0; }
.dial { position: relative; width: 220px; height: 220px; border-radius: 50%; border: 3px solid var(--line); background: radial-gradient(circle, var(--card) 60%, var(--sand-2)); transition: transform .2s linear; }
.dial .n { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); font-weight: 700; color: #b0442b; }
.needle { position: absolute; inset: 0; display: flex; justify-content: center; font-size: 2rem; transform-origin: 50% 50%; }
.needle::before { content: ""; position: absolute; top: 40px; bottom: 50%; width: 4px; background: var(--nile-2); border-radius: 2px; }
.converter { max-width: 560px; }
.conv-row { display: flex; flex-wrap: wrap; gap: 8px; }
.conv-row input, .conv-row select { font: inherit; font-size: 1.1rem; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.conv-row input { flex: 1; min-width: 120px; }

/* ---------- v10: hieroglyphs, quick planner, reminders ---------- */
.glyph-search { max-width: 520px; border: 1px solid var(--line); box-shadow: none; }
.cartouche-wrap { display: flex; justify-content: center; margin: 24px 0; }
.cartouche { font-family: "Noto Sans Egyptian Hieroglyphs", serif; font-size: 3.4rem; color: var(--nile); background: var(--card);
  border: 6px solid #8a5a2b; border-radius: 80px; padding: 18px 40px; min-height: 120px; display: flex; align-items: center; justify-content: center;
  position: relative; letter-spacing: .05em; direction: ltr; max-width: 100%; overflow-wrap: anywhere; }
.cartouche::after { content: ""; position: absolute; inset-inline-end: -18px; top: 20%; bottom: 20%; width: 6px; background: #8a5a2b; border-radius: 3px; }
.glyph-alpha { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; margin-top: 10px; }
.glyph-alpha span { display: flex; flex-direction: column; align-items: center; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; font-family: "Noto Sans Egyptian Hieroglyphs", serif; font-size: 1.6rem; }
.glyph-alpha b { font-family: Inter, sans-serif; font-size: .8rem; color: var(--muted); }
.quick-form { display: grid; gap: 10px; }
.quick-form label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
.quick-form input { font: inherit; font-size: 1rem; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); width: 100%; }
.quick-form .chips label { flex-direction: row; color: var(--ink); cursor: pointer; }
.quick-list { padding-inline-start: 20px; }
.quick-list li { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--line); }
.quick-list .km { font-size: .78rem; font-weight: 600; color: var(--accent); }
.quick-list a { text-decoration: none; }
.nearby-toggle { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; }
.toast { position: fixed; z-index: 2000; left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + 16px); background: var(--nile); color: #fff; padding: 12px 16px; border-radius: 12px; text-decoration: none; box-shadow: var(--shadow); }
@media (min-width: 1050px) { .toast { left: auto; width: 380px; bottom: 24px; } }
select.lang-btn { appearance: none; -webkit-appearance: none; cursor: pointer; font: inherit; font-weight: 600; max-width: 110px; }
select.lang-btn option { color: #222; background: #fff; }
