/* MANV-Nachforderungen vom Einsatzort (User 2026-10-01) */
.manv-requests {
  position: fixed; right: 16px; bottom: 16px; z-index: 5000; width: min(360px, calc(100vw - 32px));
  background: var(--panel-strong); border: 1px solid var(--accent); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); padding: 0.7rem 0.8rem; color: #e8eef2;
}
.manv-requests-h { font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); margin-bottom: 0.4rem; }
.manv-req + .manv-req { margin-top: 0.6rem; padding-top: 0.6rem; border-top: 1px solid rgba(108, 195, 221, 0.2); }
.manv-req-t { font-weight: 700; font-size: 0.9rem; }
.manv-req-s { font-size: 0.75rem; opacity: 0.75; margin-top: 0.15rem; }
.manv-req-b { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.manv-req-b button { flex: 1; padding: 0.45rem 0.6rem; border-radius: 5px; border: 1px solid rgba(108, 195, 221, 0.35); background: transparent; color: inherit; font-weight: 700; cursor: pointer; }
.manv-req-b .manv-req-yes { background: #b91c1c; border-color: #b91c1c; color: #fff; }

:root {
  --bg-1: #07151a;
  --bg-2: #0d2730;
  --panel: rgba(9, 29, 36, 0.86);
  --panel-strong: #0f323d;
  --text: #e6f3f7;
  --muted: #8cb7c4;
  --accent: #f2b134;
  --danger: #ff5f56;
  --ok: #58d68d;
  --radius: 16px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Manrope", sans-serif;
  background: radial-gradient(circle at 18% 12%, #154456 0%, transparent 34%),
              radial-gradient(circle at 87% 84%, #15373f 0%, transparent 32%),
              linear-gradient(140deg, var(--bg-1), var(--bg-2));
  min-height: 100vh;
}

h1, h2 {
  margin: 0;
  font-family: "Chakra Petch", sans-serif;
  letter-spacing: 0.04em;
}

h1 {
  font-size: clamp(1.6rem, 2.2vw, 2.4rem);
}

h2 {
  font-size: 1.1rem;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid rgba(140, 183, 196, 0.2);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar > :first-child {
  justify-self: start;
}

/* SimRESC-Wortmarke, exakt mittig im Grid-Mittelfeld -- unabhaengig davon,
   wie breit Titel links und Aktionen rechts sind. */
.topbar-logo {
  justify-self: center;
  height: 42px;
  width: auto;
  pointer-events: none;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
}

/* Nur im Vollkarten-Modus sichtbar (dort ist der .topbar aus); schwebt dann
   mittig oben ueber der Karte, auf einer Hoehe mit den Aktions-Buttons. */
.overlay-logo {
  display: none;
}

body.overlay-focus-mode .overlay-logo {
  display: block;
  position: fixed;
  top: 0.9rem;
  left: 50%;
  transform: translateX(-50%);
  height: 46px;
  width: auto;
  z-index: 70;
  pointer-events: none;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.6));
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
}

.topbar-actions {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-self: end;
}

.layout {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  padding: 1rem;
}

.card {
  grid-column: span 4;
  background: var(--panel);
  border: 1px solid rgba(140, 183, 196, 0.2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.9rem;
  animation: fade-in 420ms ease both;
}

.card.wide {
  grid-column: span 8;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.row.compact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.88rem;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  border: 1px solid rgba(140, 183, 196, 0.25);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  border-radius: 10px;
  padding: 0.56rem 0.62rem;
}

textarea {
  resize: vertical;
}

.btn {
  border: none;
  background: var(--accent);
  color: #18232a;
  font-weight: 700;
  padding: 0.6rem 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 120ms ease, filter 120ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.06);
}

.btn.secondary {
  background: #6cc3dd;
}

.btn.ghost {
  background: transparent;
  border: 1px solid rgba(140, 183, 196, 0.4);
  color: var(--text);
}

.badge,
.status-dot {
  font-size: 0.75rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid rgba(140, 183, 196, 0.3);
  border-radius: 999px;
  color: var(--muted);
}

.badge.bridge-online  { color: #4caf7d; border-color: #4caf7d55; }
.badge.bridge-offline { color: var(--muted); border-color: rgba(140,183,196,0.3); }
.badge.bridge-error   { color: #e05c5c; border-color: #e05c5c55; }

.hint {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.fleet-water-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(108, 195, 221, 0.45);
  color: #8fe0f1;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.alarm-category-group {
  border: 1px solid rgba(140, 183, 196, 0.25);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.7rem;
}

.alarm-category-group legend {
  color: var(--muted);
  font-size: 0.88rem;
  padding: 0 0.3rem;
}

.alarm-check-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.86rem;
  color: var(--text);
}

.alarm-check-item input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
}

.alarm-resource-tabs {
  border: 1px solid rgba(140, 183, 196, 0.2);
  border-radius: 10px;
  padding: 0.6rem;
  margin-bottom: 0.6rem;
  background: rgba(0, 0, 0, 0.14);
}

.alarm-plan-hint {
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(242, 177, 52, 0.22);
  background: rgba(242, 177, 52, 0.08);
  margin-bottom: 0.6rem;
}

.alarm-sequence-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

.alarm-sequence-chip {
  border-radius: 999px;
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(108, 195, 221, 0.3);
  background: rgba(108, 195, 221, 0.1);
  color: var(--text);
  font-size: 0.8rem;
}

.alarm-multi-select {
  min-height: 9rem;
}

.alarm-tab-panel {
  margin-bottom: 0.6rem;
}

.btn.active-tab {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(242, 177, 52, 0.38);
}

body.overlay-focus-mode {
  overflow: hidden;
  background: linear-gradient(135deg, #03090f, #071821 52%, #0a2430);
}

body.overlay-focus-mode .topbar {
  display: none;
}

body.overlay-focus-mode .layout {
  display: block;
  padding: 0;
  height: 100vh;
}

body.overlay-focus-mode .layout > .card {
  display: none;
}

body.overlay-focus-mode #mapPanel {
  display: block;
}

body.overlay-focus-mode #mapPanel {
  position: fixed;
  inset: 0;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
  z-index: 1;
}

body.overlay-focus-mode #mapPanel .card-head,
body.overlay-focus-mode #mapPanel .row {
  display: none;
}

body.overlay-focus-mode #dispatchLauncherBtn {
  position: fixed;
  top: 0.9rem;
  left: 0.9rem;
  z-index: 70;
  min-width: 220px;
  border: 1px solid rgba(108, 195, 221, 0.45);
  background: rgba(8, 30, 40, 0.92);
  color: var(--text);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
}

body.overlay-focus-mode #dispatchLauncherBtn:hover {
  background: rgba(12, 40, 53, 0.95);
}

/* Launcher-Zeile: "Einsatz generieren" + "Laufende Einsätze" nebeneinander.
   Die Zeile ist jetzt der fixierte Container; der Button selbst nicht mehr. */
body.overlay-focus-mode .launcher-row {
  position: fixed;
  top: 0.9rem;
  left: 0.9rem;
  z-index: 70;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
body.overlay-focus-mode .launcher-row #dispatchLauncherBtn {
  position: static;
  top: auto;
  left: auto;
  z-index: auto;
}
body.overlay-focus-mode .launcher-row .btn {
  min-width: 200px;
  border: 1px solid rgba(108, 195, 221, 0.45);
  background: rgba(8, 30, 40, 0.92);
  color: var(--text);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
body.overlay-focus-mode .launcher-row .btn:hover {
  background: rgba(12, 40, 53, 0.95);
}
#runningIncidentsBtn .badge {
  background: #2563eb;
  color: #fff;
  border-radius: 999px;
  padding: 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
}

/* "Laufende Einsätze"-Panel (blendet unter der Launcher-Zeile ein) */
body.overlay-focus-mode #runningIncidentsPanel.running-incidents-panel {
  position: fixed;
  top: 3.6rem;
  left: 0.9rem;
  z-index: 69;
  /* Etwas breiter, seit "Ausklinken" neben "Schliessen" steht. */
  width: min(430px, calc(100vw - 1.8rem));
  max-height: min(60vh, 520px);
  overflow-y: auto;
  overflow-x: hidden;
}
body.overlay-focus-mode #runningIncidentsPanel.is-hidden {
  display: none;
}
.running-incidents-panel .list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.running-incident-item.is-undisposed {
  opacity: 0.75;
  border-style: dashed;
}
.running-incident-item {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid rgba(108, 195, 221, 0.2);
  border-radius: 8px;
  background: rgba(5, 20, 28, 0.5);
  color: var(--text);
  cursor: pointer;
  overflow-wrap: anywhere;
}
.running-incident-item:hover {
  background: rgba(37, 99, 235, 0.22);
  border-color: rgba(37, 99, 235, 0.5);
}
.running-incident-item .primary {
  font-weight: 700;
}
.running-incident-item .secondary {
  font-size: 0.78rem;
  opacity: 0.78;
}

