:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #f7f5fa;
  background: #2c68a6;
  --panel: #171321;
  --line: #393245;
  --accent: #55eadb;
  --muted: #ccc4d7;
  --ocean: #2c68a6;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
#map { position: fixed; inset: 0; }
#map-overview {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(90vw, 90vh);
  height: min(90vw, 90vh);
  transform: translate(-50%, -50%);
  display: grid;
  grid-template: repeat(4, 1fr) / repeat(4, 1fr);
  pointer-events: none;
}
#map-overview img { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; }
#map-overview::after {
  position: absolute;
  content: '';
  left: 61.71875%; top: 15.625%;
  width: 19.53125%; height: 62.5%;
  background: var(--ocean);
}
.interactive-ready #map { background: #2c68a6; }
.interactive-ready #map-overview { display: none; }

.panel {
  position: absolute;
  z-index: 500;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 4px 22px #100a2155;
}

.toolbar { top: 12px; left: 12px; right: 12px; max-width: 440px; padding: 12px 14px; }
.heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.heading span { display: block; color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
h1 { font-size: clamp(16px, 5vw, 22px); line-height: 1.2; margin: 2px 0 0; }
#count { color: var(--muted); font-size: 12px; margin: 9px 0 0; }
#collections { margin-top: 12px; }
#results { margin: 10px 0; padding: 0; list-style: none; max-height: min(34vh, 300px); overflow-y: auto; }
#results button { width: 100%; border: 0; border-radius: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; }
#results button .result-meta { display: block; color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 2px; }
#results button { padding-top: 7px; padding-bottom: 7px; }
#results .empty { color: var(--muted); font-size: 13px; padding: 6px 0; }
input, select { width: 100%; margin-bottom: 8px; padding: 0 10px; }
button, input, select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: inherit;
  background: #231e30;
  font: inherit;
  font-size: 14px;
}
button { cursor: pointer; padding: 0 11px; font-weight: 700; }
button:disabled { opacity: .55; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button[aria-expanded="true"], .text-link { color: var(--accent); }
.text-link { border: none; background: none; padding: 0; text-align: left; }

.controls { bottom: 118px; right: 12px; padding: 3px; display: grid; gap: 2px; border-radius: 13px; }
.controls button { width: 44px; font-size: 23px; border: none; background: transparent; }
.pick-panel { bottom: 52px; left: 12px; max-width: calc(100% - 24px); padding: 0; border: 0; }
.pick-actions { display: flex; }
.pick-panel p { margin: 9px 10px; font-size: 13px; }
.credits { position: absolute; z-index: 500; bottom: 0; right: 0; color: #fff; background: #171321e8; border-radius: 8px 0 0; padding: 5px 8px; display: flex; flex-wrap: wrap; column-gap: 8px; font-size: 11px; }
.credits a { color: #fff; }

.pin { display: grid; place-items: center; }
.pin span { width: 24px; height: 24px; border: 2px solid #fff; border-radius: 50% 50% 50% 3px; background: #d92672; color: #fff; font-weight: 800; box-shadow: 0 1px 8px #000b; display: grid; place-items: center; transform: rotate(-45deg); }
.pin span b { transform: rotate(45deg); font-size: 14px; }
.pin.is-place span { background: #196786; }
.pin.place-shops span { background: #196b57; }
.pin.place-food span { background: #8a3e11; }
.pin.place-fuel span { background: #754b0e; }
.pin.place-hotels span { background: #554883; }
.pin.place-transport span { background: #30517f; }
.pin.place-outdoors span { background: #365e38; }
.place-cluster {
  display: grid;
  place-items: center;
  border: 2px solid #8fe5ec;
  border-radius: 50%;
  color: white;
  background: #183846ed;
  font: 800 13px system-ui, sans-serif;
  box-shadow: 0 2px 8px #0008;
}
.pin.is-collected span { background: #167b61; }
.pin.is-suggestion span { background: #252234; }
.leaflet-container .leaflet-popup-content-wrapper, .leaflet-container .leaflet-popup-tip { background: var(--panel); color: #f7f5fa; }
.leaflet-container .leaflet-popup-content { font-family: system-ui, sans-serif; min-width: 175px; margin: 14px 16px; }
.leaflet-popup-content h2 { font-size: 16px; margin: 3px 0 7px; }
.leaflet-popup-content button { display: block; width: 100%; margin-top: 6px; }
.pin-detail { max-height: min(48vh, 360px); overflow-y: auto; }
.pin-detail article + article { border-top: 1px solid var(--line); margin-top: 9px; padding-top: 9px; }
.pin-detail p { margin: 5px 0 7px; }
.pin-note { color: var(--muted); }
.picking #map { cursor: crosshair; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.location-guide { border-bottom: 1px solid var(--line); padding: 7px 10px 10px; }
.location-guide summary { min-height: 32px; cursor: pointer; font-weight: 700; }
.location-guide .result-meta { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; }
.location-guide p { margin: 7px 0; font-size: 13px; line-height: 1.4; }
.location-guide a { color: var(--accent); font-size: 13px; }
