/* Zwei Materialien: helles Papier für alles, was man liest (Planer), dunkles Glas für alles, was die Karte steuert.
   Akzent: Wanderweg-Gelb der Wegweiser (Raute). Die Karte geht von Rand zu Rand, der Planer schwebt rechts. */
:root {
  --paper: rgba(251, 250, 246, .97);
  --text: #1d2420;
  --muted: #59605a;
  --line: #e2dfd5;
  --accent: #2f5d46;
  --accent-soft: #e7f0ea;
  --ok: #2c7a4b;
  --ok-bg: #e7f4ec;
  --warn: #8a5a00;
  --warn-bg: #fcf1d8;
  --bad: #b3261e;
  --bad-bg: #fbe7e5;
  --info: #3c4b5a;
  --info-bg: #eef1f4;
  --glass: rgba(28, 32, 30, .74);
  --glass-hi: rgba(255, 255, 255, .12);
  --on-glass: #f4f3ee;
  --on-glass-muted: #c6cbc6;
  --signal: #f6c700;
  --radius: 12px;
  --panel-w: 400px;
  --gap: 16px;
  font-family: "Source Sans 3", ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body { background: #e9e9e6; }

#map { position: fixed; inset: 0; }
#map.picking .maplibregl-canvas { cursor: crosshair; }

/* Kartenbedienung von MapLibre: rechts neben dem Planer, wandert beim Einklappen mit */
.maplibregl-ctrl-top-right { right: calc(var(--panel-w) + var(--gap) * 2); top: 4px; transition: right .2s; }
.maplibregl-ctrl-bottom-right { right: calc(var(--panel-w) + var(--gap) * 2); transition: right .2s; }
body.sidebar-closed .maplibregl-ctrl-top-right, body.sidebar-closed .maplibregl-ctrl-bottom-right { right: 0; }
.maplibregl-ctrl-group { background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-radius: 10px; box-shadow: 0 2px 14px rgba(0,0,0,.22); }
.maplibregl-ctrl-group button + button { border-top-color: var(--glass-hi); }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(1); }
.maplibregl-ctrl button { border: 0; border-radius: 0; padding: 0; }
.maplibregl-ctrl-scale { background: rgba(255,255,255,.75); border-color: var(--text); font-weight: 600; }
.maplibregl-ctrl-attrib { font-size: 12px; }

/* ---------- Planer (schwebende Spalte rechts) ---------- */
/* Griff am linken Rand des Planers zum Ein- und Ausklappen */
#sidebar-toggle { position: fixed; top: 50%; right: calc(var(--panel-w) + var(--gap)); transform: translateY(-50%); z-index: 8;
  width: 22px; height: 56px; padding: 0; border: 0; border-radius: 8px 0 0 8px;
  background: var(--paper); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; box-shadow: -3px 0 10px rgba(0,0,0,.12); }
#sidebar-toggle:hover { background: #fff; }
#sidebar-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.sidebar-closed #sidebar { display: none; }
body.sidebar-closed #sidebar-toggle { right: 0; background: var(--glass); color: var(--on-glass); }
#sidebar {
  position: fixed; z-index: 7;
  top: var(--gap); right: var(--gap); bottom: var(--gap);
  width: var(--panel-w);
  overflow-y: auto;
  background: var(--paper);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  padding-bottom: 20px;
  font-feature-settings: "tnum" 1;
}

