/* Gemeinsame UI-Elemente: Seitenmenü, Eingabe-Panel, Popups, Platzhalter-Dialog.
   Farben bewusst an web/style.json angelehnt (helles, ruhiges Kartenbild). */

:root {
  --ui-bg: #ffffff;
  --ui-border: #dfe3e6;
  --ui-text: #2b2f33;
  --ui-text-muted: #5b6570;
  --ui-accent: #1565c0;
  --ui-hover: #eef2f1;
  --ui-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  --ui-radius: 10px;
}

/* Admin-Modus (siehe admin.js syncAdminModeClass): Bernstein statt Blau als
   Akzentfarbe - da fast alle Buttons/Hover-Flächen/Links darüber eingefärbt
   sind, färbt sich damit praktisch die ganze Oberfläche um, nicht nur eine
   einzelne Beschriftung. Soll auf den ersten Blick auffallen, ohne erst den
   "Admin: Abmelden"-Text im Seitenmenü lesen zu müssen. */
body.admin-mode {
  --ui-accent: #b45309;
  --ui-hover: #fdf1e3;
}
body.admin-mode .sidebar {
  box-shadow: 0 0 0 2px var(--ui-accent), var(--ui-shadow);
}

/* ---------- Seitenmenü ---------- */

.sidebar {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 5;
  background: var(--ui-bg);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
  overflow: hidden;
  width: 52px;
  max-width: 240px;
  transition: width 0.18s ease;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--ui-text);
}

@media (hover: hover) {
  .sidebar:hover {
    width: 220px;
  }
}
.sidebar:focus-within,
.sidebar.sidebar--pinned {
  width: 220px;
}

.sidebar-menu {
  list-style: none;
  margin: 0;
  padding: 6px;
}

.sidebar-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 8px;
  background: none;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  font: inherit;
  color: inherit;
  text-align: left;
}
.sidebar-toggle:hover {
  background: var(--ui-hover);
}

.sidebar-icon {
  flex: 0 0 20px;
  font-size: 18px;
  text-align: center;
}

.sidebar-label {
  flex: 1;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.sidebar:hover .sidebar-label,
.sidebar:focus-within .sidebar-label,
.sidebar.sidebar--pinned .sidebar-label {
  opacity: 1;
}

.sidebar-chevron {
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.sidebar:hover .sidebar-chevron,
.sidebar:focus-within .sidebar-chevron,
.sidebar.sidebar--pinned .sidebar-chevron {
  opacity: 1;
}
.sidebar-item.open .sidebar-chevron {
  transform: rotate(90deg);
}

.sidebar-submenu {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.18s ease;
}
.sidebar-item.open .sidebar-submenu {
  max-height: 200px;
}
.sidebar-submenu a,
.sidebar-submenu button {
  display: block;
  padding: 8px 10px 8px 40px;
  font-size: 13px;
  color: var(--ui-text-muted);
  text-decoration: none;
  white-space: nowrap;
  border-radius: 8px;
}
.sidebar-submenu a:hover,
.sidebar-submenu button:hover {
  background: var(--ui-hover);
  color: var(--ui-text);
}
/* Fahrzeug-Auswahl: Knöpfe statt Links, sechs Zeilen. */
.sidebar-submenu button {
  width: 100%;
  box-sizing: border-box;
  border: none;
  background: none;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.sidebar-vehicle.open .sidebar-submenu {
  max-height: 260px;
}

/* ---------- Eingabe-Panel ---------- */

.poi-panel {
  position: fixed;
  top: 16px;
  left: 232px;
  z-index: 6;
  width: 320px;
  max-width: calc(100vw - 250px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--ui-bg);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ui-text);
  padding: 14px 16px 18px;
}

/* display:flex bei .messages-mailbox schlug sonst das hidden-Attribut: das Postfach ließ sich nicht schließen */
.poi-panel[hidden] {
  display: none !important;
}

.poi-panel-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.poi-panel-header h2 {
  font-size: 16px;
  margin: 0;
}
.poi-panel-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--ui-text-muted);
  padding: 2px 6px;
}
.poi-panel-close:hover {
  color: var(--ui-text);
}

.poi-panel-note {
  font-size: 12px;
  color: var(--ui-text-muted);
  background: #fff8e1;
  border: 1px solid #f3e2a4;
  border-radius: 8px;
  padding: 8px 10px;
  margin: 10px 0;
}

.poi-field {
  display: block;
  margin-bottom: 10px;
  font-size: 13px;
}
.poi-field > span {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
}
.poi-field input[type="text"],
.poi-field input[type="search"],
.poi-field input[type="number"],
.poi-field select,
.poi-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 8px;
  border: 1px solid var(--ui-border);
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
}
.poi-field-disabled {
  opacity: 0.6;
}
/* [hidden] hat ohne diese Regel eine geringere Spezifität als die Klasse
   oben und würde von "display: block" überschrieben (gleiches Muster wie
   .poi-photo-preview[hidden] unten) - das Namensfeld bliebe sonst trotz
   admin-mode sichtbar. */
.poi-field-requestedby[hidden] {
  display: none;
}
/* Gleicher Fall: .filter-tags-field ist ebenfalls ".poi-field" (siehe
   poi-filter.js tagsField.hidden). */
.filter-tags-field[hidden] {
  display: none;
}
/* Gleicher Fall: .poi-field-flag ist ebenfalls ".poi-field" (siehe
   poi-entry.js flagField.hidden - Flag ist admin-only). */
.poi-field-flag[hidden] {
  display: none;
}

.poi-field-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--ui-text-muted);
  margin: 4px 0 0;
}

/* ---------- Prüf-Flags (poi-entry.js/way-entry.js) ---------- */

.flag-options {
  display: flex;
  gap: 6px;
}
.flag-option {
  flex: 1;
  padding: 7px 8px;
  border: 1px solid var(--ui-border);
  border-radius: 6px;
  background: var(--ui-bg);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  color: var(--ui-text);
}
.flag-option-orange.active {
  background: #f57c00;
  border-color: #f57c00;
  color: #fff;
}
.flag-option-red.active {
  background: #c62828;
  border-color: #c62828;
  color: #fff;
}
.flag-option-none.active {
  background: var(--ui-hover);
  border-color: var(--ui-text-muted);
}

/* ---------- Wege zeichnen (way-entry.js) ---------- */

.way-vertex-marker {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #8e24aa;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: grab;
}

.way-access-options {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.way-access-option {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 400;
  font-size: 12px;
  margin-bottom: 0;
}
.way-access-option input {
  margin: 0;
}

.poi-photo-status {
  font-size: 12px;
  color: var(--ui-accent);
  margin: 6px 0 0;
  min-height: 14px;
}
.poi-photo-preview {
  display: block;
  max-width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 6px;
  margin-top: 6px;
  border: 1px solid var(--ui-border);
}
/* [hidden] hat ohne diese Regel eine geringere Spezifität als die Klasse
   oben und würde von "display: block" überschrieben - das Bild wäre dann
   auch ohne ausgewählte Datei sichtbar (als kaputtes Bild-Icon). */
.poi-photo-preview[hidden] {
  display: none;
}

.poi-location-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.poi-pick-btn {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 6px;
  border: 1px solid var(--ui-accent);
  background: #fff;
  color: var(--ui-accent);
  cursor: pointer;
  font-size: 12px;
}
.poi-pick-btn:hover {
  background: var(--ui-accent);
  color: #fff;
}
.poi-location-value {
  font-size: 12px;
  color: var(--ui-text-muted);
  margin: 0;
}

.poi-form-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}
.poi-save-btn {
  flex: 1;
  padding: 9px;
  border: none;
  border-radius: 6px;
  background: var(--ui-accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}
.poi-save-btn:disabled {
  background: #b7c3cf;
  cursor: not-allowed;
}
.poi-reset-btn {
  padding: 9px 12px;
  border: 1px solid var(--ui-border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.poi-panel-list {
  margin-top: 14px;
  border-top: 1px solid var(--ui-border);
  padding-top: 8px;
}
.poi-panel-list h3 {
  font-size: 12px;
  color: var(--ui-text-muted);
  margin: 0 0 6px;
}
.poi-panel-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 140px;
  overflow-y: auto;
}
.poi-panel-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 2px;
  font-size: 13px;
}
.poi-list-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}
.poi-list-edit,
.poi-list-delete {
  background: none;
  border: none;
  color: var(--ui-text-muted);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}