/* Doppelklick-Popup "Einsatz hier erstellen" -- dunkles Blau statt des hellen
   Leaflet-Standards, passend zu den übrigen Panels. */
.map-create-incident-popup .leaflet-popup-content-wrapper {
  background: rgba(8, 30, 40, 0.97);
  color: var(--text);
  border: 1px solid rgba(108, 195, 221, 0.45);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}
.map-create-incident-popup .leaflet-popup-tip {
  background: rgba(8, 30, 40, 0.97);
  border: 1px solid rgba(108, 195, 221, 0.45);
  box-shadow: none;
}
.map-create-incident-popup .leaflet-popup-content {
  margin: 0;
}
.map-create-incident-popup a.leaflet-popup-close-button {
  color: rgba(255, 255, 255, 0.65);
}
.map-create-incident-popup a.leaflet-popup-close-button:hover {
  color: #fff;
}
.map-create-incident-btn {
  display: block;
  width: 100%;
  padding: 0.55rem 1rem;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font: 700 0.92rem/1.2 inherit;
  white-space: nowrap;
  cursor: pointer;
}
.map-create-incident-btn:hover {
  background: #1d4ed8;
}

/* Aufklappbarer Server-Einsatz-Kasten auf der Karte. Klick auf das Label
   klappt den Kasten nach unten auf (Fahrzeuge + "Einsatz öffnen"). */
.incident-box {
  position: relative;
  display: inline-block;
  background: rgba(8, 30, 40, 0.95);
  color: #fff;
  border: 1px solid rgba(108, 195, 221, 0.45);
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  font: 700 12px/15px system-ui, sans-serif;
  white-space: nowrap;
  overflow: hidden;
}
/* Undisponierter Einsatz (noch kein Fahrzeug, z. B. Verlegung): heller/grau. */
.incident-box.is-undisposed {
  background: rgba(71, 85, 105, 0.92);
  border-color: rgba(203, 213, 225, 0.7);
  color: #e2e8f0;
}
.incident-box.is-undisposed .incident-box-corner { border-top-color: #cbd5e1; }

/* Hinweis beim Ueberfahren -- derselbe dunkle Kasten statt Leaflet-Weiss. */
.leaflet-tooltip.veh-tooltip {
  background: rgba(8, 30, 40, 0.97);
  color: #ffffff;
  border: 1px solid rgba(108, 195, 221, 0.45);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  padding: 6px 10px;
  font: 500 12px/1.45 "Manrope", system-ui, sans-serif;
  white-space: nowrap;
}
.leaflet-tooltip.veh-tooltip strong {
  font: 700 13px/1.3 "Chakra Petch", system-ui, sans-serif;
}
.leaflet-tooltip.veh-tooltip::before { border-top-color: rgba(108, 195, 221, 0.45); }

/* Klick-Fenster am Fahrzeug (Livemap): gleiche Optik wie die uebrigen Kaesten. */
.veh-popup-wrap .leaflet-popup-content-wrapper {
  background: rgba(8, 30, 40, 0.97);
  color: #ffffff;
  border: 1px solid rgba(108, 195, 221, 0.45);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}
.veh-popup-wrap .leaflet-popup-tip { background: rgba(8, 30, 40, 0.97); }
.veh-popup-wrap .leaflet-popup-content { margin: 8px 12px; }
.veh-popup-wrap .leaflet-popup-close-button { color: #9fb4c2; }
.veh-popup {
  font: 500 13px/1.45 "Manrope", system-ui, sans-serif;
  white-space: nowrap;
}
.veh-popup strong {
  display: block;
  margin-bottom: 2px;
  font: 700 14px/1.3 "Chakra Petch", system-ui, sans-serif;
}

/* Fahrzeug-Beschriftung auf der Karte -- bewusst derselbe Kasten wie beim
   Einsatz (User 2026-09-20), nur mit gelber statt cyanfarbener Ecke. */
/* Der Kasten ist der Rahmen, die Beschriftung sein Kopf -- ein Klick darauf
   klappt die Angaben auf, genau wie beim Einsatz (User 2026-09-20). */
.veh-box {
  position: relative;
  display: inline-block;
  background: rgba(8, 30, 40, 0.95);
  color: #ffffff;
  border: 1px solid rgba(108, 195, 221, 0.45);
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  font: 700 12px/15px system-ui, sans-serif;
  white-space: nowrap;
  overflow: hidden;
}
.veh-box.is-solo {
  background: rgba(8, 30, 40, 0.78);
  color: #e5e7eb;
  border-color: rgba(209, 213, 219, 0.5);
}
.veh-label {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px 3px 14px;
  cursor: pointer;
}
.veh-box-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.veh-box.expanded .veh-box-detail { max-height: 160px; }
.veh-box-lines {
  padding: 5px 10px 4px 12px;
  border-top: 1px solid rgba(108, 195, 221, 0.25);
  font-weight: 600;
  font-size: 11px;
  line-height: 1.5;
  opacity: 0.92;
}
.veh-corner {
  position: absolute;
  top: 0;
  left: 0;
  border-top: 9px solid #facc15;
  border-right: 9px solid transparent;
  border-top-left-radius: 5px;
}
.veh-box.is-solo .veh-corner { border-top-color: #d1d5db; }
.veh-pilot { font-weight: 500; opacity: 0.8; }
.veh-status {
  border-radius: 3px;
  padding: 0 5px;
  font-weight: 800;
}
/* Wie lange steht der Status schon? (User 2026-09-22) */
.veh-timer {
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  opacity: 0.85;
}

.incident-box-corner {
  position: absolute;
  top: 0;
  left: 0;
  border-top: 9px solid rgba(108, 195, 221, 0.9);
  border-right: 9px solid transparent;
  border-top-left-radius: 5px;
}
.incident-box-label {
  padding: 3px 10px 3px 12px;
  cursor: pointer;
}
/* Aufklapp-Bereich: per max-height animiert (0 -> auf). */
.incident-box-detail {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.incident-box.expanded .incident-box-detail {
  max-height: 140px;
}
.incident-box-veh {
  padding: 5px 10px 3px 12px;
  font-weight: 600;
  font-size: 11px;
  opacity: 0.9;
  border-top: 1px solid rgba(108, 195, 221, 0.25);
}
.incident-box-actions {
  display: flex;
  gap: 6px;
  margin: 4px 8px 8px;
}
.incident-box-open,
.incident-box-close {
  flex: 1;
  padding: 5px 8px;
  border: none;
  border-radius: 6px;
  font: 700 11px/1.2 inherit;
  cursor: pointer;
  white-space: nowrap;
  color: #fff;
}
.incident-box-open { background: #2563eb; }
.incident-box-open:hover { background: #1d4ed8; }
.incident-box-close { background: rgba(220, 38, 38, 0.85); }
.incident-box-close:hover { background: #dc2626; }

/* Alarmierte Fahrzeuge im Bearbeiten-Modus (entfernbare Chips) */
.edit-assigned-vehicles {
  margin: 0.2rem 0 0.6rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid rgba(37, 99, 235, 0.4);
  border-radius: 10px;
  background: rgba(37, 99, 235, 0.1);
}
.edit-assigned-vehicles.is-hidden { display: none; }
.edit-assigned-vehicles .edit-assigned-head { font-weight: 700; margin-bottom: 0.4rem; }
.edit-assigned-vehicles .assigned-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.assigned-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.3rem 0.2rem 0.6rem;
  background: rgba(8, 30, 40, 0.85);
  border: 1px solid rgba(108, 195, 221, 0.35);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}
.assigned-chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  border: none;
  background: rgba(220, 38, 38, 0.85);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
}
.assigned-chip-remove:hover { background: #dc2626; }

body.overlay-focus-mode .map-style-tabs {
  position: absolute;
  top: 0.8rem;
  right: 0.8rem;
  z-index: 40;
  margin: 0;
  padding: 0.48rem;
  border-radius: 12px;
  background: rgba(5, 20, 28, 0.62);
  border: 1px solid rgba(108, 195, 221, 0.24);
  backdrop-filter: blur(3px);
}

body.overlay-focus-mode #map {
  width: 100%;
  height: 100vh;
  margin: 0;
  border-radius: 0;
}

body.overlay-focus-mode #dispatchPanel {
  position: fixed;
  /* Startet UNTER der Menü-Zeile ("Einsatz generieren"/"Laufende Einsätze"),
     damit es diese nicht mehr überlappt. */
  top: 4rem;
  left: 1rem;
  z-index: 65;
  /* Breit genug, dass Katalog + zweispaltige Zeilen ohne seitliche Scrollbar
     und ohne Abschneiden hineinpassen (vorher 760px -> Inhalt lief über). */
  width: min(880px, calc(100vw - 2rem));
  max-height: calc(100vh - 5rem);
  overflow: hidden;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(6, 20, 28, 0.97), rgba(8, 26, 34, 0.95));
  border: 1px solid rgba(108, 195, 221, 0.26);
  box-shadow: 0 28px 60px rgba(0, 0, 0, 0.5);
  border-radius: 18px;
  backdrop-filter: blur(8px);
}

body.overlay-focus-mode #dispatchPanel .card-head {
  margin: 0 0 0.8rem;
}

body.overlay-focus-mode .dispatch-head-actions {
  margin: 0;
  gap: 0.45rem;
}

body.overlay-focus-mode .dispatch-panel-body {
  max-height: calc(100vh - 9rem);
  overflow-y: auto;
  /* overflow-y:auto zwingt overflow-x sonst automatisch auf auto -> seitliche
     Scrollbar. Explizit ausblenden; der Inhalt passt sich unten per min-width an. */
  overflow-x: hidden;
  padding-right: 0.2rem;
}

body.overlay-focus-mode .dispatch-incident-manager {
  margin-top: 1rem;
  padding-top: 0.9rem;
  border-top: 1px solid rgba(108, 195, 221, 0.16);
}

body.overlay-focus-mode .dispatch-subhead {
  margin-bottom: 0.55rem;
}

body.overlay-focus-mode.dispatch-panel-hidden #dispatchPanel {
  display: none;
}

body.overlay-focus-mode.dispatch-panel-open #dispatchPanel,
body.overlay-focus-mode.dispatch-panel-minimized #dispatchPanel {
  display: block;
}

