:root { --bg: #f4f2f7; --panel: #fff; --ink: #1d1d24; --muted: #777; --line: #e3e0ea; --accent: #2b5fd9; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); }
header { position: sticky; top: 0; z-index: 1000; display: flex; gap: 14px; align-items: center; padding: 10px 18px; background: #ebe7ef; border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; }
select { font-size: 16px; padding: 6px 10px; border-radius: 8px; border: 1px solid #ccc; background: #fff; min-width: 260px; }
.muted { color: var(--muted); font-size: 13px; }
main { padding: 14px 18px; }
h2 { font-size: 16px; margin: 0 0 8px; }
.maps { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mapbox { background: var(--panel); border-radius: 12px; padding: 10px; box-shadow: 0 1px 3px rgba(0,0,0,.08); min-width: 0; }
.maphead { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.maphead h2 { margin-right: auto; }
.editor-gate { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.unlock-btn, .unlock-form button {
  font: inherit; font-size: 12px; padding: 2px 8px; border-radius: 6px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--muted);
}
.unlock-btn:hover, .unlock-form button[type="submit"]:hover { border-color: var(--accent); color: var(--accent); }
.unlock-form { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.unlock-form input[type="password"] {
  font: inherit; font-size: 12px; padding: 2px 6px; border-radius: 6px;
  border: 1px solid #ccc; width: 120px;
}
.unlock-cancel { color: var(--muted); }
.unlock-err { color: #b00020; font-size: 12px; }
.map { height: 62vh; min-height: 380px; border-radius: 8px; }
.missing-panel {
  grid-column: 1 / -1;
  background: var(--panel); border-radius: 12px; padding: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
  max-height: 320px;
}
.missing-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; }
.missing-head h2 { margin: 0; flex: 1; }
.missing-sort {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted);
}
.missing-sort select {
  min-width: 0; font-size: 13px; padding: 4px 8px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.missing-head button {
  font: inherit; font-size: 13px; padding: 5px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
}
.missing-head button.secondary { color: var(--muted, #666); }
.missing-head button:disabled { opacity: .45; cursor: default; }
.missing-head button:not(:disabled):hover { border-color: var(--accent); color: var(--accent); }
.missing-note { margin: 0 0 8px; font-size: 12px; }
.missing-table-wrap { overflow: auto; flex: 1; max-height: 260px; min-height: 120px; }
.missing-table { font-size: 13px; }
.missing-table tbody tr { cursor: pointer; }
.missing-table tbody tr:hover td { background: #f3f0f8; }
.missing-table tbody tr.selected td { background: #e4ecfb; }
.missing-table td:last-child, .missing-table th:last-child { text-align: left; }
.missing-table .missing-check { width: 28px; text-align: center; vertical-align: middle; }
.missing-table .missing-check input { cursor: pointer; vertical-align: middle; }
.missing-table .missing-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; margin-top: 14px; }
.panel { background: var(--panel); border-radius: 12px; padding: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.grid { width: 100%; border-collapse: collapse; }
.grid td, .grid th { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.grid td:last-child, .grid th:last-child { text-align: right; }
.compare td:nth-child(2), .compare th:nth-child(2) { text-align: right; }
.terrain { display: inline-flex; width: 160px; height: 12px; border-radius: 6px; overflow: hidden; vertical-align: middle; }
.terrain span { display: block; height: 100%; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.thumbs a { color: var(--ink); text-decoration: none; font-size: 13px; }
.thumbs img { width: 100%; border-radius: 8px; border: 1px solid var(--line); }
#changes { margin: 0; padding-left: 18px; }
#changes li { margin-bottom: 8px; }
footer { padding: 10px 18px 24px; }
.leaflet-tooltip { font-size: 12px; }
.poi-marker { background: transparent !important; border: none !important; }
.poi-wrap {
  display: flex; align-items: center; gap: 3px;
  pointer-events: none; white-space: nowrap;
}
.poi-icon {
  font-size: 16px; line-height: 1;
  filter: drop-shadow(0 0 1px #fff) drop-shadow(0 1px 1px rgba(0,0,0,.35))
          drop-shadow(0 0 2px #fff);
}
.poi-resto {
  display: block; flex-shrink: 0; width: 21px; height: 21px;
  object-fit: contain;
  filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1px #fff)
          drop-shadow(0 1px 2px rgba(0,0,0,.45));
  pointer-events: none; user-select: none;
}
.feat-arrow { pointer-events: none; }
/* Selection / flash overlays must not steal clicks from OSM vectors underneath */
.missing-hl { pointer-events: none !important; }
.feat-arrow span {
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%) rotate(var(--a));
  font: 700 13px/1 sans-serif; color: var(--c, #333);
  text-shadow: 0 0 2px #fff, 0 0 3px #fff; opacity: .95;
  display: block; width: 16px; height: 16px; text-align: center;
}
.lbl { pointer-events: none; }
.lbl span { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%) rotate(var(--a)); white-space: nowrap;
            font: 600 11px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
            text-shadow: 0 0 2px #fff, 0 0 2px #fff, 0 0 3px #fff, 0 0 4px #fff; }
.lbl-lift span { font-style: italic; font-size: 12px; }
.map.hide-names .lbl, .map.hide-lifts .lbl-lift, .map.hide-runs .lbl-run { display: none; }
@media (max-width: 900px) {
  .maps { grid-template-columns: 1fr; }
  .map { height: 48vh; }
  .missing-panel { max-height: 280px; }
  .missing-table-wrap { max-height: 220px; }
  select { min-width: 0; flex: 1; }
  #built { display: none; }
}
