:root {
  --green: #24584A;
  --green-dark: #173D33;
  --green-soft: #E3EEE9;
  --gold: #F4B23E;
  --gold-soft: #FDF0D6;
  --terra: #D2603A;
  --terra-soft: #FBE5DC;
  --cream: #FBF6EE;
  --card: #FFFFFF;
  --ink: #1E2724;
  --muted: #66706B;
  --line: #E7E0D4;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(30, 39, 36, .06), 0 4px 16px rgba(30, 39, 36, .06);
  --head: 'Fraunces', Georgia, serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 var(--body); color: var(--ink); background: var(--cream); }
a { color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); background: var(--green); color: #fff; }
.brand { white-space: nowrap; display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-family: var(--head); font-weight: 700; font-size: 1.3rem; }
.brand-mark { width: 32px; height: 32px; }
.top-nav { display: flex; gap: 6px; }
.nav-link { white-space: nowrap; color: #fff; text-decoration: none; font-weight: 600; font-size: .9rem; padding: 8px 12px; border-radius: 999px; }
.nav-link:hover { background: rgba(255, 255, 255, .12); }
.nav-add { background: var(--gold); color: var(--ink); }
.nav-add:hover { background: #ffc65e; }
@media (max-width: 420px) { .nav-add { padding: 8px 10px; } .nav-add .long { display: none; } .nav-link span { display: none; } .brand { font-size: 1.15rem; } }
@media (min-width: 421px) { .nav-add .short { display: none; } }

/* ---------- finder ---------- */
.finder { background: var(--green); color: #fff; padding: 4px 16px 18px; border-radius: 0 0 24px 24px; }
.finder h1 { font-size: clamp(1.6rem, 5vw, 2.3rem); color: #fff; margin: 6px 0 12px; }
.finder h1 em { font-style: normal; color: var(--gold); }
.search { display: flex; gap: 8px; }
.search input { flex: 1; min-width: 0; padding: 13px 16px; border-radius: 999px; border: 0; background: #fff; color: var(--ink); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 16px; border-radius: 999px; border: 0; font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-green { background: var(--green); color: #fff; }
.btn-ghost { background: transparent; color: var(--green); border: 1.5px solid var(--green); }
.btn-light { background: #fff; color: var(--green); border: 1.5px solid var(--line); }
.btn-sm { padding: 8px 12px; font-size: .9rem; }
.btn[disabled] { opacity: .6; cursor: default; }
.place { margin-top: 10px; font-size: .92rem; color: #d6e6df; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.place strong { color: #fff; }
.place select { background: rgba(255, 255, 255, .14); color: #fff; border: 0; border-radius: 999px; padding: 5px 10px; }
.place select option { color: var(--ink); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.controls { padding: 14px 0 4px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; font-size: .9rem; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-when[aria-pressed="true"] { background: var(--green); border-color: var(--green); }

.special { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; margin: 4px 0 12px; padding: 12px 14px; border-radius: var(--radius);
  border: 0; background: linear-gradient(110deg, #B83A2E, var(--terra)); color: #fff; box-shadow: var(--shadow); }
.special .ico { font-size: 1.7rem; }
.special strong { display: block; font-family: var(--head); font-size: 1.1rem; }
.special small { opacity: .9; }
.special[aria-pressed="true"] { outline: 3px solid var(--gold); }

.bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 4px 0 10px; }
.count { font-weight: 600; color: var(--muted); font-size: .92rem; }
.toggle { display: inline-flex; background: #fff; border: 1.5px solid var(--line); border-radius: 999px; padding: 3px; }
.toggle button { border: 0; background: transparent; padding: 6px 14px; border-radius: 999px; font-weight: 600; font-size: .9rem; }
.toggle button[aria-pressed="true"] { background: var(--green); color: #fff; }

/* ---------- results ---------- */
.results { display: grid; grid-template-columns: 1fr; gap: 16px; padding-bottom: 32px; }
.list { display: grid; gap: 12px; align-content: start; }
.map { height: 62vh; min-height: 360px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: var(--green-soft); }
.map-off { display: flex; align-items: center; justify-content: center; color: var(--muted); text-align: center; padding: 20px; }
@media (min-width: 960px) {
  .results.split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .results.split .map { position: sticky; top: 76px; height: calc(100vh - 100px); }
}
@media (min-width: 960px) { .toggle { display: none; } }
.results.list-only .map { display: none; }
.results.map-only .list { display: none; }
@media (min-width: 960px) { .results.list-only .map, .results.map-only .list { display: block; } .results.map-only .list { display: grid; } }

.card { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: start; background: var(--card); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow); text-decoration: none; color: inherit; border: 1.5px solid transparent; }
.card:hover { border-color: var(--line); }
.card.featured { border-color: var(--gold); }
.date-tile { border-radius: 12px; background: var(--green-soft); color: var(--green-dark); text-align: center; padding: 8px 4px; line-height: 1.1; }
.date-tile .dow { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.date-tile .day { font-family: var(--head); font-size: 1.6rem; font-weight: 700; }
.date-tile .mon { font-size: .72rem; font-weight: 600; text-transform: uppercase; }
.date-tile.today { background: var(--green); color: #fff; }
.card h3 { font-size: 1.12rem; margin: 0 0 2px; }
.card .where { color: var(--muted); font-size: .9rem; }
.card .when { font-weight: 600; font-size: .92rem; margin-top: 4px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.tag { font-size: .74rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: #f1ece3; color: var(--ink); }
.tag-farmers { background: #DDEED7; color: #2F5E22; }
.tag-produce { background: #E6EDD3; color: #4D6324; }
.tag-craft { background: var(--terra-soft); color: #8E3818; }
.tag-makers { background: #ECE3F4; color: #5B3F7C; }
.tag-trash-treasure { background: #D9EDF0; color: #1C5F69; }
.tag-vintage { background: var(--gold-soft); color: #7D5610; }
.tag-night { background: #DFE3F2; color: #2D3A66; }
.tag-food { background: #F7DEDA; color: #8E2D22; }
.tag-community { background: #DDE8F5; color: #2E5788; }
.tag-christmas { background: #B83A2E; color: #fff; }
.right { text-align: right; display: grid; gap: 6px; justify-items: end; }
.km { font-weight: 700; font-size: .9rem; white-space: nowrap; }
.pill { font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.pill-open { background: #1F8A4C; color: #fff; }
.pill-check { background: var(--gold-soft); color: #7D5610; }
.fav { border: 0; background: transparent; font-size: 1.35rem; line-height: 1; padding: 2px; color: var(--terra); }

.empty { background: #fff; border-radius: var(--radius); padding: 28px 20px; text-align: center; box-shadow: var(--shadow); }
.empty h3 { font-size: 1.25rem; }
.skeleton { height: 96px; border-radius: var(--radius); background: linear-gradient(90deg, #efe9de 25%, #f7f2ea 50%, #efe9de 75%); background-size: 200% 100%; animation: sh 1.2s infinite; }
@keyframes sh { to { background-position: -200% 0; } }
.ad-slot { min-height: 100px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); padding: 6px 8px 8px; overflow: hidden; }
.ad-label { display: block; font-size: .68rem; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.detail .ad-slot, #planOut .ad-slot { margin-top: 16px; }
/* "Go ad-free" (apps only) */
.adfree-box { border-radius: var(--radius); background: #FFF6E0; border: 1px solid #F0D79A; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: .95rem; }
.adfree-box.on { background: #EAF4EF; border-color: #BFDCCD; }
.btn-sm { padding: 7px 14px; font-size: .9rem; min-height: 0; }
.linkish { background: none; border: 0; padding: 0; color: var(--green); text-decoration: underline; font: inherit; cursor: pointer; }
.price-line { font-size: 1.25rem; margin: 4px 0 12px; }
/* App banner ad sits over the bottom of the screen — keep content clear of it */
html.has-banner body { padding-bottom: calc(var(--banner-h, 60px) + env(safe-area-inset-bottom)); }
html.has-banner .sheet-body { padding-bottom: calc(var(--banner-h, 60px) + 20px); }
html.has-banner #toast { bottom: calc(var(--banner-h, 60px) + 20px); }

/* ---------- detail ---------- */
.detail { max-width: 760px; margin: 0 auto; padding: 16px 16px 40px; }
.back { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; font-weight: 600; margin-bottom: 10px; }
.hero { background: #fff; border-radius: 22px; padding: 20px; box-shadow: var(--shadow); }
.hero h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); }
.hero .where { color: var(--muted); }
.verify { display: flex; gap: 8px; align-items: flex-start; margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; font-size: .9rem; }
.verify.ok { background: var(--green-soft); color: var(--green-dark); }
.verify.warn { background: var(--gold-soft); color: #6E4B0C; }
.next-big { margin-top: 16px; padding: 16px; border-radius: 16px; background: var(--green); color: #fff; }
.next-big .label { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; opacity: .8; font-weight: 700; }
.next-big .big { font-family: var(--head); font-size: 1.6rem; font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.section { background: #fff; border-radius: 18px; padding: 18px 20px; margin-top: 14px; box-shadow: var(--shadow); }
.section h2 { font-size: 1.2rem; }
.dates { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.dates li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid #f1ece3; }
.dates li:last-child { border-bottom: 0; }
.dates .cancel { color: var(--muted); text-decoration: line-through; }
.dates .extra { color: var(--terra); font-weight: 600; }
.feat { display: flex; flex-wrap: wrap; gap: 8px; }
.feat span { background: var(--cream); border: 1px solid var(--line); padding: 5px 10px; border-radius: 999px; font-size: .88rem; }
.mini-map { height: 220px; border-radius: 14px; overflow: hidden; margin-top: 12px; background: var(--green-soft); }
.small { font-size: .85rem; }

/* ---------- forms ---------- */
.form { max-width: 680px; margin: 0 auto; padding: 16px 16px 40px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label, .legend { font-weight: 600; }
.field input, .field select, .field textarea { padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; width: 100%; }
.field textarea { min-height: 90px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; font-weight: 500; font-size: .92rem; }
.checks input:checked + span { font-weight: 700; }
.hp { position: absolute; left: -9999px; }
.note { background: var(--gold-soft); border-radius: 12px; padding: 12px 14px; font-size: .92rem; }

/* ---------- sheet & toast ---------- */
.sheet { position: fixed; inset: 0; z-index: 100; background: rgba(20, 28, 25, .45); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-body { background: #fff; width: 100%; max-width: 560px; border-radius: 22px 22px 0 0; padding: 20px 20px max(20px, env(safe-area-inset-bottom)); max-height: 90vh; overflow: auto; }
@media (min-width: 600px) { .sheet { align-items: center; } .sheet-body { border-radius: 22px; } }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(120px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; transition: transform .25s; z-index: 120; font-weight: 600; }
.toast.show { transform: translateX(-50%) translateY(0); visibility: visible; }
.toast { visibility: hidden; }

.foot { text-align: center; padding: 24px 16px 40px; color: var(--muted); font-size: .9rem; border-top: 1px solid var(--line); }
.foot p { margin: 6px 0; }

.maplibregl-popup-content { font-family: var(--body); border-radius: 12px; padding: 10px 12px; }
.maplibregl-popup-content a { font-weight: 700; }
.pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--terra); border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.pin.today { background: var(--green); }

/* ---------- v2: planner, weather, confirmations ---------- */
.plan-cta { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 16px; border-radius: 16px; background: rgba(255, 255, 255, .1); border: 1.5px solid rgba(255, 255, 255, .25); color: #fff; text-decoration: none; }
.plan-cta:hover { background: rgba(255, 255, 255, .16); }
.plan-cta .ico { font-size: 1.6rem; }
.plan-cta strong { display: block; font-family: var(--head); font-size: 1.1rem; color: var(--gold); }
.plan-cta small { color: #d6e6df; }
.plan-cta > span:last-child { margin-left: auto; font-size: 1.3rem; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.meta-row:empty { display: none; }
.wx:empty { display: none; }
.wx-chip { display: inline-flex; gap: 4px; align-items: center; font-size: .8rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: #EEF4FA; color: #24496E; }
.wx-chip.watch { background: var(--gold-soft); color: #6E4B0C; }
.pill-confirmed { background: var(--green-soft); color: var(--green-dark); }
.wx-block { align-items: center; }
.wx-big { font-size: 2rem; line-height: 1; }
.place-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.planner .hero .field { margin-top: 12px; }
.timeline { list-style: none; margin: 0 0 6px; padding: 0 0 0 4px; border-left: 3px solid var(--green-soft); }
.timeline li { position: relative; display: grid; grid-template-columns: 72px 1fr; gap: 10px; padding: 10px 0 10px 14px; }
.timeline li::before { content: ''; position: absolute; left: -9px; top: 16px; width: 14px; height: 14px; border-radius: 50%; background: var(--terra); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.timeline li.tl-start::before { background: var(--green); }
.tl-time { font-weight: 700; font-family: var(--head); }
.tl-drive { grid-column: 1 / -1; font-size: .85rem; color: var(--muted); margin: -4px 0 4px; }
.big-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 14px; }
.choice { display: grid; gap: 6px; justify-items: center; padding: 18px 8px; border-radius: 16px; border: 2px solid var(--line); background: #fff; font-size: 1.8rem; }
.choice span { font-size: .95rem; font-weight: 700; }
.choice.picked.on { border-color: #1F8A4C; background: #E6F4EC; }
.choice.picked.off { border-color: #B83A2E; background: #FBE5E1; }
.choice.picked.chg { border-color: var(--gold); background: var(--gold-soft); }

@media (max-width: 520px) { .nav-hide-sm { display: none; } }
.legal h2 { font-size: 1.15rem; margin-top: 1.2em; }
.legal p { line-height: 1.6; }
.hero h2 { font-size: 1.2rem; margin-top: 14px; }
.pin-wrap { width: 30px; height: 38px; display: flex; align-items: flex-start; justify-content: center; cursor: pointer; }
.pin-wrap .pin { margin-top: 2px; }
