:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --ink: #1d1d1f;
  --ink2: #6e6e73;
  --line: rgba(0,0,0,.08);
  --accent: #0a7e94;        /* lake teal, Apple-muted */
  --accent-ink: #08616f;
  --sun: #f0a04b;
  --star: #ff9f0a;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
  --blur: saturate(180%) blur(20px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --card: #1c1c1e; --ink: #f5f5f7; --ink2: #98989d;
    --line: rgba(255,255,255,.12);
    --accent: #4cc4d8; --accent-ink: #7fd6e6;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.5);
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: clamp(300px, 46vw, 460px);
  display: flex; align-items: flex-end;
  padding: 24px 20px calc(26px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  /* Guest's own cottage photo; lake gradient shows if it ever fails to load. */
  background-color: #0a3540;
  background-image: url('assets/hero.jpeg'), linear-gradient(160deg, #0f6b7e, #0a3540);
  background-size: cover; background-position: center 38%;
  color: #fff;
}
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.10) 0%, rgba(0,0,0,.55) 100%);
}
.hero-text { position: relative; z-index: 1; }
.hero-eyebrow { margin: 0 0 6px; font-size: .8rem; font-weight: 600; opacity: .92; letter-spacing: 0; }
.hero h1 { margin: 0; font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; }
.hero-sub { margin: 6px 0 0; font-size: .95rem; opacity: .9; }

/* ---------- Toolbar ---------- */
.toolbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border-bottom: .5px solid var(--line);
  padding: 10px 14px 8px;
}
.toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }

