:root {
  --bg: #0e1320;
  --bg-2: #161d2f;
  --line: rgba(255, 255, 255, .13);   /* Trennlinien und Feldränder: halbdurchsichtig wie Glaskanten */
  --text: #e8ecf5;
  --muted: #9aa6c0;
  --accent: #ffd166;
  --danger: #ff7b72;
  --park: #9fc5ff;
  --lodge: #7ee0c3;
  --hut: #ffb86b;
  /* Glas: durchscheinend, stark weichgezeichnet und etwas abgedunkelt (damit Schrift über hellen
     Kartenstellen lesbar bleibt), mit hellem Lichtsaum oben und leichtem Glanz von links oben. */
  --glass: rgba(16, 22, 40, .28);
  --glass-strong: rgba(14, 19, 34, .6);   /* Menüs und Listen, die oft über hellen Luftbildern liegen */
  --glass-field: rgba(255, 255, 255, .06);
  --glass-field-hover: rgba(255, 255, 255, .11);
  --glass-border: rgba(255, 255, 255, .2);
  --glass-sheen: linear-gradient(145deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .04) 32%, rgba(255, 255, 255, 0) 58%);
  --glass-edge: inset 0 1px 0 rgba(255, 255, 255, .24), inset 0 -1px 0 rgba(255, 255, 255, .05);
  --glass-shadow: 0 14px 44px rgba(0, 0, 0, .38), 0 2px 8px rgba(0, 0, 0, .22);
  --glass-blur: blur(24px) saturate(1.6) brightness(.78);
  --glass-text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
}

#map { position: absolute; inset: 0; background: #05070d; }
.leaflet-container { font: inherit; }
.dim-basemap .basemap { filter: invert(1) hue-rotate(180deg) brightness(.75) contrast(.9) saturate(.35); }

/* Panel */
#panel {
  position: absolute; z-index: 1000;
  top: 12px; left: 12px; width: 380px; max-height: calc(100% - 24px);
  display: flex; flex-direction: column;
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px;
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .3);
  text-shadow: var(--glass-text-shadow); /* lesbar auch über hellen Kartenstellen */
  overflow: hidden;
}
#panel header { display: flex; align-items: center; justify-content: space-between; padding: 10px 10px 4px 14px; }
#panel h1 { margin: 0; font-size: 17px; letter-spacing: .02em; }
.icon-btn {
  display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  background: none; border: 1px solid transparent; border-radius: 8px; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { color: var(--text); border-color: var(--line); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
/* Minimiert: nur Kopf und Reiter */
#panel.collapsed .tab-body { display: none; }
#panel.collapsed #panel-toggle svg { transform: rotate(180deg); }
#panel.collapsed .tabs { border-bottom: 0; }
#panel.collapsed .tabs button[aria-selected="true"] { border-bottom-color: transparent; }

/* Reiter: passen am Computer nebeneinander; am Handy seitlich wischbar, ohne sichtbaren Rollbalken */
.tabs { display: flex; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 1 0 auto; padding: 8px 4px; background: none; border: 0; border-bottom: 2px solid transparent;
  color: var(--muted); font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer;
}
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }

.tab-body { overflow-y: auto; min-height: 0; padding: 12px 14px 14px; }
#panel header, .tabs { flex-shrink: 0; } /* Kopf und Reiter nie zusammenquetschen */
section[hidden] { display: none; }

.field { display: block; margin-bottom: 10px; }
.field > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
select, input[type="date"], input[type="datetime-local"], input[type="text"], input:not([type]), textarea {
  width: 100%; padding: 7px 9px; font: inherit; color: var(--text);
  background: var(--glass-field); border: 1px solid var(--line); border-radius: 8px;
  color-scheme: dark;
}
input[type="range"] { width: 100%; accent-color: var(--accent); }
textarea { resize: vertical; }

.btn {
  display: inline-block; padding: 8px 12px; font: inherit; color: var(--text); text-decoration: none;
  background: var(--glass-field); border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1b1400; font-weight: 600; }
.btn.ghost { background: none; }
.btn.small { padding: 4px 8px; font-size: 13px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.hint { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.msg { color: var(--danger); font-size: 13px; margin: 0 0 10px; }
.msg.info { color: var(--accent); }

.legend { margin: 4px 0 12px; }
.legend-bar { height: 10px; border-radius: 5px; border: 1px solid var(--line); }
.legend-zones { display: flex; height: 12px; border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.legend-zones span { flex: 1; }
.swatch { display: inline-block; width: 11px; height: 11px; margin-right: 6px; border: 1px solid var(--muted); border-radius: 2px; vertical-align: -1px; }
.legend-ticks { position: relative; height: 16px; font-size: 12px; color: var(--muted); }
.legend-ticks span { position: absolute; top: 1px; transform: translateX(-50%); }
.legend-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

.list { list-style: none; margin: 10px 0 0; padding: 0; }
.list li { padding: 9px 0; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .title { font-weight: 600; cursor: pointer; }
.list .meta { color: var(--muted); font-size: 13px; }
.stars { color: var(--accent); letter-spacing: 1px; }
.tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: 4px; }

/* Ergebnis Beleuchtung */
.card { margin-top: 12px; padding: 10px 12px; background: var(--glass-field); border: 1px solid var(--line); border-radius: 10px; }
.card h3 { margin: 0 0 4px; font-size: 15px; }
.card dl { margin: 6px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 13px; }
.card dt { color: var(--muted); }
.card dd { margin: 0; overflow-wrap: anywhere; }
.card a { color: var(--accent); }
.checks label { display: block; font-size: 13px; margin: 3px 0; }

/* Popups & Marker */
.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--glass); color: var(--text); border: 1px solid rgba(255, 255, 255, .1);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); text-shadow: var(--glass-text-shadow);
}
.leaflet-popup-content { margin: 10px 12px; min-width: 190px; }
.leaflet-popup-content p { margin: 0 0 6px; }
.spot-pin {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); border: 2px solid #1b1400; color: #1b1400;
  display: grid; place-items: center; font-size: 12px; line-height: 1;
  box-shadow: 0 0 0 3px rgba(255, 209, 102, .25);
}