body.overlay-focus-mode.dispatch-panel-minimized #dispatchPanel {
  width: min(420px, calc(100vw - 2rem));
  max-height: none;
}

body.overlay-focus-mode.dispatch-panel-minimized .dispatch-panel-body {
  display: none;
}

body.overlay-focus-mode.dispatch-panel-minimized #dispatchPanel .card-head {
  margin-bottom: 0;
}

.list li.clickable-entry.is-selected {
  border-color: rgba(242, 177, 52, 0.75);
  background: rgba(242, 177, 52, 0.12);
}

@media (max-width: 980px) {
  body.overlay-focus-mode #dispatchLauncherBtn {
    top: 0.7rem;
    left: 0.7rem;
    right: 0.7rem;
    min-width: 0;
  }

  body.overlay-focus-mode #dispatchPanel {
    top: 3.8rem;
    left: 0.7rem;
    right: 0.7rem;
    width: auto;
    max-height: calc(100vh - 4.5rem);
  }

  body.overlay-focus-mode.dispatch-panel-minimized #dispatchPanel {
    width: auto;
  }
}

.leaflet-popup-content-wrapper {
  background: linear-gradient(180deg, #0a1d27 0%, #07161f 100%);
  color: var(--text);
  border: 1px solid rgba(108, 195, 221, 0.32);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.45);
}

.leaflet-popup-content {
  color: var(--text);
}

.leaflet-popup-tip {
  background: #07161f;
}

.leaflet-control-layers {
  background: #081722;
  color: var(--text);
  border: 1px solid rgba(108, 195, 221, 0.35);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
  opacity: 1;
  border-radius: 14px;
}

.leaflet-control-layers-expanded {
  padding: 0.55rem 0.65rem;
  min-width: 220px;
}

.leaflet-control-layers label {
  color: var(--text);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.22rem 0;
}

.leaflet-control-layers-toggle {
  width: 42px;
  height: 42px;
  background-size: 22px 22px;
  background-position: center;
  background-repeat: no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23d8ecf2' d='M4 7h16v2H4zm0 5h16v2H4zm0 5h16v2H4z'/%3E%3C/svg%3E");
}

.leaflet-control-layers-list {
  margin-top: 0.25rem;
}

.leaflet-control-layers-selector {
  accent-color: #6cc3dd;
}

.modal-dialog {
  border: none;
  padding: 0;
  background: transparent;
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  margin: 0;
  max-width: min(640px, calc(100vw - 1.5rem));
  width: min(640px, calc(100vw - 1.5rem));
  max-height: calc(100vh - 2rem);
  overflow: auto;
  color: var(--text);
  z-index: 1200;
}

.modal-dialog::backdrop {
  background: rgba(2, 10, 13, 0.76);
  backdrop-filter: blur(4px);
}

/* Notizen im Einsatz-Kasten, nur Leitstelle (User 2026-09-21). */
.incident-box-notes {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 6px;
  min-height: 2.6em;
  max-height: 9em;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid rgba(250, 204, 21, 0.45);
  background: rgba(250, 204, 21, 0.08);
  color: var(--text, #e5e7eb);
  font: 12px/1.35 "Manrope", sans-serif;
  resize: vertical;
}
.incident-box-notes::placeholder { color: rgba(229, 231, 235, 0.5); }
.incident-box-notes:focus { outline: 1px solid rgba(250, 204, 21, 0.8); }

/* Angemeldeter Hubschrauber im Klinik-Popup (User 2026-09-21). */
.hospital-inbound {
  display: inline-block;
  margin-top: 2px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(250, 204, 21, 0.16);
  border: 1px solid rgba(250, 204, 21, 0.55);
  color: #fde68a;
}
.hospital-inbound b { color: #ffffff; }

/* Bist du noch da? (Inaktivitaet) */
.idle-card {
  max-width: 380px;
  text-align: center;
}
.idle-card h2 { margin: 0 0 0.5rem; }
.idle-card p { margin: 0 0 0.75rem; line-height: 1.4; }
.idle-count {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f87171;
}

.modal-card {
  background: linear-gradient(180deg, rgba(12, 38, 46, 0.98), rgba(7, 21, 26, 0.98));
  border: 1px solid rgba(140, 183, 196, 0.28);
  border-radius: 18px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.52);
  padding: 1rem;
}

.modal-card .card-head {
  margin-bottom: 1rem;
}

.modal-card .alarm-resource-tabs {
  max-height: 260px;
  overflow: auto;
}

.modal-card .list {
  max-height: 180px;
}

.modal-card .row:last-child {
  margin-bottom: 0;
}

.modal-card .row.compact {
  align-items: center;
}

.modal-card .hint {
  margin: 0;
}

.keyword-catalog {
  display: grid;
  grid-template-columns: 0.9fr 1.35fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.keyword-catalog-col {
  border: 1px solid rgba(140, 183, 196, 0.22);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  padding: 0.7rem;
  min-height: 220px;
  /* Grid-Spalten dürfen unter ihre Inhaltsbreite schrumpfen, sonst läuft der
     Katalog über den Panel-Rand hinaus (seitliche Scrollbar). */
  min-width: 0;
}

.keyword-search-row {
  margin-bottom: 0.6rem;
}

.keyword-search-row label {
  width: 100%;
}

.keyword-favorite-head {
  margin-top: 0.7rem;
}

.keyword-favorite-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.7rem;
  min-height: 2rem;
}

.keyword-favorite-chip {
  border: 1px solid rgba(242, 177, 52, 0.5);
  background: rgba(242, 177, 52, 0.12);
  color: var(--text);
  border-radius: 999px;
  padding: 0.42rem 0.72rem;
  cursor: pointer;
  font-size: 0.82rem;
}

.keyword-favorite-chip:hover {
  filter: brightness(1.08);
}

.keyword-favorite-empty {
  color: var(--muted);
  font-size: 0.84rem;
  padding: 0.2rem 0;
}

.keyword-catalog-head {
  font-family: "Chakra Petch", sans-serif;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.8rem;
  margin-bottom: 0.55rem;
}

.keyword-group-list,
.keyword-detail-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.keyword-group-btn,
.keyword-detail-btn {
  border: 1px solid rgba(140, 183, 196, 0.3);
  background: rgba(0, 0, 0, 0.16);
  color: var(--text);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  text-align: left;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
}

.keyword-group-btn {
  width: 100%;
}

.keyword-detail-btn {
  flex: 1 1 220px;
}

.keyword-detail-item {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
  width: 100%;
}

.keyword-star-btn {
  flex: 0 0 auto;
  min-width: 2.1rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(140, 183, 196, 0.3);
  background: rgba(0, 0, 0, 0.16);
  color: var(--muted);
  border-radius: 12px;
  cursor: pointer;
}

.keyword-star-btn.active {
  color: var(--accent);
  border-color: rgba(242, 177, 52, 0.7);
  background: rgba(242, 177, 52, 0.1);
}

.keyword-star-btn:hover {
  color: var(--accent);
}

.keyword-group-btn:hover,
.keyword-detail-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(108, 195, 221, 0.75);
}

.keyword-group-btn.active,
.keyword-detail-btn.active {
  border-color: var(--accent);
  background: rgba(242, 177, 52, 0.12);
  box-shadow: inset 0 0 0 1px rgba(242, 177, 52, 0.3);
}

.keyword-btn-title {
  display: block;
  font-weight: 700;
  color: var(--text);
}