.segment {
  display: inline-flex; background: color-mix(in srgb, var(--ink2) 30%, transparent);
  border-radius: 12px; padding: 3px; gap: 2px;
}
.seg-btn {
  border: 0; background: transparent; color: var(--ink); font-family: var(--font);
  font-weight: 600; font-size: .95rem; padding: 9px 20px; border-radius: 9px; cursor: pointer;
  transition: all .18s; display: inline-flex; align-items: center; gap: 6px;
}
.seg-btn.active { background: var(--accent); color: #fff; box-shadow: 0 1px 5px rgba(0,0,0,.22); }

.surprise {
  border: 0; background: var(--accent); color: #fff; font-family: var(--font);
  font-weight: 600; font-size: .88rem; padding: 8px 14px; border-radius: 999px; cursor: pointer;
  transition: transform .12s, opacity .2s;
}
.surprise:active { transform: scale(.93); }

/* Wrapping category pills — no horizontal scroll */
.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: .5px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: 6px 12px; font-size: .82rem; font-weight: 500;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px;
  transition: all .18s; line-height: 1;
}
.chip .emoji { font-size: .95rem; }
.chip:hover { border-color: var(--accent); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* Cuisine sub-filter (appears under chips when Food is selected) */
.subchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.subchips.hidden { display: none; }
.subchip {
  border: .5px solid var(--line); background: var(--card); color: var(--ink2);
  border-radius: 999px; padding: 5px 11px; font-size: .78rem; font-weight: 500;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: all .16s;
}
.subchip:hover { border-color: var(--sun); }
.subchip.active { background: var(--sun); border-color: var(--sun); color: #4a2c12; font-weight: 600; }

.sliderrow { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.slider-label { font-size: .82rem; color: var(--ink2); }
.slider-val { font-size: .82rem; color: var(--accent-ink); min-width: 86px; }
#driveSlider { flex: 1; accent-color: var(--accent); height: 4px; }
.resultcount { margin: 8px 2px 0; font-size: .74rem; color: var(--ink2); }

/* ---------- List ---------- */
main { position: relative; }
.listview {
  display: grid; gap: 10px; padding: 16px 14px 90px;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  max-width: 1100px; margin: 0 auto;
}

/* ---------- Cards (compact rows) ---------- */
.card {
  display: flex; align-items: center; gap: 13px;
  background: var(--card); border-radius: 16px; padding: 11px 13px;
  box-shadow: var(--shadow); cursor: pointer; border: .5px solid var(--line);
  transition: transform .12s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 12px 26px rgba(0,0,0,.10); }
.card:active { transform: scale(.99); }
.card-icon {
  flex: none; width: 56px; height: 56px; border-radius: 15px;
  display: grid; place-items: center; font-size: 1.7rem; color: #fff;
  box-shadow: inset 0 0 0 .5px rgba(255,255,255,.18);
}
.card-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.card-title { font-size: 1rem; font-weight: 600; margin: 0; letter-spacing: -0.02em; line-height: 1.25; }
.card-sub { font-size: .8rem; color: var(--ink2); margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: .78rem; color: var(--ink2); margin-top: 1px; }
.meta-pill { display: inline-flex; align-items: center; gap: 3px; }
.dot { opacity: .45; }
.rating { color: var(--ink); font-weight: 600; }
.rating .star { color: var(--star); }
.badge-miss {
  background: color-mix(in srgb, var(--star) 20%, transparent); color: var(--star);
  font-size: .64rem; font-weight: 800; letter-spacing: .2px;
  padding: 3px 7px; border-radius: 999px; text-transform: uppercase; white-space: nowrap;
}

.empty { text-align: center; color: var(--ink2); padding: 60px 20px; grid-column: 1/-1; }
.empty .big { font-size: 3rem; }

/* ---------- Map ---------- */
.mapview { position: fixed; inset: 0; top: auto; }
.mapview:not(.hidden) { position: relative; height: calc(100vh - 60px); }
#map { position: absolute; inset: 0; }
.hidden { display: none !important; }
.recenter {
  position: absolute; right: 16px; bottom: 28px; z-index: 500;
  width: 48px; height: 48px; border-radius: 50%; border: .5px solid var(--line);
  background: var(--card); color: var(--ink); font-size: 1.3rem; box-shadow: var(--shadow); cursor: pointer;
}
.leaflet-popup-content-wrapper { border-radius: 16px; }
.leaflet-popup-content { margin: 0; width: 200px !important; }
.pop-photo { height: 92px; background-size: cover; background-position: center; border-radius: 16px 16px 0 0; }
.pop-in { padding: 10px 12px 12px; }
.pop-title { font-weight: 600; font-size: .92rem; margin: 0 0 3px; color: var(--ink); }
.pop-meta { font-size: .72rem; color: var(--ink2); margin: 0 0 9px; }
.pop-actions { display: flex; gap: 6px; }
.pop-actions a { flex: 1; text-align: center; font-size: .74rem; font-weight: 600; text-decoration: none; padding: 7px; border-radius: 9px; }
.house-dot { background: var(--sun); width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--sun), 0 1px 4px rgba(0,0,0,.4); }

/* ---------- Detail sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 100; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.sheet-card {
  position: absolute; left: 0; right: 0; bottom: 0; background: var(--card);
  border-radius: 26px 26px 0 0; max-height: 92vh; overflow-y: auto;
  box-shadow: 0 -4px 40px rgba(0,0,0,.3); animation: slideup .28s cubic-bezier(.2,.8,.2,1);
  max-width: 640px; margin: 0 auto;
}
@keyframes slideup { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--ink2); opacity: .35; margin: 9px auto 0; }
.sheet-close {
  position: absolute; top: 14px; right: 14px; z-index: 2; border: 0;
  background: color-mix(in srgb, #000 40%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: #fff; width: 32px; height: 32px; border-radius: 50%; font-size: .9rem; cursor: pointer;
}
.s-photo { position: relative; aspect-ratio: 16/9; background-size: cover; background-position: center; display: grid; place-items: center; }
.s-photo .ph-emoji { font-size: 4rem; filter: drop-shadow(0 2px 8px rgba(0,0,0,.2)); }
.credit {
  position: absolute; bottom: 5px; right: 7px;
  font-size: 9px; line-height: 1; color: #fff; opacity: .75;
  text-shadow: 0 1px 1px rgba(0,0,0,.5);
}
.s-content { padding: 18px 20px calc(28px + env(safe-area-inset-bottom)); }
.s-content h2 { margin: 0 0 4px; font-size: 1.55rem; font-weight: 700; letter-spacing: -0.03em; }
.s-cat { color: var(--ink2); font-size: .85rem; margin: 0 0 14px; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.s-desc { font-size: 1rem; line-height: 1.55; margin: 0 0 20px; color: var(--ink); }
.s-actions { display: flex; gap: 10px; }
.btn {
  flex: 1; text-align: center; text-decoration: none; font-weight: 600; font-size: .95rem;
  padding: 13px; border-radius: 13px; cursor: pointer; border: 0; font-family: var(--font);
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-tinted { background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-ink); }

/* ---------- Suggest a spot ---------- */
.fab-suggest {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 40;
  border: 0; background: var(--accent); color: #fff; font-family: var(--font);
  font-weight: 600; font-size: .92rem; padding: 12px 20px; border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0,0,0,.22); cursor: pointer;
  transition: transform .12s, opacity .2s;
}
.fab-suggest:active { transform: translateX(-50%) scale(.95); }
.fab-suggest.hidden { display: none; }

.reco-intro { font-size: .95rem; line-height: 1.5; color: var(--ink2); margin: 0 0 18px; }
.reco-form { display: flex; flex-direction: column; gap: 14px; }
.reco-field { display: flex; flex-direction: column; gap: 6px; }
.reco-field > span { font-size: .82rem; font-weight: 600; color: var(--ink); }
.reco-field em { color: var(--accent-ink); font-style: normal; }
.reco-field em.muted { color: var(--ink2); font-weight: 400; }
.reco-field input,
.reco-field select,
.reco-field textarea {
  font-family: var(--font); font-size: 1rem; color: var(--ink);
  background: color-mix(in srgb, var(--ink2) 10%, transparent);
  border: .5px solid var(--line); border-radius: 12px; padding: 12px 13px;
  -webkit-appearance: none; appearance: none; width: 100%;
}
.reco-field textarea { resize: vertical; min-height: 64px; }
.reco-field input:focus,
.reco-field select:focus,
.reco-field textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.reco-form .s-actions { margin-top: 4px; }
#recoSubmit[disabled] { opacity: .55; cursor: default; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  background: color-mix(in srgb, var(--ink) 92%, transparent); color: var(--bg);
  padding: 11px 20px; border-radius: 999px; font-size: .88rem; font-weight: 600; z-index: 200;
  box-shadow: var(--shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  animation: pop .2s ease;
}
@keyframes pop { from { transform: translate(-50%, 12px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
