/* Eigene Karte: Ebenen-Schalter, Hintergrund ohne Basiskarte. Die Kartenfarben selbst stehen in
   karte-stil.js (Basiskarte) und karte-symbole.js (Luftfahrt), jeweils hell und dunkel. */
.route-map .leaflet-tile-pane { filter: none; }
.route-map { --karte-grund: #f6f4ec; }
:root[data-theme="dark"] .route-map { --karte-grund: #161a1f; }
.route-map.leaflet-container { background: var(--karte-grund); }
/* Nur Luftfahrtdaten: neutraler Grund, damit Lufträume und Symbole gut lesbar bleiben */
.route-map.ohne-basis.leaflet-container { background: var(--map-bg); }

.karte-schalter { display: grid; justify-items: end; gap: 6px; }
.karte-schalter .map-switch button.on { background: var(--ink); color: var(--on-ink); }
/* Ebenen-Menü: liegt direkt in der Karte über allen Controls und der Quellenangabe (Leaflet-Controls: z-index 1000).
   Höhe an die Karte gebunden (max-height aus karte-ebenen.js), Kopf fest, Inhalt scrollt. */
.karte-ebenen { position: absolute; z-index: 1010; right: 10px; top: 52px; width: 250px; max-width: calc(100% - 20px); max-height: calc(100% - 70px);
  display: flex; flex-direction: column; border-radius: 12px; background: var(--surface); color: var(--text);
  box-shadow: 0 4px 18px rgba(0,0,0,.25); font: calc(13px * var(--fs, 1))/1.3 var(--f-body); cursor: default; }
.karte-ebenen[hidden] { display: none; }
.ke-kopf { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 2px 12px; }
.ke-titel { margin: 0; font: 600 calc(11px * var(--fs, 1))/1 var(--f-body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #71717b); }
.karte-ebenen .ke-zu { display: grid; place-items: center; width: 32px; height: 32px; min-height: 0; padding: 0; border: 0; border-radius: 8px;
  background: none; box-shadow: none; color: var(--muted); font: 400 calc(22px * var(--fs, 1))/1 var(--f-body); letter-spacing: 0; text-transform: none; cursor: pointer; }
.karte-ebenen .ke-zu:hover { background: var(--zinc-50); color: var(--ink); }
.karte-ebenen .ke-zu:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 0; }
.ke-inhalt { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 0 12px 10px; scrollbar-width: thin; }
.ke-feld { margin: 0; padding: 0; border: 0; min-width: 0; }
.karte-ebenen label { display: flex; align-items: center; gap: 8px; min-height: 32px; cursor: pointer; }
.karte-ebenen input { width: 18px; height: 18px; margin: 0; accent-color: var(--brand); }
.karte-ebenen input:disabled + * , .karte-ebenen label:has(input:disabled) { opacity: .5; cursor: default; }
/* Handy/schmale Karte: Blatt von unten über die ganze Kartenbreite */
.karte-ebenen.blatt { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-width: none; border-radius: 14px 14px 0 0; box-shadow: 0 -6px 20px rgba(0,0,0,.28); }
.karte-ebenen.blatt .ke-kopf { padding: 6px 6px 4px 14px; }
.karte-ebenen.blatt .ke-inhalt { padding: 0 14px 12px; }
@media (pointer: coarse) {
  .karte-ebenen label { min-height: 44px; }
  .karte-ebenen .ke-zu { width: 44px; height: 44px; }
}

.leaflet-control-attribution { font-size: calc(10.5px * var(--fs, 1)); line-height: 1.4; max-width: 70%; white-space: normal; text-align: right; }
@media (max-width: 600px) { .leaflet-control-attribution { max-width: 100%; } }
.route-map .leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--text); }

/* Anzeigegrenze der Lufträume (luftraum-filter.js): Auswahl im Ebenen-Menü, Hinweis unter Karte und im Profil */
.karte-ebenen .karte-lr { flex-wrap: wrap; gap: 4px 8px; margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--rule); cursor: default; }
.karte-ebenen .karte-lr select { padding: 4px 26px 4px 8px; font: calc(13px * var(--fs, 1)) var(--f-body); }
.karte-lr-hint { margin: 4px 0 0; font-size: calc(11px * var(--fs, 1)); line-height: 1.3; color: var(--muted); }
.lr-hinweis { margin: 0; padding-inline: 4px; font-size: calc(12px * var(--fs, 1)); line-height: 1.4; color: var(--muted); }
.lr-hinweis .lr-link { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: var(--brand-fg); font: inherit; text-transform: none; letter-spacing: normal; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; min-height: 0; }
.lr-hinweis .lr-link:hover { background: none; color: var(--ink); }
.lr-hinweis.lr-warnung .lr-text { color: var(--warn); font-weight: 600; }