.keyword-btn-meta {
  display: block;
  margin-top: 0.18rem;
  font-size: 0.78rem;
  color: var(--muted);
}

#map.map-pick-active {
  cursor: crosshair;
}

#map.map-pick-active .leaflet-container {
  cursor: crosshair;
}

.log,
.list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 220px;
  overflow: auto;
}

.log li,
.list li {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(140, 183, 196, 0.16);
  border-radius: 10px;
  padding: 0.45rem 0.6rem;
  display: flex;
  flex-direction: column;
}

.list li.clickable-entry {
  cursor: pointer;
}

.list li.clickable-entry:hover,
.list li.clickable-entry:focus-visible {
  border-color: rgba(108, 195, 221, 0.7);
  background: rgba(108, 195, 221, 0.12);
  outline: none;
}

.primary {
  color: var(--text);
}

.secondary-line {
  color: var(--muted);
  font-size: 0.82rem;
}

.list-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.btn-small {
  background: rgba(108, 195, 221, 0.2);
  border: 1px solid rgba(108, 195, 221, 0.5);
  color: #6cc3dd;
  padding: 0.3rem 0.6rem;
  border-radius: 5px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-small:hover {
  background: rgba(108, 195, 221, 0.4);
  border-color: #6cc3dd;
}

#map {
  width: 100%;
  height: 320px;
  border-radius: 12px;
  margin-bottom: 0.7rem;
}

#map.map-theme-dark .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) saturate(0.7) brightness(0.82) contrast(1.08);
}

.map-style-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

.map-style-tab {
  border: 1px solid rgba(140, 183, 196, 0.35);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  border-radius: 999px;
  padding: 0.38rem 0.72rem;
  font-size: 0.8rem;
  cursor: pointer;
}

.map-style-tab.active {
  border-color: rgba(242, 177, 52, 0.82);
  color: #ffe1a4;
  background: rgba(242, 177, 52, 0.16);
}

.map-style-tabs {
  display: none !important;
}

.pager-preview {
  margin-top: 0.6rem;
  border-radius: 12px;
  border: 1px dashed rgba(140, 183, 196, 0.4);
  padding: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

body.pager-classic .pager-preview {
  background: rgba(242, 177, 52, 0.2);
}

body.pager-nightops .pager-preview {
  background: rgba(108, 195, 221, 0.2);
}

body.pager-highcontrast .pager-preview {
  background: #ffffff;
  color: #000000;
}

@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1200px) {
  .card,
  .card.wide {
    grid-column: span 6;
  }
}

@media (max-width: 860px) {
  .topbar {
    position: static;
    grid-template-columns: 1fr auto;
  }

  .topbar-logo {
    grid-column: 1 / -1;
    grid-row: 2;
    height: 34px;
    justify-self: center;
    margin-top: 0.4rem;
  }

  .card,
  .card.wide {
    grid-column: span 12;
  }

  .row {
    grid-template-columns: 1fr;
  }
}

/* ── Anmelde-Sperre ─────────────────────────────────────────────────────
   Liegt ueber der gesamten Leitstelle, bis eine SimRESC-Anmeldung steht.
   Wichtig: die [hidden]-Regel muss NACH .login-overlay stehen und gleich
   spezifisch sein, sonst gewinnt das display:flex und der Dialog bliebe
   sichtbar, obwohl das hidden-Attribut gesetzt ist. */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(6, 10, 18, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.login-overlay[hidden] {
  display: none;
}

.login-dialog {
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 24px;
  border-radius: 14px;
  background: var(--card, #131a26);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

.login-eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}

.login-dialog h2 {
  margin: 0;
  font-size: 1.4rem;
}

.login-hint {
  margin: 0 0 4px;
  font-size: 0.85rem;
  opacity: 0.75;
}

.login-dialog label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.85rem;
}

.login-advanced summary {
  cursor: pointer;
  font-size: 0.8rem;
  opacity: 0.7;
}

.login-advanced input {
  margin-top: 6px;
  width: 100%;
}

.login-error {
  margin: 0;
  font-size: 0.85rem;
  color: #fca5a5;
}

.login-error[hidden] {
  display: none;
}

/* Discord-Login (Hauptweg) + Trenner zum internen Passwort-Login. */
.btn.btn-discord {
  background: #5865f2;
  color: #fff;
  border: none;
  margin-top: 4px;
}
.btn.btn-discord:hover {
  background: #4752c4;
}
.btn.btn-discord:disabled {
  opacity: 0.6;
  cursor: default;
}
.login-or {
  margin: 6px 0 2px;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7c8798;
}

.login-dialog .btn {
  margin-top: 4px;
  padding: 10px;
  font-size: 0.95rem;
}

/* Funkstatus 5 (Sprechwunsch) blinkt auf dem Fahrzeugmarker zwischen Rot und
   Dunkelgrau. Als Keyframe-Animation, weil der Marker sein HTML per divIcon
   erzeugt und dort keine Animation inline moeglich ist. */
@keyframes vehStatusBlink {
  0%, 49%   { background: #dc2626; }
  50%, 100% { background: #374151; }
}
.veh-status-blink {
  animation: vehStatusBlink 1s steps(1, end) infinite;
}

/* ════════════════════════════════════════════════════════════════════════
   Layout-Umbau 2026-09-10: Kopfleiste, allgemeines Menue, Kartenauswahl
   ════════════════════════════════════════════════════════════════════════ */

/* Kopfleiste ueber die volle Breite, hinter Launcher-Buttons, Logo und Menue.
   Die Karte beginnt darunter, damit nichts unter der Leiste verschwindet. */
.overlay-topbar {
  display: none;
}
body.overlay-focus-mode .overlay-topbar {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4.3rem;
  z-index: 60;
  background: linear-gradient(180deg, rgba(5, 18, 25, 0.97), rgba(7, 22, 30, 0.9));
  border-bottom: 1px solid rgba(108, 195, 221, 0.22);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
body.overlay-focus-mode #mapPanel {
  top: 4.3rem;
  margin: 0;
  /* .card blendet mit "fade-in" ein (von translateY(4px) nach 0). Beim
     bildschirmfuellenden Kartenbereich rutscht die Karte dabei kurz nach unten
     und ragt 4px aus dem Bild; laeuft die Animation nicht (verdeckter Tab),
     bleibt der Versatz stehen. Fuer die Karte ohnehin sinnlos. */
  animation: none;
}
/* Die Karte war bildschirmhoch (100vh). Seit sie unter der Leiste beginnt,
   ragte sie um die Leistenhoehe unten aus dem Bild -- und nahm Kartenauswahl
   und Zoom-Knoepfe mit. Jetzt fuellt sie genau den Kartenbereich. */
body.overlay-focus-mode #map {
  height: 100%;
}
/* "Laufende Einsaetze" klappt jetzt unterhalb der Leiste auf. */
body.overlay-focus-mode #runningIncidentsPanel.running-incidents-panel {
  top: 4.8rem;
}

/* Allgemeines Menue oben rechts */
.app-menu {
  display: none;
}
body.overlay-focus-mode .app-menu {
  display: block;
  position: fixed;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 72;
}
.app-menu-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid rgba(108, 195, 221, 0.45);
  background: rgba(8, 30, 40, 0.92)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23d8ecf2' d='M4 7h16v2H4zm0 5h16v2H4zm0 5h16v2H4z'/%3E%3C/svg%3E")
    center / 22px 22px no-repeat;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
  cursor: pointer;
}
.app-menu-btn:hover,
.app-menu-btn[aria-expanded="true"] {
  background-color: rgba(12, 40, 53, 0.95);
}
.app-menu-btn:focus-visible {
  outline: 2px solid #6cc3dd;
  outline-offset: 2px;
}
.app-menu-list {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  min-width: 250px;
  display: flex;
  flex-direction: column;
  padding: 0.35rem;
  background: #081722;
  border: 1px solid rgba(108, 195, 221, 0.35);
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}
/* display:flex oben wuerde das hidden-Attribut sonst aushebeln. */
.app-menu-list[hidden] {
  display: none;
}
.app-menu-item {
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
}
.app-menu-item:hover,
.app-menu-item:focus-visible {
  background: rgba(108, 195, 221, 0.14);
  outline: none;
}
.app-menu-sep {
  height: 1px;
  margin: 0.3rem 0.4rem;
  background: rgba(140, 183, 196, 0.2);
}

/* Einstellungsseite */
.settings-card {
  min-height: 240px;
}
.settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.settings-section {
  border-top: 1px solid rgba(140, 183, 196, 0.18);
  padding-top: 0.9rem;
}
.settings-section h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

/* Kartenauswahl: dauerhaft offen unten rechts, rechts neben den Zoom-Knoepfen.
   Leaflet stapelt Controls in einer Ecke per float -- welches wo landet, haengt
   dann an der Einfuege-Reihenfolge. Mit flex + order ist die Anordnung davon
   unabhaengig: Zoom | Kartenauswahl, darunter die Quellenangabe ueber die
   ganze Breite. */