dialog {
  width: min(420px, calc(100vw - 24px)); padding: 16px;
  color: var(--text); background: var(--glass); border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px;
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}
dialog::backdrop { background: rgba(0, 0, 0, .55); }
dialog h2 { margin: 0 0 12px; font-size: 17px; }
dialog .row { justify-content: flex-end; }

/* All-Sky-Ansicht */
/* oben verankert, damit der Dialog beim Umschalten Kuppel/Panorama nicht springt */
dialog.allsky { width: min(600px, calc(100vw - 24px)); margin: max(12px, 4vh) auto auto; padding: 14px 16px 12px; text-shadow: var(--glass-text-shadow); }
.allsky header { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.allsky h2 { margin: 0; }
.allsky-sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.allsky-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 10px 0 8px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { padding: 4px 12px; background: none; border: 0; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--glass-field); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.allsky-check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.allsky-check input { accent-color: var(--accent); margin: 0; }
.allsky-stage { position: relative; display: grid; place-items: center; }
.allsky-canvas { display: block; max-width: 100%; cursor: crosshair; }
.allsky-status { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 0 20px; color: var(--muted); font-size: 14px; text-align: center; }
.allsky-readout { min-height: 2.9em; margin: 6px 0 4px; font-size: 13px; text-align: center; }
.allsky .legend { margin: 4px 0 10px; }
.allsky-facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; }
.allsky-facts dt { color: var(--muted); }
.allsky-facts dd { margin: 0; }
.allsky .hint { font-size: 12px; }

@media (max-width: 640px) {
  #panel {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 55%;
    border-radius: 14px 14px 0 0; border-width: 1px 0 0;
    padding-bottom: env(safe-area-inset-bottom); /* Home-Balken am iPhone */
  }
  /* iOS zoomt beim Antippen in Felder mit weniger als 16 px Schrift */
  select, input, textarea { font-size: 16px; }
  .tabs button { font-size: 14px; padding: 10px 6px; }
  /* Unten angedockt: Pfeil zeigt nach unten zum Einklappen */
  #panel-toggle svg { transform: rotate(180deg); }
  #panel.collapsed #panel-toggle svg { transform: none; }
  /* Quellenangabe muss sichtbar bleiben (OSM-Lizenz): unten liegt die Leiste, also nach oben links */
  .leaflet-bottom.leaflet-right { top: 0; bottom: auto; left: 0; right: auto; }
  .leaflet-control-attribution { max-width: calc(100vw - 70px); font-size: 9px; line-height: 1.3; border-radius: 0 0 6px 0; }
  dialog.allsky { width: calc(100vw - 16px); max-height: calc(100% - 16px); margin-top: 8px; padding: 12px; }
}

