:root {
  --navy: #0B2E4A; --orange: #F59E0B; --orange-d: #D97706;
  --bg: #ffffff; --fg: #0B2E4A; --muted: #64748b; --line: #e5e7eb; --chip: #ffffff; --chip-on: #0B2E4A;
  --shadow: 0 6px 24px rgba(11, 46, 74, .18); --radius: 16px;
  --open: #16a34a; --closed: #dc2626;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15202b; --fg: #e8eef4; --muted: #9aa8b5; --line: #263443; --chip: #1c2a37; --chip-on: #F59E0B;
    --shadow: 0 6px 24px rgba(0, 0, 0, .45);
  }
}
:root[data-theme="dark"] {
  --bg: #15202b; --fg: #e8eef4; --muted: #9aa8b5; --line: #263443; --chip: #1c2a37; --chip-on: #F59E0B;
  --shadow: 0 6px 24px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #A8DCEF; color: var(--fg);
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif; }
#map { position: absolute; inset: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ── Top: search + chips ── */
.top { position: absolute; top: 0; left: 0; right: 0; z-index: 5; padding: max(12px, env(safe-area-inset-top)) 12px 0;
  pointer-events: none; }
.top > * { pointer-events: auto; }
.search { position: relative; display: flex; align-items: center; gap: 8px; max-width: 520px;
  background: var(--bg); border-radius: 28px; box-shadow: var(--shadow); padding: 6px 8px 6px 12px; }
.search-logo { flex: none; }
.search input { flex: 1; border: 0; outline: 0; background: transparent; color: var(--fg); font-size: 16px; padding: 8px 4px; min-width: 0; }
.search input::-webkit-search-cancel-button { display: none; } /* we have our own clear button */
.icon-btn { border: 0; background: transparent; font-size: 24px; line-height: 1; padding: 4px 8px; color: var(--muted); }
.results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px 0; list-style: none;
  background: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow); max-height: 60vh; overflow: auto; }
.results li { display: flex; gap: 10px; align-items: center; padding: 9px 14px; cursor: pointer; }
.results li:hover, .results li[aria-selected="true"] { background: rgba(245, 158, 11, .12); }
.results .ic { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; }
.results .t { font-weight: 600; }
.results .s { font-size: 13px; color: var(--muted); }
.results .d { margin-left: auto; font-size: 12px; color: var(--muted); white-space: nowrap; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 6px; scrollbar-width: none; max-width: 100%; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--chip); color: var(--fg); border-radius: 20px;
  padding: 7px 14px; font-size: 14px; font-weight: 500; box-shadow: 0 2px 6px rgba(0,0,0,.08); white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--chip-on); border-color: var(--chip-on); color: #fff; }
.chip.toggle[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: #111; }
.chip-sep { flex: none; width: 1px; background: var(--line); margin: 4px 2px; }

/* ── Floating buttons ── */
.fab-stack { position: absolute; right: 12px; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 4; display: grid; gap: 10px; }
.fab { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--bg); color: var(--fg);
  box-shadow: var(--shadow); display: grid; place-items: center; }
.fab.active { color: var(--orange-d); }
.menu { position: absolute; right: 68px; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 6; background: var(--bg);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 16px; display: grid; gap: 10px; font-size: 14px; }
.menu a { color: var(--orange-d); }

/* ── Bottom sheet (mobile) / side card (desktop) ── */
.sheet { position: absolute; z-index: 7; left: 0; right: 0; bottom: 0; max-height: 70vh; overflow: auto;
  background: var(--bg); border-radius: 20px 20px 0 0; box-shadow: var(--shadow);
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); animation: up .22s ease-out; }
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 10px; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 760px) {
  .sheet { left: 12px; right: auto; top: 140px; bottom: auto; width: 380px; max-height: calc(100vh - 160px); border-radius: var(--radius); }
  .sheet::before { display: none; }
  .fab-stack { bottom: 30px; }
}
.cover { width: calc(100% + 32px); margin: -8px -16px 12px; height: 160px; object-fit: cover; display: block; background: #dbe7ef; }
@media (min-width: 760px) { .cover { border-radius: var(--radius) var(--radius) 0 0; } }
.sheet h2 { margin: 0 0 2px; font-size: 20px; line-height: 1.25; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 14px; color: var(--muted); margin: 4px 0 8px; }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: rgba(11,46,74,.08); color: var(--fg); }
.badge.verified { background: rgba(22,163,74,.12); color: var(--open); }
.open { color: var(--open); font-weight: 600; } .closed { color: var(--closed); font-weight: 600; }
.star { color: var(--orange); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.btn { border: 0; border-radius: 22px; padding: 10px 16px; font-weight: 600; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; text-decoration: none; }
.btn.primary { background: var(--orange); color: #111; }
.btn.navy { background: var(--navy); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--fg); }
.close { position: absolute; top: 8px; right: 10px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 20px; line-height: 1; z-index: 1; }
.details { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; font-size: 14px; display: grid; gap: 8px; }
.details dl { display: grid; grid-template-columns: 90px 1fr; gap: 6px 10px; margin: 0; }
.details dt { color: var(--muted); }
.details dd { margin: 0; word-break: break-word; }
.details a { color: var(--orange-d); }
.gallery { display: flex; gap: 8px; overflow-x: auto; }
.gallery img { height: 90px; border-radius: 10px; }
.link { background: none; border: 0; color: var(--muted); font-size: 13px; text-decoration: underline; padding: 6px 0; }

/* ── Directions ── */
.modes { display: flex; gap: 6px; margin: 6px 0 10px; }
.modes button { flex: 1; border: 1px solid var(--line); background: var(--chip); border-radius: 12px; padding: 8px 4px; font-size: 13px; font-weight: 600; }
.modes button[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.summary { font-size: 22px; font-weight: 700; }
.steps { list-style: none; margin: 10px 0 0; padding: 0; font-size: 14px; }
.steps li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.steps .dist { margin-left: auto; color: var(--muted); white-space: nowrap; }
.from-to { font-size: 14px; display: grid; gap: 4px; }

/* ── Dialog + toast ── */
dialog { border: 0; border-radius: var(--radius); padding: 18px; width: min(420px, 92vw); background: var(--bg); color: var(--fg); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog h3 { margin: 0 0 4px; }
dialog select, dialog textarea { width: 100%; margin: 8px 0; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: inherit; }
dialog .row { display: flex; justify-content: flex-end; gap: 8px; }
.toast { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 9; background: var(--navy); color: #fff;
  padding: 10px 16px; border-radius: 22px; box-shadow: var(--shadow); font-size: 14px; max-width: 90vw; }
.maplibregl-ctrl-attrib { font-size: 11px; }
