:root {
  --bg: #fff;
  --fg: #1d1d1d;
  --muted: #6b6b6b;
  --line: #d8d8d8;
  --accent: #c8102e;
  --hover: #f3f3f3;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--fg); }
#map { position: absolute; inset: 0; background: #e9eef2; }

.panel {
  position: absolute; z-index: 1000; background: var(--bg);
  border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.hidden { display: none; }

#search { top: 12px; left: 12px; width: min(420px, calc(100% - 150px)); }
#q { width: 100%; border: 0; padding: 11px 14px; font-size: 15px; border-radius: 8px; outline: none; background: transparent; }
#results { list-style: none; margin: 0; padding: 0; max-height: 60vh; overflow-y: auto; }
#results:not(:empty) { border-top: 1px solid var(--line); }
#results li { padding: 8px 14px; cursor: pointer; border-bottom: 1px solid var(--line); }
#results li:last-child { border-bottom: 0; }
#results li:hover, #results li.active { background: var(--hover); }
#results .name { font-weight: 600; }
#results .sub { color: var(--muted); font-size: 12px; }
#results .msg { color: var(--muted); cursor: default; }

.btn {
  border: 0; background: var(--accent); color: #fff; font: inherit; font-weight: 600;
  padding: 9px 14px; border-radius: 8px; cursor: pointer;
}
.btn.secondary { background: #eee; color: var(--fg); }
.btn:disabled { opacity: .6; cursor: wait; }
#printToggle { top: 12px; right: 12px; }

#printPanel { top: 60px; right: 12px; width: 300px; padding: 12px 14px; }
#printPanel h3 { margin: 0 0 8px; font-size: 15px; }
#printPanel label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 8px; flex: 1; }
#printPanel input, #printPanel select {
  display: block; width: 100%; margin-top: 3px; padding: 6px 8px; font: inherit; color: var(--fg);
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
}
#printPanel .row { display: flex; gap: 8px; }
#printPanel .row .btn { flex: 1; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0; }

#coords {
  bottom: 22px; left: 12px; padding: 5px 10px; font-size: 12px;
  font-variant-numeric: tabular-nums; pointer-events: none;
}
.leaflet-bottom.leaflet-left .leaflet-control-scale { margin-bottom: 52px; }

@media (max-width: 600px) {
  #search { width: calc(100% - 24px); }
  #printToggle { top: auto; bottom: 60px; }
  #printPanel { top: auto; bottom: 110px; left: 12px; right: 12px; width: auto; }
  #coords { display: none; }
}