input[type="number"], input[type="time"] {
  width: 100%; padding: 7px 9px; font: inherit; color: var(--text);
  background: var(--glass-field); border: 1px solid var(--line); border-radius: 8px; color-scheme: dark;
}
.sqm-pin {
  width: 44px; height: 20px; border-radius: 10px; border: 1.5px solid #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff;
  text-shadow: 0 0 2px #000, 0 0 2px #000; box-shadow: 0 1px 4px rgba(0, 0, 0, .6);
}
.modes label { display: flex; gap: 8px; align-items: flex-start; padding: 8px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.modes label:has(input:checked) { border-color: var(--accent); }
.modes strong { color: var(--text); font-size: 14px; }
.finder-pin {
  width: 24px; height: 24px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: #7ee0c3; border: 2px solid #06382b; display: grid; place-items: center;
}
.finder-pin span { transform: rotate(45deg); font-size: 12px; font-weight: 700; color: #06382b; }
.score { float: right; font-weight: 700; color: #7ee0c3; }
.facts { margin: 4px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--muted); }
.facts li { padding: 1px 0; border: 0; }
.facts .ok::before { content: "✓ "; color: #7ee0c3; }
.facts .warn::before { content: "! "; color: var(--accent); font-weight: 700; }
.horizon { display: block; width: 100%; height: auto; margin-top: 6px; background: #070b16; border: 1px solid var(--line); border-radius: 6px; }
.leaflet-popup-content { max-width: 280px; }

/* Kartenebenen */
.overlays { margin: 0 0 12px; padding: 8px 10px 4px; border: 1px solid var(--line); border-radius: 10px; }
.overlays legend { padding: 0 4px; font-size: 12px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 14px; cursor: pointer; }
.check input { accent-color: var(--accent); margin: 0; }
.park-pin, .lodge-pin {
  display: grid; place-items: center; border-radius: 50%; line-height: 1; box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
.park-pin { width: 24px; height: 24px; font-size: 14px; background: var(--park); border: 2px solid #0b2350; color: #0b2350;
  box-shadow: 0 0 0 3px rgba(159, 197, 255, .3), 0 1px 4px rgba(0, 0, 0, .5); }
.lodge-pin { width: 22px; height: 22px; font-size: 13px; font-weight: 700; background: var(--lodge); border: 2px solid #06382b; color: #06382b; }
.lodge-pin.hut-pin { background: var(--hut); border-color: #5a2d00; color: #5a2d00; }
.hut-pin svg { width: 12px; height: 12px; fill: currentColor; }
.hut-pin.mini svg { width: 10px; height: 10px; }
.lodging-kinds { margin: 0 0 4px; }
.check.small { margin: 0 0 6px; font-size: 13px; }
.lodge-contact { color: var(--text); font-size: 13px; overflow-wrap: anywhere; }
.park-cluster { position: relative; width: 34px; height: 34px; font-size: 17px; }
.park-cluster span {
  position: absolute; right: -6px; top: -6px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: #0b2350; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.lodge-cluster { position: relative; width: 30px; height: 30px; font-size: 15px; }
.lodge-cluster span {
  position: absolute; right: -7px; top: -7px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: #06382b; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
}
.park-pending { border-style: dashed; background: #c9dcff; }
/* Dunkles Schutzgebiet ohne DarkSky-Zertifikat: gleiche Form, eigene Farbe */
.park-protected { background: #b9ecd9; border-color: #0b3d2e; color: #0b3d2e; box-shadow: 0 0 0 3px rgba(126, 224, 195, .3), 0 1px 4px rgba(0, 0, 0, .5); }
.place-pin { width: 18px; height: 18px; font-size: 11px; }
.map-status {
  /* Mittig im Kartenbereich rechts neben der Seitenleiste (380 px + Ränder) und links der Zoom-Knöpfe */
  position: absolute; z-index: 1001; top: 12px; left: 404px; right: 60px; width: fit-content; margin: 0 auto;
  display: flex; align-items: center; gap: 10px; padding: 7px 12px;
  background: var(--glass); color: var(--text); font-size: 13px;
  border: 1px solid rgba(255, 255, 255, .08); border-radius: 18px;
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}
.obs-pin { background: #e5d4ff; border-color: #3b1f6b; color: #3b1f6b; font-size: 12px; }
.osm-pin { background: #d9e8ff; }
.boundary-swatch { display: inline-block; width: 18px; height: 12px; border: 1.5px dashed var(--park); background: rgba(159, 197, 255, .15); border-radius: 3px; }
.guide { margin: 0 0 14px; padding: 10px 12px 12px; border: 1px solid var(--park); border-radius: 10px; background: rgba(159, 197, 255, .06); }
.guide-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.guide-title { margin: 0 0 4px; font-size: 16px; }
.guide .section-title { margin-top: 12px; }
.guide .icon-btn { font-size: 20px; line-height: 1; }
.mini { display: inline-grid; width: 18px; height: 18px; font-size: 11px; box-shadow: none; }
.section-title { margin: 14px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.section-title:first-child { margin-top: 0; }
/* Leaflet färbt Links in Popups blau – Buttons behalten ihre eigenen Farben */
.leaflet-container a.btn { color: var(--text); }
.leaflet-container a.btn.primary { color: #1b1400; }
.popup-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.trend-box:empty { display: none; }
.trend { display: block; width: 100%; height: 46px; margin: 4px 0 0; background: rgba(0, 0, 0, .25); border-radius: 6px; }
.trend-axis { display: flex; justify-content: space-between; font-size: 11px; }
.popup-meta { color: var(--muted); font-size: 12.5px; margin: 0 0 6px; }
.popup-meta a { color: var(--accent); }

body.popup-open .map-status { opacity: 0; pointer-events: none; }
.map-status { transition: opacity .15s; }

/* Ortssuche */
.search { position: relative; display: flex; align-items: center; gap: 4px; margin: 2px 10px 8px; flex-shrink: 0; }
.search input {
  flex: 1; min-width: 0; padding: 7px 10px; font: inherit; color: var(--text);
  background: var(--glass-field); border: 1px solid var(--line); border-radius: 8px; color-scheme: dark;
}
.search input:focus { outline: none; border-color: var(--accent); }
.search .icon-btn svg { width: 17px; height: 17px; }
.search-results {
  position: absolute; z-index: 5; top: calc(100% + 4px); left: 0; right: 0; max-height: 50vh; overflow-y: auto;
  margin: 0; padding: 4px 0; list-style: none; background: rgba(12, 17, 30, .72); border: 1px solid var(--line); border-radius: 10px;
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.search-section { padding: 6px 12px 2px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.search-item { padding: 6px 12px; cursor: pointer; }
.search-item .title { font-size: 14px; }
.search-item .meta { font-size: 12px; color: var(--muted); }
.search-item:hover, .search-item.active { background: var(--glass-field-hover); }
.search-hint { padding: 4px 12px 6px; font-size: 12px; color: var(--muted); }

/* Ortungsknopf */
.locate-control a { display: grid; place-items: center; width: 30px; height: 30px; }
.locate-control svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.locate-control a.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Wahl der Hintergrundkarte */
.basemap-control { position: relative; }
.basemap-control > a { display: grid; place-items: center; width: 30px; height: 30px; }
.basemap-control svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.basemap-menu {
  position: absolute; top: 0; right: 38px; width: 240px; padding: 8px;
  /* deckender als die Leiste: liegt oft über hellen Luftbildern */
  color: var(--text); background: rgba(12, 17, 30, .8); border: 1px solid rgba(255, 255, 255, .1); border-radius: 10px;
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  text-shadow: var(--glass-text-shadow); box-shadow: 0 8px 30px rgba(0, 0, 0, .3);
}
.basemap-menu-title { padding: 2px 6px 6px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.basemap-menu label { display: flex; gap: 8px; align-items: flex-start; padding: 6px; border-radius: 6px; font-size: 14px; line-height: 1.3; cursor: pointer; }
.basemap-menu label:hover { background: rgba(255, 255, 255, .07); }
.basemap-menu input { margin: 2px 0 0; accent-color: var(--accent); }
.basemap-menu small { display: block; font-size: 12px; color: var(--muted); }
.basemap-labels { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
.map-toast {
  position: absolute; z-index: 1002; bottom: 32px; left: 404px; right: 12px; width: fit-content; margin: 0 auto; padding: 8px 14px;
  background: var(--glass); color: var(--text); font-size: 13px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 18px;
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
}
.map-toast .btn { flex-shrink: 0; }

/* Mond-Widget */
.night-widget {
  position: absolute; z-index: 1001; right: 12px; bottom: 30px; max-width: calc(100% - 24px);
  color: var(--text); background: var(--glass); border: 1px solid rgba(255, 255, 255, .1); border-radius: 12px;
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur); box-shadow: 0 8px 30px rgba(0, 0, 0, .3);
  text-shadow: var(--glass-text-shadow);
}
.moon-svg { flex-shrink: 0; filter: drop-shadow(0 0 6px rgba(243, 239, 217, .28)); }
.night-compact { display: flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; font: inherit; color: inherit; background: none; border: 0; cursor: pointer; text-align: left; }
.night-compact-text { display: flex; flex-direction: column; font-size: 13px; line-height: 1.3; }
.night-compact-text span { color: var(--muted); font-size: 12px; }
.night-compact-text span.good, .night-table .good { color: #7ee0c3; }
.night-widget.open { width: 430px; max-height: calc(100% - 60px); overflow-y: auto; }
.night-details { padding: 10px 14px 12px; }
.night-head { display: flex; align-items: center; justify-content: space-between; }
.night-head h2 { margin: 0; font-size: 16px; }
.moon-now { display: flex; align-items: center; gap: 14px; margin: 8px 0 4px; font-size: 14px; }
.moon-strip { display: grid; grid-template-columns: repeat(35, 1fr); gap: 2px; margin: 8px 0 4px; }
.moon-cell { position: relative; height: 22px; border-radius: 3px; }
.moon-cell.dark { outline: 2px solid #7ee0c3; outline-offset: -2px; }
.moon-cell.today { box-shadow: 0 0 0 2px var(--accent); }
.moon-cell span { position: absolute; left: 1px; bottom: -15px; font-size: 10px; color: var(--muted); }
.moon-strip + .small { margin-top: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.night-nav { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.night-nav input { flex: 1; min-width: 0; padding: 4px 6px; font: inherit; font-size: 13px; color: var(--text); background: var(--glass-field); border: 1px solid var(--line); border-radius: 8px; color-scheme: dark; }
.night-table-wrap { overflow-x: auto; }
.night-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.night-table th { text-align: left; font-weight: 600; color: var(--muted); padding: 4px 6px 4px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.night-table td { padding: 5px 6px 5px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); vertical-align: top; }
.night-table td:first-child { white-space: nowrap; }

/* Am Handy: Hinweis unter der Quellenangabe, volle Breite bis zu den Zoom-Knöpfen.
   Steht nach der Grundregel für .map-status, damit er sie überschreibt. */
@media (max-width: 640px) {
  .map-status { left: 12px; right: 60px; top: 48px; }
  .map-toast { left: 12px; right: 12px; bottom: auto; top: 48px; }
  /* Unten liegt die Seitenleiste: Widget rechts unter Zoom, Ortung und Kartenwahl, aufgeklappt in voller Breite */
  .night-widget { right: 10px; bottom: auto; top: 170px; }
  .night-widget.open { left: 10px; right: 10px; width: auto; max-height: calc(100% - 320px); } /* über der eingeklappten Leiste */
  .night-compact { padding: 6px 10px 6px 6px; }
  .night-compact-text span { display: none; }
}

/* Routenplaner */
.route-points { display: grid; gap: 6px; margin-bottom: 10px; }
.route-point { position: relative; display: flex; align-items: center; gap: 4px; }
.route-point input { flex: 1; min-width: 0; margin-left: 4px; }
.route-pin {
  display: grid; place-items: center; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  font-size: 12px; font-weight: 700; border: 2px solid; text-shadow: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .12), 0 2px 6px rgba(0, 0, 0, .45);
}
.route-pin.from { background: #7ee0c3; color: #06382b; border-color: #06382b; }
.route-pin.to { background: var(--accent); color: #1b1400; border-color: #1b1400; }
.route-suggest { position: absolute; z-index: 5; top: calc(100% + 4px); left: 32px; right: 0; max-height: 40vh; overflow-y: auto; margin: 0; padding: 4px 0; list-style: none; border: 1px solid; }
.route-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.route-depart { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.route-depart input { width: auto; padding: 4px 6px; font-size: 13px; }
.route-card .route-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 16px; }
.route-verdict { margin: 10px 0 8px; padding: 7px 10px; border-radius: 10px; font-size: 13px; }
.route-verdict.good { background: rgba(126, 224, 195, .12); border: 1px solid rgba(126, 224, 195, .35); }
.route-verdict.warn { background: rgba(255, 209, 102, .1); border: 1px solid rgba(255, 209, 102, .35); }
.route-sky { margin: 6px 0 4px; }
.picking, .picking .leaflet-interactive { cursor: crosshair !important; }

/* ------------------------------------------------------------ Glas
   Alle schwebenden Flächen teilen dieselbe Optik. Steht am Ende, damit es die Einzelregeln oben
   überschreibt; Randbreiten (z. B. der Seitenleiste am Handy) bleiben, gesetzt wird nur die Farbe. */
#panel, .leaflet-popup-content-wrapper, dialog, .night-widget, .map-status, .map-toast,
.basemap-menu, .search-results, .route-suggest, .leaflet-bar {
  background: var(--glass-sheen), var(--glass);
  border-color: var(--glass-border);
  box-shadow: var(--glass-edge), var(--glass-shadow);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}
#panel, .leaflet-popup-content-wrapper, dialog, .night-widget { border-radius: 16px; }
.basemap-menu, .search-results, .route-suggest { background: var(--glass-sheen), var(--glass-strong); border-radius: 12px; }
dialog::backdrop { background: rgba(4, 6, 12, .4); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.leaflet-popup-tip { background: rgba(16, 22, 40, .55); box-shadow: none; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-container a.leaflet-popup-close-button:hover { color: var(--text); }

/* Kartenknöpfe (Zoom, Kartenwahl, Ortung) als Glas statt weiß */
.leaflet-touch .leaflet-bar, .leaflet-bar { border: 1px solid var(--glass-border); border-radius: 12px; }
.leaflet-bar a, .leaflet-touch .leaflet-bar a {
  background: transparent; color: var(--text); border-bottom-color: var(--line); text-shadow: var(--glass-text-shadow);
}
.leaflet-bar a:hover, .leaflet-bar a:focus { background: var(--glass-field-hover); color: #fff; }
.leaflet-bar a.leaflet-disabled { background: transparent; color: rgba(255, 255, 255, .3); }
.leaflet-bar a:first-child { border-top-left-radius: 11px; border-top-right-radius: 11px; }
.leaflet-bar a:last-child, .leaflet-bar a:only-of-type { border-bottom-left-radius: 11px; border-bottom-right-radius: 11px; }
.leaflet-bar a:only-of-type { border-top-left-radius: 11px; border-top-right-radius: 11px; }

/* Quellenangabe */
.leaflet-container .leaflet-control-attribution {
  color: var(--muted); background: rgba(16, 22, 40, .45);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
}
.leaflet-control-attribution a { color: #b9c9ec; }

/* Felder und Knöpfe in Glasflächen */
.btn { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); transition: background .15s, border-color .15s; }
.btn:hover { background: var(--glass-field-hover); border-color: rgba(255, 255, 255, .3); }
.btn.primary {
  background: linear-gradient(180deg, #ffe39a, var(--accent)); border-color: rgba(255, 225, 150, .9); text-shadow: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 2px 12px rgba(255, 209, 102, .25);
}
.btn.primary:hover { background: linear-gradient(180deg, #ffeab0, #ffd979); }
select, input[type="date"], input[type="text"], input:not([type]), textarea, input[type="number"], input[type="time"], .search input {
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25);
}
select:focus, input:focus, textarea:focus { outline: none; border-color: rgba(255, 209, 102, .7); box-shadow: 0 0 0 3px rgba(255, 209, 102, .15); }
.card, .overlays, .modes label { background: var(--glass-field); }
.tabs button[aria-selected="true"] { text-shadow: 0 0 12px rgba(255, 209, 102, .35); }
@media (max-width: 640px) {
  #panel { border-radius: 18px 18px 0 0; } /* unten angedockt */
  .leaflet-container .leaflet-control-attribution { border-radius: 0 0 8px 0; }
}

[hidden] { display: none !important; }

/* Sprachumschalter in der Kopfzeile der Seitenleiste */
.header-tools { display: flex; align-items: center; gap: 2px; }
.lang-btn { width: auto; min-width: 30px; padding: 0 6px; font: inherit; font-size: 12px; font-weight: 600; letter-spacing: .04em; }

/* ------------------------------------------------------------ Info
   Kapitelkarten im Reiter „Info“ und ein breites Lesefenster: links die Kapitel samt Abschnitten,
   rechts der Text. Etwas dichteres Glas als sonst, damit lange Texte über der Karte ruhig lesbar bleiben. */
.info-more { margin: 0 0 12px; }
.info-more a, .info-article a { color: var(--accent); text-decoration-color: rgba(255, 209, 102, .4); text-underline-offset: 2px; }
.info-more a:hover, .info-article a:hover { text-decoration-color: var(--accent); }

.info-cards { display: grid; gap: 8px; margin-top: 12px; }
.info-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; width: 100%;
  padding: 12px; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--glass-field); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08); transition: background .15s, border-color .15s;
}
.info-card:hover { background: var(--glass-field-hover); border-color: rgba(255, 209, 102, .5); }
.info-card-text { display: grid; gap: 2px; }
.info-card-text strong { font-size: 15px; }
.info-card-text span { color: var(--muted); font-size: 13px; line-height: 1.4; }
.info-card-icon, .info-ch-icon {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: rgba(255, 209, 102, .12); color: var(--accent);
}
.info-card-icon svg, .info-ch-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.info-card-chev { color: var(--muted); font-size: 22px; line-height: 1; }

dialog.info-dialog {
  width: min(1040px, calc(100vw - 32px)); height: min(860px, calc(100dvh - 32px));
  max-width: none; max-height: none; margin: auto; padding: 0; overflow: hidden;
  background: var(--glass-sheen), rgba(12, 17, 31, .74);
}
.info-shell { display: grid; grid-template-columns: 236px 1fr; height: 100%; }
.info-nav { overflow-y: auto; padding: 18px 10px; border-right: 1px solid var(--line); background: rgba(255, 255, 255, .025); }
.info-nav ul { list-style: none; margin: 0; padding: 0; }
.info-ch {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; margin-bottom: 2px;
  background: none; border: 1px solid transparent; border-radius: 10px; color: var(--muted);
  font: inherit; font-size: 14px; text-align: left; cursor: pointer;
}
.info-ch .info-ch-icon { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; background: rgba(255, 255, 255, .05); color: var(--muted); }
.info-ch:hover { color: var(--text); background: var(--glass-field); }
.info-ch[aria-current="true"] { color: var(--text); background: var(--glass-field-hover); border-color: var(--line); font-weight: 600; }
.info-ch[aria-current="true"] .info-ch-icon { background: rgba(255, 209, 102, .14); color: var(--accent); }
.info-sub { margin: 4px 0 10px 22px !important; padding-left: 12px !important; border-left: 1px solid var(--line); }
.info-sub button {
  display: block; width: 100%; padding: 4px 6px; background: none; border: 0; border-radius: 6px;
  color: var(--muted); font: inherit; font-size: 12.5px; line-height: 1.35; text-align: left; cursor: pointer;
}
.info-sub button:hover { color: var(--text); }
.info-sub button.active { color: var(--accent); }

.info-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.info-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0 12px; padding: 16px 20px 12px 32px; border-bottom: 1px solid var(--line); }
.info-kicker { grid-column: 1; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.info-head h2 { grid-column: 1; margin: 2px 0 0; font-size: 22px; letter-spacing: .01em; }
.info-close { grid-column: 2; grid-row: 1 / span 2; align-self: start; font-size: 22px; line-height: 1; width: 34px; height: 34px; }

.info-article {
  flex: 1; min-height: 0; overflow-y: auto; position: relative; outline: none;
  padding: 8px 32px 28px; font-size: 15.5px; line-height: 1.62; overscroll-behavior: contain;
}
.info-article > * { max-width: 70ch; }
.info-article p { margin: 0 0 12px; }
.info-article .info-lead { font-size: 17px; line-height: 1.55; color: #f3f5fb; margin: 14px 0 18px; }
.info-article h3 {
  margin: 30px 0 10px; padding-left: 12px; font-size: 17px; line-height: 1.3;
  border-left: 3px solid var(--accent); scroll-margin-top: 12px;
}
.info-article ul, .info-article ol { margin: 0 0 14px; padding-left: 1.3em; }
.info-article li { margin: 0 0 7px; }
.info-article li::marker { color: var(--muted); }
.info-article b { color: #fff; font-weight: 600; }
.info-go { margin: -2px 0 8px !important; }

.info-steps { list-style: none; padding: 0 !important; counter-reset: step; }
.info-steps li { position: relative; padding: 2px 0 2px 40px; counter-increment: step; }
.info-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 2px; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #1b1400;
  background: linear-gradient(180deg, #ffe39a, var(--accent)); text-shadow: none;
}
.info-rules li::marker { color: var(--accent); font-weight: 700; }

.info-formula {
  margin: 4px 0 14px; padding: 12px 16px; border-radius: 10px; overflow-x: auto;
  background: rgba(0, 0, 0, .25); border: 1px solid var(--line);
  font: 16px/1.7 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; font-style: italic; letter-spacing: .01em;
}
.info-scroll { overflow-x: auto; margin: 0 0 14px; }
.info-table { border-collapse: collapse; font-size: 14px; line-height: 1.45; margin: 0 0 14px; }
.info-scroll .info-table { margin: 0; }
.info-table th, .info-table td { padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.info-table thead th { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.info-params th { white-space: nowrap; font-family: "Iowan Old Style", Palatino, Georgia, serif; font-style: italic; font-weight: 400; color: var(--accent); padding-right: 16px; }
.info-scale td:nth-child(2) { white-space: nowrap; font-variant-numeric: tabular-nums; }

.info-figure { margin: 6px 0 16px; padding: 12px; border-radius: 12px; background: rgba(0, 0, 0, .22); border: 1px solid var(--line); max-width: 70ch; }
.info-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.info-charts svg { width: 100%; height: auto; display: block; }
.info-charts .ttl { fill: var(--text); font-size: 11.5px; font-weight: 600; }
.info-charts .tick { fill: var(--muted); font-size: 9.5px; }
.info-charts .lab { fill: var(--text); font-size: 9.5px; font-weight: 600; }
.info-charts .ax { stroke: rgba(255, 255, 255, .35); stroke-width: 1; }
.info-charts .grid { stroke: rgba(255, 255, 255, .08); stroke-width: 1; }
.info-charts .curve { fill: none; stroke: var(--accent); stroke-width: 2; }
.info-charts .walker { fill: none; stroke: #9fc5ff; stroke-width: 1.4; stroke-dasharray: 4 3; }
.info-charts .dot { fill: var(--accent); stroke: #1b1400; stroke-width: 1; }
.info-figure figcaption { margin-top: 8px; color: var(--muted); font-size: 12.5px; line-height: 1.45; }

.info-effects { display: grid; grid-template-columns: 9.5em 1fr; gap: 10px 16px; margin: 0 0 16px; }
.info-effects dt { font-weight: 600; color: var(--accent); }
.info-effects dd { margin: 0; }
.info-callout {
  margin: 4px 0 16px; padding: 12px 14px; border-radius: 12px; font-size: 14.5px;
  background: rgba(159, 197, 255, .08); border: 1px solid rgba(159, 197, 255, .35);
}
.info-note { color: var(--muted); font-size: 13.5px; }
.info-links li { font-size: 14px; }
.info-actions { list-style: none; padding: 0 !important; display: grid; gap: 6px; }
.info-actions li { margin: 0; padding: 8px 12px; border-radius: 10px; background: var(--glass-field); border: 1px solid var(--line); }
.info-actions a b { color: var(--accent); }

.info-pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 30px; padding-top: 16px; border-top: 1px solid var(--line); }

@media (max-width: 760px) {
  /* Am Handy: Vollbild; oben Titel, darunter die Kapitel als wischbare Leiste (ohne Abschnittsliste), dann der Text */
  dialog.info-dialog { width: 100vw; height: 100dvh; margin: 0; border-radius: 0; border: 0; }
  .info-shell { display: flex; flex-direction: column; }
  .info-main { display: contents; }
  .info-head { order: 1; padding: calc(10px + env(safe-area-inset-top)) 12px 10px 18px; }
  .info-head h2 { font-size: 19px; }
  .info-nav { order: 2; flex-shrink: 0; padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .info-nav::-webkit-scrollbar { display: none; }
  .info-nav > ul { display: flex; gap: 6px; }
  .info-nav li { flex-shrink: 0; }
  .info-ch { margin: 0; padding: 5px 10px 5px 6px; white-space: nowrap; border-color: var(--line); }
  .info-ch .info-ch-icon { width: 24px; height: 24px; }
  .info-ch .info-ch-icon svg { width: 16px; height: 16px; }
  .info-sub { display: none; }
  .info-article { order: 3; padding: 4px 18px calc(24px + env(safe-area-inset-bottom)); font-size: 15px; }
  .info-charts { grid-template-columns: 1fr; }
  .info-effects { grid-template-columns: 1fr; gap: 2px; }
  .info-effects dd { margin-bottom: 10px; }
}