.leaflet-bottom.leaflet-right {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: flex-end;
}
.leaflet-bottom.leaflet-right .leaflet-control {
  float: none;
  clear: none;
}
.leaflet-bottom.leaflet-right .leaflet-control-zoom {
  order: 1;
}
.leaflet-bottom.leaflet-right .leaflet-control-layers {
  order: 2;
}
.leaflet-bottom.leaflet-right .leaflet-control-attribution {
  order: 3;
  flex-basis: 100%;
  margin: 0;
  text-align: right;
}
.leaflet-bottom.leaflet-right .leaflet-control-layers-expanded {
  min-width: 0;
  text-align: left;
}
/* Eintraege wirklich linksbuendig. Vorher wurden sie per Flex zentriert und
   standen dadurch treppenfoermig versetzt (kuerzerer Name = weiter rechts). */
.leaflet-bottom.leaflet-right .leaflet-control-layers label {
  flex-direction: row;
  justify-content: flex-start;
}
/* Leaflet begrenzt die Hoehe der offenen Liste per Inline-Style anhand des
   Abstands zur KARTENOBERKANTE (gedacht fuer oben rechts). In der unteren Ecke
   ist dieser Abstand gross -> die drei Eintraege bekamen einen Scrollbalken.
   Drei Eintraege passen immer, also Begrenzung aufheben. */
.leaflet-bottom.leaflet-right .leaflet-control-layers-list {
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
}
.leaflet-bottom.leaflet-right .leaflet-control-layers-scrollbar {
  overflow-y: visible;
  padding-right: 0;
}

/* "Einsatz erstellen" genau wie "Laufende Einsaetze": unter der Kopfleiste,
   gleicher Abstand und gleicher Rahmen. Die alten Werte (top 4rem, eigener
   Verlauf/Radius) stammten aus der Zeit vor der Leiste und liessen das
   Fenster in die Leiste ragen. (2026-09-10) */
body.overlay-focus-mode #dispatchPanel {
  top: 4.8rem;
  left: 0.9rem;
  max-height: calc(100vh - 5.7rem);
  padding: 0.9rem;
  background: var(--panel);
  border: 1px solid rgba(140, 183, 196, 0.2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
body.overlay-focus-mode .dispatch-panel-body {
  max-height: calc(100vh - 9.7rem);
}
@media (max-width: 980px) {
  body.overlay-focus-mode #dispatchPanel {
    top: 4.8rem;
    max-height: calc(100vh - 5.7rem);
  }
}

/* Logo darf weder die Launcher-Buttons noch die Funkleiste ueberdecken.
   Seit rechts die Funkleiste sitzt, ist der Platz neben dem Menue belegt --
   das Logo bleibt mittig, solange rechts und links genug Luft ist, und wird
   darunter ausgeblendet. Gemessen: Funkleiste hoechstens 491px breit; bei
   1280px bleiben zwischen Logo und Leiste noch 21px, darunter wird es eng. */
@media (max-width: 1280px) {
  body.overlay-focus-mode .overlay-logo {
    display: none;
  }
}

/* ════════════════════════════════════════════════════════════════════════
   Funk in der Kopfleiste (2026-09-10) -- genau eine Gruppe wie im Client
   ════════════════════════════════════════════════════════════════════════ */
.funk-strip {
  display: none;
}
body.overlay-focus-mode .funk-strip {
  position: fixed;
  top: 0.9rem;
  right: calc(0.9rem + 44px + 0.6rem);
  z-index: 71;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.35rem 0 0.7rem;
  border: 1px solid rgba(108, 195, 221, 0.45);
  border-radius: 12px;
  background: rgba(8, 30, 40, 0.92);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
}
body.overlay-focus-mode .funk-strip[hidden] {
  display: none;
}
.funk-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #b3402f;
}
.funk-dot.on {
  background: #27c56a;
  box-shadow: 0 0 8px #27c56a;
}
.funk-group {
  width: 190px;
  height: 32px;
  padding: 0 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(108, 195, 221, 0.3);
  background: #0b2029;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}
.funk-speaker {
  max-width: 170px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.82rem;
  font-weight: 600;
  color: #6ee7a0;
}
.funk-speaker:empty {
  display: none;
}
.funk-strip.rx {
  border-color: rgba(46, 224, 111, 0.6);
}
.funk-ptt {
  height: 34px;
  min-width: 78px;
  padding: 0 0.8rem;
  border-radius: 9px;
  border: 1px solid #2c3744;
  background: #1b232e;
  color: #c6d2df;
  font: inherit;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}
.funk-ptt:disabled {
  opacity: 0.45;
  cursor: default;
}
.funk-ptt.tx {
  background: #1f9350;
  border-color: #2ee06f;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(46, 224, 111, 0.22);
}
.funk-note {
  display: none;
}
body.overlay-focus-mode .funk-note {
  display: block;
  position: fixed;
  top: 4.8rem;
  right: 0.9rem;
  z-index: 69;
  max-width: min(420px, calc(100vw - 1.8rem));
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  border: 1px solid rgba(230, 192, 122, 0.4);
  background: rgba(28, 21, 12, 0.94);
  color: #e6c07a;
  font-size: 0.82rem;
  line-height: 1.4;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
}
body.overlay-focus-mode .funk-note[hidden] {
  display: none;
}
/* Schmaler werdend: erst "wer spricht" weg, dann die Gruppenauswahl kuerzer,
   zuletzt nur noch Status + PTT. Grenzen per Messung (Changelog). */
@media (max-width: 1100px) {
  .funk-speaker {
    display: none;
  }
}
@media (max-width: 860px) {
  .funk-group {
    width: 130px;
  }
}
@media (max-width: 760px) {
  .funk-group {
    display: none;
  }
}
@media (max-width: 640px) {
  body.overlay-focus-mode .funk-strip {
    display: none;
  }
}

/* Einstellungen: Funk-Abschnitt */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--muted);
}
.settings-field select {
  height: 36px;
  padding: 0 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(108, 195, 221, 0.3);
  background: #0b2029;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
}
.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}
.settings-value {
  font-weight: 700;
}

/* ════════════════════════════════════════════════════════════════════════
   Einsatz erstellen: gefuehrte Einsatzanlage in 4 Schritten (2026-09-10)
   ════════════════════════════════════════════════════════════════════════ */
body.overlay-focus-mode.dispatch-panel-open #dispatchPanel {
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100vw - 1.8rem));
}
body.overlay-focus-mode.dispatch-panel-open .dispatch-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
}
body.overlay-focus-mode.dispatch-panel-minimized .dispatch-steps,
body.overlay-focus-mode.dispatch-panel-minimized .dispatch-footer {
  display: none;
}
#dispatchPanel [hidden] {
  display: none !important;
}

.dispatch-steps {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
}
.dispatch-step-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(140, 183, 196, 0.25);
  background: rgba(0, 0, 0, 0.16);
  color: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  text-align: left;
}
.dispatch-step-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dispatch-step-no {
  flex: 0 0 auto;
  width: 1.45rem;
  height: 1.45rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  border: 1px solid rgba(140, 183, 196, 0.4);
}
.dispatch-step-btn:hover:not(:disabled) {
  border-color: rgba(108, 195, 221, 0.75);
}
.dispatch-step-btn.is-done .dispatch-step-no {
  background: rgba(88, 214, 141, 0.16);
  border-color: var(--ok);
  color: var(--ok);
}
.dispatch-step-btn.is-current {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(242, 177, 52, 0.12);
}
.dispatch-step-btn.is-current .dispatch-step-no {
  background: var(--accent);
  border-color: var(--accent);
  color: #18232a;
}
.dispatch-step-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.dispatch-footer {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(108, 195, 221, 0.16);
}
.dispatch-footer .hint.dispatch-footer-hint {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}
.dispatch-footer .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn.dispatch-alarm-btn {
  background: var(--danger);
  color: #fff;
  padding-inline: 1.3rem;
}
.btn.dispatch-small-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}
.btn.dispatch-small-btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

#dispatchPanel .dispatch-step > label {
  margin-bottom: 0.6rem;
}
.dispatch-step-lead {
  margin: 0 0 0.7rem;
  color: var(--text);
  font-size: 0.92rem;
}