/* ---------- Große Karte (map.js): fester Rahmen über dem Fenster, kein Seiten-Scroll ----------
   Zeilen: schmale Kopfzeile · Karte (minmax(0, 1fr), bekommt den ganzen Rest) · Seitenprofil kompakt (profil.css). */
html.map-open { overflow: hidden; }
.workspace-side.expanded { position: fixed; inset: calc(env(safe-area-inset-top, 0px) + 8px) 8px calc(env(safe-area-inset-bottom, 0px) + 8px); z-index: 1000; height: auto;
  display: grid !important; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px; padding: 8px;
  border-radius: 18px; background: var(--sunken); box-shadow: 0 0 0 100vmax rgba(10, 10, 10, .45); }
.workspace-side.expanded > * { grid-area: auto !important; min-width: 0; }
/* Der Knopf in der Karte weicht „Karte verkleinern“ in der Kopfzeile; die Knöpfe der Kopfzeile gibt es nur hier */
.workspace-side.expanded .map-expand, .gk-urteil, .gk-mehr, .gk-zu { display: none; }

/* Kopfzeile: Urteil | Kennzahlen als Chips | mehr | Pilotlog / PDF | Karte verkleinern */
.workspace-side.expanded .overview { position: relative; z-index: 2; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  grid-template-areas: "urteil kpis mehr pdf zu"; align-items: center; gap: 8px; padding: 6px 8px; }
.workspace-side.expanded :is(.overview-top, .overview-actions) { display: contents; }
.workspace-side.expanded .gk-urteil { grid-area: urteil; display: inline-flex; align-items: baseline; gap: 8px; min-width: 0; max-width: min(40vw, 420px); padding: 6px 12px 6px 10px;
  border: 1px solid var(--rule); border-left: 4px solid var(--rule-strong); border-radius: 10px; background: var(--surface); color: var(--ink);
  font: 700 calc(17px * var(--fs, 1))/1.1 var(--f-display); letter-spacing: .01em; text-transform: none; white-space: nowrap; text-align: left; }
.gk-urteil-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gk-urteil-n { flex: none; font: 600 calc(12px * var(--fs, 1))/1 var(--f-body); letter-spacing: 0; color: var(--muted); }
.gk-urteil-n::after { content: " ▾"; }
.gk-urteil[aria-expanded="true"] .gk-urteil-n::after { content: " ▴"; }
.workspace-side.expanded .gk-urteil.ok { border-left-color: var(--ok-strong); color: var(--ok); }
.workspace-side.expanded .gk-urteil.warn { border-left-color: var(--warn-strong); background: var(--warn-bg); color: var(--warn); }
.workspace-side.expanded .gk-urteil.bad { border-left-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.workspace-side.expanded .gk-urteil:hover:not(:disabled) { border-color: var(--rule-strong); }
/* Hinweise: das vollständige Urteil als Tafel über der Karte */
.workspace-side.expanded #verdict { display: none; }
.workspace-side.expanded .overview.gk-offen #verdict { display: grid; position: absolute; z-index: 3; top: calc(100% + 6px); left: 0; width: min(640px, calc(100vw - 40px));
  max-height: min(60vh, 560px); overflow-y: auto; padding: 12px 16px; border: 1px solid var(--rule); border-left-width: 4px; border-radius: 12px;
  background: var(--surface); box-shadow: 0 12px 32px -10px rgba(0, 0, 0, .45); }
