:root {
  color-scheme: light;
  --deep: #12382d;
  --deep-2: #0b2a25;
  --green: #1f7a5f;
  --green-soft: #dcefe7;
  --sand: #f4eddc;
  --sand-2: #fbf7ed;
  --water: #d9edf4;
  --text: #17211d;
  --muted: #53635c;
  --line: rgba(18, 56, 45, .16);
  --line-strong: rgba(18, 56, 45, .26);
  --shadow: 0 16px 40px rgba(8, 32, 28, .14);
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--sand-2);
}
a { color: #0b5f88; }
button, input { font: inherit; }
.app-shell {
  --sidebar-width: clamp(330px, 30vw, 390px);
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  position: relative;
  transition: grid-template-columns .24s ease;
}
.app-shell.sidebar-collapsed {
  grid-template-columns: 0 minmax(0, 1fr);
}
.sidebar {
  z-index: 1000;
  min-width: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 14px;
  background:
    radial-gradient(circle at top left, rgba(217, 237, 244, .95), transparent 26rem),
    linear-gradient(160deg, var(--sand-2), var(--sand));
  border-right: 1px solid var(--line);
  transition: opacity .2s ease, transform .24s ease, padding .24s ease;
}
.app-shell.sidebar-collapsed .sidebar {
  width: 0;
  min-width: 0;
  padding: 0;
  border-right: 0;
  opacity: 0;
  transform: translateX(-18px);
  pointer-events: none;
  overflow: hidden;
}
.sidebar-toggle {
  position: fixed;
  z-index: 1600;
  top: 14px;
  left: calc(clamp(330px, 30vw, 390px) + 14px);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(18,56,45,.18);
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(255,255,255,.94);
  color: var(--deep);
  box-shadow: 0 10px 28px rgba(8,32,28,.14);
  font-weight: 850;
  font-size: 12px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: left .24s ease, transform .16s ease, background .16s ease, color .16s ease;
}
.sidebar-toggle:hover {
  background: var(--deep);
  color: white;
}
.sidebar-toggle:focus-visible {
  outline: 3px solid rgba(31,122,95,.24);
  outline-offset: 2px;
}
.toggle-icon { font-size: 14px; line-height: 1; }
.app-shell.sidebar-collapsed .sidebar-toggle { left: 64px; }
.app-shell.sidebar-collapsed .sidebar-toggle .toggle-label::after { content: " einblenden"; }
.sidebar-header, .panel {
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(18, 56, 45, .12);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(8, 32, 28, .08);
  backdrop-filter: blur(10px);
}
.sidebar-header {
  padding: 14px;
  margin-bottom: 10px;
}
.eyebrow {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--green);
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1 {
  margin: 0;
  font-size: clamp(23px, 2.7vw, 31px);
  line-height: 1.05;
  letter-spacing: -.035em;
  color: var(--deep);
}
.lead {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
  margin: 9px 0 0;
}
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
}
.compact-stats { margin-top: 12px; }
.stat {
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 8px 9px;
  min-width: 0;
}
.stat b { display: block; font-size: 19px; line-height: 1; color: var(--deep); }
.stat span { display: block; margin-top: 3px; font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.panel {
  margin-top: 10px;
  padding: 0;
  overflow: hidden;
}
.panel summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 13px;
  font-size: 13px;
  font-weight: 800;
  color: var(--deep);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.panel summary::-webkit-details-marker { display: none; }
.panel summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform .16s ease;
  flex: 0 0 auto;
}
.panel[open] summary::after { transform: rotate(225deg); }
.panel > :not(summary) { margin: 0 13px 13px; }
.search-panel { padding: 13px; }
.search-panel > * { margin-left: 0; margin-right: 0; }
.label {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 750;
}
.search {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 11px 12px;
  font-size: 13px;
  background: white;
  outline: none;
}
.search:focus { border-color: rgba(31,122,95,.72); box-shadow: 0 0 0 4px rgba(31,122,95,.12); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 1px; }
.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  padding: 7px 9px;
  cursor: pointer;
  color: var(--deep);
  font-weight: 750;
  font-size: 11.5px;
}
.chip:hover { background: white; border-color: var(--line-strong); }
.chip.active { background: var(--deep); color: white; border-color: var(--deep); }
.list-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 11.5px;
}
.text-button {
  border: 1px solid var(--line);
  background: white;
  color: var(--deep);
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.text-button:hover { border-color: var(--green); color: var(--green); }
.spot-list {
  display: grid;
  gap: 7px;
  max-height: min(48vh, 455px);
  overflow: auto;
  padding-right: 4px;
}
.spot-item {
  width: 100%;
  text-align: left;
  border: 1px solid rgba(18,56,45,.12);
  border-radius: 16px;
  background: rgba(255,255,255,.75);
  padding: 9px;
  cursor: pointer;
  color: inherit;
}
.spot-item:hover { border-color: rgba(31,122,95,.55); background: #fff; }
.spot-row { display: grid; grid-template-columns: 13px 1fr auto; align-items: start; gap: 7px; }
.spot-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-top: 3px;
  border: 2px solid white;
  box-shadow: 0 0 0 1px rgba(0,0,0,.22);
}
.spot-main { min-width: 0; }
.spot-main strong {
  display: block;
  font-size: 12.8px;
  line-height: 1.22;
  color: var(--deep);
}
.spot-meta {
  display: block;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.28;
  font-size: 11.2px;
}
.badge {
  border-radius: 999px;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 850;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge-high { background: #dcefe7; color: #0d4a38; border-color: #b8decf; }
.badge-mid { background: #fff1c7; color: #6b4a00; border-color: #ead99b; }
.badge-low { background: #eee9e1; color: #5d5348; border-color: #d8cfc1; }
.legend {
  display: grid;
  grid-template-columns: 16px 1fr;
  align-items: center;
  gap: 8px 8px;
  font-size: 12px;
  color: var(--muted);
}
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid white; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.dash { border-bottom: 2px dashed #333; width: 18px; display: inline-block; }
.quality-note, .notice {
  margin-top: 11px;
  padding: 10px 11px;
  border-radius: 15px;
  background: #fff7db;
  border: 1px solid #ead99b;
  color: #654600;
  font-size: 11.5px;
  line-height: 1.35;
}
.downloads { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.downloads a {
  display: block;
  text-align: center;
  text-decoration: none;
  border-radius: 14px;
  padding: 9px 7px;
  background: var(--deep);
  color: white;
  font-weight: 800;
  font-size: 12px;
}
.downloads a:hover { background: var(--green); }
.map-wrap { position: relative; width: 100%; height: 100vh; overflow: hidden; background: #d9edf4; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 100%; overflow: hidden; background: #d9edf4; }
.leaflet-container { width: 100% !important; height: 100% !important; }
.map-badge {
  position: absolute;
  z-index: 800;
  right: 14px;
  bottom: 14px;
  max-width: min(360px, calc(100% - 28px));
  background: rgba(255,255,255,.92);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--muted);
  box-shadow: 0 10px 28px rgba(0,0,0,.12);
}
.leaflet-control-layers { border: none !important; border-radius: 18px !important; box-shadow: 0 12px 30px rgba(0,0,0,.16) !important; overflow: hidden; }
.leaflet-popup-content-wrapper { border-radius: 18px; }
.popup h3 { margin: 0 0 8px; font-size: 17px; color: var(--deep); }
.popup table { border-collapse: collapse; font-size: 12px; min-width: 280px; }
.popup td { padding: 5px 6px; vertical-align: top; border-top: 1px solid #eee; }
.popup td:first-child { font-weight: 750; color: #2b3934; white-space: nowrap; }
.spot-label { background: rgba(255,255,255,.92) !important; border: 1px solid rgba(0,0,0,.12) !important; border-radius: 999px !important; padding: 3px 8px !important; font-weight: 750; color: var(--deep) !important; box-shadow: 0 4px 12px rgba(0,0,0,.08); }
@media (max-width: 900px) {
  html, body { overflow: auto; }
 .app-shell { width: 100%; height: auto; min-height: 100vh; overflow: visible; grid-template-columns: 1fr; grid-template-rows: auto 72vh; }
  .sidebar { height: auto; max-height: none; border-right: none; border-bottom: 1px solid var(--line); }
  .map-wrap { height: 72vh; min-height: 520px; }
  #map { min-height: 520px; }
  .spot-list { max-height: 340px; }
}
@media (max-width: 520px) {
  .sidebar { padding: 10px; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .downloads { grid-template-columns: 1fr; }
  .spot-row { grid-template-columns: 13px 1fr; }
  .badge { grid-column: 2; width: fit-content; }
}