/* Schritt 1 */
.dispatch-address-form {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.dispatch-address-form label {
  flex: 1 1 auto;
  min-width: 0;
}
.dispatch-address-results {
  list-style: none;
  margin: 0 0 0.7rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.dispatch-address-results .hint {
  margin: 0;
}
.dispatch-address-result {
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.5rem 0.65rem;
  border-radius: 10px;
  border: 1px solid rgba(140, 183, 196, 0.28);
  background: rgba(0, 0, 0, 0.18);
  color: var(--text);
  cursor: pointer;
}
.dispatch-address-result:hover {
  border-color: rgba(108, 195, 221, 0.75);
}
.dispatch-address-main {
  font-weight: 700;
}
.dispatch-address-sub {
  font-size: 0.78rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dispatch-map-pick {
  margin-bottom: 0.7rem;
}
.dispatch-map-pick .hint {
  margin: 0;
}
.dispatch-point-card {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px dashed rgba(140, 183, 196, 0.3);
  margin-bottom: 0.7rem;
}
.dispatch-point-card.is-set {
  border-style: solid;
  border-color: rgba(88, 214, 141, 0.45);
  background: rgba(88, 214, 141, 0.08);
}
.dispatch-point-card .hint {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
}
.dispatch-point-card.is-set .hint {
  color: var(--text);
}

/* Schritt 2 */
.keyword-toolbar {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}
#dispatchPanel .keyword-catalog-col {
  min-height: 0;
}
#dispatchPanel .keyword-group-btn {
  padding: 0.42rem 0.6rem;
}
#dispatchPanel label.dispatch-involved {
  margin: 0.7rem 0 0;
}
.dispatch-summary-block .hint + .hint {
  margin-top: 0.1rem;
}

/* Schritt 3 */
.dispatch-suggestion {
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(242, 177, 52, 0.28);
  background: rgba(242, 177, 52, 0.08);
  margin-bottom: 0.7rem;
}
.dispatch-suggestion-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
}
.dispatch-suggestion-head .hint {
  flex: 1 1 auto;
  margin: 0;
}
.dispatch-suggestion .alarm-sequence-list {
  margin: 0;
}
.dispatch-vehicles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}
.dispatch-vehicle-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  border: 1px solid rgba(140, 183, 196, 0.22);
  background: rgba(0, 0, 0, 0.18);
}
.dispatch-vehicle-card.is-active {
  border-color: rgba(242, 177, 52, 0.6);
  box-shadow: inset 0 0 0 1px rgba(242, 177, 52, 0.22);
}
.dispatch-vehicle-card--rth {
  grid-column: 1 / -1;
}
.dispatch-vehicle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.dispatch-vehicle-title {
  font-weight: 700;
  color: var(--text);
}
.dispatch-vehicle-note,
.dispatch-vehicle-empty {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}
.dispatch-rec {
  font-size: 0.72rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(242, 177, 52, 0.55);
  color: var(--accent);
  white-space: nowrap;
}
.dispatch-stepper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.dispatch-stepper-btn {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 10px;
  border: 1px solid rgba(140, 183, 196, 0.4);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.dispatch-stepper-btn:hover:not(:disabled) {
  border-color: rgba(108, 195, 221, 0.75);
}
.dispatch-stepper-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.dispatch-stepper-value {
  min-width: 1.6rem;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.dispatch-heli-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 15rem;
  overflow-y: auto;
}
label.dispatch-heli-row {
  flex-direction: row;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(140, 183, 196, 0.22);
  background: rgba(0, 0, 0, 0.14);
  color: var(--text);
  cursor: pointer;
}
label.dispatch-heli-row.is-active {
  border-color: rgba(242, 177, 52, 0.6);
  background: rgba(242, 177, 52, 0.1);
}
.dispatch-heli-row input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  padding: 0;
}
.dispatch-heli-name {
  font-weight: 700;
}
.dispatch-heli-meta {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

/* Schritt 4 */
.dispatch-summary {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.dispatch-summary-block {
  padding: 0.6rem 0.75rem;
  border-radius: 12px;
  border: 1px solid rgba(140, 183, 196, 0.22);
  background: rgba(0, 0, 0, 0.18);
}
.dispatch-summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
.dispatch-summary-title {
  font-family: "Chakra Petch", sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
  color: var(--accent);
}
.dispatch-summary-block p {
  margin: 0 0 0.2rem;
  color: var(--text);
}
.dispatch-summary-block p.hint,
.dispatch-summary-block .hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}
.dispatch-summary-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--text);
}
.dispatch-summary-list .is-heli {
  font-weight: 700;
}
.dispatch-warning {
  margin: 0.5rem 0 0;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 95, 86, 0.45);
  background: rgba(255, 95, 86, 0.1);
  color: #ffb4ae;
  font-size: 0.84rem;
}

@media (max-width: 980px) {
  body.overlay-focus-mode.dispatch-panel-open #dispatchPanel {
    width: auto;
  }
}
@media (max-width: 640px) {
  .dispatch-vehicles,
  .keyword-toolbar,
  #dispatchPanel .keyword-catalog {
    grid-template-columns: 1fr;
  }
  .dispatch-step-label {
    display: none;
  }
  .dispatch-step-btn {
    justify-content: center;
  }
}

/* ════════════════════════════════════════════════════════════════════════
   RTH-Stationen als Kartenebene mit 60-km-Kreis (2026-09-10)
   ════════════════════════════════════════════════════════════════════════ */
.leaflet-marker-icon.station-marker {
  background: transparent;
  border: 0;
}
.station-dot {
  display: block;
  width: 12px;
  height: 12px;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}
.leaflet-tooltip.station-label {
  display: none;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  background: rgba(5, 20, 28, 0.82);
  border: 1px solid rgba(108, 195, 221, 0.35);
  border-radius: 6px;
  box-shadow: none;
  white-space: nowrap;
}
.leaflet-tooltip.station-label::before {
  display: none;
}
.show-station-labels .leaflet-tooltip.station-label {
  display: block;
}
.station-popup-hint {
  font-size: 12px;
  color: var(--muted);
}
.station-popup-hint a {
  color: #8fe0f1;
}
.leaflet-control-layers-separator {
  border-top-color: rgba(108, 195, 221, 0.2);
  margin: 0.3rem 0;
}

/* Krankenhaeuser als Kartenebene (2026-09-10) */
.leaflet-tooltip.hospital-label {
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  background: rgba(5, 20, 28, 0.88);
  border: 1px solid rgba(108, 195, 221, 0.35);
  border-radius: 6px;
  box-shadow: none;
  white-space: nowrap;
}
.leaflet-tooltip.hospital-label::before {
  display: none;
}

/* Krankenhaeuser: eckiges "H" (2026-09-10) -- blau mit Landeplatz, rot ohne */
.leaflet-marker-icon.hospital-square-marker {
  background: transparent;
  border: 0;
}
.hospital-square {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  box-sizing: border-box;
  border-radius: 3px;
  border: 1.5px solid #ffffff;
  background: #dc2626;
  color: #ffffff;
  font: 800 11px/1 Arial, "Helvetica Neue", sans-serif;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.hospital-square-marker.has-helipad .hospital-square {
  background: #2563eb;
}
.hospital-square-marker:hover .hospital-square {
  transform: scale(1.15);
}

/* VIVENA-Kliniken (2026-09-21): ohne Landeplatz grau statt rot -- Rot gehoert
   hier der Ampel, die als Punkt oben rechts am "H" sitzt. */
.hospital-square-marker.vivena .hospital-square {
  position: relative;
  background: #64748b;
}
.hospital-square-marker.vivena.has-helipad .hospital-square {
  background: #2563eb;
}
.hospital-ampel {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  box-sizing: border-box;
  flex: 0 0 auto;
}
.hospital-square .hospital-ampel {
  position: absolute;
  top: -5px;
  right: -5px;
}
.ampel-gruen { background: #16a34a; }
.ampel-gelb { background: #eab308; }
.ampel-rot { background: #dc2626; }
.ampel-schwarz { background: #111827; }
.ampel-unbekannt { background: #94a3b8; }
.hospital-ampel-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}
.hospital-ampel-line .hospital-ampel { border-color: rgba(0, 0, 0, 0.25); }
.hospital-caps {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}
.hospital-caps span {
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.22);
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 700;
}
.hospital-stale { color: #b45309; }

/* Zielklinik-Auswahl im Einsatz-Assistenten (Schritt 2) */
/* Zielklinik in Schritt 4 (User 2026-09-22) */
.dispatch-dest-block { margin-top: 0.6rem; }
.dispatch-dest-block .row { margin-top: 0.3rem; }

.dest-suggest {
  margin: 0.2rem 0 0.6rem;
  padding: 0.5rem;
  border: 1px solid var(--border, rgba(148, 163, 184, 0.25));
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.35);
}
.dest-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}
.dest-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 600;
  white-space: nowrap;
}
.dest-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.dest-row:hover { background: rgba(30, 91, 184, 0.3); }
.dest-row.is-chosen {
  border-color: #3b82f6;
  background: rgba(37, 99, 235, 0.22);
}
.dest-row.is-closed { opacity: 0.55; }
.dest-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 auto;
}
.dest-name {
  font-weight: 700;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dest-meta {
  font-size: 0.74rem;
  color: var(--muted);
}
.dest-fit {
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: rgba(22, 163, 74, 0.2);
  color: #4ade80;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.dest-foot {
  margin-top: 0.3rem;
  font-size: 0.7rem;
  color: var(--muted);
}

/* ════════════════════════════════════════════════════════════════════════
   Livemap (livemap.html, 2026-09-10) -- oeffentlich, nur lesend
   ════════════════════════════════════════════════════════════════════════ */
body.livemap-page .livemap-bar {
  position: fixed;
  top: 0.9rem;
  left: 0.9rem;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.livemap-title {
  padding: 0 0.35rem;
  font-family: "Chakra Petch", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.livemap-chip,
body.livemap-page .livemap-status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 44px;
  padding: 0 0.95rem;
  border-radius: 12px;
  border: 1px solid rgba(108, 195, 221, 0.45);
  background: rgba(8, 30, 40, 0.92);
  color: var(--text);
  font: 600 0.9rem "Manrope", sans-serif;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
}
.livemap-chip {
  cursor: pointer;
}
.livemap-chip:hover {
  background: rgba(12, 40, 53, 0.95);
}
.livemap-chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.livemap-chip strong {
  min-width: 1.4ch;
  font-size: 1.05rem;
  color: #ffffff;
  text-align: center;
}
.livemap-chip-dot,
.livemap-status-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  flex: 0 0 auto;
}
.livemap-chip-dot.is-incident {
  background: #2563eb;
}
.livemap-chip-dot.is-vehicle {
  background: #facc15;
}
.livemap-chip-dot.is-funk {
  background: var(--muted);
}
/* NOTAM-Ebene (User 2026-09-21): Popup im Stil der Livemap. */
.notam-leaflet-popup .leaflet-popup-content-wrapper {
  background: rgba(8, 30, 40, 0.97);
  color: var(--text);
  border: 1px solid rgba(108, 195, 221, 0.35);
  border-radius: 10px;
}
.notam-leaflet-popup .leaflet-popup-tip {
  background: rgba(8, 30, 40, 0.97);
}
.notam-popup {
  font: 0.82rem "Manrope", sans-serif;
  min-width: 14rem;
}
.notam-popup-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.25rem;
  font-size: 0.92rem;
}
.notam-popup-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  flex: 0 0 auto;
}
.notam-popup-meta {
  color: var(--muted);
  margin-bottom: 0.15rem;
}
.notam-popup-text {
  margin: 0.4rem 0;
  max-height: 11rem;
  overflow: auto;
  white-space: pre-wrap;
  font: 0.78rem/1.35 ui-monospace, Consolas, monospace;
  color: var(--text);
}
.notam-popup-foot {
  font-size: 0.7rem;
  color: var(--muted);
}
@media (max-width: 640px) {
  body.livemap-page .livemap-bar { flex-wrap: wrap; right: 0.9rem; }
}
/* Kopfzeile der ausklinkbaren Fenster: Titel links, Knoepfe rechts in EINER
   Zeile. Die Standard-.row ist ein Zwei-Spalten-Raster -- damit stapelten sich
   die Knoepfe und der Titel brach um (User 2026-09-20). */
