/* ===========================================================================
   Hausboot-Navigator – responsive Layout (mobile-first), Offline-PWA
   =========================================================================== */
:root {
  --teal: #0d6e6e;
  --blue: #1c6cab;
  --orange: #e8590c;
  --bg: #f4f7f9;
  --panel: #ffffff;
  --ink: #1d2b33;
  --muted: #6c7a85;
  --ok: #2f9e44;
  --warn: #f08c00;
  --err: #e03131;
  --line: #e2e8ee;
  --shadow: 0 2px 12px rgba(0, 40, 60, .12);
}

/* Dark Mode – überschreibt die Farbvariablen */
:root[data-theme="dark"] {
  --teal: #2bb3ad;
  --blue: #5aa9e6;
  --orange: #ff8a4c;
  --bg: #0b1f26;
  --panel: #12262e;
  --ink: #e6edf1;
  --muted: #93a4ad;
  --ok: #4cc66a;
  --warn: #ffb454;
  --err: #ff6b6b;
  --line: #21404a;
  --shadow: 0 2px 14px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
/* Das hidden-Attribut muss display-setzende Klassen (z. B. .overlay/.live-controls
   mit display:grid) immer schlagen – sonst sind „versteckte“ Dialoge sichtbar. */
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink); background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

/* Karte füllt den Hintergrund */
#map { position: fixed; inset: 0; z-index: 0; }

/* Panel: mobil unten als Sheet, ab Tablet seitlich */
#panel {
  position: fixed; z-index: 10;
  left: 0; right: 0; bottom: 0;
  max-height: 70vh; overflow-y: auto;
  background: var(--panel);
  border-radius: 16px 16px 0 0;
  box-shadow: var(--shadow);
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}
body.panel-collapsed #panel { transform: translateY(calc(100% - 56px)); }
#panel { transition: transform .25s ease; }

/* Schwebende Steuerung (immer sichtbar) */
#floatControls {
  position: fixed; z-index: 11; top: 10px; right: 10px;
  display: flex; gap: 7px;
}
.fc-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: none; background: var(--teal); color: #fff;
  font-size: 16px; box-shadow: var(--shadow); cursor: pointer;
  display: grid; place-items: center; padding: 0;
}
.fc-btn.active { background: var(--orange); }
.fc-btn:active { transform: scale(.94); }

/* Layer-Popover am 🛟-Button */
.fc-popover-wrap { position: relative; }
.fc-popover {
  position: absolute; top: 46px; right: 0;
  min-width: 220px; background: var(--bg, #fff); color: var(--fg, #222);
  border: 1px solid var(--border, #ccc); border-radius: 8px;
  box-shadow: var(--shadow); padding: 10px 12px; z-index: 12;
}
.fc-popover h3 { margin: 0 0 6px; font-size: .85rem; color: var(--teal); }
.fc-popover label { display: flex; align-items: center; gap: 8px; font-size: .85rem; padding: 3px 0; cursor: pointer; }
.fc-popover label input { margin: 0; }
.fc-popover .lp-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,.2); }

/* Marker-Cluster für Piers/Slips/Ankerplätze (Override des Default-Skins) */
.pier-cluster-wrap { background: transparent !important; border: none !important; }
.pier-cluster {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: .8rem;
  border-radius: 50%; border: 2px solid rgba(255,255,255,.85);
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}