.workspace-side.expanded .overview.gk-offen .verdict.ok { border-left-color: var(--ok-strong); }
.workspace-side.expanded .overview.gk-offen .verdict.warn { border-left-color: var(--warn-strong); }
.workspace-side.expanded .overview.gk-offen .verdict.bad { border-left-color: var(--bad); }
/* Kennzahlen als Chips in einer Zeile; übrige (ohne Warnung) erst mit „mehr“, Details im Tooltip */
.workspace-side.expanded .kpis { grid-area: kpis; display: flex; flex-wrap: nowrap; gap: 6px; min-width: 0; overflow: hidden; }
.workspace-side.expanded .overview.gk-alle .kpis { flex-wrap: wrap; }
.workspace-side.expanded .kpi { flex: none; display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 10px; border-radius: 999px; grid-column: auto; }
.workspace-side.expanded .overview:not(.gk-alle) .kpi:not(.gk-haupt):not(.warn):not(.bad) { display: none; }
.workspace-side.expanded .kpi .kicker { font-size: calc(10.5px * var(--fs, 1)); letter-spacing: .08em; white-space: nowrap; }
.workspace-side.expanded .kpi-val { font-size: calc(16px * var(--fs, 1)); white-space: nowrap; }
.workspace-side.expanded :is(.kpi-sub, .kosten-plan, .kosten-details, .kosten-eingaben, .kosten-hinweis) { display: none; }
.workspace-side.expanded .gk-mehr { grid-area: mehr; display: inline-block; padding: 6px 10px; font: 600 calc(12px * var(--fs, 1))/1 var(--f-body); letter-spacing: 0; text-transform: none; color: var(--muted); border-color: var(--rule); white-space: nowrap; }
.workspace-side.expanded .gk-mehr[hidden] { display: none; }
.workspace-side.expanded .pilotlog-btn { grid-area: pdf; padding: 8px 14px; font-size: calc(13px * var(--fs, 1)); white-space: nowrap; }
.workspace-side.expanded .gk-zu { grid-area: zu; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; font-size: calc(13px * var(--fs, 1)); white-space: nowrap;
  background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.workspace-side.expanded .gk-zu:hover:not(:disabled) { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.gk-zu span { font-size: calc(15px * var(--fs, 1)); }

/* Karte füllt die freie Zeile; Hinweis zur Luftraum-Anzeigegrenze als kleine Einblendung in der Kartenecke */
.workspace-side.expanded .map-card { position: relative; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 4px; padding: 6px; min-height: 0; }
.workspace-side.expanded .route-map { height: 100%; min-height: 0; }
.workspace-side.expanded .map-hint { display: none; }
.workspace-side.expanded .karte-lr-hinweis { position: absolute; z-index: 1; left: 14px; bottom: 14px; max-width: min(60%, 460px); margin: 0; padding: 3px 10px;
  border-radius: 999px; background: color-mix(in srgb, var(--surface) 90%, transparent); box-shadow: 0 1px 6px rgba(0, 0, 0, .22); font-size: calc(11.5px * var(--fs, 1)); line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Handy/schmal: Zeile 1 Urteil und „Karte verkleinern“, Zeile 2 alle Kennzahlen wischbar und PDF */
@media (max-width: 760px) {
  .workspace-side.expanded { inset: calc(env(safe-area-inset-top, 0px) + 4px) 4px calc(env(safe-area-inset-bottom, 0px) + 4px); gap: 6px; padding: 6px; border-radius: 14px; }
  .workspace-side.expanded .overview { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "urteil zu" "kpis pdf"; gap: 6px; padding: 6px; }
  .workspace-side.expanded .gk-urteil { max-width: none; font-size: calc(16px * var(--fs, 1)); padding-inline: 8px 10px; }
  .workspace-side.expanded .gk-urteil-n { font-size: 0; }
  .workspace-side.expanded .gk-urteil-n::after { font-size: calc(12px * var(--fs, 1)); }
  .workspace-side.expanded :is(.gk-zu, .pilotlog-btn) { justify-self: end; padding: 8px 12px; }
  .workspace-side.expanded .gk-mehr { display: none; }
  .workspace-side.expanded .overview .kpi:not(.gk-haupt) { display: inline-flex; }
  .workspace-side.expanded .kpis, .workspace-side.expanded .overview.gk-alle .kpis { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .workspace-side.expanded .kpi { padding: 4px 9px; }
  .workspace-side.expanded .kpi-val { font-size: calc(15px * var(--fs, 1)); }
  .workspace-side.expanded .map-card { padding: 4px; }
  .workspace-side.expanded .karte-lr-hinweis { left: 10px; bottom: auto; top: 10px; max-width: calc(100% - 20px - 150px); }
}
@media (max-width: 760px), (pointer: coarse) {
  .workspace-side.expanded :is(.gk-urteil, .gk-zu, .pilotlog-btn) { min-height: 44px; }
}

/* Große Karte als Symbolknopf oben rechts (D11) */

/* ---------- Ortssuche (ortssuche-ui.js): Feld oben links über dem Zoom; auf schmalen Bildschirmen nur die Lupe,
   beim Fokus aufgeklappt. Trefferliste bleibt in der Karte (Höhe aus ortssuche-ui.js). ---------- */
.leaflet-control.ortssuche { position: relative; z-index: 850; } /* Liste über Zoom und Nachbar-Steuerelementen (800) */
.ortssuche .os-feld { display: flex; align-items: center; gap: 6px; box-sizing: border-box; width: 210px; height: 34px; margin: 0; padding: 0 10px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); color: var(--muted); box-shadow: 0 2px 8px rgba(0,0,0,.18); cursor: text; transition: width .15s; }
.ortssuche .os-feld svg { flex: none; width: 16px; height: 16px; }
.ortssuche input[type="search"] { flex: 1; min-width: 0; width: auto; height: 100%; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none;
  color: var(--ink); font: calc(13px * var(--fs, 1)) var(--f-body); outline: none; -webkit-appearance: none; appearance: none; }
.ortssuche input[type="search"]:focus { box-shadow: none; }
.ortssuche:focus-within .os-feld { width: 260px; border-color: var(--brand-fg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent), 0 2px 8px rgba(0,0,0,.18); }
.os-liste { position: absolute; z-index: 1; top: calc(100% + 4px); left: 0; box-sizing: border-box; width: 290px; max-width: calc(100vw - 40px); max-height: 300px; overflow-y: auto;
  margin: 0; padding: 4px; list-style: none; border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); box-shadow: 0 6px 18px rgba(0,0,0,.22);
  overscroll-behavior: contain; font: calc(13px * var(--fs, 1))/1.3 var(--f-body); }
.os-liste[hidden], .os-status[hidden] { display: none; }
.os-liste li { display: grid; gap: 1px; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.os-liste li b { color: var(--ink); font-weight: 600; }
.os-liste li span { font-size: calc(12px * var(--fs, 1)); color: var(--muted); }
.os-liste li.os-platz b { color: var(--brand-fg); }
.os-liste li:hover, .os-liste li[aria-selected="true"] { background: var(--sunken); }
.os-liste li[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--brand-fg); }
.os-status { position: absolute; top: calc(100% + 4px); left: 0; margin: 0; padding: 6px 10px; border-radius: 10px; white-space: nowrap;
  background: var(--surface); color: var(--muted); box-shadow: 0 2px 8px rgba(0,0,0,.18); font: calc(12px * var(--fs, 1)) var(--f-body); }
.os-liste:not([hidden]) + .os-status { display: none; }
.pop-info { font: calc(12px * var(--fs, 1))/1.35 var(--f-num); color: var(--muted); }
/* Markierung des gewählten Orts: Ring mit Namen */
.ort-marker span { display: block; width: 12px; height: 12px; border: 3px solid var(--ink); border-radius: 50%; background: var(--surface); box-shadow: 0 0 0 2px var(--surface), 0 1px 4px rgba(0,0,0,.4); }
.ort-marker b { position: absolute; left: 22px; top: 0; white-space: nowrap; font: 700 calc(13px * var(--fs, 1))/1 var(--f-body); color: var(--ink);
  background: color-mix(in srgb, var(--surface) 90%, transparent); padding: 2px 5px; border-radius: 4px; }
@media (max-width: 600px) {
  .ortssuche .os-feld { width: 34px; padding: 0 8px; }
  .ortssuche:focus-within .os-feld { width: min(280px, calc(100vw - 130px)); } /* rechts bleibt „Große Karte“ frei */
}
@media (pointer: coarse) {
  .ortssuche .os-feld { height: 44px; }
  .os-liste li { padding: 10px; }
}
@media (max-width: 600px) and (pointer: coarse) { .ortssuche:not(:focus-within) .os-feld { width: 44px; padding: 0 13px; } }
