/* Phone-first, one column, one set of components.
   Calm neutrals, one teal accent for actions, saffron only for "live". */
:root {
  --bg: #f4f4f1;
  --surface: #ffffff;
  --surface-2: #ececE8;
  --ink: #15171a;
  --muted: #62666d;
  --line: #e2e2dd;
  --accent: #0b7a75;
  --accent-ink: #ffffff;
  --accent-soft: #e1f1ef;
  --live: #c98a00;
  --live-ink: #ffffff;
  --warn-bg: #fff6dc;
  --warn-ink: #6b4d00;
  --sea: #cde3e6;
  --land: #f1eee6;
  --road: #e0b27c;
  --c-coffee: #8a5a2b; --c-quick: #d0661f; --c-restaurants: #2f8a5b; --c-bars: #7a45a8;
  --c-everyday: #6b7280; --c-sights: #1f63b5; --c-daytrips: #0b7a75; --c-hotel: #15171a;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --maxw: 640px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1012; --surface: #181b1e; --surface-2: #23272b; --ink: #f1f2f3; --muted: #9aa1a9; --line: #2b3035;
    --accent: #3fc2b9; --accent-ink: #062321; --accent-soft: #11302e; --live: #f0b429; --live-ink: #1d1400;
    --warn-bg: #2f2711; --warn-ink: #f3d68b; --sea: #12262a; --land: #1c1f22; --road: #7b5a33;
    --c-coffee: #c8925c; --c-quick: #f08a45; --c-restaurants: #5cc48c; --c-bars: #b98be3;
    --c-everyday: #a3a9b1; --c-sights: #6aa8f0; --c-daytrips: #3fc2b9; --c-hotel: #f1f2f3;
    --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1012; --surface: #181b1e; --surface-2: #23272b; --ink: #f1f2f3; --muted: #9aa1a9; --line: #2b3035;
  --accent: #3fc2b9; --accent-ink: #062321; --accent-soft: #11302e; --live: #f0b429; --live-ink: #1d1400;
  --warn-bg: #2f2711; --warn-ink: #f3d68b; --sea: #12262a; --land: #1c1f22; --road: #7b5a33;
  --c-coffee: #c8925c; --c-quick: #f08a45; --c-restaurants: #5cc48c; --c-bars: #b98be3;
  --c-everyday: #a3a9b1; --c-sights: #6aa8f0; --c-daytrips: #3fc2b9; --c-hotel: #f1f2f3;
  --shadow: none; color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3, p, dl, dd { margin: 0; }
a { color: var(--accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 20; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }

/* ---------- Shell ---------- */
.appbar {
  position: sticky; top: 0; z-index: 10;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.appbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: var(--maxw); margin: 0 auto; }
.theme-toggle { display: grid; place-items: center; width: 36px; height: 36px; margin: -6px -6px -6px 0; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme-toggle .i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .i-moon { display: none; }
:root[data-theme-now="light"] .theme-toggle .i-sun { display: none; }
:root[data-theme-now="light"] .theme-toggle .i-moon { display: block; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 0.95rem; letter-spacing: -0.01em; }
.brand span { color: var(--muted); font-weight: 500; }
.brand-mark { width: 10px; height: 10px; border-radius: 3px; background: var(--accent); transform: rotate(45deg); }
main {
  max-width: var(--maxw); margin: 0 auto; outline: none;
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) calc(96px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display: grid; gap: 20px; align-content: start;
}
main > * { min-width: 0; }
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 10; display: grid; grid-template-columns: repeat(4, 1fr);
  padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 0; color: var(--muted); text-decoration: none; font-size: 0.72rem; font-weight: 500; }
.tabbar a .i { width: 24px; height: 24px; }
.tabbar a[aria-current] { color: var(--accent); font-weight: 600; }
@media (min-width: 700px) { .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: min(var(--maxw), 100%); bottom: 12px; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 6px 24px rgb(0 0 0 / 0.08); } }

/* ---------- Page header ---------- */
.page-head { display: grid; gap: 6px; padding-top: 12px; }
.page-head h1 { font-size: 1.85rem; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; text-wrap: balance; }
.page-head.hero h1 { font-size: 2.2rem; }
.page-sub { color: var(--muted); }
.page-sub strong { color: var(--ink); font-weight: 600; }
.eyebrow { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.back { display: inline-flex; align-items: center; gap: 2px; margin: 4px 0 -8px -6px; padding: 6px; color: var(--accent); text-decoration: none; font-weight: 500; justify-self: start; }
.body { font-size: 1.02rem; line-height: 1.65; }

/* ---------- Groups and rows (the main building block) ---------- */
.group { display: grid; gap: 8px; scroll-margin-top: 72px; }
.group-title { font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 0 4px; }
.group-more { justify-self: end; font-size: 0.9rem; font-weight: 600; text-decoration: none; padding: 2px 4px; }
.list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.list li + li .row { border-top: 1px solid var(--line); }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; color: var(--ink); text-decoration: none; min-height: 56px; }
.row:hover { background: var(--surface-2); }
.row:active { background: var(--surface-2); }
.row-lead { flex: none; width: 64px; display: grid; gap: 2px; font-weight: 600; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.row-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.row-title { font-weight: 600; line-height: 1.3; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 1px; }
.tag { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.02em; line-height: 1; padding: 3px 6px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); white-space: nowrap; }
.row-sub { color: var(--muted); font-size: 0.86rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row-meta { flex: none; max-width: 32%; color: var(--muted); font-size: 0.78rem; text-align: right; }
.row .i { color: var(--muted); width: 18px; height: 18px; }
.party { color: var(--live); }
.live { justify-self: start; font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; padding: 1px 6px; border-radius: 999px; background: var(--live); color: var(--live-ink); }


/* ---------- Cards, facts, actions ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px; box-shadow: var(--shadow); }
.facts div, .info div { display: grid; grid-template-columns: 112px 1fr; gap: 12px; padding: 12px 0; }
.facts div + div, .info div + div { border-top: 1px solid var(--line); }
.facts dt, .info dt { color: var(--muted); font-size: 0.9rem; }
.facts dd { font-weight: 500; }
.info div { grid-template-columns: 1fr; gap: 2px; }
.info dt { color: var(--ink); font-weight: 600; font-size: 0.95rem; }
.info dd { color: var(--muted); font-size: 0.93rem; line-height: 1.5; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 0.92rem var(--font); text-decoration: none; text-align: center; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--warn-bg); color: var(--warn-ink); font-size: 0.88rem; line-height: 1.45; }
.notice .i { width: 18px; height: 18px; margin-top: 1px; }
.tip { padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 0.95rem; }
.tip strong { color: var(--accent); margin-right: 6px; }
.foot-note { color: var(--muted); font-size: 0.85rem; padding: 0 4px; }
.empty { color: var(--muted); text-align: center; padding: 40px 16px; }

/* ---------- Filters ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 0.88rem; font-weight: 500; white-space: nowrap; }
.chip[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; padding: 3px; gap: 3px; background: var(--surface-2); border-radius: 12px; }
.seg a { text-align: center; padding: 8px 6px; border-radius: 9px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.9rem; }
.seg a[aria-current] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.search { display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; background: none; padding: 12px 0; font: inherit; color: var(--ink); outline: none; }

/* ---------- Today ---------- */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-tile { display: grid; gap: 2px; padding: 14px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.quick-tile strong { font-weight: 600; }
.quick-tile span { color: var(--muted); font-size: 0.84rem; }

/* ---------- Map ---------- */
.map { position: relative; height: min(60vh, 520px); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--land); }
.map-svg { width: 100%; height: 100%; display: block; touch-action: none; user-select: none; cursor: grab; }
.m-land { fill: var(--land); }
.m-sea { fill: var(--sea); }
.m-creek { fill: none; stroke: var(--sea); stroke-linecap: round; stroke-linejoin: round; }
.m-palm { fill: none; stroke: var(--land); stroke-linecap: round; stroke-linejoin: round; }
.m-road { fill: none; stroke: var(--road); stroke-linecap: round; stroke-linejoin: round; opacity: 0.7; }
.m-area { fill: var(--muted); font-family: var(--font); font-weight: 600; text-anchor: middle; opacity: 0.75; pointer-events: none; }
.pin { cursor: pointer; }
.pin .hit { fill: transparent; stroke: none; }
.pin circle:not(.hit) { stroke: var(--surface); }
.pin text { fill: var(--ink); font-family: var(--font); font-weight: 600; paint-order: stroke; stroke: var(--land); stroke-width: 0.3em; pointer-events: none; }
.pin.is-sel circle:not(.hit) { stroke: var(--ink); }
.pin-coffee circle:not(.hit) { fill: var(--c-coffee); }
.pin-quick circle:not(.hit) { fill: var(--c-quick); }
.pin-restaurants circle:not(.hit) { fill: var(--c-restaurants); }
.pin-bars circle:not(.hit) { fill: var(--c-bars); }
.pin-everyday circle:not(.hit) { fill: var(--c-everyday); }
.pin-sights circle:not(.hit) { fill: var(--c-sights); }
.pin-daytrips circle:not(.hit) { fill: var(--c-daytrips); }
.pin-hotel circle:not(.hit) { fill: var(--c-hotel); }
.map-ctrl { position: absolute; right: 10px; top: 10px; display: grid; gap: 6px; }
.map-ctrl button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 1.15rem; cursor: pointer; box-shadow: 0 1px 4px rgb(0 0 0 / 0.12); }
.map-note { position: absolute; left: 10px; bottom: 8px; font-size: 0.7rem; color: var(--muted); background: color-mix(in srgb, var(--surface) 85%, transparent); padding: 2px 8px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
.map-google { background: var(--surface); }
.map-loading { display: grid; place-items: center; }
.map-loading .map-note { position: static; }
.map-wrap { position: relative; }
.map-pick { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 2; }
.map-pick:empty { display: none; }
.map-pick .list { box-shadow: 0 4px 18px rgb(0 0 0 / 0.18); }
.pin-show circle:not(.hit) { fill: #c2410c; }
.show-badge { display: inline-grid; place-items: center; min-width: 40px; height: 26px; padding: 0 6px; border-radius: 13px; background: #c2410c; color: #fff; font-size: 0.7rem; font-weight: 800; letter-spacing: 0.04em; }
.rating { margin: 0 0 12px; font-weight: 600; }
.rating span[aria-hidden] { color: #e0a100; }
.rating .muted { font-weight: 400; color: var(--muted); }