.poi-list-edit:hover {
  color: var(--ui-accent);
}
.poi-list-delete:hover {
  color: #c0392b;
}

/* ---------- Hover-Tooltip auf der Karte ---------- */

.poi-hover-popup {
  pointer-events: none;
}
.poi-hover-popup .maplibregl-popup-tip {
  display: none;
}
.poi-hover-popup .maplibregl-popup-content {
  background: rgba(43, 47, 51, 0.82);
  color: #fff;
  padding: 5px 9px;
  border-radius: 6px;
  box-shadow: none;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 12px;
  line-height: 1.4;
  /* Lange Namen und Kategorien umbrechen, die Breite begrenzt MapLibre (240px) */
  white-space: normal;
  overflow-wrap: anywhere;
}

/* ---------- Filter-Panel ---------- */

.filter-categories {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.filter-cat-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}
.filter-cat-item[hidden] {
  display: none;
}
.filter-cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.filter-count {
  margin: 6px 0 0;
}

/* ---------- Such-Panel (poi-search.js) ---------- */

.poi-search-results {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.poi-search-result button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 7px 8px;
  border: none;
  background: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: var(--ui-text);
}
.poi-search-result button:hover {
  background: var(--ui-hover);
}
.poi-search-result-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.poi-search-result-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.poi-search-result-text strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.poi-search-result-cat {
  font-size: 11px;
  color: var(--ui-text-muted);
}

/* ---------- Popup auf der Karte ---------- */

.poi-popup {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  max-width: 220px;
}
.poi-popup-flag {
  margin: -2px -2px 6px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
.poi-popup-flag-orange {
  background: #f57c00;
}
.poi-popup-flag-red {
  background: #c62828;
}
.poi-popup-cat {
  font-size: 12px;
  font-weight: 600;
}
.poi-popup-tags {
  margin-top: 4px;
}
.poi-popup-tags span {
  display: inline-block;
  background: var(--ui-hover);
  border-radius: 10px;
  padding: 2px 8px;
  margin: 2px 2px 0 0;
  font-size: 11px;
}
/* Wege zeigen zwei Chip-Gruppen (way-layer.js): freie Tags UND "Geeignet
   für" (Fahrzeugklassen) - die zweite Gruppe optisch leicht abgesetzt,
   damit beide auf einen Blick unterscheidbar bleiben. */
.poi-popup-access span {
  background: none;
  border: 1px solid var(--ui-border);
}
.poi-popup p {
  margin: 6px 0;
  color: var(--ui-text-muted);
}
.poi-popup-photo {
  font-size: 11px;
}
.poi-popup-thumb {
  display: block;
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 6px;
  margin-top: 6px;
  cursor: zoom-in;
}
.poi-popup-dates {
  font-size: 11px;
  color: var(--ui-text-muted);
  margin: 6px 0 0;
  line-height: 1.5;
}

/* ---------- Foto-Lightbox (sanftes Vergrößern/Verkleinern am Ort) ---------- */

.photo-lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0);
  transition: background 0.28s ease;
  cursor: zoom-out;
}
.photo-lightbox-backdrop--visible {
  background: rgba(0, 0, 0, 0.75);
}
.photo-lightbox-img {
  position: fixed;
  z-index: 21;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
  cursor: zoom-out;
  margin: 0;
}
.poi-popup-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}
.poi-popup-edit,
.poi-popup-delete,
.poi-popup-validate,
.poi-popup-copy,
.poi-popup-complete,
.poi-popup-reopen,
.poi-popup-message {
  border: none;
  background: none;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.poi-popup-edit {
  color: var(--ui-accent);
}
.poi-popup-delete {
  color: #c0392b;
}
.poi-popup-validate {
  color: #2e7d32;
}
.poi-popup-validate:disabled {
  color: var(--ui-text-muted);
  cursor: default;
}
.poi-popup-copy,
.poi-popup-message {
  color: #1565c0;
}
.poi-popup-complete {
  color: #2e7d32;
  font-weight: 600;
}
.poi-popup-reopen {
  color: #1565c0;
}

/* ---------- Platzhalter-Dialog ---------- */

.placeholder-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 9;
}
.placeholder-modal-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  background: #fff;
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
  padding: 20px 24px;
  max-width: 320px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ui-text);
}
.placeholder-modal-panel h2 {
  margin-top: 0;
  font-size: 16px;
}
.placeholder-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--ui-text-muted);
}

/* ---------- Bestätigungsdialog / Admin-Login / Ticket-Formular ----------
   Gleiches Grundgerüst wie der Platzhalter-Dialog (Backdrop + zentriertes
   Panel), mit einer Aktionsleiste (Abbrechen/OK) statt nur einem Schließen. */