.brand {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px 12px 18px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.brand h1 { font-size: 16px; letter-spacing: -0.005em; margin: 0; display: flex; align-items: center; gap: 9px; }
/* gelbe Raute wie auf den Wanderwegweisern */
.brand h1 img { flex: none; border-radius: 6px; }
.tabs { display: flex; background: #ecebe4; border-radius: 9px; padding: 3px; gap: 0; }
.tabs button {
  border: 0; background: none; padding: 5px 12px; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted);
  border-radius: 7px; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.globals { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; padding: 14px 18px 2px; }
.intro { color: var(--muted); margin: 10px 18px 12px; }

/* Abschnitte: keine Karten in der Karte, nur Haarlinien */
section {
  margin: 0 18px;
  padding: 16px 0 18px;
  border-top: 1px solid var(--line);
}
#tab-plan section:first-of-type, #tab-plan section[hidden] + section:not([hidden]) { border-top: 0; }
h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; font-weight: 700; }
h3 { font-size: 15px; margin: 14px 0 6px; }

label { display: block; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
input[type=text], input[type=date], input[type=time], select {
  display: block; width: 100%; margin-top: 3px; padding: 7px 10px;
  font: inherit; font-size: 15px; font-weight: 500; color: var(--text); background: #fff;
  border: 1px solid var(--line); border-radius: 9px;
}
input:focus, select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
input.title-input { font-size: 22px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 12px; padding: 4px 0; border: 0 !important;
  border-bottom: 1px dashed transparent !important; border-radius: 0 !important; background: transparent !important; }
input.title-input:hover, input.title-input:focus { border-bottom-color: var(--line) !important; outline: none; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.seg { display: flex; background: #ecebe4; border-radius: 9px; padding: 3px; margin-bottom: 12px; }
.seg label { flex: 1; margin: 0; text-align: center; padding: 6px 4px; cursor: pointer; color: var(--muted); font-size: 14px; font-weight: 600; border-radius: 7px; }
.seg input { display: none; }
.seg label:has(input:disabled) { opacity: .4; cursor: default; }
.seg label[hidden] { display: none; }
.place-label { margin: 0 0 4px; font-size: 12px; color: var(--muted); }
.seg label:has(input:checked) { background: #fff; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

button, .button {
  display: inline-block; font: inherit; font-size: 14px; font-weight: 600; color: var(--text);
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; margin: 0;
}
button:hover, .button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.ghost { background: transparent; border-style: dashed; color: var(--accent); }
button.wide { display: block; width: calc(100% - 36px); margin: 14px 18px; padding: 11px; }
button:disabled { opacity: .45; cursor: default; }
.buttons { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
/* Nebenaktionen als Textlinks */
.buttons.small { gap: 14px; margin-top: 10px; }
.buttons.small button, .buttons.small .button { border: 0; background: none; padding: 0; font-size: 13px; font-weight: 600; color: var(--accent);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(47,93,70,.35); }

.hint { background: var(--accent-soft); color: var(--accent); border-radius: 9px; padding: 8px 12px; margin: 2px 0 10px; font-size: 14px; }
.hint:empty { display: none; }
.note { color: var(--muted); font-size: 12px; margin: 8px 0 0; }

/* Haltepunkte an einer weiss-rot-weissen Bergweg-Linie */
.stops { list-style: none; padding: 0; margin: 0; position: relative; }
.stops:has(li + li)::before { content: ''; position: absolute; left: 12px; top: 20px; bottom: 20px; width: 2px;
  background: repeating-linear-gradient(var(--bad) 0 6px, #fff 6px 9px); }
.stops li { display: flex; align-items: center; gap: 12px; padding: 6px 0; position: relative; }
.stops .name { flex: 1; font-weight: 600; }
.stops .meta { color: var(--muted); font-size: 13px; font-weight: 400; }
.stops button { border: 0; background: none; padding: 4px 6px; font-size: 13px; color: var(--muted); }
.stops button:hover { color: var(--bad); }

/* ---------- Vorschlagskarten ---------- */
.idea {
  margin: 0 18px 14px; background: #fff; border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: box-shadow .15s, transform .15s; box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.idea:hover, .idea.hl { box-shadow: 0 8px 22px rgba(30, 40, 35, .16); transform: translateY(-1px); }
.idea .cover { position: relative; height: 150px; background: linear-gradient(135deg, #c6d9a8, #cfcadb); background-size: cover; background-position: center; }
.idea .rating { position: absolute; top: 10px; left: 10px; }
.idea .body { padding: 12px 14px 14px; }
.idea h3 { margin: 0; font-size: 17px; }
.idea .region { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.chip { font-size: 13px; font-weight: 600; background: #f2f1ec; border-radius: 999px; padding: 2px 10px; color: #3d4540; font-variant-numeric: tabular-nums; }
.reasons { list-style: none; padding: 0; margin: 6px 0 0; font-size: 14px; }
.reasons li { padding: 2px 0 2px 16px; position: relative; }
.reasons li::before { content: ''; position: absolute; left: 0; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.reasons li.bad::before { background: var(--bad); border-radius: 2px; }
.reasons li.warn::before { background: #e3a72a; border-radius: 1px; transform: rotate(45deg) scale(.9); }
.reasons li.ok::before { background: var(--ok); }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.pill.ok { background: var(--ok); color: #fff; }
.pill.warn { background: #e0a526; color: #1d2420; }
.pill.bad { background: var(--bad); color: #fff; }
.pill.loading { background: rgba(255,255,255,.9); color: var(--muted); font-weight: 500; }
.photo-credit { position: absolute; right: 6px; bottom: 4px; font-size: 11px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7); max-width: 80%; text-align: right; }
.photo-credit a { color: inherit; }

.about p { margin: 0 0 8px; }
.about ul { margin: 4px 0 8px; padding-left: 18px; }
.about li { margin: 2px 0; }
.gallery { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 10px 0 4px; }
.gallery a { position: relative; display: block; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: #eee; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Etappen, Badges ---------- */
.pin {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 12px;
  border: 2px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.35); flex: none;
}
.pin.start { background: #2c7a4b; }
.pin.camp { background: #d1661f; font-size: 13px; }
.pin.end { background: #b3261e; }

/* Etappe: Farbe des Tages als feine Linie oben, Kennzahlen gross in Tabellenziffern */
.day { border-top: 3px solid; padding: 10px 0 12px; margin-bottom: 6px; }
.day h3 { margin: 0 0 10px; font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px; font-variant-numeric: tabular-nums; }
.stats b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stats span { color: var(--muted); font-size: 12px; display: block; }
.chart-wrap { position: relative; height: 170px; margin-top: 6px; }

.badge { border-radius: 9px; padding: 8px 12px; margin: 6px 0; font-size: 14px; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.storm-alert { margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: #fde6e1; color: #7a1d12; font-size: 14px; line-height: 1.4; }
.storm-alert b { display: block; }
.storm-alert small { display: block; margin-top: 4px; color: #8f4a3f; font-size: 12px; }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.info { background: var(--info-bg); color: var(--info); }
.badge small { display: block; opacity: .9; margin-top: 2px; font-size: 13px; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-variant-numeric: tabular-nums; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.list { list-style: none; padding: 0; margin: 4px 0; }
.list li { padding: 6px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .meta { color: var(--muted); font-size: 13px; }
.loading { color: var(--muted); font-style: italic; }
.error { color: var(--bad); }
.credits { color: var(--muted); font-size: 12px; padding: 14px 18px 0; line-height: 1.5; }

/* ---------- Karte: Werkzeuge (dunkles Glas) & Marker ---------- */
.map-btn, .map-search input, .layers-menu, .wx-rail, .wx-bar {
  background: var(--glass); color: var(--on-glass); backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 2px 14px rgba(0,0,0,.22);
}
.map-tools { position: absolute; top: var(--gap); left: var(--gap); z-index: 7; /* über der Wetterliste: Suchergebnisse bleiben sichtbar */ display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap;
  max-width: calc(100% - var(--panel-w) - 120px); }
body.sidebar-closed .map-tools { max-width: calc(100% - 100px); }
.map-btn {
  border: 0; border-radius: 10px; height: 40px; padding: 0 14px; font-size: 14px; font-weight: 600;
  display: inline-flex; align-items: center; cursor: pointer; list-style: none; color: var(--on-glass);
}
.map-btn:hover { background: rgba(28, 32, 30, .86); border: 0; }
.map-btn.on { background: var(--signal); color: var(--text); }
.layers summary::-webkit-details-marker { display: none; }
.layers-menu { margin-top: 8px; border-radius: 12px; padding: 8px 14px; }
.layers-menu label { display: flex; gap: 8px; align-items: center; color: var(--on-glass); font-size: 14px; margin: 6px 0; white-space: nowrap; }
.layers-menu input { accent-color: var(--signal); }
.pin-wrap { display: flex; flex-direction: column; align-items: center; cursor: grab; }
.pin-label, .idea-label {
  margin-top: 3px; font-size: 12px; font-weight: 600; color: var(--text);
  background: var(--paper); padding: 1px 8px; border-radius: 6px; white-space: nowrap; box-shadow: 0 1px 4px rgba(0,0,0,.18);
}
.idea-marker { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.idea-marker .dot {
  width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: #fff; border: 2px solid var(--accent); font-size: 15px; box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.idea-marker.ok .dot { border-color: var(--ok); }
.idea-marker.warn .dot { border-color: #e0a526; }
.idea-marker.bad .dot { border-color: var(--bad); opacity: .75; }
.idea-marker.hl .dot { transform: scale(1.2); }

.poi {
  width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 11px; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); cursor: pointer;
}
.poi.water { background: #1b8ad3; color: #fff; }
.poi.shelter { background: #6b4f2f; color: #fff; }
.poi.hut { background: #b3261e; color: #fff; }
.poi.camp_site { background: #2c7a4b; color: #fff; }
.maplibregl-popup-content { border-radius: 12px; font-size: 14px; padding: 12px 14px; box-shadow: 0 6px 24px rgba(0,0,0,.22); background: var(--paper); }
.maplibregl-popup-close-button { font-size: 18px; padding: 0 6px; border: 0; }

/* Legende der Wegkategorien auf der Karte */
.route-legend { position: absolute; left: var(--gap); bottom: 40px; z-index: 2; background: var(--paper); border-radius: 10px;
  padding: 8px 12px; font-size: 13px; line-height: 1.6; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.route-legend i { display: inline-block; width: 22px; height: 0; border-top: 4px solid var(--c); margin-right: 8px; vertical-align: middle; }
.route-legend i.dash { border-top-style: dashed; border-top-width: 3px; }
.guideposts { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.guideposts li { margin: 2px 0; }
.wx-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 6px; font-variant-numeric: tabular-nums; }
.wx-table th, .wx-table td { text-align: right; padding: 3px 4px; border-bottom: 1px solid var(--line); }
.wx-table th:first-child, .wx-table td:first-child { text-align: left; }
.wx-table .bad { color: #b3261e; font-weight: 600; }
.wx-table .warn { color: #9a6200; font-weight: 600; }
.cat-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin: 8px 0 2px; gap: 2px; }
.cat-bar span { display: block; height: 100%; }

/* ---------- Wetter auf der Karte ---------- */
/* Hülle über der ganzen Karte; nur die Teile selbst fangen Klicks */
.wx-ui { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.wx-ui > * { pointer-events: auto; }
/* Grössenwahl als Liste links unter den Werkzeugen */
.wx-rail { position: absolute; top: 68px; /* wird per JS unter die Werkzeuge gesetzt */ left: var(--gap); width: 250px; padding: 6px; border-radius: 12px; }
.wx-rail h4 { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--on-glass-muted); margin: 6px 10px 6px; }
.wx-rail button { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: none; text-align: left;
  padding: 7px 10px; border-radius: 8px; font-size: 14px; font-weight: 500; color: var(--on-glass); }
.wx-rail button:hover { background: var(--glass-hi); }
.wx-rail button.on { background: rgba(255,255,255,.16); font-weight: 700; }
.wx-rail svg { width: 18px; height: 18px; flex: none; color: var(--on-glass-muted); }
.wx-rail button.on svg { color: var(--signal); }
.wx-rail select { display: none; }
/* Wetter + Warnungen: bei kleinen Fensterhöhen scrollen statt unter die Zeitleiste ragen */
.wx-rail { max-height: calc(100vh - 300px); overflow-y: auto; }
.wx-rail h4 + div[role=group] { display: contents; }
/* Legende unter einer eingeschalteten Warnung */
.warn-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; margin: -2px 10px 8px 38px; font-size: 12px; color: var(--on-glass-muted); }
.warn-legend i { width: 18px; height: 14px; border-radius: 3px; font-style: normal; font-size: 10px; font-weight: 700; color: #1d2420; text-align: center; line-height: 14px; }
.warn-legend i:last-of-type { color: #fff; }
.warn-legend span { flex-basis: 100%; }
.warn-legend .warn-zone { width: 18px; background: repeating-linear-gradient(45deg, transparent 0 3px, rgba(230,30,30,.6) 3px 5px); border: 1.5px solid #e61e1e; }
/* Zeitleiste unten über die freie Kartenbreite */
.wx-bar { position: absolute; left: var(--gap); right: calc(var(--panel-w) + var(--gap) * 2); bottom: 34px;
  display: flex; align-items: center; gap: 16px; padding: 12px 14px 12px 12px; border-radius: 14px; font-size: 14px; }
body.sidebar-closed .wx-bar { right: 60px; }
.wx-play { border: 0; background: var(--signal); color: var(--text); border-radius: 50%; width: 44px; height: 44px; padding: 0; font-size: 14px; flex: none; cursor: pointer; }
.wx-play:hover { border: 0; filter: brightness(1.05); }
.wx-readout { width: 230px; flex: none; }
.wx-readout b { display: block; font-size: 19px; line-height: 1.2; white-space: nowrap; }
.wx-note { margin: 3px 0 0; font-size: 12px; color: var(--on-glass-muted); line-height: 1.35; }
.wx-track { flex: 1; min-width: 160px; position: relative; padding-top: 18px; }
.wx-ticks { position: absolute; top: 0; left: 0; right: 0; height: 18px; font-size: 12px; color: var(--on-glass-muted); }
.wx-ticks span { position: absolute; white-space: nowrap; border-left: 1px solid rgba(255,255,255,.3); padding-left: 5px; }
.wx-track input[type=range] { width: 100%; margin: 6px 0 4px; -webkit-appearance: none; appearance: none; background: transparent; height: 22px; cursor: pointer; }
.wx-track input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: rgba(255,255,255,.22); }
.wx-track input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(255,255,255,.22); }
/* Zeitzeiger als gelbe Wegweiser-Raute */
.wx-track input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -5px; background: var(--signal);
  border-radius: 2px; transform: rotate(45deg); box-shadow: 0 0 0 2px rgba(28,32,30,.85); }
.wx-track input[type=range]::-moz-range-thumb { width: 14px; height: 14px; background: var(--signal); border: 0; border-radius: 2px;
  transform: rotate(45deg); box-shadow: 0 0 0 2px rgba(28,32,30,.85); }
.wx-track input[type=range]:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 4px; }
.wx-side { width: 250px; flex: none; display: flex; flex-direction: column; gap: 6px; }
.wx-legend { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 12px; color: var(--on-glass); align-items: center; }
.wx-step { display: inline-flex; align-items: center; gap: 4px; }
.wx-step i { width: 14px; height: 10px; border-radius: 2px; }
.wx-unit { color: var(--on-glass-muted); }
.wx-grad { display: block; width: 100%; height: 10px; border-radius: 5px; }
.wx-scale { display: flex; justify-content: space-between; width: 100%; font-size: 12px; color: var(--on-glass-muted); }
.wx-update { align-self: flex-start; border: 0; background: rgba(255,255,255,.14); color: var(--on-glass); border-radius: 8px; padding: 5px 12px; font-size: 13px; }
.wx-update:hover { border: 0; background: rgba(255,255,255,.22); }
.wx-close { border: 0; background: none; color: var(--on-glass-muted); font-size: 22px; line-height: 1; padding: 0 4px; align-self: flex-start; }
.wx-close:hover { border: 0; color: var(--on-glass); }
.wx-wind { position: absolute; top: 0; left: 0; pointer-events: none; }
/* hidden muss immer gewinnen, auch gegen display: flex/grid einzelner Bausteine (sonst bleibt z. B. das Wetter-Kästchen stehen) */
[hidden] { display: none !important; }

.wx-tip { position: absolute; z-index: 7; pointer-events: none; background: var(--paper); color: var(--text); border-radius: 10px;
  padding: 7px 11px; font-size: 13px; line-height: 1.35; display: flex; flex-direction: column; box-shadow: 0 6px 24px rgba(0,0,0,.22); }
.wx-tip b { font-size: 20px; }
.wx-tip span { color: var(--muted); font-size: 12px; }
.wx-tip .wx-src { color: var(--warn); font-size: 12px; margin-top: 2px; }
.wx-tip .wx-measured { color: var(--ok); font-weight: 600; }

/* Suche auf der Karte */
.map-search { position: relative; }
.map-search input { width: 270px; height: 40px; padding: 0 14px; border-radius: 10px; border: 0; font: inherit; font-size: 15px; }
.map-search input::placeholder { color: var(--on-glass-muted); }
.map-search input:focus { outline: 2px solid var(--signal); }
.map-search ul { position: absolute; top: 100%; left: 0; z-index: 5; margin: 6px 0 0; padding: 4px 0; list-style: none; width: 320px;
  background: var(--paper); border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.22); max-height: 320px; overflow: auto; }
.map-search li { padding: 7px 12px; cursor: pointer; display: flex; flex-direction: column; font-size: 14px; }
.map-search li span { font-size: 12px; color: var(--muted); }
.map-search li:hover { background: var(--accent-soft); }
.map-search li.empty { color: var(--muted); cursor: default; }
.search-pin { width: 16px; height: 16px; border-radius: 50%; background: #e4572e; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.kv-table { border-collapse: collapse; margin-top: 4px; font-size: 13px; }
.kv-table td { padding: 2px 6px 2px 0; }
.kv-table td:last-child { color: var(--muted); }

/* ---------- Mittlere Breite: Zeitleiste in zwei Zeilen ---------- */
@media (max-width: 1250px) {
  .wx-bar { flex-wrap: wrap; row-gap: 8px; }
  .wx-readout { width: auto; flex: 1; }
  .wx-side { width: 220px; }
  .wx-track { order: 5; flex-basis: 100%; }
}

/* ---------- Handy: Planer als untere Hälfte ---------- */
@media (max-width: 760px) {
  :root { --panel-w: 0px; --gap: 10px; }
  #sidebar { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 52vh; border-radius: 14px 14px 0 0; }
  #sidebar-toggle { top: auto; bottom: 52vh; right: 50%; transform: translateX(50%) rotate(90deg); }
  body.sidebar-closed #sidebar-toggle { bottom: 30px; right: 50%; }
  .maplibregl-ctrl-top-right { right: 0; }
  .map-tools { max-width: calc(100% - 70px); }
  .map-search input { width: 180px; }
  .wx-rail { width: auto; right: auto; display: flex; flex-wrap: wrap; max-width: calc(100% - 20px); }
  .wx-rail h4 { display: none; }
  .wx-rail button { width: auto; }
  .wx-rail button span { display: none; }
  .warn-legend { display: none; }
  .wx-bar { left: 10px; right: 10px; bottom: calc(52vh + 46px); flex-wrap: wrap; gap: 8px; } /* über dem Griff am Planer */
  body.sidebar-closed .wx-bar { right: 10px; bottom: 80px; } /* Platz für den Aufklapp-Griff unten */
  .wx-readout, .wx-side { width: auto; flex: 1; }
}
