:root {
  --bar: #0b3d5c;
  --bg: #ffffff;
  --text: #13202b;
  --muted: #5d6b77;
  --line: #e3e8ec;
  --head: #f3f6f8;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Kopfzeile */
.bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
  background: var(--bar); color: #fff; flex: none;
}
.bar h1 { font-size: 18px; margin: 0; letter-spacing: .3px; }
.units { display: flex; border: 1px solid rgba(255,255,255,.5); border-radius: 8px; overflow: hidden; }
.units button {
  font: inherit; font-size: 14px; color: #fff; background: transparent;
  border: 0; padding: 6px 12px; min-width: 52px; cursor: pointer;
}
.units button.on { background: #fff; color: var(--bar); font-weight: 600; }

main { position: relative; flex: 1; min-height: 0; overflow: hidden; }
#map { position: absolute; inset: 0; background: #e9eef1; }
.wind-canvas { position: absolute; left: 0; top: 0; pointer-events: none; }

/* Hinweiszeile (Laden / Fehler) */
.status {
  position: absolute; z-index: 800; left: 16px; right: 16px; top: 12px;
  margin: 0 auto; max-width: 420px;
  background: #fff; border-radius: 8px; padding: 10px 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,.18); font-size: 14px;
}
.status button { font: inherit; margin-left: 8px; }

/* Legende */
.legend {
  position: absolute; z-index: 700; right: 10px; top: 10px;
  background: rgba(255,255,255,.92); border-radius: 8px; padding: 6px 8px;
  font-size: 11px; color: var(--muted); pointer-events: none;
}
.legend-scale { display: flex; gap: 2px; }
.legend-scale span { width: 20px; height: 8px; border-radius: 2px; }
.legend-nums { display: flex; justify-content: space-between; margin-top: 2px; }

/* Pins */
.pin { background: none; border: 0; }
.pin-in {
  position: relative; border-radius: 50%;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px; color: #fff;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.pin-in.sel { outline: 3px solid var(--bar); outline-offset: 1px; }
.pin-arrow { position: absolute; inset: -11px; pointer-events: none; }
.pin-arrow::before {
  content: ""; position: absolute; left: 50%; top: 0; transform: translateX(-50%);
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 10px solid #13202b;
}
@media (max-width: 499px) {
  .pin-in { font-size: 12px; }
}

/* Spot-Fenster unten */
.sheet {
  position: absolute; z-index: 1100; left: 0; right: 0; bottom: 0; /* über Leaflet-Bedienelementen (1000) */
  max-width: 560px; margin: 0 auto; max-height: 62%; overflow-y: auto;
  background: var(--bg); border-radius: 14px 14px 0 0;
  box-shadow: 0 -4px 18px rgba(0,0,0,.18);
}
.sheet-head { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px 8px; }
.sheet-title { min-width: 0; }
.sheet-title h2 { margin: 0; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-title p { margin: 0; font-size: 13px; color: var(--muted); }
.close {
  margin-left: auto; flex: none; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: var(--head); font-size: 16px; cursor: pointer; color: var(--text);
}
.big { display: flex; gap: 8px; padding: 0 16px 10px; }
.big div { flex: 1; min-width: 0; background: var(--head); border-radius: 10px; padding: 6px 4px; text-align: center; }
.big small { display: block; color: var(--muted); font-size: 11px; }
.big b { font-size: 20px; white-space: nowrap; }
.big b small { display: inline; font-size: 11px; font-weight: 400; }
.big i { display: inline-block; font-style: normal; }

.strip {
  display: flex; gap: 2px; overflow-x: auto; padding: 0 16px 6px;
  -webkit-overflow-scrolling: touch; font-variant-numeric: tabular-nums;
}
.col {
  flex: none; width: 40px; text-align: center; font-size: 12px;
  border: 0; background: none; font: inherit; color: inherit;
  border-radius: 6px; padding: 3px 0; cursor: pointer;
}
.col.on { background: #e3edf4; }
.col.past { opacity: .45; cursor: default; }
.col .h { display: block; color: var(--muted); font-size: 12px; }
.col .a { display: block; height: 20px; font-size: 15px; }
.col .v { display: block; margin: 2px 3px; border-radius: 4px; font-weight: 700; font-size: 13px; padding: 2px 0; }
.col .m { display: block; font-size: 10px; color: var(--muted); }
.note { color: var(--muted); font-size: 11px; margin: 4px 16px 12px; }

/* Zeitleiste unten */
.time {
  flex: none; background: var(--bg); border-top: 1px solid var(--line);
  padding: 8px 16px; padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.time-top { display: flex; align-items: center; gap: 10px; }
.play {
  width: 38px; height: 38px; flex: none; border-radius: 50%; border: 0;
  background: var(--bar); color: #fff; font-size: 14px; cursor: pointer;
}
.time-label { font-weight: 700; }
.time-model { margin-left: auto; font-size: 12px; color: var(--muted); }
#slider { width: 100%; margin: 8px 0 2px; height: 28px; accent-color: var(--bar); }
.days { display: flex; font-size: 12px; color: var(--muted); }
.days button {
  flex: 1; min-width: 0; font: inherit; color: inherit; background: none;
  border: 0; border-left: 1px solid var(--line); padding: 3px 0; cursor: pointer;
}
.days button:first-child { border-left: 0; }
.days button.on { color: var(--bar); font-weight: 700; }
