:root {
  color-scheme: light;
  --forest: #183c33;
  --pine: #25594a;
  --rust: #94442e;
  --gold: #f0d998;
  --text: #20342d;
  --muted: #4b6258;
  --line: #dce5dd;
  --paper: #fbfcf8;
  font: 16px/1.5 system-ui, sans-serif;
  color: var(--text);
  background: #edf2eb;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button { color: inherit; }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #ba6a2e; outline-offset: 3px; }
a { color: var(--pine); text-underline-offset: .15em; }
.masthead {
  background: var(--forest);
  color: #fffdf6;
  padding: 1.15rem max(1.25rem, calc((100% - 88rem) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 3px solid #cfab62;
}
.brand, .header-actions { display: flex; align-items: center; gap: .9rem; }
.municipal-logo { display: block; width: clamp(7rem, 12vw, 11rem); height: auto; flex: none; }
.brand-title { border-left: 1px solid #849d8f; padding-left: .95rem; }
.edition { margin: 0; font-size: .75rem; letter-spacing: .16em; font-weight: 720; color: var(--gold); }
h1, h2 { font-family: Georgia, serif; margin: 0; line-height: 1.15; font-weight: 500; }
h1 { font-size: clamp(1.68rem, 3.3vw, 2.45rem); }
.header-actions button, .fit {
  border: 1px solid #8da597;
  background: transparent;
  padding: .62rem .85rem;
  min-height: 44px;
  border-radius: .55rem;
  font-weight: 650;
  font-size: .88rem;
}
.header-actions button:hover { background: #31564a; }
.header-actions .primary { color: #273226; background: var(--gold); border-color: var(--gold); }
.header-actions .primary:hover { background: #fae7b6; }
main { max-width: 91rem; margin: auto; padding: 1.75rem 1.5rem; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 1.1rem; margin-bottom: 1.3rem; }
.intro h2 { font-size: clamp(1.6rem, 2.7vw, 2.35rem); }
.intro p { color: var(--muted); margin: .45rem 0 0; }
.stats { display: flex; flex: none; gap: .7rem; }
.stats span { border: 1px solid #d0ded3; background: #f8faf5; padding: .44rem .67rem; border-radius: .5rem; font-size: .87rem; }
.stats strong { color: var(--pine); font-size: 1.05rem; }
.explorer {
  display: grid;
  grid-template-columns: minmax(20rem, 23rem) minmax(0, 1fr);
  height: clamp(34rem, calc(100dvh - 13rem), 55rem);
  overflow: hidden;
  border: 1px solid #cbd9ce;
  border-radius: .95rem;
  box-shadow: 0 7px 24px #1c3f2611;
}
.sidebar { display: flex; flex-direction: column; min-height: 0; background: var(--paper); border-right: 1px solid var(--line); }
.filters { display: grid; gap: .6rem; padding: 1rem; border-bottom: 1px solid var(--line); }
.filters label { font-weight: 700; }
.filters input, .filters select { width: 100%; background-color: white; border: 1px solid #aebfb4; border-radius: .5rem; color: var(--text); padding: .55rem .65rem; min-height: 44px; }
.filters select { appearance: none; padding-right: 2rem; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m5 7 5 5 5-5' fill='none' stroke='%23183c33' stroke-width='1.8'/%3E%3C/svg%3E") right .55rem center / 1.2rem no-repeat; }
.route-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.route-buttons button { min-height: 44px; border: 1px solid #cedbd0; background: #edf3ee; border-radius: .5rem; font-size: .9rem; font-weight: 700; }
.route-buttons button:hover { background: #dce9df; }
.route-buttons button[aria-pressed=true] { background: var(--pine); color: white; border-color: var(--pine); }
.results { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.results h3 { margin: 0; padding: .8rem 1rem .5rem; font-size: .94rem; font-weight: 700; color: var(--muted); }
#places { flex: 1; overflow: auto; list-style: none; margin: 0; padding: 0 .6rem .65rem; }
.place {
  display: flex;
  align-items: start;
  gap: .7rem;
  width: 100%;
  background: transparent;
  text-align: left;
  border: 1px solid transparent;
  border-bottom-color: var(--line);
  border-radius: .5rem;
  padding: .72rem .5rem;
  overflow-wrap: anywhere;
}
.place:hover, .place[aria-current=true] { background: #e8f0e9; }
.place[aria-current=true] { border-color: #aac3af; }
.place strong { display: block; font-size: .95rem; line-height: 1.35; }
.place small { color: var(--muted); font-size: .83rem; display: block; margin-top: .2rem; }
.place .caution, .caution { color: #85541d; }
.badge, .pin span { width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: .78rem; font-weight: 730; color: white; background: var(--pin, var(--pine)); }
.r2 { --pin: var(--rust); }
.pin span { width: 34px; height: 34px; border: 2px solid white; box-shadow: 0 1px 5px #21372180; }
.pin.approximate span { border: 3px dashed #ffe49a; }
.pin.selected span { outline: 3px solid var(--forest); outline-offset: 2px; }
.map-panel { position: relative; min-height: 0; isolation: isolate; background: #e3ebe1; }
#map { width: 100%; height: 100%; background: #e3ebe1; }
.fit { position: absolute; z-index: 500; right: .75rem; top: .75rem; background: #fff; box-shadow: 0 2px 6px #203c3320; }
.fit:hover { background: #eef4ed; }
.legend { z-index: 500; position: absolute; bottom: 1.55rem; left: .65rem; background: #fffffff5; border: 1px solid var(--line); border-radius: .55rem; padding: .4rem .55rem; display: flex; flex-wrap: wrap; gap: .2rem .65rem; font-size: .78rem; pointer-events: none; }
.legend span { display: flex; gap: .35em; align-items: center; }
.legend i { width: .72em; height: .72em; border-radius: 50%; background: var(--pine); }
.legend .drive { background: var(--rust); }
.legend .approx { background: transparent; border: 1px dashed #85541d; }
.leaflet-popup-content { font-family: system-ui, sans-serif; font-size: .94rem; }
.leaflet-popup-content h3 { margin: 0; font-size: 1.03rem; line-height: 1.35; }
.leaflet-popup-content p { margin: .35rem 0 .65rem; white-space: pre-line; }
.leaflet-popup-content a { font-weight: 650; color: var(--pine); }
.leaflet-popup-content .other { display: block; border: 0; background: #edf3ee; padding: .4rem; margin: .5rem 0 0; border-radius: .3rem; text-align: left; }
.empty { color: var(--muted); padding: .5rem; }
dialog { width: min(32rem, calc(100% - 2rem)); border: 1px solid #9fb6a6; color: var(--text); border-radius: .75rem; padding: 1.5rem; }
dialog::backdrop { background: #14291fb3; }
dialog form { float: right; margin-left: .5rem; }
.close { display: grid; place-items: center; width: 44px; height: 44px; background: #edf3ef; border: 1px solid var(--line); border-radius: .5rem; font-size: 1.45rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 750px) {
  main { padding: 1.15rem .8rem; }
  .masthead { padding: .9rem .8rem; align-items: start; flex-wrap: wrap; }
  .brand { gap: .6rem; }
  .municipal-logo { width: clamp(5.1rem, 24vw, 8rem); }
  .brand-title { padding-left: .6rem; }
  .header-actions { gap: .45rem; }
  .intro { flex-wrap: wrap; gap: .65rem; }
  .explorer { grid-template-columns: 1fr; height: auto; }
  .map-panel { grid-row: 1; height: clamp(21rem, 51dvh, 30rem); }
  .sidebar { height: min(32rem, 80dvh); min-height: 23rem; border-right: 0; border-top: 1px solid var(--line); }
}