/* Pier-Detail-Dialog: Tag-Tabelle */
.pier-tags { width: 100%; border-collapse: collapse; font-size: .82rem; margin-top: 8px; }
.pier-tags th, .pier-tags td { text-align: left; padding: 3px 6px; border-bottom: 1px solid var(--border, #eee); vertical-align: top; }
.pier-tags th { width: 38%; color: var(--muted); font-weight: 500; }
.pier-tags td { word-break: break-word; }
.pier-kind-badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: .72rem; font-weight: 600; color: #fff; margin-right: 6px;
}
.pier-kind-badge.pier         { background: #2c6e91; }
.pier-kind-badge.slipway      { background: #8a5a2b; }
.pier-kind-badge.anchorage    { background: #d4351c; }
.pier-kind-badge.anchor_berth { background: #f39c12; color: #222; }

/* Nahe-Anleger/Ankerplätze in der Hafen-Detailansicht */
.near-list { list-style: none; padding: 0; margin: 6px 0 0; }
.near-list li { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px dashed var(--border, #eee); font-size: .85rem; }
.near-list .nl-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.near-list .nl-dist { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .78rem; }
.near-list button.mini { padding: 1px 6px; font-size: .75rem; }
/* Umkreis-Umschalter über der Anleger-/Ankerplatz-Liste */
.near-radius { display: inline-flex; gap: 4px; margin: 4px 0 6px; }
.near-radius-btn {
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  padding: 2px 8px; font-size: .75rem; border-radius: 12px; cursor: pointer;
}
.near-radius-btn.active { background: var(--teal); color: #fff; border-color: var(--teal); }
.near-radius-show {
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  padding: 2px 7px; font-size: .75rem; border-radius: 12px; cursor: pointer; margin-left: 4px;
}
.near-radius-show:hover { background: var(--teal); color: #fff; border-color: var(--teal); }

.app-header h1 { font-size: 1.15rem; margin: 0 0 2px; color: var(--teal); }
.trip-info { margin: 0 0 8px; font-size: .78rem; color: var(--muted); }
.trip-info .boat-link { color: var(--teal); text-decoration: underline; cursor: pointer; background: none; border: 0; padding: 0; font: inherit; }
.trip-info .boat-link:hover { filter: brightness(1.15); }
.boat-spec { display: grid; grid-template-columns: max-content 1fr auto; gap: 6px 14px; align-items: baseline; margin: 8px 0 14px; font-size: .9rem; }
.boat-spec dt { color: var(--muted); }
.boat-spec dd { margin: 0; }
.boat-used-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; background: var(--teal); color: #fff; font-size: .7rem; font-weight: 600; letter-spacing: .02em; }
.boat-section-title { margin: 14px 0 4px; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

.block { border-top: 1px solid var(--line); padding: 12px 0; }
.block:first-of-type { border-top: none; }
.block h2 { font-size: .95rem; margin: 0 0 8px; }
.block h3 { font-size: .9rem; margin: 0 0 8px; }
.block-head { display: flex; justify-content: space-between; align-items: center; }
.actions { display: flex; gap: 6px; }

/* Buttons */
button { font: inherit; }
.mini { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.mini:hover { background: #f0f4f7; }
.mini.danger { color: var(--err); border-color: #f3c2c2; }

/* Ziel-Chips */
.stops { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #eef4f8; border: 1px solid #d7e3ec; color: var(--blue);
  border-radius: 999px; padding: 4px 10px; font-size: .82rem; cursor: pointer;
}
.chip.home { background: #e1f0ef; border-color: #b9ddda; color: var(--teal); font-weight: 600; }
.chip.ghost { opacity: .6; font-style: italic; }
.chip-idx { background: rgba(0,0,0,.08); border-radius: 50%; width: 18px; height: 18px; display: grid; place-items: center; font-size: .7rem; }
.chip-x { border: none; background: none; color: inherit; font-size: 1.1rem; line-height: 1; cursor: pointer; padding: 0 0 0 2px; }

.toggle { display: flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted); }
.sub-toggle { font-weight: 500; color: var(--ink); }

/* Zusammenfassung */
.alert { border-radius: 10px; padding: 10px 12px; font-size: .85rem; font-weight: 500; margin-bottom: 10px; }
.alert.ok  { background: #e7f6ec; color: #1b6b32; }
.alert.warn{ background: #fff4e2; color: #8a5300; }
.alert.err { background: #fdecec; color: #a51e1e; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: #f7fafc; border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; text-align: center; }
.stat .num { font-size: 1.05rem; font-weight: 700; color: var(--teal); }
.stat .lbl { font-size: .68rem; color: var(--muted); }

.warnings { margin-top: 10px; font-size: .8rem; }
.warnings summary { cursor: pointer; color: var(--warn); }
.warn-item { padding: 4px 0 0 4px; color: var(--muted); }

/* Optionen ("nächste Ziele") */
.opt {
  display: flex; gap: 8px; align-items: stretch;
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; background: #fff;
}
.opt-main { flex: 1; cursor: pointer; }
.opt-name { font-weight: 600; }
.conf { color: var(--muted); font-weight: 400; }
.opt-meta { font-size: .8rem; color: var(--blue); margin: 2px 0; }
.geomkm { color: var(--muted); font-weight: 400; }
.opt-way { font-size: .72rem; color: var(--muted); }
.opt-desc { font-size: .78rem; color: var(--ink); margin-top: 4px; }
.opt-locks { font-size: .72rem; color: var(--err); margin-top: 3px; }
.opt-add { align-self: center; white-space: nowrap; border: 1px solid var(--orange); color: var(--orange); background: #fff; border-radius: 8px; padding: 6px 8px; cursor: pointer; font-size: .8rem; }
.opt-add:hover { background: var(--orange); color: #fff; }

/* Tagesplan */
.day { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; overflow: hidden; }
.day-head { background: var(--teal); color: #fff; padding: 6px 10px; font-size: .82rem; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.day-title { flex: 1; }
.day-arr { font-weight: 400; opacity: .9; }
.day-start { display: inline-flex; align-items: center; gap: 4px; font-weight: 400; }
.day-start input[type="time"] { font: inherit; font-size: .78rem; padding: 1px 4px; border: none; border-radius: 5px; background: rgba(255,255,255,.9); color: #123; }
.day-start-reset { border: none; background: rgba(255,255,255,.25); color: #fff; border-radius: 5px; cursor: pointer; font-size: .72rem; line-height: 1; padding: 2px 5px; }
.day-rest { border: none; background: rgba(255,255,255,.25); color: #fff; border-radius: 5px; cursor: pointer; font-size: .85rem; line-height: 1; padding: 3px 6px; }
.day-rest:hover { background: rgba(255,255,255,.4); }
.leg-stay { font-size: .74rem; color: var(--blue); margin-top: 2px; }
.leg-note { font-size: .74rem; margin-top: 3px; padding: 4px 6px; border-radius: 5px; border-left: 3px solid transparent; line-height: 1.35; }
.leg-note-wait { background: color-mix(in srgb, var(--warn) 14%, transparent); border-left-color: var(--warn); color: var(--warn); }
.leg-note-shift { background: color-mix(in srgb, var(--err) 12%, transparent); border-left-color: var(--err); color: var(--err); }
.leg-note-warn { background: color-mix(in srgb, var(--err) 14%, transparent); border-left-color: var(--err); color: var(--err); }
.leg-note-fuel { background: color-mix(in srgb, var(--blue) 14%, transparent); border-left-color: var(--blue); color: var(--blue); }
.leg-fuel-chip { font-size: .82rem; }
.hr-fuel { font-size: .82rem; }
.advisory.fuel { margin-top: 6px; padding: 6px 8px; border-radius: 8px; background: #eef6fb; }
.advisory.fuel.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); }
.advisory.fuel.err  { background: color-mix(in srgb, var(--err)  16%, transparent); color: var(--err); }
.leg { padding: 6px 10px; border-top: 1px solid var(--line); }
.leg:first-of-type { border-top: none; }
.leg-route { font-size: .85rem; }
.leg-meta { font-size: .74rem; color: var(--blue); }
.leg-locks { font-size: .72rem; color: var(--err); display: flex; flex-wrap: wrap; gap: 4px; }
.leg-lock-btn { background: transparent; border: 1px solid currentColor; color: var(--err); border-radius: 999px; padding: 1px 8px; font: inherit; font-size: .72rem; cursor: pointer; line-height: 1.4; }
.leg-lock-btn:hover { background: rgba(192,57,43,.12); }
.day-foot { background: #f7fafc; padding: 5px 10px; font-size: .74rem; color: var(--muted); }
.day-wx { padding: 6px 10px 8px; }
.day-wx .wind-line { margin: 0; }
.wx-na { font-size: .74rem; }

/* Presets */
.presets { display: grid; gap: 6px; }
.preset { text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.preset b { display: block; font-size: .85rem; }
.preset span { font-size: .74rem; color: var(--muted); }
.preset:hover { border-color: var(--blue); }

.saved { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: .85rem; }
.saved span { flex: 1; }

/* Hafen-Suche (Floating-Dialog) */
#harborSearch { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); margin: 8px 0 0; }
.harbor-list { display: grid; gap: 6px; }
.harbor-row { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); }
.harbor-row .hr-top { display: flex; align-items: center; gap: 8px; }
.harbor-row .hr-name { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; font: inherit; font-size: .95rem; font-weight: 600; color: var(--ink); cursor: pointer; }
.harbor-row .hr-name:hover { color: var(--blue); text-decoration: underline; }
.harbor-row .hr-desc { font-size: .78rem; color: var(--muted); line-height: 1.3; }
.harbor-row .hr-add { flex: 0 0 auto; white-space: nowrap; }
.harbor-row .hr-home { color: var(--teal); }
.harbor-row.lock-row .hr-name { color: var(--red, #c0392b); }
.hr-section { margin: 10px 2px 4px; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }

/* Seekarten-Legende */
.seamark-legend h3 { margin: 12px 0 6px; font-size: .85rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.seamark-legend h3:first-child { margin-top: 0; }
.sm-row { display: flex; align-items: center; gap: 12px; padding: 6px 0; font-size: .88rem; border-bottom: 1px solid var(--line); }
.sm-row:last-child { border-bottom: 0; }
.sm-row b { color: var(--ink); }
.sm-row > div { flex: 1; }
.sm-img { width: auto; max-width: 120px; max-height: 64px; flex: 0 0 auto; object-fit: contain; background: #f4f7f9; border-radius: 4px; padding: 2px; }
body.theme-dark .sm-img { background: #e6eef2; }
.sm-callout { margin: 0 0 12px; padding: 10px 12px; background: var(--bg-soft, #f4f6f9); border-left: 4px solid var(--teal); border-radius: 6px; font-size: .85rem; line-height: 1.45; }
.harbor-card .harbor-head { padding: 12px 14px 10px; }
.harbor-card .harbor-head h2 { margin: 0 0 4px; font-size: 1.05rem; }
.harbor-card .harbor-body { padding: 10px 14px 14px; overflow: auto; }
.mini.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.mini.primary:disabled { opacity: .4; cursor: default; }

.range { display: block; font-size: .8rem; color: var(--muted); margin: 8px 0; }
.range input { width: 100%; }

.muted { color: var(--muted); font-size: .82rem; }
.app-footer { border-top: 1px solid var(--line); padding-top: 10px; }
.disclaimer { font-size: .68rem; color: var(--muted); line-height: 1.4; }

/* Karten-Marker */
.harbor-marker .hm {
  position: relative;
  width: var(--sz); height: var(--sz); border-radius: 50%;
  background: var(--bg); color: #fff; display: grid; place-items: center;
  border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); font-size: 14px;
}
.harbor-marker .hm[style*="--sz:30"] { font-size: 16px; }
/* Routen-Nummer am Hafen-Marker */
.hm-num {
  position: absolute; top: -8px; left: -10px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9px; background: #fff; color: #111;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  border: 1px solid rgba(0,0,0,.25); box-shadow: 0 1px 2px rgba(0,0,0,.4);
}
/* Lock-Popup */
.lock-pop { font-size: .82rem; }
.lock-pop-title { font-weight: 700; font-size: .9rem; }
.lock-pop-water, .lock-pop-meta, .lock-pop-note { font-size: .72rem; margin-top: 2px; }
.lock-pop-date { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: .76rem; }
.lock-pop-date input { font: inherit; padding: 2px 4px; }
.lock-pop-window { margin-top: 6px; padding: 6px 8px; background: #eef7ee; border-radius: 6px; }
.lock-pop-window.err { background: #fdecec; color: #a51e1e; }
/* Karten-Legende (Tagesfarben) – als fixed-DIV im Body (kein Leaflet-Control). */
.map-legend {
  position: fixed; right: 8px; bottom: 12px; z-index: 12;
  background: rgba(255,255,255,.92); color: #123;
  padding: 6px 8px; border-radius: 8px; font-size: .74rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.25); max-width: 200px;
  pointer-events: auto;
}
[data-theme="dark"] .map-legend { background: rgba(20,30,40,.92); color: #eef; }
.map-legend .ml-title { font-weight: 700; margin-bottom: 3px; font-size: .72rem; opacity: .8; }
.map-legend .ml-row { display: flex; align-items: center; gap: 6px; line-height: 1.5; }
.map-legend .ml-swatch { width: 14px; height: 4px; border-radius: 2px; display: inline-block; }
/* Mobil: über dem eingeklappten Panel-Peek (~56 px) und der Attribution platzieren.
   Wenn das Panel ausgeklappt ist (bis 70 vh), Legende dynamisch darüber schieben. */
@media (max-width: 819px) {
  .map-legend {
    bottom: 72px;
    max-width: 55vw; font-size: .72rem; padding: 5px 7px; line-height: 1.35;
  }
  body:not(.panel-collapsed) .map-legend { bottom: calc(70vh + 8px); }
  .map-legend .ml-row { font-size: .68rem; }
}

/* "Auf Karte zeigen"-Button in NfB-Koordinaten-Zeile */
.nfb-coord-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 6px; padding: 2px 7px; font-size: .78rem; cursor: pointer;
  margin-left: 6px; white-space: nowrap;
}
.nfb-coord-btn:hover { background: var(--teal); color: #fff; border-color: var(--teal); }
[data-theme="dark"] .nfb-coord-btn { background: #1a242e; color: #eef; }

/* Schwebender "Zurück zur Meldung"-Button (wenn ELWIS-Koords auf der Karte aktiv sind) */
#nfbReturnBtn {
  position: fixed; z-index: 20;
  bottom: calc(16px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  background: var(--orange, #e8590c); color: #fff; border: none;
  padding: 10px 18px; border-radius: 22px; font-size: .9rem; font-weight: 600;
  box-shadow: 0 2px 10px rgba(0,0,0,.3); cursor: pointer;
}
#nfbReturnBtn:active { transform: translateX(-50%) scale(.96); }
/* Kurzes Aufblitzen des NfB-Eintrags nach "Zurück zur Meldung". */
.nfb-flash { animation: nfbFlash 1.6s ease-out; }
@keyframes nfbFlash {
  0%   { box-shadow: 0 0 0 3px var(--orange, #e8590c); background: rgba(232,89,12,.18); }
  60%  { box-shadow: 0 0 0 3px var(--orange, #e8590c); background: rgba(232,89,12,.10); }
  100% { box-shadow: 0 0 0 0 transparent; background: transparent; }
}

/* Liegetag-Badge auf der Karte (Ring + Tagesnummer am Liegehafen). */
.rest-day-badge { background: transparent !important; border: none !important; }
.rest-day-badge .rdb {
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; border: 2px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1; box-shadow: 0 1px 3px rgba(0,0,0,.3);
  position: relative;
}
.rest-day-badge .rdb span {
  position: absolute; right: -6px; bottom: -4px;
  background: currentColor; color: #fff;
  font-size: 9px; font-weight: 700; line-height: 1;
  padding: 2px 4px; border-radius: 8px;
}
[data-theme="dark"] .rest-day-badge .rdb { background: #1a242e; }

/* Live-Modus */
.live-toggle, .plan-toggle { font-weight: 600; color: var(--ink); }
.plan-toggle { margin-bottom: 6px; }
.live-toggle { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); display: block; }
.live-block .block-title { margin: 0 0 8px; font-size: .92rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.live-controls { margin-top: 10px; display: grid; gap: 8px; }
.live-status { font-size: .82rem; padding: 8px 10px; border-radius: 8px; background: var(--block-alt, #f3f7f9); }
.live-status.err { background: #fdecec; color: #a51e1e; }
.field { display: grid; gap: 3px; font-size: .78rem; color: var(--muted); }
.field select, .field input { font: inherit; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
.live-hint { font-size: .74rem; margin: 2px 0 0; }
.badge-water { font-size: .8rem; }

/* Boot-Marker (GPS-Position im Live-Modus) */
.boat-marker .bm {
  width: 34px; height: 34px; border-radius: 50%;
  background: #ffba08; color: #1b1b1b; display: grid; place-items: center;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.45);
  font-size: 18px;
  animation: boatPulse 1.8s ease-in-out infinite;
}
@keyframes boatPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,186,8,.55), 0 2px 6px rgba(0,0,0,.45); }
  50%      { box-shadow: 0 0 0 12px rgba(255,186,8,0),   0 2px 6px rgba(0,0,0,.45); }
}

/* Open-Water-Hinweis & Wind */
.advisory { margin-top: 10px; background: #eef6fb; border: 1px solid #cfe6f4; border-radius: 10px; padding: 8px 10px; font-size: .78rem; color: #155e8a; }
.wind-line { margin-top: 6px; font-size: .78rem; padding: 4px 8px; border-radius: 8px; }
.wind-line.ok { background: #e7f6ec; color: #1b6b32; }
.wind-line.warn { background: #fff4e2; color: #8a5300; }
.wind-line.err { background: #fdecec; color: #a51e1e; }
.sun-line { font-size: .72rem; margin-top: 2px; }
.trend { font-weight: 600; font-size: .76rem; padding: 1px 5px; border-radius: 6px; margin-left: 4px; }
.trend.up   { background: #fdecec; color: #a51e1e; }
.trend.down { background: #e7f6ec; color: #1b6b32; }
.trend.flat { background: #eef0f3; color: #555; }
:root[data-theme="dark"] .trend.up   { background: #3a1717; color: #ff9b9b; }
:root[data-theme="dark"] .trend.down { background: #14331f; color: #7ee59a; }
:root[data-theme="dark"] .trend.flat { background: #2a2e34; color: #ccc; }

/* ELWIS-NfB-Anzeige */
.nfb-line { font-size: .78rem; padding: 6px 10px; border-radius: 8px; margin-top: 6px; line-height: 1.35; }
.nfb-line.ok   { background: #f1f4f7; color: var(--muted); }
.nfb-line.warn { background: #fff4e2; color: #8a5300; }
.nfb-line.clickable { cursor: pointer; }
.nfb-line.clickable:hover { filter: brightness(0.96); }
.nfb-line a { color: inherit; text-decoration: underline; }
:root[data-theme="dark"] .nfb-line.ok   { background: #1f242a; color: #aab; }
:root[data-theme="dark"] .nfb-line.warn { background: #3a2e12; color: #ffcd7a; }
.nfb-dialog-list { display: flex; flex-direction: column; gap: 10px; }
.nfb-item { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--card-alt); }
.nfb-item .nfb-title { font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.nfb-item .nfb-meta { font-size: .75rem; color: var(--muted); margin-bottom: 6px; }
.nfb-item .nfb-body { font-size: .85rem; white-space: pre-wrap; line-height: 1.4; }
.nfb-item .nfb-links { margin-top: 8px; font-size: .78rem; }
.nfb-item .nfb-tags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.nfb-item .nfb-tag { background: var(--card); border-radius: 999px; padding: 1px 8px; font-size: .72rem; border: 1px solid var(--border); }
.nfb-entries { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 8px; }
.nfb-keyfacts { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 6px 0 8px; padding: 6px 10px; background: var(--card); border-left: 3px solid var(--teal); border-radius: 4px; font-size: .85rem; }
.nfb-keyfacts dt { color: var(--muted); font-weight: 500; }
.nfb-keyfacts dd { margin: 0; font-weight: 600; }
.nfb-entry { border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; background: var(--card); }
.nfb-entry-ort { font-weight: 600; font-size: .85rem; margin-bottom: 4px; }
.nfb-entry-grid { display: grid; grid-template-columns: max-content 1fr; gap: 2px 10px; margin: 0; font-size: .8rem; line-height: 1.35; }
.nfb-entry-grid dt { color: var(--muted); font-weight: 500; }
.nfb-entry-grid dd { margin: 0; }
.nfb-extra { margin-top: 6px; font-size: .78rem; }
.nfb-extra summary { cursor: pointer; color: var(--muted); }
.nfb-extra .nfb-body { margin-top: 4px; color: var(--muted); }
.lock-section-title { font-weight: 600; font-size: .85rem; color: var(--muted); margin: 8px 0 2px; text-transform: uppercase; letter-spacing: .04em; }
.lock-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.lock-chip { background: var(--card-alt); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; font-size: .8rem; }
.lock-chip-plan { background: var(--teal); color: #fff; border-color: transparent; }
.lock-card { background: var(--card-alt); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; }
.lock-card-head { font-weight: 600; font-size: .82rem; color: var(--muted); margin: 0 0 6px; text-transform: uppercase; letter-spacing: .04em; }
.lock-card-note { border-left: 3px solid #d99a30; background: #fff4e2; }
:root[data-theme="dark"] .lock-card-note { background: #3a2e12; color: #ffcd7a; }
.lock-status { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .82rem; font-weight: 600; margin: 0 0 8px; }
.lock-status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.lock-status-open { color: #1f7a3a; background: #e3f5e8; }
.lock-status-lunch { color: #8a5a00; background: #fff1d6; }
.lock-status-closed { color: #a02020; background: #fde6e2; }
:root[data-theme="dark"] .lock-status-open { background: rgba(31,122,58,.18); color: #7fdc99; }
:root[data-theme="dark"] .lock-status-lunch { background: rgba(138,90,0,.22); color: #ffcd7a; }
:root[data-theme="dark"] .lock-status-closed { background: rgba(160,32,32,.22); color: #ffb8ad; }
.lock-spec { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; font-size: .9rem; }
.lock-spec dt { color: var(--muted); }
.lock-spec dd { margin: 0; }
.lock-season-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.lock-season-table td { padding: 4px 6px; border-bottom: 1px solid var(--border); }
.lock-season-table tr:last-child td { border-bottom: 0; }
.lock-season-table tr.active td { background: rgba(0,128,128,.10); }
.lock-season-table tr.active td:first-child::before { content: '▸ '; color: var(--teal); font-weight: 700; }
.lock-nfb-details > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.lock-nfb-details > summary::-webkit-details-marker { display: none; }
.lock-nfb-details > summary::after { content: '▾'; color: var(--muted); font-size: .9rem; margin-left: auto; transition: transform .15s; }
.lock-nfb-details[open] > summary::after { transform: rotate(180deg); }
.lock-nfb-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--card-alt); color: var(--muted); border: 1px solid var(--border); }
.lock-nfb-badge[data-state="none"] { background: #e3f5e8; color: #1f7a3a; border-color: transparent; }
.lock-nfb-badge[data-state="warn"] { background: #fde6e2; color: #a02020; border-color: transparent; }
.lock-nfb-details.has-warn { border-color: #e8a89e; }
:root[data-theme="dark"] .lock-nfb-badge[data-state="none"] { background: rgba(31,122,58,.22); color: #7fdc99; }
:root[data-theme="dark"] .lock-nfb-badge[data-state="warn"] { background: rgba(160,32,32,.28); color: #ffb8ad; }
:root[data-theme="dark"] .lock-nfb-details.has-warn { border-color: rgba(160,32,32,.55); }
.lock-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.lock-show-map { background: var(--teal); color: #fff; border: 0; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: .85rem; cursor: pointer; }
.lock-show-map:hover { filter: brightness(1.1); }
.lock-elwis-link { font-size: .8rem; color: var(--teal); }
.lock-nfb-box { margin: 4px 0 10px; }
.lock-nfb-box.muted { color: var(--muted); }
.detail-nfb .nfb-head { font-size: .78rem; color: var(--muted); margin-bottom: 6px; }
.detail-nfb .ww-tag { display: inline-block; background: var(--card-alt); border-radius: 999px; padding: 1px 8px; margin: 2px 2px; font-size: .72rem; }
.detail-nfb .nfb-item { background: #fff4e2; border-left: 3px solid #d99a30; padding: 8px 10px; border-radius: 6px; margin: 6px 0; }
:root[data-theme="dark"] .detail-nfb .nfb-item { background: #3a2e12; color: #ffcd7a; }
.detail-nfb .nfb-title { font-weight: 600; }
.detail-nfb .nfb-body { font-size: .82rem; margin-top: 4px; white-space: pre-line; }
.detail-nfb .nfb-link { display: inline-block; margin-top: 8px; font-size: .8rem; }
.detail-nfb .nfb-sub { font-size: .78rem; margin: 10px 0 4px; font-weight: 600; }
.detail-nfb .nfb-item.nfb-explicit { border-left-width: 4px; border-left-color: #c0392b; background: #fde6e2; }
:root[data-theme="dark"] .detail-nfb .nfb-item.nfb-explicit { background: #4a1a14; color: #ffb8ad; }

/* Hafen-Detailansicht (Overlay) ------------------------------------------------ */
.overlay { position: fixed; inset: 0; z-index: 30; background: rgba(10, 30, 40, .45); display: grid; place-items: end center; }
@media (min-width: 820px) { .overlay { place-items: center; } }

/* Card als 3-Zeilen-Grid: Kopf (sticky) · scrollbarer Body · Aktionsleiste (sticky) */
.detail-card {
  background: var(--card); width: 100%; max-width: 520px;
  max-height: 92vh; display: grid; grid-template-rows: auto 1fr auto;
  border-radius: 16px 16px 0 0; position: relative; box-shadow: var(--shadow);
  overflow: hidden;
}
@media (min-width: 820px) { .detail-card { border-radius: 16px; max-height: 88vh; } }

.detail-head {
  position: relative; padding: 0;
  border-bottom: 1px solid var(--line); background: var(--card);
}
.detail-banner {
  height: 140px; background-size: cover; background-position: center;
  display: block;
  border-radius: 16px 16px 0 0;
  position: relative; background-color: #234;
}
@media (min-width: 820px) { .detail-banner { height: 170px; } }
/* Bei echtem Foto: dunkler Gradient unten f\u00fcr Icon-Lesbarkeit */
.detail-banner[data-photo='1']::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 40%, rgba(0,0,0,0.45) 100%);
  border-radius: 16px 16px 0 0; pointer-events: none;
}
.banner-icon {
  position: absolute; right: 12px; bottom: 8px;
  font-size: 2.2rem; line-height: 1; z-index: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,.55));
}
.detail-banner[data-photo='1'] .banner-icon { display: none; }
.banner-wx {
  position: absolute; left: 12px; top: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 600;
  background: rgba(255,255,255,0.92); color: var(--ink);
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.banner-wx.loading { background: rgba(255,255,255,0.72); color: var(--muted); font-weight: 400; }
.banner-wx.ok   { background: rgba(231,246,236,0.95); color: #1b6b32; }
.banner-wx.warn { background: rgba(255,244,226,0.95); color: #8a5300; }
.banner-wx.err  { background: rgba(253,236,236,0.95); color: #a51e1e; }
.banner-dist {
  position: absolute; left: 12px; bottom: 10px; z-index: 2;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 999px;
  font-size: .76rem; font-weight: 600;
  background: rgba(0,0,0,0.55); color: #fff;
  backdrop-filter: blur(4px);
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.banner-dist.home { background: rgba(212, 95, 31, 0.92); }
.banner-credit {
  position: absolute; right: 8px; bottom: 8px; z-index: 2;
  padding: 3px 8px; border-radius: 999px;
  font-size: .65rem;
  background: rgba(0,0,0,0.45); color: #fff;
  backdrop-filter: blur(4px);
}
.banner-credit a { color: #fff; text-decoration: none; }
.banner-credit a:hover { text-decoration: underline; }
.detail-head-text { padding: 10px 18px 12px; }
.detail-close {
  position: absolute; top: 8px; right: 10px; border: none;
  background: rgba(0,0,0,.35); color: #fff;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 1.3rem; line-height: 1; cursor: pointer; z-index: 2;
  display: grid; place-items: center;
}
.detail-close:hover { background: rgba(0,0,0,.55); }
.detail-card h2 { margin: 0 0 4px; color: var(--teal); font-size: 1.2rem; }
.detail-desc { font-size: .85rem; color: var(--muted); margin: 0; line-height: 1.4; }

.detail-body {
  overflow-y: auto; padding: 4px 14px 14px;
  -webkit-overflow-scrolling: touch;
}

/* Zwei klar getrennte Gruppen: Hafen vs. Ort */
.detail-group { margin: 12px 0 4px; }
.group-h {
  display: flex; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  color: var(--muted); text-transform: uppercase;
  padding: 4px 4px 6px; border-bottom: 2px solid var(--line); margin-bottom: 8px;
}
.group-icon { font-size: 1rem; }
.group-harbor .group-h { color: var(--teal); border-bottom-color: var(--teal); opacity: .85; }
.group-place .group-h  { color: var(--blue); border-bottom-color: var(--blue); opacity: .85; }

/* Einklappbare Sektionen */
.detail-section { margin: 6px 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow: hidden; }
.detail-section > summary.section-h {
  display: flex; align-items: center; gap: 8px;
  font-size: .85rem; font-weight: 600;
  color: var(--ink);
  padding: 10px 36px 10px 12px; margin: 0; cursor: pointer;
  list-style: none; position: relative;
  user-select: none;
}
.detail-section > summary.section-h > span:first-child { flex: 1; min-width: 0; }
.detail-section.has-warn { border-color: #e8a89e; }
:root[data-theme="dark"] .detail-section.has-warn { border-color: rgba(160,32,32,.55); }
.detail-section > summary.section-h::-webkit-details-marker { display: none; }
.detail-section > summary.section-h::after {
  content: '▸'; position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-size: .9rem; transition: transform .15s ease;
}
.detail-section[open] > summary.section-h::after { transform: translateY(-50%) rotate(90deg); }
.detail-section[open] > summary.section-h { border-bottom: 1px solid var(--line); background: var(--card-alt); }
.section-pad { padding: 10px 12px; }
/* Direkter Inhalt (kein .section-pad-Wrapper) bekommt eigenen Innenabstand */
.detail-section > :not(summary):not(.section-pad) { padding: 10px 12px; }

/* Wetter / Pegel / Distanz ----------------------------------------------------- */
.detail-weather { margin: 0; }
.wx { font-size: .82rem; padding: 8px 10px; border-radius: 10px; }
.wx.ok { background: #e7f6ec; color: #1b6b32; } .wx.warn { background: #fff4e2; color: #8a5300; } .wx.err { background: #fdecec; color: #a51e1e; }
.detail-pegel:empty { display: none; }
.pegel { font-size: .8rem; background: var(--card-alt); border-radius: 10px; padding: 8px 10px; margin-top: 8px; }
.detail-dist { font-size: .82rem; color: var(--blue); background: var(--card-alt); border-radius: 10px; padding: 8px 10px; }

/* Hafen-Service ---------------------------------------------------------------- */
.harbor-facs { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.harbor-facs .hf { font-size: .76rem; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 4px; }
.harbor-facs .hf.yes { background: #e7f6ec; color: #1b6b32; border-color: #cfe8d7; }
.harbor-facs .hf.no  { background: #fdecec; color: #a51e1e; border-color: #f3cccc; }
.harbor-facs .hf.unk { background: var(--card-alt); color: var(--muted); }
.harbor-info { display: grid; grid-template-columns: max-content 1fr; gap: 6px 10px; font-size: .82rem; align-items: baseline; }
.hr-row { display: contents; }
.hr-k { color: var(--muted); white-space: nowrap; font-size: .78rem; }
.hr-v { color: var(--ink); word-break: break-word; }
.hr-v a { color: var(--blue); text-decoration: none; }
.hr-v a:hover { text-decoration: underline; }
.hr-note { grid-column: 1 / -1; font-size: .78rem; color: var(--ink); background: var(--card-alt); border-radius: 8px; padding: 6px 8px; margin-top: 4px; }
.hf-src, .hr-src { font-size: .7em; opacity: .65; margin-left: 4px; }
.hr-sources { font-size: .7rem; color: var(--muted); margin: 8px 0 0; word-break: break-all; }
.hr-sources a { color: var(--muted); text-decoration: underline dotted; }
.hr-disclaimer { font-size: .72rem; color: var(--muted); margin: 8px 0 0; font-style: italic; }

/* Vor Ort (POI) ---------------------------------------------------------------- */
.poi-hint { margin: 0 0 6px; font-size: .72rem; }
.poi-list { list-style: none; margin: 6px 0 0; padding: 0; }
.poi-list li { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); font-size: .8rem; }
.poi-list li:first-child { border-top: none; padding-top: 4px; }
.poi-name { font-weight: 600; }
.poi-meta { color: var(--blue); font-size: .74rem; }
.poi-hours { flex-basis: 100%; font-size: .74rem; color: var(--muted); }

/* Reiseführer (Tipps & Sehenswertes) ------------------------------------------ */
.guide-intro { margin: 0 0 10px; font-size: .9rem; line-height: 1.5; color: var(--ink); }
.guide-history { margin: 0 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--card-alt); }
.guide-history > summary { cursor: pointer; padding: 7px 10px; font-size: .8rem; font-weight: 600; color: var(--teal); list-style: none; position: relative; padding-right: 28px; }
.guide-history > summary::-webkit-details-marker { display: none; }
.guide-history > summary::after { content: '▸'; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); transition: transform .15s ease; }
.guide-history[open] > summary::after { transform: translateY(-50%) rotate(90deg); }
.guide-history p { margin: 0; padding: 0 10px 10px; font-size: .82rem; line-height: 1.5; color: var(--ink); }
.guide-highlights { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.guide-highlights li { padding: 8px 10px; background: var(--card-alt); border-radius: 8px; font-size: .82rem; line-height: 1.45; border-left: 3px solid var(--teal); }
.guide-highlights li b { color: var(--teal); display: block; margin-bottom: 2px; font-size: .85rem; }
.guide-highlights li span { color: var(--ink); }
.tips { margin: 0; padding-left: 18px; }
.tips li { font-size: .85rem; margin: 4px 0; line-height: 1.4; }
.provisioning { font-size: .82rem; margin-top: 10px; color: var(--ink); background: var(--card-alt); border-radius: 10px; padding: 8px 10px; }
.guide-links { margin-top: 12px; padding-top: 8px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 4px; }
.gl-h { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 6px 0 6px; }
.guide-links a { font-size: .82rem; color: var(--blue); text-decoration: none; padding: 2px 0; }
.guide-links a:hover { text-decoration: underline; }

/* Ausstattung & Links ----------------------------------------------------------*/
.detail-facilities { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.detail-facilities:empty { display: none; }
.facility { background: #eef4f8; border: 1px solid #d7e3ec; color: var(--blue); border-radius: 999px; padding: 3px 10px; font-size: .76rem; }
.detail-links { display: flex; flex-direction: column; gap: 2px; }
.detail-links a { font-size: .82rem; color: var(--blue); padding: 4px 0; text-decoration: none; }
.detail-links a:hover { text-decoration: underline; }

/* Notiz / Reservierung ---------------------------------------------------------*/
.detail-notes { display: flex; flex-direction: column; gap: 8px; }
.note-reserved { display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.detail-notes .field { font-size: .82rem; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }
.detail-notes .field input { font: inherit; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.detail-notes textarea { width: 100%; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); resize: vertical; }
.note-row { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-bottom: 6px; cursor: pointer; background: var(--card); }
.note-row:hover { border-color: var(--blue); }
.note-head { font-size: .85rem; }

/* Aktionsleiste (sticky unten) -------------------------------------------------*/
.detail-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 10px 18px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--card);
}
.detail-actions .btn-primary, .detail-actions .btn-secondary { flex: 1 1 0; min-width: 140px; }
.btn-primary { background: var(--orange); color: #fff; border: none; border-radius: 9px; padding: 10px 14px; font-size: .9rem; cursor: pointer; }
.btn-secondary { background: var(--card); color: var(--teal); border: 1px solid var(--teal); border-radius: 9px; padding: 10px 14px; font-size: .9rem; cursor: pointer; }

/* Header-Zeile mit Theme-Schalter ----------------------------------------------*/
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.theme-btn { font-size: 1rem; line-height: 1; }
.note-meta { font-size: .74rem; color: var(--ok); }
.note-text { font-size: .8rem; color: var(--muted); margin-top: 3px; white-space: pre-wrap; }

/* Marker-Notiz-Symbol – relativ zum inneren .hm positionieren, damit Leaflets
   absolute Positionierung des Icons (Zoom!) nicht überschrieben wird. */
.hm-note { position: absolute; top: -8px; right: -10px; font-size: 12px; filter: drop-shadow(0 1px 1px rgba(0,0,0,.5)); }

/* Hell/Dunkel-neutrale Karten-Flächen via Variablen */
:root { --card: #ffffff; --card-alt: #f7fafc; --chip-bg: #eef4f8; --chip-border: #d7e3ec; }
:root[data-theme="dark"] { --card: #16303a; --card-alt: #102a32; --chip-bg: #15333d; --chip-border: #2a4f5a; }

.mini, .opt, .preset, .detail-card, .field select, .field input, .btn-secondary { background: var(--card); color: var(--ink); }
.mini:hover { background: var(--card-alt); }
.chip, .facility { background: var(--chip-bg); border-color: var(--chip-border); }
.stat, .day-foot { background: var(--card-alt); }
:root[data-theme="dark"] .advisory { background: #11313d; border-color: #1d4b59; color: #8fd3ef; }
:root[data-theme="dark"] .alert.ok   { background: #14331f; color: #7ee59a; }
:root[data-theme="dark"] .alert.warn { background: #3a2e12; color: #ffcd7a; }
:root[data-theme="dark"] .alert.err  { background: #3a1717; color: #ff9b9b; }
:root[data-theme="dark"] .wind-line.ok, :root[data-theme="dark"] .wx.ok { background: #14331f; color: #7ee59a; }
:root[data-theme="dark"] .wind-line.warn, :root[data-theme="dark"] .wx.warn { background: #3a2e12; color: #ffcd7a; }
:root[data-theme="dark"] .wind-line.err, :root[data-theme="dark"] .wx.err { background: #3a1717; color: #ff9b9b; }

/* Hilfe / Onboarding-Dialog */
.help-card {
  background: var(--card); width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  border-radius: 16px 16px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  position: relative; box-shadow: var(--shadow); color: var(--ink);
}
@media (min-width: 820px) { .help-card { border-radius: 16px; } }
.help-card h2 { margin: 0 8px 6px 0; color: var(--teal); font-size: 1.15rem; }
.help-intro { font-size: .85rem; color: var(--ink); margin: 0 0 10px; }
.help-list { list-style: none; margin: 0; padding: 0; }
.help-list li { font-size: .83rem; line-height: 1.45; padding: 7px 0; border-top: 1px solid var(--line); }
.help-list li:first-child { border-top: none; }
.help-foot { font-size: .76rem; color: var(--muted); margin: 12px 0 10px; }
.help-preload {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 8px 0 12px; padding: 10px 12px;
  background: var(--bg-soft, #f4f6f9); border-radius: 8px;
}
.help-preload .small { font-size: .76rem; }

/* Info-(ℹ)-Button an Chips */
.chip-i { border: none; background: rgba(0,0,0,.08); color: inherit; width: 18px; height: 18px; border-radius: 50%; font-size: .7rem; line-height: 1; cursor: pointer; padding: 0; }
.chip-i:hover { background: var(--blue); color: #fff; }

/* Expander (Details-Abschnitte) */
.exp > summary { cursor: pointer; font-size: .95rem; font-weight: 600; list-style: none; padding: 2px 0; }
.exp > summary::-webkit-details-marker { display: none; }
.exp > summary::before { content: '▸ '; color: var(--muted); }
.exp[open] > summary::before { content: '▾ '; }
.exp > .exp-body { margin-top: 8px; }
.block-head.actions-only { justify-content: flex-end; margin-bottom: 6px; }

/* POI-Kategorie-Tabs */
.poi-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.poi-tab { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 4px 10px; font-size: .78rem; cursor: pointer; }
.poi-tab.active { background: var(--teal); color: #fff; border-color: var(--teal); }
.poi-cnt { opacity: .7; font-size: .72rem; }

/* Tagesplan – Drag & Drop */
.dnd-hint { font-size: .72rem; color: var(--muted); margin: 0 0 8px; }
.leg-drag { cursor: grab; }
.leg-drag.dragging { opacity: .5; }
.leg-pt { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 2px; }
.leg-move { display: flex; gap: 6px; margin-top: 4px; }
.leg-move .mv { width: 26px; height: 24px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 6px; cursor: pointer; font-size: .8rem; line-height: 1; }
.leg-move .mv:hover { background: var(--orange); color: #fff; border-color: var(--orange); }
.leg-move .mv.active { background: var(--blue); color: #fff; border-color: var(--blue); }
.day.drop-target { outline: 2px dashed var(--orange); outline-offset: 2px; }

/* Druckansicht: nur Panel-Inhalt, kein Karten-/Steuerungs-Ballast */
@media print {
  #map, #floatControls, .live-block, .range, #exportBtn, #printBtn, #saveBtn, #resetBtn { display: none !important; }
  #panel { position: static; max-height: none; box-shadow: none; width: auto; overflow: visible; }
  body { background: #fff; }
  .day, .opt { break-inside: avoid; }
}

/* Desktop / Tablet: Panel als Seitenleiste */
@media (min-width: 820px) {
  #panel {
    top: 0; bottom: 0; left: 0; right: auto;
    width: 400px; max-height: none; border-radius: 0;
    border-right: 1px solid var(--line);
  }
  body.panel-collapsed #panel { transform: translateX(-100%); }
  #map { left: 0; }
}
@media (min-width: 820px) {
  #map { left: 400px; transition: left .25s ease; }
  body.panel-collapsed #map { left: 0; }
}
