:root {
  --bg: #f6f4ee; --panel: #fffdf8; --ink: #1f2a24; --muted: #66716a;
  --line: #ddd8cb; --accent: #2f6b4f; --accent-ink: #fff; --soft: #e6efe9;
  --warn: #9a5b13;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; color: var(--ink);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); }
body { display: grid; grid-template-columns: minmax(340px, 430px) 1fr; }
#panel { height: 100vh; overflow-y: auto; background: var(--panel); border-right: 1px solid var(--line); padding: 16px; }
#map { height: 100vh; }
h1 { margin: 0; font-size: 1.35rem; letter-spacing: -.01em; }
.tagline { margin: 2px 0 14px; color: var(--muted); }
.muted { color: var(--muted); font-size: .87rem; }

fieldset { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
legend { padding: 0; margin-bottom: 5px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.row { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.row > input[type=search] { flex: 1 1 120px; min-width: 0; }
input[type=search], select, button { font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 7px 9px; }
button { cursor: pointer; }
button:hover { border-color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
#addressGo { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
#locate { font-size: 1.1rem; line-height: 1; padding: 6px 9px; }
button.link { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; }
.check { display: flex; gap: 6px; align-items: center; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { border-radius: 999px; padding: 4px 10px; font-size: .87rem; background: #fff; }
.chip[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip small { opacity: .65; margin-left: 3px; }

.listhead { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0 8px; border-top: 1px solid var(--line); position: sticky; top: -16px; background: var(--panel); z-index: 2; }
.seg { display: flex; }
.seg button { border-radius: 0; padding: 5px 10px; font-size: .87rem; }
.seg button:first-child { border-radius: 8px 0 0 8px; }
.seg button:last-child { border-radius: 0 8px 8px 0; border-left: 0; }
.seg button[aria-pressed=true] { background: var(--soft); border-color: var(--accent); font-weight: 600; }

.group > h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 6px; display: flex; justify-content: space-between; gap: 8px; }
.group > h2 a { color: inherit; }
.ev { display: grid; grid-template-columns: 46px 1fr; gap: 10px; padding: 9px 8px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; }
.ev:hover, .ev.active { background: var(--soft); border-color: #c9dccf; }
.ev.past { opacity: .6; }
.date { text-align: center; line-height: 1.05; padding-top: 2px; }
.date b { display: block; font-size: 1.25rem; }
.date span { font-size: .72rem; text-transform: uppercase; color: var(--muted); }
.ev h3 { margin: 0 0 2px; font-size: .98rem; line-height: 1.25; }
.meta { font-size: .85rem; color: var(--muted); }
.tags { margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: .72rem; padding: 1px 7px; border-radius: 999px; background: #efeadd; }
.tag.fmt { background: var(--soft); }
.tag.approx { background: #f6e6cf; color: var(--warn); }
.more { display: none; margin-top: 6px; font-size: .88rem; white-space: pre-line; }
.ev.open .more { display: block; }
.more a { color: var(--accent); font-weight: 600; margin-right: 10px; }
.empty { padding: 24px 8px; color: var(--muted); text-align: center; }
footer { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--line); }
footer a { color: inherit; }

.pin { background: var(--accent); color: #fff; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(0,0,0,.4); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.pin.approx { background: #c98a2b; border-style: dashed; }
.pin.active { background: #12382a; transform: scale(1.2); }
.me { background: #1d6fd6; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px #1d6fd6; }
.leaflet-popup-content { margin: 10px 12px; font: inherit; font-size: .88rem; }
.leaflet-popup-content h4 { margin: 0 0 4px; font-size: .9rem; }
.leaflet-popup-content ul { margin: 0; padding: 0; list-style: none; max-height: 180px; overflow-y: auto; }
.leaflet-popup-content li { padding: 3px 0; }
.leaflet-popup-content button { border: 0; background: none; padding: 0; text-align: left; color: var(--accent); font-weight: 600; }

@media (max-width: 760px) {
  body { display: flex; flex-direction: column; }
  #map { order: -1; height: 45vh; position: sticky; top: 0; z-index: 3; }
  #panel { height: auto; overflow: visible; border-right: 0; }
  .listhead { top: 45vh; }
}

.morebtn { display: block; width: 100%; margin-top: 12px; }