#runningIncidentsPanel .card-head,
#forcesPanel .card-head {
  gap: 0.6rem;
  flex-wrap: nowrap;
}
#runningIncidentsPanel .card-head h2,
#forcesPanel .card-head h2 {
  margin-right: auto;
  white-space: nowrap;
}
#runningIncidentsPanel .card-head .row,
#forcesPanel .card-head .row {
  display: flex;
  flex: 0 0 auto;
  gap: 0.4rem;
}
#runningIncidentsPanel .card-head .btn,
#forcesPanel .card-head .btn {
  white-space: nowrap;
  padding: 0.35rem 0.7rem;
  font-size: 0.82rem;
}

/* ── Einsatzkraefte-Fenster (User 2026-09-20) ───────────────────────────── */
.forces-panel {
  position: fixed;
  top: 3.6rem;
  left: 0.9rem;
  z-index: 66;
  width: min(42rem, calc(100vw - 1.8rem));
  max-height: calc(100vh - 6rem);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.forces-panel.is-hidden { display: none; }
.forces-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(108, 195, 221, 0.25);
}
.forces-tab {
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  border: 1px solid rgba(108, 195, 221, 0.35);
  background: transparent;
  color: var(--muted);
  font: 600 0.82rem "Manrope", sans-serif;
  cursor: pointer;
}
.forces-tab:hover { color: var(--text); }
.forces-tab.is-active {
  background: rgba(30, 91, 184, 0.35);
  border-color: var(--accent);
  color: #ffffff;
}
.forces-body {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 0.45rem;
  overflow-y: auto;
  padding-right: 0.2rem;
}
.forces-card {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  width: 100%;
  padding: 0.4rem 0.55rem;
  border-radius: 9px;
  border: 1px solid rgba(108, 195, 221, 0.28);
  background: rgba(8, 30, 40, 0.75);
  color: var(--text);
  font: 600 0.85rem "Manrope", sans-serif;
  text-align: left;
  cursor: default;
}
button.forces-card { cursor: pointer; }
button.forces-card:hover { background: rgba(12, 40, 53, 0.95); }
.forces-card.is-offline { opacity: 0.55; }
.forces-status {
  flex: 0 0 auto;
  margin-top: 0.05rem;
  min-width: 1.9rem;
  padding: 0.15rem 0;
  border-radius: 6px;
  background: #16a34a;
  color: #ffffff;
  font-weight: 800;
  text-align: center;
}
.forces-status.s3, .forces-status.s4 { background: #dc2626; }
/* Sprechwunsch (5) und Prio-Sprechwunsch (0) blinken rot/schwarz -- wie in der
   echten Leitstelle nicht zu uebersehen (User 2026-09-20). */
.forces-status.s0, .forces-status.s5 {
  background: #b91c1c;
  animation: forces-blink 0.9s steps(1, end) infinite;
}
/* Offener Sprechwunsch, nachdem der Status schon zurueckgegangen ist: ruhig,
   aber deutlich (User 2026-09-21: kein Dauerblinken). */
.forces-wish {
  flex: none;
  align-self: center;
  margin-left: auto;
  padding: 2px 6px;
  border: 1px solid #dc2626;
  border-radius: 4px;
  color: #dc2626;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.forces-wish.is-prio { background: #b91c1c; color: #fff; border-color: #b91c1c; }
@keyframes forces-blink {
  0%, 49% { background: #dc2626; color: #ffffff; }
  50%, 100% { background: #0b0f14; color: #f87171; }
}
/* Wer keine Animationen mag, bekommt wenigstens die Farbe. */
@media (prefers-reduced-motion: reduce) {
  .forces-status.s0, .forces-status.s5 { animation: none; }
}
.forces-status.s7, .forces-status.s8 { background: #2563eb; }
.forces-status.s6, .forces-status.s9 { background: #374151; }
.forces-status.is-none { background: #334155; color: #cbd5e1; }
/* Nichts abschneiden: lange Rufnamen und Wachen duerfen umbrechen. */
.forces-lines {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.forces-name { overflow-wrap: anywhere; line-height: 1.25; }
.forces-note {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.76rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

/* Menue am Fahrzeug */
.forces-menu {
  position: fixed;
  z-index: 90;
  min-width: 15rem;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid rgba(108, 195, 221, 0.45);
  background: rgba(8, 30, 40, 0.98);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5);
}
.forces-menu[hidden] { display: none; }
.forces-menu-head {
  padding: 0.25rem 0.5rem 0.4rem;
  font: 700 0.9rem "Chakra Petch", sans-serif;
  color: #ffffff;
}
.forces-menu-info {
  padding: 0 0.5rem 0.45rem;
  border-bottom: 1px solid rgba(108, 195, 221, 0.2);
  margin-bottom: 0.3rem;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
}
.forces-menu-hint {
  padding: 0.4rem 0.5rem 0.2rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.forces-menu-item {
  display: block;
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: 600 0.83rem "Manrope", sans-serif;
  text-align: left;
  cursor: pointer;
}
.forces-menu-item:hover { background: rgba(30, 91, 184, 0.4); }
/* Quittieren geht nur, wenn wirklich ein Sprechwunsch offen ist. */
.forces-menu-item:disabled { opacity: 0.4; cursor: default; }
.forces-menu-item:disabled:hover { background: transparent; }

/* ── Ausgeklinktes Fenster (?panel=...) ──────────────────────────────────
   Nur das eine Panel, formatfuellend -- Karte, Leisten und Menue bleiben weg. */
body.panel-mode .launcher-row,
body.panel-mode .app-menu,
body.panel-mode .overlay-logo,
body.panel-mode .overlay-topbar,
body.panel-mode .livemap-right { display: none !important; }
/* main.layout darf NICHT verschwinden -- das Einsatzfenster steckt darin, und
   ein Kind eines ausgeblendeten Elements wird nie gezeichnet (User 2026-09-20:
   schwarzes Fenster). Stattdessen kommen die uebrigen Karten weg. */
body.panel-mode main.layout {
  display: block;
  padding: 0;
  min-height: 100vh;
}
body.panel-mode main.layout > .card { display: none !important; }
/* Nur das Panel dieses Fensters ist sichtbar -- und zwar unabhaengig davon,
   ob es sonst als "zu" oder "minimiert" gilt. */
body.panel-mode.panel-dispatch #dispatchPanel {
  display: block !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: none !important;
  overflow-y: auto;
}
/* Ohne Karte faellt die Seitenhoehe zusammen -- dann hat auch die
   Anmeldemaske keine Flaeche mehr. */
body.panel-mode, body.panel-mode > .layout { min-height: 100vh; }
/* Das Panel ist hier das ganze Fenster: die Regeln fuer "zu"/"minimiert"
   duerfen es nicht ausblenden. */
/* Nur das Einsatzkraefte-Fenster ist von Haus aus eine Spalte. Die anderen
   beiden sind normale Karten -- flex wuerde ihren Inhalt nebeneinander legen
   (User 2026-09-20: zerrissenes Einsatzfenster). */
body.panel-mode.panel-forces #forcesPanel { display: flex !important; }
body.panel-mode.panel-incidents #runningIncidentsPanel { display: block !important; }
/* Das Panel fuellt das Fenster -- die Masse aus dem Kartenbetrieb (feste
   Breite, Abstand zur Menuezeile) gelten hier nicht. */
body.panel-mode #dispatchPanel,
body.panel-mode #runningIncidentsPanel,
body.panel-mode #forcesPanel {
  position: fixed !important;
  inset: 0.6rem !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 12px;
}
body.panel-mode .card-head .btn[id^="popout"] { display: none; }

/* Abzeichen fuer die Oktoberfest-Einsaetze des Auto-Disponenten. */
.wiesn-badge {
  display: inline-block;
  padding: 0 0.4rem;
  border-radius: 6px;
  background: #1e5bb8;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.settings-range {
  flex: 1 1 12rem;
  min-width: 8rem;
  accent-color: var(--accent);
}
.livemap-chip.is-on {
  border-color: rgba(88, 214, 141, 0.55);
}
.livemap-chip.is-on .livemap-chip-dot.is-funk {
  background: var(--ok);
}
/* Jemand spricht gerade -- derselbe Puls wie bei der Live-Anzeige. */
.livemap-chip.is-speaking .livemap-chip-dot.is-funk {
  animation: livemap-pulse 1.4s ease-out infinite;
}
.livemap-select {
  height: 44px;
  padding: 0 0.6rem;
  border-radius: 12px;
  border: 1px solid rgba(108, 195, 221, 0.45);
  background: rgba(8, 30, 40, 0.92);
  color: var(--text);
  font: 600 0.9rem "Manrope", sans-serif;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
  max-width: 14rem;
}
.livemap-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
body.livemap-page .livemap-status {
  position: fixed;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 70;
  border-color: rgba(108, 195, 221, 0.3);
  color: var(--muted);
  font-size: 0.85rem;
}
.livemap-status-dot {
  background: var(--muted);
}
body.livemap-page .livemap-status.is-live {
  color: var(--text);
}
.livemap-status.is-live .livemap-status-dot {
  background: var(--ok);
  animation: livemap-pulse 2s ease-out infinite;
}
body.livemap-page .livemap-status.is-offline {
  color: #ffb4ae;
  border-color: rgba(255, 95, 86, 0.45);
}
.livemap-status.is-offline .livemap-status-dot {
  background: var(--danger);
}
@keyframes livemap-pulse {
  0% { box-shadow: 0 0 0 0 rgba(88, 214, 141, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(88, 214, 141, 0); }
  100% { box-shadow: 0 0 0 0 rgba(88, 214, 141, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .livemap-status.is-live .livemap-status-dot {
    animation: none;
  }
}
/* Rechte Gruppe: Leitstelle + Live-Anzeige (links waere sie bei breiten
   Bildschirmen mit dem mittigen Logo kollidiert). */
body.livemap-page .livemap-right {
  position: fixed;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 70;
  display: flex;
  /* Zwei Zeilen: oben Leitstelle + Live, darunter der Funk (User 2026-09-20).
     Vorher stand der Funk links und drueckte das Logo aus der Mitte. */
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}
body.livemap-page .livemap-right-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  max-width: 100%;
}
/* Etwas Luft zwischen Anzeigen und Funk (User 2026-09-20: "ein bisschen tiefer"). */
body.livemap-page .livemap-right-row + .livemap-right-row {
  margin-top: 0.45rem;
}
body.livemap-page .livemap-right .livemap-status {
  position: static;
}
.livemap-chip.is-static {
  cursor: default;
}
.livemap-chip.is-static:hover {
  background: rgba(8, 30, 40, 0.92);
}
.livemap-chip-dot.is-dispatch {
  background: var(--muted);
}
.livemap-chip.is-online .livemap-chip-dot.is-dispatch {
  background: var(--ok);
}
#livemapDispatchText {
  max-width: 20rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 1100px) {
  #livemapDispatchText {
    max-width: 11rem;
  }
}
@media (max-width: 760px) {
  .livemap-title {
    display: none;
  }
  body.livemap-page .livemap-right {
    top: auto;
    right: auto;
    bottom: 0.9rem;
    left: 0.9rem;
    align-items: flex-start;
  }
  body.livemap-page .livemap-right-row {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  #livemapDispatchText {
    max-width: 8rem;
  }
  .livemap-chip,
  body.livemap-page .livemap-status {
    height: 40px;
    padding: 0 0.7rem;
    font-size: 0.8rem;
  }
  body.livemap-page .livemap-status {
    top: auto;
    right: auto;
    bottom: 0.9rem;
    left: 0.9rem;
  }
}

/* Inkognito (User 2026-09-16): der Pilot laesst sich vom KI-Disponenten alarmieren, obwohl
   wir online sind. Er ist ganz normal online -- in der Flottenliste nur hellgrau. */
.fleet-solo .primary,
.fleet-solo .secondary-line {
  color: #9ca3af;
}

/* ════════════════════════════════════════════════════════════════════════
   Livemap: Flugverfolgung (2026-09-25, "wie Flightradar24") -- Tafel links,
   Spur nach Hoehe eingefaerbt. Nur mit Transponder und ueber 180 m aufgezeichnet.
   ════════════════════════════════════════════════════════════════════════ */
body.livemap-page .leaflet-marker-icon.is-trackable .veh-heli {
  cursor: pointer;
}
.veh-heli.is-tracked {
  outline: 3px solid rgba(250, 204, 21, 0.55);
  outline-offset: 3px;
}
.lm-track {
  position: fixed;
  top: 4.6rem;
  left: 0.9rem;
  z-index: 70;
  width: 310px;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  padding: 0.9rem 1rem 0.8rem;
  border-radius: 14px;
  border: 1px solid rgba(108, 195, 221, 0.45);
  background: rgba(8, 30, 40, 0.95);
  color: var(--text);
  font: 500 0.85rem "Manrope", sans-serif;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
}
.lm-track[hidden] {
  display: none;
}
.lm-track-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
}
.lm-track-cs {
  font: 700 1.2rem "Chakra Petch", sans-serif;
  letter-spacing: 0.03em;
  color: #ffffff;
}
.lm-track-pilot {
  color: var(--muted);
  font-size: 0.82rem;
}
.lm-track-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 6px;
}
.lm-track-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}
.lm-track-rx {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.6rem;
  font-weight: 700;
}
.lm-rx {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
}
.lm-rx.is-on {
  background: var(--ok);
  box-shadow: 0 0 8px var(--ok);
}
.lm-rx.is-off {
  background: #6b7280;
}
.lm-track-hint {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}
.lm-track-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem 0.8rem;
  margin: 0.8rem 0 0.2rem;
}
.lm-track-grid span {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.lm-track-grid b {
  font-size: 1rem;
  color: #ffffff;
}
.lm-track-grid small.lm-track-msl {
  display: block;
  font-size: 0.7rem;
  color: var(--muted);
}
.lm-track-legend-t {
  flex-basis: 100%;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.lm-track-grid b.lm-track-status {
  font-size: 0.82rem;
}
.lm-track-sub {
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.76rem;
}
.lm-track-profile {
  display: block;
  width: 100%;
  height: 70px;
  margin-top: 0.35rem;
}
.lm-track-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--muted);
}
.lm-track-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.7rem;
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(108, 195, 221, 0.2);
  font-size: 0.68rem;
  color: var(--muted);
}
.lm-track-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.lm-track-legend i {
  width: 0.9rem;
  height: 0.25rem;
  border-radius: 2px;
}
.lm-track-legend i.is-gap {
  background: repeating-linear-gradient(90deg, #9ca3af 0 3px, transparent 3px 6px);
}
@media (max-width: 640px) {
  .lm-track {
    top: auto;
    bottom: 0.6rem;
    left: 0.6rem;
    right: 0.6rem;
    width: auto;
    max-height: 55vh;
  }
}
