/* Geoportal viewer — denser, more "GIS tool" than the trail map, same palette. */
:root {
  --bg: #fafaf7;
  --card: #ffffff;
  --ink: #1c2733;
  --muted: #5b6b7a;
  --accent: #1d6fce;
  --green: #2e7d4f;
  --mtb: #d2691e;
  --measure: #c62828;
  --line: #e3e6e0;
  --chip: #eef2ee;
  --shadow: 0 2px 14px rgba(20, 35, 50, .14);
  --panel-w: 320px;
  --head-h: 52px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12181f; --card: #1a232d; --ink: #e8edf2; --muted: #9fb0c0;
    --accent: #5aa2ee; --green: #58b385; --mtb: #e8944e; --measure: #ef5350;
    --line: #2a3641; --chip: #223040; --shadow: 0 2px 14px rgba(0, 0, 0, .5);
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }

header.site {
  position: fixed; inset: 0 0 auto 0; height: var(--head-h);
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: var(--card); border-bottom: 1px solid var(--line); z-index: 1200;
}
.brand { font-weight: 800; text-decoration: none; color: var(--ink); font-size: 16px; white-space: nowrap; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.head-spacer { flex: 1; }
.langs button { background: none; border: 0; cursor: pointer; font-weight: 700; font-size: 13px; color: var(--muted); padding: 4px 5px; }
.langs button.on { color: var(--accent); }
.menu-toggle { display: none; background: none; border: 0; font-size: 20px; cursor: pointer; }

#map { position: fixed; inset: var(--head-h) 0 0 var(--panel-w); background: var(--bg); }
aside.panel {
  position: fixed; inset: var(--head-h) auto 0 0; width: var(--panel-w);
  background: var(--card); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; z-index: 1100; overflow-y: auto;
}

.section { border-bottom: 1px solid var(--line); padding: 10px 12px; }
.section > h2 {
  margin: 0 0 8px; font-size: 11px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted);
}

.search { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.search:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.results { margin-top: 6px; max-height: 210px; overflow-y: auto; }
.results button {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  padding: 7px 8px; border-radius: 7px; cursor: pointer; font-size: 13px;
}
.results button:hover { background: var(--chip); }
.results .kind { color: var(--muted); font-size: 11.5px; }

.opt { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; font-size: 13.5px; }
.opt input { accent-color: var(--accent); flex: none; }
.opt .sw { width: 10px; height: 10px; border-radius: 2px; flex: none; }

.opacity-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.opacity-row span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.opacity-row input { flex: 1; accent-color: var(--accent); }

.tools { display: flex; gap: 6px; flex-wrap: wrap; }
.tool {
  border: 1px solid var(--line); background: var(--bg); border-radius: 8px;
  padding: 6px 10px; cursor: pointer; font-size: 13px;
}
.tool[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.hint { font-size: 11.5px; color: var(--muted); margin: 6px 0 0; }
.total { font-weight: 700; color: var(--measure); }

.coords { font-variant-numeric: tabular-nums; font-size: 12.5px; }
.coords div { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; }
.coords b { font-weight: 700; }
.coords .lbl { color: var(--muted); }

/* map bits */
.leaflet-container { background: var(--bg); font: inherit; }
.leaflet-control-attribution { font-size: 10.5px; }
.map-btn {
  background: var(--card); border: 0; border-radius: 6px; width: 34px; height: 34px;
  cursor: pointer; font-size: 15px; box-shadow: var(--shadow);
}
.loading {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--card); padding: 10px 16px; border-radius: 10px;
  box-shadow: var(--shadow); z-index: 900; font-size: 13.5px;
}
.busnote {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  background: var(--card); padding: 6px 12px; border-radius: 20px;
  box-shadow: var(--shadow); font-size: 12.5px; color: var(--muted); z-index: 800;
}
.leaflet-popup-content { font-size: 13px; }
.leaflet-popup-content b { display: block; margin-bottom: 2px; }

@media (max-width: 800px) {
  .menu-toggle { display: block; }
  #map { inset: var(--head-h) 0 0 0; }
  aside.panel {
    width: 86vw; max-width: 340px;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: var(--shadow);
  }
  aside.panel.open { transform: none; }
  .brand small { display: none; }
}
