:root {
  color-scheme: light;
  --bg: #f3f6fb;
  --panel: #ffffff;
  --border: #d8e1ee;
  --text: #17324d;
  --muted: #60758d;
  --accent: #0a84ff;
  --accent-dark: #0866c2;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  height: 100vh;
}

.sidebar {
  overflow-y: auto;
  padding: 20px;
  border-right: 1px solid var(--border);
  background: #f8fbff;
}

.brand h1,
.panel h2 {
  margin: 0 0 8px;
}

.brand p,
.hint,
.details dd,
.panel li,
.status {
  color: var(--muted);
}

.panel {
  margin-top: 16px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(14, 39, 80, 0.05);
}

.panel.compact ul {
  margin: 0;
  padding-left: 18px;
}

.button-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.select-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

button {
  border: 0;
  border-radius: 12px;
  padding: 11px 12px;
  background: var(--accent);
  color: white;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

#clearBtn {
  background: #8a98ab;
}

#clearBtn:hover {
  background: #6f7f93;
}

.details {
  margin: 12px 0 0;
}

.details div {
  margin-bottom: 12px;
}

.details dt {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 4px;
}

.details dd {
  margin: 0;
  line-height: 1.5;
  word-break: break-word;
}

.status {
  font-size: 14px;
  font-weight: 600;
}

.map-shell {
  min-width: 0;
}

#map {
  width: 100%;
  height: 100%;
}

#map[data-map-style="standard"] .leaflet-tile-pane {
  filter: none;
}

#map[data-map-style="grayscale"] .leaflet-tile-pane {
  filter: grayscale(1) saturate(0.2) brightness(1.03) contrast(1.05);
}

#map[data-map-style="dark"] .leaflet-tile-pane {
  filter: grayscale(0.35) invert(0.92) hue-rotate(180deg) brightness(0.85) contrast(1.15) saturate(0.8);
}

#map[data-map-style="contrast"] .leaflet-tile-pane {
  filter: saturate(1.35) contrast(1.3) brightness(1.03) sepia(0.08);
}

.leaflet-popup-content {
  line-height: 1.5;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .map-shell {
    min-height: 60vh;
  }
}