.confirm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 9;
}
.confirm-modal-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  background: #fff;
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
  padding: 20px 24px;
  width: 320px;
  max-width: calc(100vw - 32px);
  /* Nie höher als der sichtbare Bildschirm (dvh = ohne Browserleisten, z. B. Firefox/Safari auf dem iPhone),
     sonst ragen Überschrift und Knöpfe heraus und lassen sich nicht erreichen. */
  box-sizing: border-box;
  max-height: calc(100vh - 140px);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ui-text);
}
.confirm-modal-panel h2,
.confirm-modal-title {
  margin: 0 0 10px;
  font-size: 16px;
}
.confirm-modal-message {
  font-size: 13px;
  color: var(--ui-text-muted);
  margin: 0 0 4px;
}
.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}
.confirm-modal-cancel {
  padding: 8px 14px;
  border: 1px solid var(--ui-border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}
.confirm-modal-ok {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: var(--ui-accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
.confirm-modal-ok-danger {
  background: #c0392b;
}
.confirm-modal-ok:disabled {
  background: #b7c3cf;
  cursor: not-allowed;
}

.admin-login-error {
  color: #c0392b;
  font-size: 12px;
  min-height: 14px;
  margin: 4px 0 0;
}

/* ---------- Mobile Standort-Auswahl (poi-entry.js pickBtn-Flow) ----------
   Nur unterhalb des .poi-panel-Breakpoints aktiv (siehe isMobileLayout()) -
   volle Kartenansicht statt des Eingabe-Panels, Bestätigung über diese
   Leiste am unteren Rand statt im (dafür ausgeblendeten) Panel. */
.poi-location-confirm-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  background: var(--ui-bg);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.poi-location-confirm-bar p {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--ui-text-muted);
}
.poi-location-confirm-actions {
  display: flex;
  gap: 8px;
}
.poi-location-confirm-cancel {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--ui-border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}
.poi-location-confirm-ok {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  background: var(--ui-accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
/* Zusätzliche Absicherung, falls die Leiste aus irgendeinem Grund über
   640px hinaus sichtbar bliebe - dort ist genug Platz neben dem Panel,
   diese Leiste soll dort nie auftauchen. */
@media (min-width: 641px) {
  .poi-location-confirm-bar {
    display: none !important;
  }
}

/* ---------- Tickets ---------- */

.tickets-panel .tickets-list {
  margin-top: 12px;
}
.ticket-card {
  border: 1px solid var(--ui-border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 13px;
}
.ticket-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
}
.ticket-card-date {
  font-size: 11px;
  color: var(--ui-text-muted);
}
.ticket-card-reason {
  margin: 6px 0;
  color: var(--ui-text-muted);
  white-space: pre-wrap;
}
.ticket-act-btn {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--ui-accent);
  border-radius: 6px;
  background: #fff;
  color: var(--ui-accent);
  cursor: pointer;
  font-size: 12px;
}
.ticket-act-btn:hover {
  background: var(--ui-accent);
  color: #fff;
}
.ticket-resolve-btn {
  padding: 7px 10px;
  border: 1px solid var(--ui-border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
}

/* ---------- Mobile Kopfleiste (sidebar.js initMobileNav) ----------
   Ersetzt das Hover-Seitenmenü (.sidebar) unterhalb des Breakpoints - kein
   Hover auf Touch-Geräten, und die schmalen Tippflächen des Seitenmenüs
   waren dort schwer bedienbar. Vier Tasten: Suche und Login (Direktaktionen),
   Fahrzeug und Einstellungen (klappen per Klick ein Dropdown darunter auf). Standardmäßig ausgeblendet (siehe
   Media-Query unten), damit sie auf Desktop nicht doppelt zum Seitenmenü
   auftaucht. */
.mobile-nav,
.mobile-nav-dropdown {
  display: none;
}

@media (min-width: 641px) {
  .mobile-nav-root {
    display: none;
  }
}

/* ---------- Mobilversion ----------
   Das Eingabe-/Tickets-Panel (.poi-panel) ist auf Desktop rechts neben dem
   Seitenmenü verankert (left: 232px, schmale max-width) - auf einem
   Telefon-Bildschirm passt das nicht mehr nebeneinander. Unter dieser
   Breite rutscht das Panel stattdessen unter die Kopfleiste, über die volle
   Breite. */
@media (max-width: 640px) {
  .sidebar {
    display: none;
  }

  .mobile-nav {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 8;
    height: 50px;
    background: var(--ui-bg);
    box-shadow: var(--ui-shadow);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  }

  /* MapLibres eigene Controls oben rechts (Standort, auf Desktop auch Zoom)
     sitzen sonst mit z-index:2 unter der Kopfleiste (z-index:8, volle
     Breite, 50px hoch) - dort weder sichtbar noch klickbar. Einfach unter
     die Kopfleiste schieben statt an der Überlappung mit z-index zu
     basteln. */
  .maplibregl-ctrl-top-right {
    top: 50px;
  }
  .mobile-nav-toggle {
    flex: 1;
    border: none;
    background: none;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    color: var(--ui-text);
    cursor: pointer;
  }
  .mobile-nav-toggle:active,
  .mobile-nav-toggle.active {
    background: var(--ui-hover);
    color: var(--ui-accent);
  }
  .mobile-nav-toggle + .mobile-nav-toggle {
    border-left: 1px solid var(--ui-border);
  }

  /* Suche (erster Punkt) und Login (letzter Punkt) sind Icon- statt
     Text-Buttons - reines Piktogramm statt Beschriftung, siehe
     initMobileNav. */
  .mobile-nav-icon-btn {
    font-size: 20px;
  }
  /* Login soll auffallen (Nutzeranfrage) statt wie die übrigen, neutralen
     Kopfleisten-Buttons unterzugehen - gefüllte Akzentfarbe statt nur Text.
     --ui-accent wechselt im admin-mode automatisch auf Bernstein (siehe
     body.admin-mode oben), der Button zeigt den Anmelde-Status also von
     selbst mit an, ohne eigene Zusatzlogik. */
  .mobile-nav-login {
    background: var(--ui-accent);
    color: #fff;
  }

  .mobile-nav-dropdown {
    position: fixed;
    top: 50px;
    left: 0;
    right: 0;
    z-index: 8;
    background: var(--ui-bg);
    box-shadow: var(--ui-shadow);
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    display: flex;
    flex-direction: column;
  }
  /* [hidden] hat ohne diese Regel eine geringere Spezifität als die Klasse
     oben und würde von "display: flex" überschrieben (gleiches Muster wie
     .poi-photo-preview[hidden]/.poi-field-requestedby[hidden]) - ein
     geschlossenes Dropdown bliebe sonst sichtbar UND würde Klicks auf das
     darunterliegende abfangen. */
  .mobile-nav-dropdown[hidden] {
    display: none;
  }
  .mobile-nav-dropdown a,
  .mobile-nav-dropdown button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 14px 20px;
    border: none;
    border-top: 1px solid var(--ui-border);
    background: none;
    font: inherit;
    font-size: 14px;
    text-align: left;
    color: var(--ui-text);
    text-decoration: none;
    cursor: pointer;
  }
  .mobile-nav-dropdown a:first-child,
  .mobile-nav-dropdown button:first-child {
    border-top: none;
  }
  /* Gleiches Muster wie .poi-photo-preview[hidden] oben: der Tickets-Button
     ist für Nicht-Admin per hidden-Attribut ausgeblendet (siehe sidebar.js
     renderTicketsVisibility), würde sonst von "display: block" oben
     überschrieben. */
  .mobile-nav-dropdown button[hidden] {
    display: none;
  }

  .poi-panel {
    top: 60px;
    left: 12px;
    right: 12px;
    width: auto;
    max-width: none;
    max-height: calc(100vh - 76px);
  }

  .placeholder-modal-panel,
  .confirm-modal-panel {
    width: calc(100vw - 32px);
    max-width: 360px;
  }
}

/* ---------- Anmeldung / Benutzerkonten (ADR 0009) ---------- */

.auth-tabs {
  display: flex;
  gap: 6px;
  margin: 8px 0 12px;
}
.auth-tab {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--ui-border, #c9ced6);
  background: transparent;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.auth-tab.active {
  background: var(--ui-accent, #1565c0);
  color: #fff;
  border-color: transparent;
}
.auth-emergency {
  margin: 8px 0 0;
  font-size: 12px;
  text-align: right;
}
.auth-emergency a {
  color: inherit;
  opacity: 0.7;
}
.users-items {
  list-style: none;
  padding: 0;
  margin: 0;
}
.users-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.users-name {
  font-weight: 600;
  flex: 1 1 auto;
}
.users-role {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.07);
}
.users-role-admin {
  background: var(--ui-accent, #1565c0);
  color: #fff;
}
.users-actions {
  display: flex;
  gap: 6px;
  width: 100%;
  justify-content: flex-end;
}
.users-actions button {
  font: inherit;
  font-size: 12px;
  padding: 4px 8px;
  border: 1px solid var(--ui-border, #c9ced6);
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
}
.users-delete[data-armed="1"] {
  background: #c62828;
  color: #fff;
  border-color: transparent;
}

/* .poi-field setzt display:block und würde das hidden-Attribut sonst
   überstimmen - Passwort-Wiederholung und Passphrase blieben sichtbar. */
.admin-login-form [hidden] {
  display: none !important;
}

/* ---------- Anmelde-Gate vor der Karte ---------- */

.login-gate {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #1d2630;
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  /* Wie im Logo: vom Dunkelviolett des Himmels oben zum Dunkelblau des Meeres unten. */
  background: linear-gradient(180deg, #27225f 0%, #0f2a57 100%);
  overflow-y: auto;
}
.login-gate-panel {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 20px;
  padding: 28px 24px 22px;
  box-shadow: 0 20px 50px rgba(5, 25, 55, 0.35);
}
.login-gate-logo {
  width: 124px;
  height: 124px;
  margin: -6px auto 12px;
  filter: drop-shadow(0 8px 14px rgba(40, 20, 90, 0.35));
}
.login-gate-logo svg {
  display: block;
  width: 100%;
  height: 100%;
}
.login-gate-title {
  margin: 0;
  font-size: 22px;
  text-wrap: balance;
  line-height: 1.2;
  letter-spacing: -0.01em;
  text-align: center;
}
.login-gate-subtitle {
  margin: 4px 0 20px;
  font-size: 13px;
  color: #5b6570;
  text-align: center;
}
.login-gate-disclaimer {
  margin: 14px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: #7a838c;
  text-align: center;
}
.login-gate-offline + .login-gate-disclaimer {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid #e6eaee;
}
.login-gate-disclaimer a {
  color: inherit;
}
.login-gate .auth-title {
  display: none;
}
.login-gate .auth-tabs {
  gap: 0;
  margin: 0 0 18px;
  padding: 3px;
  background: #eef2f5;
  border-radius: 12px;
}
.login-gate .auth-tab {
  padding: 9px 8px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #5b6570;
  font-weight: 600;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.login-gate .auth-tab.active {
  background: #fff;
  color: var(--ui-accent, #1565c0);
  box-shadow: 0 1px 4px rgba(20, 40, 70, 0.18);
}
.login-gate .poi-field {
  margin-bottom: 14px;
}
.login-gate .poi-field > span {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #3b4650;
}
.login-gate input {
  width: 100%;
  box-sizing: border-box;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #ccd3da;
  border-radius: 12px;
  background: #f8fafb;
  font: inherit;
  font-size: 16px; /* unter 16 px zoomt iOS beim Antippen die Seite */
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.login-gate input:focus {
  outline: none;
  border-color: var(--ui-accent, #1565c0);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(21, 101, 192, 0.2);
}
.login-gate .admin-login-error:not(:empty) {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #fdecea;
  font-size: 13px;
}
.login-gate .confirm-modal-actions {
  display: block;
  margin-top: 6px;
}
.login-gate .confirm-modal-ok {
  width: 100%;
  height: 48px;
  border-radius: 12px;
  font-size: 16px;
  box-shadow: 0 6px 14px rgba(21, 101, 192, 0.3);
}
.login-gate .confirm-modal-ok:disabled {
  box-shadow: none;
}
.login-gate-offline[hidden] {
  display: none;
}
.login-gate-offline {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #ccd3da;
  border-radius: 12px;
  background: #fff;
  color: #3b4650;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.users-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}
.users-head .users-name {
  flex: 1 1 auto;
}
.users-role-select {
  font: inherit;
  font-size: 12px;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--ui-border, #c9ced6);
}
.users-vehicle {
  width: 100%;
  margin: 4px 0 0;
}
.users-vehicle-select {
  font: inherit;
  font-size: 12px;
  margin-left: 6px;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--ui-border, #c9ced6);
}
.users-stats {
  width: 100%;
  margin: 2px 0 0;
}

.users-pending {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #fff3e0;
  color: #e65100;
  font-weight: 400;
}
.users-approve {
  font: inherit;
  font-size: 12px;
  padding: 4px 10px;
  border: 0;
  border-radius: 6px;
  background: var(--ui-accent, #1565c0);
  color: #fff;
  cursor: pointer;
}

/* ---------- Nachrichten (ADR 0009) ---------- */
.messages-heading {
  font-size: 14px;
  margin: 12px 0 6px;
}
.messages-item {
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  list-style: none;
}
.messages-unread .messages-text {
  font-weight: 600;
}
.messages-meta {
  font-size: 12px;
  color: #666;
}
.messages-new {
  color: #e65100;
  font-weight: 600;
}
.messages-text {
  white-space: pre-wrap;
  font-size: 13px;
  margin: 4px 0;
}
.messages-actions {
  display: flex;
  gap: 6px;
}
.messages-actions button {
  font: inherit;
  font-size: 12px;
  padding: 3px 8px;
  border: 1px solid var(--ui-border, #c9ced6);
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
}
.messages-popup-text {
  white-space: pre-wrap;
}
/* Lange Nachrichten: nur der Text scrollt, Überschrift und "Verstanden" bleiben sichtbar. */
.messages-popup .confirm-modal-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.messages-popup .confirm-modal-panel h2,
.messages-popup .confirm-modal-actions {
  flex: 0 0 auto;
}
.messages-popup-text {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Änderungsvorschlag im Ticket: pro geändertem Feld "alt -> neu" */
.ticket-diff {
  list-style: none;
  margin: 6px 0;
  padding: 0;
  font-size: 0.9em;
}
.ticket-diff li {
  margin: 3px 0;
}
.ticket-diff-label {
  font-weight: 600;
}
.ticket-diff-old {
  color: #b71c1c;
  text-decoration: line-through;
}
.ticket-diff-new {
  color: #1b5e20;
}

/* Bezug einer Nachricht auf einen Punkt/Weg (Admin-Eingang) */
.messages-ref {
  font-size: 12px;
  font-weight: 600;
  margin: 2px 0;
}

/* Gebiete: Farbpunkt im Popup und Farbwähler im Zeichnen-Panel */
.area-popup-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
}
.area-color-input {
  width: 56px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--ui-border);
  border-radius: 6px;
  background: none;
  cursor: pointer;
}

/* Straßensperrungen: Enddatum im Popup, Hinweisliste im Ablauf-Dialog */
.closure-popup-end {
  font-weight: 600;
  color: #b71c1c;
  margin: 4px 0;
}
.closure-popup-end-planned {
  color: #e65100;
}
.closure-popup-end-ended {
  color: #1565c0;
}
.closure-popup-end-archived {
  color: #616161;
}
.closure-notice-list {
  margin: 8px 0 12px;
  padding-left: 18px;
}
.closure-notice-list li {
  margin: 6px 0;
}

/* iOS Safari zoomt beim Fokussieren in jedes Eingabefeld, dessen Schrift
   kleiner als 16px ist (Anmeldung, Eingabemaske, Nachrichten). Auf dem Handy
   deshalb überall mindestens 16px - der Seiten-Zoom ist zusätzlich in
   index.html gesperrt. Muss am Dateiende stehen, damit es die 13px-Regeln
   weiter oben übersteuert. */
@media (max-width: 640px) {
  input,
  select,
  textarea,
  .tagify__input {
    font-size: 16px !important;
  }
}

/* ---------- Neuigkeiten im Nachrichtenfenster (messages-panel.js, version.js) ---------- */
.messages-version {
  font-size: 12px;
  font-weight: 400;
  margin-left: 6px;
}
.release-notes details {
  margin: 0 0 8px;
}
.release-notes summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}
.release-notes h4 {
  margin: 10px 0 4px;
  font-size: 13px;
}
.release-notes ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.4;
}
.release-notes li {
  margin-bottom: 4px;
}

/* ---------- Breitere Fenster am Desktop ----------
   Benutzer (Rolle und Standard-Fahrzeug je Konto) und Nachrichten (Eingang,
   Neuigkeiten) brauchen mehr Platz als die schmalen 320px der übrigen Panels.
   Am Handy gilt weiter die volle Breite (siehe Mobilversion oben). */
@media (min-width: 641px) {
  .poi-panel.users-panel {
    width: 480px;
  }
  .poi-panel.messages-panel {
    width: 440px;
  }
}

/* ---------- Änderungshistorie (changes-panel.js) ---------- */
@media (min-width: 641px) {
  .poi-panel.changes-panel {
    width: 640px;
  }
}
.changes-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  font-size: 12px;
}
.changes-filter select,
.changes-filter input {
  font: inherit;
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--ui-border, #c9ced6);
  min-width: 0;
}
.changes-filter input[type="search"] {
  flex: 1 1 140px;
}
.changes-item {
  padding: 8px 0;
  border-top: 1px solid var(--ui-border, #e3e6ea);
  font-size: 13px;
}
.changes-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--ui-text-muted);
  font-size: 12px;
}
.changes-by {
  font-weight: 600;
}
.changes-what {
  margin: 2px 0;
}
.changes-details {
  margin: 4px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: var(--ui-text-muted);
}
.changes-show,
.changes-more {
  font: inherit;
  font-size: 12px;
  margin-left: 6px;
  padding: 2px 8px;
  border: 1px solid var(--ui-border, #c9ced6);
  border-radius: 6px;
  background: none;
  cursor: pointer;
}
.changes-more-row {
  text-align: center;
  margin-top: 8px;
}
.changes-more[hidden] {
  display: none;
}

/* ---------- Benutzer-Konsole: Tabelle und Detailfenster (users-panel.js) ---------- */
@media (min-width: 641px) {
  .poi-panel.users-panel {
    width: min(1000px, calc(100vw - 260px));
    max-width: none;
  }
}
.ut-scroll {
  overflow-x: auto;
}
.ut-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ut-table th {
  text-align: left;
  padding: 6px 8px;
  font-size: 12px;
  color: var(--ui-text-muted);
  border-bottom: 2px solid var(--ui-border, #d5d9de);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.ut-table td {
  padding: 8px;
  border-bottom: 1px solid var(--ui-border, #e3e6ea);
  white-space: nowrap;
}
.ut-num {
  text-align: right !important;
}
.ut-row {
  cursor: pointer;
}
.ut-row:hover,
.ut-row:focus {
  background: var(--ui-hover, #eef3fb);
  outline: none;
}
.ut-name {
  font-weight: 600;
}
.ut-msg-btn,
.ut-open-mailbox,
.ut-actions button,
.ut-show {
  font: inherit;
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--ui-border, #c9ced6);
  border-radius: 6px;
  background: none;
  cursor: pointer;
}
.ut-badge {
  display: inline-block;
  min-width: 16px;
  padding: 0 5px;
  border-radius: 8px;
  background: #c62828;
  color: #fff;
  font-size: 11px;
  text-align: center;
}
.ut-detail {
  width: min(720px, calc(100vw - 24px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  text-align: left;
}
.ut-detail h2 {
  margin: 0 0 8px;
  font-size: 18px;
}
.ut-section {
  padding: 10px 0;
  border-top: 1px solid var(--ui-border, #e3e6ea);
}
.ut-section h3 {
  margin: 0 0 6px;
  font-size: 14px;
}
.ut-section h4 {
  margin: 10px 0 4px;
  font-size: 13px;
}
.ut-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 14px;
  margin: 0;
  font-size: 13px;
}
.ut-dl dt {
  color: var(--ui-text-muted);
}
.ut-dl dd {
  margin: 0;
}
.ut-dl select,
.ut-compose textarea {
  font: inherit;
  font-size: 13px;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--ui-border, #c9ced6);
}
.ut-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.ut-actions .ut-delete {
  color: #c62828;
}
.ut-compose {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}
.ut-compose textarea {
  flex: 1;
}
.ut-messages,
.ut-entries {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  max-height: 220px;
  overflow-y: auto;
  font-size: 13px;
}
.ut-msg-item {
  padding: 6px 8px;
  margin-bottom: 4px;
  border-radius: 8px;
  background: #f1f3f6;
}
.ut-msg-item.ut-out {
  background: #e3effd;
}
.ut-entries li {
  padding: 3px 0;
}

/* ---------- Postfach der Admins (messages-panel.js) ----------
   Nutzt am Computer fast den ganzen Bildschirm: Ordner links, Liste in der Mitte, Nachricht rechts. */
@media (min-width: 641px) {
  .poi-panel.messages-panel.messages-mailbox {
    width: calc(100vw - 260px);
    max-width: none;
    height: calc(100vh - 32px);
    display: flex;
    flex-direction: column;
  }
  .messages-mailbox .messages-body {
    flex: 1;
    min-height: 0;
  }
}
.messages-mailbox .messages-body,
.messages-mailbox .mb {
  height: 100%;
}
.mb {
  display: flex;
  gap: 12px;
  min-height: 0;
}
.mb-folders {
  flex: 0 0 170px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mb-folder {
  font: inherit;
  font-size: 13px;
  text-align: left;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: none;
  cursor: pointer;
  color: var(--ui-text);
}
.mb-folder:hover {
  background: var(--ui-hover, #eef3fb);
}
.mb-folder.active {
  background: var(--ui-hover, #eef3fb);
  color: var(--ui-accent);
  font-weight: 600;
}
.mb-new {
  border: 1px solid var(--ui-border, #c9ced6);
  margin-bottom: 6px;
}
.mb-userfilter {
  margin-top: 8px;
  padding: 6px 8px;
  font-size: 12px;
  background: #fff8e1;
  border-radius: 8px;
}
.mb-clear {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 15px;
}
.mb-main {
  flex: 1;
  display: flex;
  gap: 12px;
  min-width: 0;
  min-height: 0;
}
.mb-list {
  flex: 0 0 340px;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  border-right: 1px solid var(--ui-border, #e3e6ea);
  max-height: 100%;
}
.mb-item {
  padding: 10px 12px 10px 4px;
  border-bottom: 1px solid var(--ui-border, #e3e6ea);
  cursor: pointer;
  font-size: 13px;
}
.mb-item:hover,
.mb-item:focus {
  background: var(--ui-hover, #eef3fb);
  outline: none;
}
.mb-item.mb-selected {
  background: var(--ui-hover, #eef3fb);
  box-shadow: inset 3px 0 0 var(--ui-accent);
}
.mb-item.messages-unread .mb-from {
  font-weight: 700;
}
.mb-from {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.mb-date {
  color: var(--ui-text-muted);
  font-size: 11px;
  font-weight: 400;
}
.mb-ref {
  font-size: 12px;
  color: var(--ui-accent);
}
.mb-preview {
  color: var(--ui-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mb-reader,
.mb-single {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  max-height: 100%;
}
.mb-reader h3,
.mb-single h3 {
  margin: 0 0 4px;
}
.mb-body {
  margin: 12px 0;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.5;
}
.mb-reply textarea,
.mb-compose textarea {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 14px;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--ui-border, #c9ced6);
}
.mb-reply-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}
.mb-markread,
.mb-back {
  font: inherit;
  font-size: 12px;
  padding: 4px 10px;
  border: 1px solid var(--ui-border, #c9ced6);
  border-radius: 6px;
  background: none;
  cursor: pointer;
}
.mb-back {
  display: none;
  margin-bottom: 8px;
}
.mb-empty {
  padding: 12px;
}

/* Handy: Ordner als Leiste oben, danach entweder die Liste oder die einzelne Nachricht */
@media (max-width: 640px) {
  .poi-panel.messages-panel.messages-mailbox {
    bottom: 12px;
    max-height: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  .messages-mailbox .messages-body {
    flex: 1;
    min-height: 0;
  }
  .mb {
    flex-direction: column;
    gap: 8px;
  }
  .mb-folders {
    flex: 0 0 auto;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .mb-new {
    margin-bottom: 0;
  }
  .mb-main {
    flex-direction: column;
    flex: 1;
  }
  .mb-list {
    flex: 1;
    border-right: none;
  }
  .mb-reader:not(.mb-open) {
    display: none;
  }
  .mb-reading .mb-list {
    display: none;
  }
  .mb-reading .mb-folders {
    display: none;
  }
  .mb-back {
    display: inline-block;
  }
}
.ut-compose .poi-save-btn {
  flex: 0 0 auto;
  width: auto;
  padding: 8px 16px;
}

/* Kommentare mit Auszeichnung (web/markdown.js) */
.comment-md p {
  margin: 4px 0;
  color: var(--ui-text-muted);
}
.comment-md ul {
  margin: 4px 0;
  padding-left: 18px;
  color: var(--ui-text-muted);
}
.comment-md a {
  color: #1565c0;
  text-decoration: underline;
  word-break: break-all;
}
.comment-toolbar {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.comment-toolbar-btn {
  padding: 2px 8px;
  font-size: 13px;
  border: 1px solid #c9ced6;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}
.comment-toolbar-btn:hover {
  background: #eef1f5;
}

/* ---------- Hubschrauber-Verwaltung (heli-panel.js) ---------- */
@media (min-width: 641px) {
  .poi-panel.heli-panel {
    width: 800px;
  }
}
.heli-table-wrap {
  overflow-x: auto;
}
.heli-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.heli-table th,
.heli-table td {
  padding: 5px 6px;
  text-align: left;
  vertical-align: middle;
  border-top: 1px solid var(--ui-border, #e3e6ea);
}
.heli-table th {
  font-size: 12px;
  color: var(--ui-text-muted);
  border-top: 0;
}
.heli-table input:not([type="checkbox"]),
.heli-add input {
  font: inherit;
  font-size: 13px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid var(--ui-border, #c9ced6);
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}
.heli-reg,
.heli-seen,
.heli-actions {
  white-space: nowrap;
}
.heli-reg {
  font-family: ui-monospace, monospace;
}
.heli-actions button,
.heli-add button {
  font: inherit;
  font-size: 12px;
  padding: 3px 8px;
  border: 1px solid var(--ui-border, #c9ced6);
  border-radius: 6px;
  background: none;
  cursor: pointer;
}
.heli-actions button:disabled {
  opacity: 0.4;
  cursor: default;
}
.heli-error {
  color: #b00020;
  font-size: 13px;
  margin: 6px 0;
}
.heli-error[hidden] {
  display: none;
}
.heli-add {
  margin: 12px 0;
  font-size: 13px;
}
.heli-add-row {
  display: grid;
  grid-template-columns: 90px 1fr 100px auto;
  gap: 6px;
  margin-top: 6px;
}
.heli-history-title {
  font-size: 14px;
  margin: 14px 0 4px;
}
@media (max-width: 640px) {
  .heli-add-row {
    grid-template-columns: 1fr 1fr;
  }
}
.heli-history .changes-item {
  display: block;
}
.heli-bases {
  margin: 12px 0;
}
.heli-base {
  padding: 8px 10px;
  border: 1px solid var(--ui-border, #e3e6ea);
  border-radius: 8px;
  font-size: 13px;
}
.heli-base p {
  margin: 4px 0;
}
.heli-suggestion {
  margin: 8px 0;
  padding: 8px;
  border-radius: 6px;
  background: #fff4d6;
}
.heli-suggestion-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.heli-suggestion-actions button {
  font: inherit;
  font-size: 12px;
  padding: 3px 10px;
  border: 1px solid var(--ui-border, #c9ced6);
  border-radius: 6px;
  background: none;
  cursor: pointer;
}
.heli-visits {
  margin: 4px 0 0;
  padding-left: 18px;
}
.heli-table .heli-name {
  min-width: 140px;
}
.heli-table .heli-operator {
  min-width: 90px;
}
.heli-popup-head {
  margin: 8px 0 2px;
  font-size: 12px;
  font-weight: 600;
}
.heli-popup-list {
  margin: 0;
  padding-left: 18px;
  font-size: 12px;
}
.heli-popup .maplibregl-popup-content {
  max-height: 60vh;
  overflow-y: auto;
}
/* 10 % durchsichtig; Text bleibt deckend. Die Angabe muss die Handy-Regel für alle Popups übertrumpfen. */
.maplibregl-popup.heli-popup:not(.poi-hover-popup) .maplibregl-popup-content {
  background: color-mix(in srgb, var(--m-bg, #ffffff) 90%, transparent);
}
.heli-radius {
  width: 70px;
  font: inherit;
  font-size: 13px;
  padding: 2px 4px;
  border: 1px solid var(--ui-border, #c9ced6);
  border-radius: 6px;
}
.heli-radius-label {
  display: block;
  margin: 4px 0;
  font-size: 13px;
}

/* ---------- Einstellungen > Rollen, RTH (settings-panel.js) ---------- */
/* Navigation der Einstellungen: ausklappbare Gruppen mit Unterpunkten */
.settings-nav {
  margin: 0 0 10px;
  border-bottom: 1px solid var(--ui-border, #e3e6ea);
}
.settings-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 8px 4px;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  color: inherit;
}
.settings-group-head::before {
  content: "▸";
  display: inline-block;
  width: 12px;
  transition: transform 0.15s ease;
}
.settings-group-head[aria-expanded="true"]::before {
  transform: rotate(90deg);
}
.settings-subs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 0 8px 18px;
}
.settings-subs[hidden] {
  display: none;
}
.settings-sub {
  font: inherit;
  font-size: 13px;
  padding: 5px 10px;
  border: 1px solid var(--ui-border, #e3e6ea);
  border-radius: 14px;
  background: none;
  cursor: pointer;
  color: var(--ui-text-muted);
}
.settings-sub.active {
  color: #fff;
  background: var(--ui-accent);
  border-color: transparent;
}
.chips-table-wrap {
  overflow-x: auto;
  margin: 0 0 8px;
}
.chips-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.chips-table th,
.chips-table td {
  padding: 6px 4px;
  border-bottom: 1px solid var(--ui-border, #e3e6ea);
  vertical-align: middle;
}
.chips-rolecol {
  width: 38px;
  min-width: 38px;
  text-align: center;
}
.chips-rolecol .chips-roleicon,
.chips-rolecol .chips-roleshort {
  display: block;
}
.chips-roleshort {
  font-size: 10px;
  font-weight: 400;
  color: var(--ui-text-muted);
}
.chips-namecol {
  width: 140px;
  min-width: 140px;
  max-width: 140px;
  overflow-wrap: anywhere;
  text-align: left;
  /* beim seitlichen Scrollen auf dem Handy stehen lassen */
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--ui-bg, #fff);
}
.chips-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.chips-summary {
  display: block;
  margin: 2px 0;
  font-size: 11px;
}
.chips-edit {
  font: inherit;
  font-size: 12px;
  padding: 2px 8px;
  border: 1px solid var(--ui-border, #c9ced6);
  border-radius: 10px;
  background: none;
  cursor: pointer;
}
.chips-detail td {
  background: var(--ui-hover, #f3f5f7);
}
.chips-detail-grid {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}
.chips-detail-grid .chips-color {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--ui-border, #c9ced6);
  border-radius: 50%;
  background: none;
}
.chips-detail-grid .chips-cats,
.chips-detail-grid .chips-tags,
.chips-detail-grid tags.tagify,
.chips-detail-grid .chips-logic,
.chips-detail-grid .chips-btns {
  grid-column: 1 / -1;
}
.chips-btns {
  display: flex;
  gap: 6px;
}
.chips-cats summary {
  cursor: pointer;
  font-size: 13px;
}
.chips-cat-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 170px;
  margin-top: 6px;
  padding: 6px 8px;
  overflow-y: auto;
  border: 1px solid var(--ui-border, #e3e6ea);
  border-radius: 8px;
  background: var(--ui-bg, #fff);
  font-size: 13px;
}
.chips-logic {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 12px;
  color: var(--ui-text-muted);
}
.roles-vehicles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 8px;
}
.roles-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--ui-border, #e3e6ea);
  font-size: 13px;
}
.roles-rule-text {
  flex: 1;
}
.roles-add {
  margin: 12px 0;
}
.roles-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.roles-add select[hidden],
.roles-add input[hidden] {
  display: none;
}
.settings-crumb {
  color: var(--ui-text-muted);
  font-weight: 400;
}
.settings-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0 0 10px;
  border-bottom: 1px solid var(--ui-border, #e3e6ea);
}
.settings-tab {
  font: inherit;
  font-size: 13px;
  padding: 6px 10px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  cursor: pointer;
  color: var(--ui-text-muted);
}
.settings-tab.active {
  color: inherit;
  border-bottom-color: #1f6feb;
  font-weight: 600;
}
.settings-badge {
  display: inline-block;
  min-width: 16px;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 8px;
  background: #d93025;
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}
.rth-title {
  margin: 12px 0 4px;
  font-size: 14px;
}
.rth-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 6px 0;
  font-size: 13px;
}
.rth-list {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--ui-border, #e3e6ea);
  border-radius: 6px;
}
.rth-item {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 6px 8px;
  font-size: 13px;
  border-top: 1px solid var(--ui-border, #e3e6ea);
}
.rth-item:first-child {
  border-top: 0;
}
.rth-ongoing {
  background: #fff8e1;
}
.rth-uncertain {
  opacity: 0.7;
}
.rth-warn {
  color: #b26a00;
}
.rth-unread {
  background: #eef5ff;
}
.rth-kind {
  padding: 0 6px;
  border-radius: 8px;
  background: #e8eaed;
  font-size: 11px;
}
.rth-when {
  color: var(--ui-text-muted);
  white-space: nowrap;
}
.rth-reg {
  font-family: ui-monospace, monospace;
}
.rth-dur {
  font-weight: 600;
}
.rth-body {
  flex: 1 1 100%;
  white-space: pre-wrap;
}
.rth-stats {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.rth-stats th,
.rth-stats td {
  padding: 3px 6px;
  text-align: left;
  border-top: 1px solid var(--ui-border, #e3e6ea);
}
.rth-more {
  font: inherit;
  font-size: 13px;
  margin: 2px 0 8px;
}

/* Umschalter Karte/Luftbild (satellite-control.js) */
.satellite-control button {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
}
.satellite-control.satellite-on button {
  background: #1f6feb;
  color: #fff;
}

/* ---------- Handy-Design (Mockup "Handy-Ansicht", siehe docs/adr/0034-handy-design.md) ----------
   Oben eine schwebende Suchleiste mit Filter-Knopf und die Kategorie-Chips (mobile-chips.js), unten eine schwebende
   Leiste, dazwischen die Karte. Dropdowns, Fenster und das Detail-Fenster eines Punkts (MapLibre-Popup als Sheet
   über der Leiste) sind abgerundete Karten. Die Maße (Suchleiste 10 + 48, Chips bis 112, Leiste 14 + 64) stecken in
   den top/bottom-Werten unten - ändert sich eine Leiste, müssen sie mit.
   Die Farben der neuen Elemente stehen in den --m-*-Variablen; "Dunkelmodus" (theme.js) tauscht sie und dunkelt die
   Karte ab. Die übrigen Fenster (.poi-panel) bleiben auch im Dunkelmodus hell. */
.mobile-top,
.mobile-chips {
  display: none;
}
.poi-popup-nav {
  display: none;
}
@keyframes m-rise {
  from { transform: translateY(14px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
@media (max-width: 640px) {
  :root {
    --m-bg: #ffffff;
    --m-text: #1d2a24;
    --m-muted: #5d6b64;
    --m-border: #e3e8e4;
    --m-accent: var(--ui-accent);
    --m-accbg: #e3edf8;
    --m-onacc: #ffffff;
    --m-shadow: 0 2px 12px rgba(20, 40, 30, 0.25);
  }
  body.admin-mode {
    --m-accent: var(--ui-accent);
    --m-accbg: #fdf1e3;
  }
  body.theme-dark {
    --m-bg: #2a312e;
    --m-text: #eef3f0;
    --m-muted: #a2b0a9;
    --m-border: #3a4440;
    --m-accent: #5fd09a;
    --m-accbg: #23423a;
    --m-onacc: #10251c;
    --m-shadow: 0 2px 14px rgba(0, 0, 0, 0.65);
  }
  body.theme-dark.admin-mode {
    --m-accent: #f2a65a;
    --m-accbg: #4a3a22;
    --m-onacc: #2b1a05;
  }
  body.theme-dark .maplibregl-canvas {
    filter: brightness(0.62) saturate(0.85);
  }

  .mobile-top,
  .mobile-chips,
  .mobile-nav-toggle,
  .mobile-nav-dropdown button,
  .poi-popup-nav {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  }

  /* Oben: Suchleiste und Filter-Knopf */
  .mobile-top {
    display: flex;
    position: fixed;
    top: 10px;
    left: 12px;
    right: 12px;
    z-index: 8;
    gap: 8px;
  }
  .mobile-search-bar,
  .mobile-filter-btn {
    height: 48px;
    border: none;
    border-radius: 24px;
    background: var(--m-bg);
    color: var(--m-muted);
    box-shadow: var(--m-shadow);
    font: inherit;
    cursor: pointer;
  }
  .mobile-search-bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 16px;
    font-size: 14px;
    text-align: left;
  }
  .mobile-filter-btn {
    flex: none;
    width: 48px;
    font-size: 20px;
    color: var(--m-accent);
  }

  /* Kategorie-Chips unter der Suchleiste (unter den Fenstern, damit sie von ihnen verdeckt werden) */
  .mobile-chips {
    display: flex;
    position: fixed;
    top: 66px;
    left: 0;
    right: 0;
    z-index: 4;
    gap: 8px;
    padding: 4px 12px 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .mobile-chips::-webkit-scrollbar {
    display: none;
  }
  .mobile-chip {
    flex: none;
    display: flex;
    align-items: center;
    gap: 7px;
    max-width: 210px;
    height: 36px;
    padding: 0 14px;
    border: none;
    border-radius: 18px;
    background: var(--m-bg);
    color: var(--m-text);
    box-shadow: var(--m-shadow);
    font: inherit;
    font-size: 12.5px;
    white-space: nowrap;
    cursor: pointer;
  }
  .mobile-chip[aria-pressed="true"] {
    background: var(--m-accbg);
    color: var(--m-accent);
    font-weight: 600;
  }
  .mobile-chip[disabled] {
    opacity: 0.75;
    cursor: default;
  }
  .mobile-chip-dot {
    flex: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
  }
  .mobile-chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Unten: schwebende Leiste */
  .mobile-nav {
    top: auto;
    bottom: 14px;
    left: 12px;
    right: 12px;
    height: 64px;
    padding: 0 8px;
    border-radius: 32px;
    overflow: visible;
    background: var(--m-bg);
    box-shadow: var(--m-shadow);
  }
  .mobile-nav-toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    min-width: 48px;
    font-size: 10.5px;
    font-weight: 400;
    color: var(--m-muted);
  }
  .mobile-nav-toggle + .mobile-nav-toggle {
    border-left: none;
  }
  .mobile-nav-toggle:active,
  .mobile-nav-toggle.active {
    background: none;
    color: var(--m-accent);
    font-weight: 600;
  }
  .mobile-nav-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 56px;
    height: 28px;
    border-radius: 14px;
    font-size: 19px;
    line-height: 1;
    transition: background 0.15s ease;
  }
  .mobile-nav-plus {
    font-size: 26px;
    font-weight: 300;
  }
  .mobile-nav-home {
    color: var(--m-accent);
    font-weight: 600;
  }
  .mobile-nav-home .mobile-nav-pill,
  .mobile-nav-toggle.active .mobile-nav-pill {
    background: var(--m-accbg);
  }

  /* Menüs klappen über der Leiste auf */
  .mobile-nav-dropdown {
    top: auto;
    bottom: 90px;
    left: 12px;
    right: 12px;
    max-height: calc(100vh - 190px);
    overflow-y: auto;
    border-radius: 22px;
    background: var(--m-bg);
    box-shadow: var(--m-shadow);
    animation: m-rise 0.18s ease-out;
  }
  .mobile-nav-dropdown button {
    min-height: 50px;
    padding: 14px 22px;
    border-top-color: var(--m-border);
    color: var(--m-text);
  }
  .mobile-nav-login {
    background: none;
    color: var(--m-accent);
    font-weight: 600;
  }

  /* Kartenknöpfe und Maßstab weichen Leisten aus */
  .maplibregl-ctrl-top-right {
    top: 116px;
  }
  .maplibregl-ctrl-bottom-left,
  .maplibregl-ctrl-bottom-right {
    margin-bottom: 86px;
  }
  /* Eine Zeile unten: Maßstab links, dann das Copyright, ganz rechts der Info-Knopf */
  .maplibregl-ctrl-bottom-right {
    left: 90px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    pointer-events: none;
  }
  .maplibregl-ctrl-bottom-right .maplibregl-ctrl {
    pointer-events: auto;
  }
  .maplibregl-ctrl-bottom-right .maplibregl-ctrl-attrib:not(.maplibregl-compact) {
    min-width: 0;
    font-size: 10px;
    line-height: 1.25;
    text-align: right;
    margin-right: 4px;
  }
  /* Der Info-Knopf bleibt, sein Text erscheint erst nach dem Antippen */
  .maplibregl-ctrl-attrib.maplibregl-compact:not(.maplibregl-compact-show) .maplibregl-ctrl-attrib-inner {
    display: none;
  }

  /* Fenster (Suche, Filter, Formulare ...): abgerundete Karten zwischen den Leisten */
  .poi-panel {
    top: 68px;
    max-height: calc(100vh - 164px);
    border-radius: 22px;
  }

  /* Detail-Fenster eines Punkts (MapLibre-Popup) als Sheet über der unteren Leiste */
  .maplibregl-popup:not(.poi-hover-popup) {
    position: fixed !important;
    top: auto !important;
    left: 12px !important;
    right: 12px !important;
    bottom: 90px !important;
    transform: none !important;
    max-width: none !important;
    z-index: 7;
    animation: m-rise 0.2s ease-out;
  }
  .maplibregl-popup:not(.poi-hover-popup) .maplibregl-popup-tip {
    display: none;
  }
  .maplibregl-popup:not(.poi-hover-popup) .maplibregl-popup-content {
    box-sizing: border-box;
    width: 100%;
    max-height: calc(100vh - 230px);
    overflow-y: auto;
    padding: 12px 18px 16px;
    border-radius: 26px;
    background: var(--m-bg);
    color: var(--m-text);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.28);
  }
  .maplibregl-popup:not(.poi-hover-popup) .maplibregl-popup-content::before {
    content: "";
    display: block;
    width: 38px;
    height: 4px;
    margin: 0 auto 12px;
    border-radius: 2px;
    background: var(--m-border);
  }
  .maplibregl-popup:not(.poi-hover-popup) .maplibregl-popup-close-button {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    font-size: 22px;
    color: var(--m-muted);
  }
  .poi-popup {
    max-width: none;
    font-size: 14px;
  }
  .poi-popup strong {
    font-size: 18px;
    font-weight: 600;
  }
  .poi-popup-tags span {
    padding: 3px 10px;
    border-radius: 12px;
    background: var(--m-accbg);
    color: var(--m-accent);
  }
  .poi-popup-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    margin-top: 12px;
    border-radius: 23px;
    background: var(--m-accent);
    color: var(--m-onacc);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
  }
  .poi-popup-actions button {
    min-height: 40px;
  }
}

/* Straßensperrungen: Art (ADR 0043) und Vorschläge aus dem Baustellen-Import (ADR 0042) */
.tickets-section-title {
  margin: 1.2rem 0 0.4rem;
  font-size: 1rem;
}
.poi-popup-tags .closure-kind-chip {
  color: #fff;
}
.poi-popup-tags .closure-kind-full {
  background: #e00000;
}
.poi-popup-tags .closure-kind-partial {
  background: #f4c20d;
  color: #222;
}

/* Offline-Hinweisleiste (offline-banner.js) und Offline-Dialog (offline-panel.js) */
.offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: calc(env(safe-area-inset-top, 0px) + 4px) 12px 4px;
  background: #b45309;
  color: #fff;
  font: 600 12px/1.3 system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: center;
}
body.is-offline .mobile-top,
body.is-offline .mobile-chips {
  transform: translateY(34px);
}
.offline-progress {
  width: 100%;
  margin: 8px 0 4px;
}

/* ---------- Navigation per Langdruck (navigation.js, ADR 0051) ---------- */

.nav-popup .maplibregl-popup-content {
  padding: 12px 14px 14px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ui-text);
  border-radius: var(--ui-radius);
}
.nav-menu-title {
  font-weight: 600;
  margin-right: 18px;
}
.nav-menu-coords {
  font-size: 12px;
  color: var(--ui-text-muted);
  margin: 2px 0 10px;
}
.nav-menu-classes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.nav-class {
  border: 1px solid var(--ui-border);
  background: var(--ui-bg);
  color: var(--ui-text);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}
.nav-class.is-active {
  background: var(--ui-accent);
  border-color: var(--ui-accent);
  color: #fff;
}
.nav-start {
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: var(--ui-accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 12px;
  cursor: pointer;
}
.nav-bar {
  position: fixed;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%);
  z-index: 7;
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  max-width: calc(100vw - 32px);
  background: var(--ui-bg);
  color: var(--ui-text);
  border-radius: var(--ui-radius);
  box-shadow: var(--ui-shadow);
  padding: 10px 14px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 14px;
}
.nav-bar[hidden] {
  display: none !important;
}
.nav-bar-close {
  flex: none;
  border: 1px solid var(--ui-border);
  background: var(--ui-bg);
  color: var(--ui-text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
}
.nav-target {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #d50000;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #d50000, var(--ui-shadow);
}
/* Handy: über der unteren Leiste (Karte, Funktion, Neu, Mehr) */
@media (max-width: 640px) {
  .nav-bar {
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
}

/* ---------- Ortsatlas als PDF (pdf-panel.js, ADR 0055) ---------- */
.pdf-modal .confirm-modal-panel {
  width: 560px;
}
.pdf-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
}
.pdf-close {
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--ui-text-muted);
}
.pdf-regions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.pdf-regions button {
  padding: 5px 12px;
  border: 1px solid var(--ui-border);
  border-radius: 999px;
  background: #fff;
  color: var(--ui-text);
  font-size: 12px;
  cursor: pointer;
}
.pdf-map {
  height: clamp(180px, 32vh, 340px);
  border: 1px solid var(--ui-border);
  border-radius: 6px;
}
.pdf-choice {
  position: relative;
  margin-top: 8px;
}
.pdf-search {
  box-sizing: border-box;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--ui-border);
  border-radius: 6px;
  font-size: 16px; /* kleiner würde iOS beim Antippen zoomen */
}
.pdf-results {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  max-height: 220px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--ui-border);
  border-radius: 6px;
  box-shadow: var(--ui-shadow);
  z-index: 3;
}
.pdf-results[hidden] {
  display: none;
}
.pdf-results button {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: none;
  background: none;
  text-align: left;
  color: var(--ui-text);
  font-size: 13px;
  cursor: pointer;
}
.pdf-results button:hover,
.pdf-results button:focus-visible {
  background: #eef4fb;
}
.pdf-results small,
.pdf-results p {
  color: var(--ui-text-muted);
}
.pdf-results p {
  margin: 8px 10px;
  font-size: 13px;
}
.pdf-selected {
  margin: 6px 0;
  font-size: 13px;
  font-weight: 600;
}
.pdf-sheets {
  margin: 0 0 10px;
  padding: 0;
  border: none;
  min-width: 0;
}
.pdf-sheets[hidden] {
  display: none;
}
.pdf-sheets legend {
  padding: 0;
  font-size: 13px;
  font-weight: 600;
}
.pdf-sheets-hint {
  margin: 2px 0 6px;
  font-size: 12px;
  color: var(--ui-text-muted);
}
.pdf-sheet-list {
  max-height: clamp(120px, 22vh, 220px);
  overflow-y: auto;
  border: 1px solid var(--ui-border);
  border-radius: 6px;
}
.pdf-sheet {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  font-size: 13px;
  cursor: pointer;
}
.pdf-sheet + .pdf-sheet {
  border-top: 1px solid var(--ui-border);
}
.pdf-sheet:has(input:checked) {
  background: #eef4fb;
}
.pdf-sheet input {
  flex: none;
  margin: 0;
}
.pdf-sheet-nr {
  flex: none;
  min-width: 22px;
  padding: 2px 0;
  border-radius: 4px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.pdf-sheet strong,
.pdf-sheet small {
  display: block;
}
.pdf-sheet small {
  font-size: 11px;
  color: var(--ui-text-muted);
}
.pdf-option {
  display: flex;
  gap: 8px;
  align-items: start;
  margin: 4px 0;
  font-size: 13px;
}
.pdf-option[hidden] {
  display: none;
}
.pdf-foot {
  /* Status und Knöpfe bleiben sichtbar, auch wenn die Liste der Ausschnitte das Fenster füllt. */
  position: sticky;
  bottom: -20px;
  z-index: 2;
  margin: 0 -24px;
  padding: 0 24px 10px;
  background: #fff;
}
.pdf-status {
  min-height: 16px;
  margin: 8px 0 4px;
  font-size: 13px;
}
.pdf-progress {
  width: 100%;
}
.pdf-download {
  margin-right: auto;
  align-self: center;
  color: var(--ui-accent);
  font-weight: 600;
  font-size: 13px;
}
.pdf-download[hidden] {
  display: none;
}
.pdf-credit {
  margin: 10px 0 0;
  text-align: right;
  font-size: 11px;
  color: var(--ui-text-muted);
}

/* ---------- Zahl offener Provider-Änderungen am Menüpunkt (provider-changes.js, ADR 0054) ---------- */
.sidebar-action[data-action="tickets"],
.mobile-nav-tickets,
.mobile-nav-toggle[data-menu="mehr"] {
  position: relative;
}
.provider-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  line-height: 15px;
  pointer-events: none;
}
.mobile-nav-tickets .provider-badge {
  position: static;
  margin-left: 6px;
}
/* Der PDF-Knopf soll im Menü auffallen: rot hinterlegt, mit Symbol "PDF-Datei". */
.sidebar-pdf,
.sidebar-pdf:hover {
  background: #fdecea;
  border-radius: 6px;
  color: #b71c1c;
  font-weight: 700;
}
.sidebar-pdf:hover {
  background: #fbd9d5;
}
.sidebar-pdf .sidebar-icon svg {
  display: block;
  margin: 0 -1px;
}
.mobile-nav-dropdown button.mobile-nav-pdf {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fdecea;
  color: #b71c1c;
  font-weight: 700;
}
