/* Frontend (Einsatzstelle) - eigenstaendiges dunkles Theme, optimiert fuer
   Handy/Tablet unter widrigen Bedingungen (Sonnenlicht, Handschuhe, Dunkelheit). */

:root {
    --fe-bg: #0b0d10;
    --fe-surface: #15181c;
    --fe-surface-2: #1c2126;
    --fe-border: rgba(255,255,255,0.09);
    --fe-border-strong: rgba(255,255,255,0.18);
    --fe-text: #f2f0ee;
    --fe-text-muted: rgba(242,240,238,0.62);
    --fe-text-faint: rgba(242,240,238,0.42);
    --fe-accent: #630d00;
    --fe-accent-soft: rgba(99,13,0,0.25);
    --fe-green: #2fbf6e;
    --fe-red: #ef4444;
    --fe-blue: #3b82f6;
    --fe-amber: #f2b134;
}

:root[data-theme="light"] {
    --fe-bg: #f4f2ee;
    --fe-surface: #ffffff;
    --fe-surface-2: #f2f0ec;
    --fe-border: rgba(0,0,0,0.1);
    --fe-border-strong: rgba(0,0,0,0.18);
    --fe-text: #1a1a1a;
    --fe-text-muted: rgba(26,26,26,0.62);
    --fe-text-faint: rgba(26,26,26,0.42);
    --fe-accent-soft: rgba(99,13,0,0.12);
}

body.area-frontend, body.area-auth {
    background: var(--fe-bg);
    color: var(--fe-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    height: 100%;
    overflow: hidden;
    margin: 0;
}

/* Einfaches "html { height: 100% }" statt eines :has()-Selektors - diese
   Datei wird ohnehin nur von layout_frontend.php/layout_auth.php geladen
   (siehe body.area-frontend/area-auth oben), :has() braeuchte es also nicht,
   spart aber vor allem den Support-Vorbehalt: :has() gibt es erst ab Safari
   15.4, auf aelteren Safari-Versionen (z.B. manche iPads) wird die GESAMTE
   Selector-Liste (beide Seiten des Kommas) verworfen, weil ein Komma keine
   "forgiving selector list" wie :is()/:where() ist. Ohne diese html-Hoehe
   fehlt der Karte (#fe-leaflet-map, "height:100%") im Zweifel eine definierte
   Bezugsgroesse und sie kann ueber die Bottom-Nav hinaus wachsen. */
html { height: 100%; }

body.area-frontend *, body.area-auth * { box-sizing: border-box; }

/* Backend/Bootstrap bekommt "[hidden] { display: none !important; }" gratis
   ueber Bootstraps Reboot-CSS - hier nicht, daher explizit noetig. Ohne diese
   Regel gewinnt jede spezifischere "display: ..."-Deklaration auf demselben
   Element gegen das hidden-Attribut (z.B. .searchable-select__panel oder
   .searchable-select__item), das Element bleibt dann trotz hidden sichtbar. */
[hidden] { display: none !important; }

.fe-heading {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--fe-text);
}

/* ── Auth (Login / Passwort) ── */
.fe-auth-shell {
    height: 100vh; height: 100dvh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: calc(32px + env(safe-area-inset-top, 0px)) 24px calc(32px + env(safe-area-inset-bottom, 0px));
}

.fe-brand-mark {
    width: 80px;
    height: 80px;
    border-radius: 22px;
    overflow: hidden;
    margin: 0 auto 20px;
    box-shadow: 0 0 56px rgba(99, 13, 0, 0.33);
}
.fe-brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

.fe-auth-title {
    text-align: center;
    margin-bottom: 40px;
}
.fe-auth-title h1 { font-size: 32px; margin-top: 4px; }
.fe-auth-title p { font-size: 13px; color: var(--fe-text-muted); margin-top: 8px; letter-spacing: 0.3px; }

.fe-card {
    width: 100%;
    background: var(--fe-surface);
    border: 1px solid var(--fe-border);
    border-radius: 18px;
    padding: 32px;
}

/* Login-/Auth-Karten sollen nicht ueber die volle Breite laufen, sondern wie
   ein zentriertes Formular wirken - .fe-auth-shell zentriert bereits per
   flexbox, hier nur die Breite selbst begrenzen. */
.fe-card--auth {
    max-width: 400px;
}

.fe-card h2 { font-size: 19px; margin-bottom: 24px; }

.fe-field { margin-bottom: 18px; }
.fe-field label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--fe-text-muted);
    margin-bottom: 8px;
}
.fe-field input, .fe-field textarea, .fe-field select {
    width: 100%;
    min-height: 48px;
    background: var(--fe-bg);
    border: 1.5px solid var(--fe-border);
    border-radius: 10px;
    padding: 13px 14px;
    color: var(--fe-text);
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    outline: none;
}
.fe-field input:focus, .fe-field textarea:focus, .fe-field select:focus { border-color: var(--fe-accent); }
.fe-field textarea { resize: vertical; }
.fe-field input:disabled, .fe-field textarea:disabled, .fe-field select:disabled { opacity: 0.5; cursor: not-allowed; }

.fe-btn {
    width: 100%;
    min-height: 52px;
    background: var(--fe-accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 28px rgba(99, 13, 0, 0.31);
    touch-action: manipulation;
}
.fe-btn--secondary {
    background: transparent;
    color: var(--fe-text);
    border: 1px solid var(--fe-border);
    box-shadow: none;
}

.fe-status-line {
    margin-top: 32px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--fe-text-muted);
    opacity: 0.7;
}

.fe-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--fe-green);
    animation: fe-pulse 2s infinite;
    flex-shrink: 0;
}
@keyframes fe-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes fe-slideup { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes fe-fadein { from { opacity: 0; } to { opacity: 1; } }

/* ── App shell ── */
.fe-shell {
    display: flex; flex-direction: column; overflow: hidden;
    height: 100vh; height: 100dvh; /* 100dvh korrigiert einen iOS-Bug: 100vh stimmt im
    Standalone-Modus (Home-Bildschirm-App ohne Browser-Chrome) nicht zuverlaessig mit der
    tatsaechlich sichtbaren Flaeche ueberein. */
}

.fe-header {
    min-height: 56px;
    background: var(--fe-surface);
    border-bottom: 1px solid var(--fe-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: env(safe-area-inset-top, 0px) 14px 0;
    flex-shrink: 0;
    z-index: 50;
    gap: 8px;
}
.fe-header__brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fe-header__brand-icon {
    width: 34px; height: 34px; border-radius: 9px; overflow: hidden; flex-shrink: 0;
}
.fe-header__brand-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fe-header__brand-text { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif; font-size: 19px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--fe-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fe-header__actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.fe-pill {
    display: flex; align-items: center; gap: 6px;
    background: var(--fe-surface-2); border: 1px solid var(--fe-border);
    border-radius: 20px; padding: 5px 12px;
    font-size: 11px; font-weight: 700; color: var(--fe-text-muted);
    text-transform: uppercase; letter-spacing: 0.5px;
    text-decoration: none;
    white-space: nowrap;
}
button.fe-pill { cursor: pointer; font-family: inherit; }
.fe-icon-btn {
    width: 36px; height: 36px; min-height: 36px;
    background: var(--fe-surface-2); border: 1px solid var(--fe-border); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0;
    padding: 0;
}

/* min-height:0 haelt das Panel innerhalb seines flex:1-Anteils, auch falls
   Leaflet (Kind der Karte) intern grosse Pixel-Groessen setzt - Flex-Items
   haben per Spec sonst "min-height:auto", also mindestens die intrinsische
   Groesse ihres Inhalts, wodurch .fe-panels sich sonst auf Kosten von
   .fe-header/.fe-bottom-nav aufblaehen koennte statt zu schrumpfen. */
.fe-panels { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.fe-panel { position: absolute; inset: 0; background: var(--fe-bg); display: none; flex-direction: column; overflow: hidden; }
.fe-panel.is-active { display: flex; }
.fe-panel--map.is-active { display: block; }

#fe-leaflet-map { height: 100%; width: 100%; position: absolute; inset: 0; }

.fe-map-anfahrt-btn {
    /* top-Wert unter der Leaflet-Zoom-Control (oben links, ~10px Rand +
       bis zu 2x30px Buttons bei Touch-Geraeten) platziert, sonst ueberlappt
       der Button die +/- Buttons der Karte. */
    position: absolute; top: 82px; left: 12px; z-index: 1000;
    display: flex; align-items: center; gap: 8px;
    background: var(--fe-red); color: #fff; border: none; border-radius: 12px;
    padding: 13px 18px; font-size: 14px; font-weight: 800;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    text-transform: uppercase; letter-spacing: 0.8px;
    box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4);
    cursor: pointer; touch-action: manipulation;
}
.fe-map-anfahrt-btn[hidden] { display: none; }

.fe-map-controls {
    position: absolute; top: 12px; left: 12px; right: 12px; z-index: 1000;
    display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none;
}
.fe-map-controls #fe-polling-toggle, .fe-map-controls #fe-hydranten-toggle, .fe-map-controls #fe-wasserkarte-toggle, .fe-map-controls #fe-legend-toggle { pointer-events: auto; cursor: pointer; border: none; }
.fe-map-controls #fe-polling-toggle .fe-dot, .fe-map-controls #fe-hydranten-toggle .fe-dot, .fe-map-controls #fe-wasserkarte-toggle .fe-dot, .fe-map-controls #fe-legend-toggle .fe-dot { background: var(--fe-text-muted); }
.fe-map-controls #fe-polling-toggle.is-active, .fe-map-controls #fe-hydranten-toggle.is-active, .fe-map-controls #fe-wasserkarte-toggle.is-active, .fe-map-controls #fe-legend-toggle.is-active { background: var(--fe-accent); color: #fff; }
.fe-map-controls #fe-polling-toggle.is-active .fe-dot, .fe-map-controls #fe-hydranten-toggle.is-active .fe-dot, .fe-map-controls #fe-wasserkarte-toggle.is-active .fe-dot, .fe-map-controls #fe-legend-toggle.is-active .fe-dot { background: #fff; }
.fe-map-controls #fe-polling-toggle:disabled { opacity: 0.5; cursor: not-allowed; }
.fe-map-controls__hint {
    background: rgba(15, 17, 21, 0.9); backdrop-filter: blur(12px);
    border: 1px solid var(--fe-border); border-radius: 10px; padding: 8px 12px;
    font-size: 11px; color: rgba(255,255,255,.75); max-width: 260px; margin: 0;
}

/* Track+Knob-Toggle (iOS-Stil), z.B. Dark Mode, Protokoll-Ansicht. */
.fe-switch {
    width: 46px; height: 27px; border-radius: 14px; border: none; cursor: pointer;
    position: relative; padding: 0; background: var(--fe-border-strong);
    transition: background .15s; flex-shrink: 0;
}
.fe-switch.is-active { background: var(--fe-accent); }
.fe-switch__knob {
    position: absolute; top: 2px; left: 2px; width: 23px; height: 23px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: left .15s;
}
.fe-switch.is-active .fe-switch__knob { left: 21px; }
.fe-switch:disabled { opacity: 0.5; cursor: not-allowed; }

.fe-legend {
    position: absolute; bottom: 16px; left: 12px; z-index: 1000;
    background: rgba(15, 17, 21, 0.9); backdrop-filter: blur(12px);
    border: 1px solid var(--fe-border); border-radius: 12px; padding: 10px 14px;
    display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.fe-legend[hidden] { display: none; }
.fe-legend__row { display: flex; align-items: center; gap: 8px; }
.fe-legend__dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); flex-shrink: 0; }
.fe-legend__row span { font-size: 11px; font-weight: 600; color: #fff; }

.fe-search-bar { padding: 12px; background: var(--fe-surface); border-bottom: 1px solid var(--fe-border); flex-shrink: 0; }
.fe-search-bar input {
    width: 100%; background: var(--fe-bg); border: 1.5px solid var(--fe-border); border-radius: 10px;
    padding: 10px 36px 10px 36px; color: var(--fe-text); font-size: 15px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif; outline: none;
    min-height: 44px;
}
.fe-search-clear {
    position: absolute; right: 24px; top: 50%; transform: translateY(-50%);
    display: flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; padding: 0; border: none; border-radius: 50%;
    background: var(--fe-border); color: var(--fe-text-muted); cursor: pointer;
}
.fe-search-clear:hover { background: var(--fe-text-muted); color: var(--fe-surface); }

.fe-chips { padding: 10px 12px; display: flex; gap: 8px; background: var(--fe-surface); border-bottom: 1px solid var(--fe-border); flex-shrink: 0; overflow-x: auto; }
.fe-chips--stacked { flex-direction: column; overflow-x: visible; }
.fe-chips--stacked .fe-chip { width: 100%; text-align: left; }
.fe-chip {
    border: 1px solid var(--fe-border); background: var(--fe-surface-2); color: var(--fe-text-muted);
    border-radius: 20px; padding: 7px 14px; font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; cursor: pointer; flex-shrink: 0; white-space: nowrap; min-height: 32px;
}
.fe-chip.is-active { background: var(--fe-accent); color: #fff; border-color: transparent; }
.fe-chip:disabled { opacity: 0.4; cursor: not-allowed; }

.fe-besatzung-row { display: flex; gap: 8px; }
.fe-besatzung-field { flex: 1; }
.fe-besatzung-field label { display: block; font-size: 10px; color: var(--fe-text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.fe-besatzung-field input:disabled { opacity: 0.5; cursor: not-allowed; }
.fe-besatzung-field input {
    width: 100%; min-height: 44px; background: var(--fe-bg); border: 1.5px solid var(--fe-border); border-radius: 10px;
    padding: 8px 10px; color: var(--fe-text); font-size: 16px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif; text-align: center;
}

.fe-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.fe-resource-group { display: flex; flex-direction: column; gap: 6px; }

/* ── Einsatzbericht: fahrzeugbezogene Erfassung (Kilometer/Personal/Material) ── */
.fe-bericht-fahrzeug { background: var(--fe-surface-2); border: 1px solid var(--fe-border); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.fe-bericht-fahrzeuge-group.is-collapsed { display: none; }
.fe-bericht-fahrzeug__name { font-size: 14px; font-weight: 700; color: var(--fe-text); margin-bottom: 10px; }
.fe-bericht-row { display: flex; gap: 6px; margin-bottom: 6px; align-items: center; }
.fe-bericht-row input, .fe-bericht-row select {
    flex: 1; min-width: 0; min-height: 40px; background: var(--fe-bg); border: 1.5px solid var(--fe-border); border-radius: 8px;
    padding: 8px 10px; color: var(--fe-text); font-size: 14px; font-family: inherit; outline: none;
}
.fe-bericht-row input:focus, .fe-bericht-row select:focus { border-color: var(--fe-accent); }
.fe-bericht-row input:disabled, .fe-bericht-row select:disabled { opacity: 0.5; cursor: not-allowed; }
.fe-bericht-row__remove {
    flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--fe-surface); color: var(--fe-red);
    display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 16px; line-height: 1; padding: 0;
}
.fe-bericht-row-add { background: none; border: 1px dashed var(--fe-border-strong); color: var(--fe-text-muted); border-radius: 8px;
    width: 100%; min-height: 38px; font-size: 13px; font-weight: 600; cursor: pointer; margin-bottom: 10px; }

/* ── Einsatzmittel Karten-Grid ── */
.fe-em-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
@media (min-width: 560px) { .fe-em-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .fe-em-grid { grid-template-columns: repeat(4, 1fr); } }

.fe-em-card {
    background: var(--fe-surface-2); border: 1px solid var(--fe-border); border-radius: 14px;
    cursor: pointer; overflow: hidden; display: flex; flex-direction: column; position: relative;
    flex-shrink: 0; -webkit-tap-highlight-color: transparent;
}
.fe-em-card__statusbar { height: 4px; width: 100%; flex-shrink: 0; }
.fe-em-card__body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.fe-em-card__name { font-size: 13px; font-weight: 700; color: var(--fe-text); line-height: 1.25; }
.fe-em-card__meta { font-size: 11px; color: var(--fe-text-muted); line-height: 1.3; }
.fe-em-card__fremd-badge {
    display: inline-block; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--fe-amber); border: 1px solid var(--fe-amber); border-radius: 4px; padding: 1px 5px; vertical-align: middle;
}
.fe-em-card__wehr { font-size: 10px; color: var(--fe-blue); font-weight: 600; }
.fe-em-card__footer { margin-top: auto; padding-top: 6px; display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; }
.fe-em-card__status-chip {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 7px; border: none;
    font-size: 13px; font-weight: 800; font-family: inherit; padding: 0;
}
button.fe-em-card__status-chip { cursor: pointer; }
.fe-em-card__besatzung {
    font-size: 10px; font-weight: 700; color: var(--fe-text-muted); background: var(--fe-bg);
    border: 1px solid var(--fe-border); border-radius: 20px; padding: 2px 8px;
}
.fe-em-card__book-btn {
    width: 26px; height: 26px; min-height: 26px; flex-shrink: 0;
    border-radius: 50%; border: none; display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 15px; font-weight: 700; line-height: 1; padding: 0;
}
.fe-em-card__book-btn--add { background: var(--fe-accent); color: #fff; }
.fe-em-card__book-btn--remove { background: var(--fe-surface); border: 1px solid var(--fe-border); color: var(--fe-red); }
.fe-em-card__book-btn--move { background: var(--fe-surface); border: 1px solid var(--fe-border); color: var(--fe-blue); font-size: 13px; }

.fe-em-modal-grid { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 18px 20px 6px; }
.fe-resource-card__wehr { font-size: 11px; color: var(--fe-blue); margin-top: 2px; font-weight: 600; }

.fe-status-form__label { font-size: 11px; color: var(--fe-text-muted); text-transform: uppercase; letter-spacing: 0.5px; flex-shrink: 0; }
.fe-status-select {
    flex: 1; min-height: 38px; background: var(--fe-bg); border: 1.5px solid var(--fe-border); border-radius: 8px;
    padding: 6px 10px; color: var(--fe-text); font-size: 13px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
}

.fe-status-header {
    padding: 14px 16px; background: var(--fe-surface); border-bottom: 1px solid var(--fe-border);
    display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.fe-status-header span:first-child { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--fe-text-muted); }

.fe-as-clock {
    padding: 10px 16px; background: var(--fe-surface); border-bottom: 1px solid var(--fe-border);
    flex-shrink: 0; text-align: center; font-size: 20px; font-weight: 700; letter-spacing: 1px;
    color: var(--fe-text); font-variant-numeric: tabular-nums;
}

.fe-empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 24px; text-align: center; min-height: 240px; }
.fe-empty-state__icon {
    width: 72px; height: 72px; background: var(--fe-surface-2); border: 1.5px solid var(--fe-border); border-radius: 20px;
    display: flex; align-items: center; justify-content: center; margin-bottom: 20px;
}
.fe-empty-state h3 { font-size: 20px; margin-bottom: 10px; }
.fe-empty-state p { font-size: 13px; color: var(--fe-text-muted); line-height: 1.65; max-width: 280px; }

/* ── Profil-Tab ── */
.fe-profil-box {
    padding: 12px 14px; border-radius: 10px; background: var(--fe-surface-2); border: 1px solid var(--fe-border);
}
.fe-profil-box__title { font-size: 15px; font-weight: 700; color: var(--fe-text); }
.fe-profil-box__sub { font-size: 13px; color: var(--fe-text-muted); margin-top: 2px; }
.fe-profil-box--inline { display: flex; align-items: center; font-size: 14px; font-weight: 600; color: var(--fe-text); }
.fe-profil-box--row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }

.fe-bottom-nav {
    min-height: 68px; padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--fe-surface); border-top: 1px solid var(--fe-border); display: flex; align-items: stretch; flex-shrink: 0; z-index: 50;
}
.fe-tab-btn {
    flex: 1; background: transparent; border: none; border-top: 2.5px solid transparent; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    color: var(--fe-text-muted); font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif; padding: 0; position: relative;
}
.fe-tab-btn.is-active { color: var(--fe-accent); border-top-color: var(--fe-accent); }
.fe-tab-btn span { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.fe-tab-btn__dot {
    position: absolute; top: 8px; right: calc(50% - 20px); width: 8px; height: 8px; border-radius: 50%;
    background: var(--fe-amber); border: 2px solid var(--fe-surface);
}

.fe-em-summary {
    background: var(--fe-surface); border: 1px solid var(--fe-border); border-radius: 12px;
    padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px;
}
.fe-em-summary__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fe-em-summary__label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--fe-text-muted); flex-shrink: 0; }
.fe-em-summary__value { font-size: 16px; font-weight: 700; color: var(--fe-text); text-align: right; }
.fe-em-summary__chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.fe-em-besatzung-chip {
    font-size: 11px; font-weight: 600; color: var(--fe-text); background: var(--fe-surface-2);
    border: 1px solid var(--fe-border); border-radius: 20px; padding: 3px 10px; white-space: nowrap;
}

/* ── Detail bottom-sheet ── */
.fe-sheet-backdrop {
    /* Ueber den Leaflet-Panes (bis z-index 700) UND den eigenen Karten-Overlays
       (Controls/Legende/Info-Karte bei 1000) - .fe-panels/#fe-leaflet-map bilden
       keinen eigenen Stacking-Context, weshalb diese sonst durchscheinen. */
    position: fixed; inset: 0; z-index: 2000; display: none; align-items: flex-end;
    background: rgba(0, 0, 0, 0.75); animation: fe-fadein 0.18s ease;
}
.fe-sheet-backdrop.is-open { display: flex; }
.fe-sheet {
    width: 100%; background: var(--fe-surface); border-top: 1px solid var(--fe-border);
    border-radius: 22px 22px 0 0; padding-bottom: 28px;
    animation: fe-slideup 0.26s cubic-bezier(.25,.46,.45,.94);
    max-height: 92vh; overflow-y: auto;
}
.fe-sheet__handle { display: flex; justify-content: center; padding: 14px 0 8px; }
.fe-sheet__handle span { width: 38px; height: 4px; background: var(--fe-border); border-radius: 2px; display: block; }
.fe-sheet__head { display: flex; align-items: flex-start; justify-content: space-between; padding: 10px 20px 18px; gap: 12px; }
.fe-sheet__head-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--fe-text-muted); margin-bottom: 5px; }
.fe-sheet__head h2 { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif; font-size: 26px; font-weight: 800; line-height: 1.1; }
.fe-sheet__divider { height: 1px; background: var(--fe-border); }
.fe-sheet__stat { background: var(--fe-surface-2); border: 1px solid var(--fe-border); border-radius: 12px; padding: 14px; }
.fe-sheet__stat-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; color: var(--fe-text-muted); margin-bottom: 6px; }
.fe-sheet__stat-value { font-size: 14px; font-weight: 700; color: var(--fe-text); }

.fe-einsatz-marker {
    width: 22px; height: 22px; border-radius: 50%;
    background: #ef4444; border: 3px solid rgba(255,255,255,.9);
    box-shadow: 0 2px 14px rgba(0,0,0,.8), 0 0 0 6px rgba(239,68,68,.25);
    animation: fe-pulse 2s infinite;
}

.fe-hydrant-marker {
    width: 20px; height: 20px; border-radius: 50%;
    background: #3b82f6; border: 2px solid rgba(255,255,255,.9);
    box-shadow: 0 2px 10px rgba(0,0,0,.7);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 10px; font-weight: 800; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
}
/* Form statt Farbe unterscheidet den Typ: rund = Ueberflur (Default), abgerundetes
   Quadrat = Unterflur - beide einheitlich blau. */
.fe-hydrant-marker--unterflur { border-radius: 5px; }

.fe-vehicle-marker {
    width: 22px; height: 22px; border-radius: 6px;
    border: 2px solid rgba(255,255,255,.9);
    box-shadow: 0 2px 8px rgba(0,0,0,.5);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 11px; font-weight: 800;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
}

/* Bottom-Sheet-Infokarte fuer Karten-Marker (Fahrzeug/Einsatzstelle/Hydrant) -
   ersetzt die native Leaflet-Popup-Bubble durch ein einheitliches, auf Mobilgeraeten
   besser lesbares Muster. */
.fe-map-info-card {
    position: absolute; left: 12px; right: 12px; bottom: 14px; z-index: 1000;
    background: var(--fe-surface); border: 1px solid var(--fe-border); border-radius: 12px;
    padding: 14px 16px; box-shadow: 0 6px 24px rgba(0,0,0,.35);
    display: none;
}
.fe-map-info-card.is-open { display: block; }
.fe-map-info-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.fe-map-info-card__close {
    border: none; background: none; color: var(--fe-text-muted); cursor: pointer;
    padding: 2px; flex-shrink: 0; display: flex;
}

.fe-toast {
    position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(8px);
    background: var(--fe-surface); border: 1px solid var(--fe-border); color: var(--fe-text);
    padding: 10px 18px; border-radius: 10px; font-size: 13px; font-weight: 600;
    box-shadow: 0 8px 24px rgba(0,0,0,.5); z-index: 2100; opacity: 0; pointer-events: none;
    transition: opacity .2s ease, transform .2s ease; max-width: 88vw; text-align: center;
}
.fe-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

.hint { color: var(--fe-text-muted); font-size: 13px; }

.fe-list-subheader {
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px;
    color: var(--fe-text-muted); padding: 4px 2px 2px; margin-top: 4px;
}
.fe-list-subheader:first-child { margin-top: 0; }
.fe-list-subheader--toggle {
    width: 100%; display: flex; align-items: center; justify-content: space-between;
    background: none; border: none; cursor: pointer; min-height: 32px;
    color: var(--fe-text-muted); font: inherit; text-transform: uppercase; letter-spacing: 0.8px;
}
.fe-list-subheader--toggle svg { flex-shrink: 0; transition: transform .15s; transform: rotate(-90deg); }
.fe-list-subheader--toggle.is-expanded svg { transform: rotate(0deg); }
.fe-em-grid.is-collapsed { display: none; }

.fe-row-btn {
    margin-top: 10px; width: 100%; min-height: 42px; border-radius: 8px; border: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif; font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.5px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.fe-row-btn--add { background: var(--fe-accent); color: #fff; }
.fe-row-btn--remove { background: var(--fe-surface); border: 1px solid var(--fe-border); color: var(--fe-text-muted); }

dialog {
    border: none; border-radius: 16px; padding: 0; width: min(440px, 92vw);
    background: var(--fe-surface); color: var(--fe-text); box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.65); }
.dialog-body { padding: 24px; }
.dialog-body h2 { margin-bottom: 20px; }
.btn-row { display: flex; gap: 10px; margin-top: 20px; }
.btn-row .fe-btn { width: auto; flex: 1; }

.fe-dialog--einsatz { width: min(640px, 96vw); max-height: 94vh; overflow-y: auto; }

.fe-dialog--quick-book { max-height: 80vh; overflow-y: auto; }
.fe-dialog--quick-book .fe-btn { margin-bottom: 8px; }
.fe-dialog--einsatz .dialog-body { padding: 28px; }
.fe-dialog--einsatz h2 { font-size: 22px; }

/* ── Einsatz-Liste / Detail ── */
.fe-einsatz-row {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
    background: var(--fe-surface-2); border: 1px solid var(--fe-border); border-radius: 14px;
    padding: 12px 40px 12px 14px; position: relative; text-align: left; cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif; width: 100%; -webkit-tap-highlight-color: transparent;
}
.fe-einsatz-row__main { display: flex; align-items: center; gap: 8px; }
.fe-einsatz-row__badge {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
    background: var(--fe-accent); color: #fff; border-radius: 20px; padding: 2px 8px; flex-shrink: 0;
}
.fe-einsatz-row__name { font-size: 14px; font-weight: 700; color: var(--fe-text); }
.fe-einsatz-row__meta { font-size: 11px; color: var(--fe-text-muted); }
.fe-einsatz-row__chevron { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--fe-text-muted); }

.fe-einsatz-detail-panel { display: none; }
.fe-einsatz-detail-panel.is-active { display: block; }

/* ── Abschnitte (Kanban) ── */
.fe-kanban-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 20px; margin-bottom: 20px; }
.fe-kanban-add-btn {
    display: flex; align-items: center; gap: 6px; flex-shrink: 0;
    background: var(--fe-accent); color: #fff; border: none; border-radius: 20px;
    padding: 7px 14px; min-height: 32px; font-size: 11px; font-weight: 700; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer;
    box-shadow: 0 2px 12px rgba(99, 13, 0, 0.28);
}
.fe-kanban {
    display: flex; gap: 10px; width: 100%; overflow-x: auto; padding-bottom: 6px;
    -webkit-overflow-scrolling: touch; align-items: flex-start;
}
.fe-kanban-col {
    flex: 1 1 0; min-width: 150px; background: var(--fe-surface-2); border: 1px solid var(--fe-border);
    border-radius: 14px; display: flex; flex-direction: column; max-height: 480px;
}
.fe-kanban-col__head {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 10px 12px;
    border-bottom: 1px solid var(--fe-border); font-size: 12px; font-weight: 700; color: var(--fe-text); flex-shrink: 0;
}
.fe-kanban-col__count { color: var(--fe-text-muted); font-weight: 600; flex-shrink: 0; }
.fe-kanban-col__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fe-kanban-col__delete {
    margin-left: auto; background: none; border: none; color: var(--fe-text-muted); cursor: pointer;
    font-size: 16px; line-height: 1; padding: 2px; flex-shrink: 0;
}
.fe-kanban-col__summary {
    flex-basis: 100%; font-size: 10px; font-weight: 600; color: var(--fe-text-muted); text-transform: none;
    letter-spacing: 0;
}
.fe-kanban-col__body {
    padding: 10px; display: flex; flex-direction: column; gap: 8px; flex: 1;
    overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.fe-kanban-col__empty { font-size: 11px; color: var(--fe-text-muted); text-align: center; padding: 14px 4px; }

/* ── Chat / Log ── */
#fe-chat-detail-view { display: flex; flex-direction: column; height: 100%; }
.fe-chat-detail-panel { display: none; flex-direction: column; flex: 1; min-height: 0; }
.fe-chat-detail-panel.is-active { display: flex; }
.fe-chat-detail-head {
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px;
    background: var(--fe-surface); border-bottom: 1px solid var(--fe-border); flex-shrink: 0;
}
.fe-chat-detail-head__title { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; color: var(--fe-text); flex: 1; min-width: 0; }
.fe-chat-log-toggle-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 12px; border-bottom: 1px solid var(--fe-border); flex-shrink: 0;
    font-size: 12px; font-weight: 600; color: var(--fe-text-muted);
}

.fe-chat-messages, .fe-chat-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.fe-chat-message { max-width: 82%; align-self: flex-start; }
.fe-chat-message--own { align-self: flex-end; }
.fe-chat-message__meta { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--fe-text-muted); margin-bottom: 3px; padding: 0 4px; }
.fe-chat-message--own .fe-chat-message__meta { justify-content: flex-end; }
.fe-chat-message__time { margin-left: auto; }
.fe-chat-message--own .fe-chat-message__time { margin-left: 0; }
.fe-chat-message__reply-btn {
    background: none; border: none; color: var(--fe-text-muted); cursor: pointer; padding: 2px 4px;
    font-size: 13px; line-height: 1; border-radius: 6px; flex-shrink: 0;
}
.fe-chat-message__reply-btn:hover, .fe-chat-message__reply-btn:active { color: var(--fe-accent); background: var(--fe-surface-2); }
.fe-chip--reply.is-active { background: var(--fe-blue); }
.fe-chat-message__text {
    background: var(--fe-surface-2); border: 1px solid var(--fe-border); border-radius: 14px 14px 14px 4px;
    padding: 10px 13px; font-size: 14px; color: var(--fe-text); line-height: 1.4; word-break: break-word;
}
.fe-chat-message--own .fe-chat-message__text { background: var(--fe-accent); color: #fff; border-color: transparent; border-radius: 14px 14px 4px 14px; }

.fe-chat-compose { flex-shrink: 0; padding: 10px 12px; background: var(--fe-surface); border-top: 1px solid var(--fe-border); }
.fe-chat-compose .fe-chips { padding: 0 0 8px; background: transparent; border: none; }
.fe-chat-input-row { display: flex; gap: 8px; }
.fe-chat-input-row input {
    flex: 1; min-height: 44px; background: var(--fe-bg); border: 1.5px solid var(--fe-border); border-radius: 22px;
    padding: 10px 16px; color: var(--fe-text); font-size: 15px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif; outline: none;
}
.fe-chat-send-btn {
    width: 44px; height: 44px; min-height: 44px; flex-shrink: 0; border-radius: 50%; border: none;
    background: var(--fe-accent); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer;
}

.fe-log-entry { display: flex; gap: 10px; font-size: 13px; padding: 6px 4px; border-bottom: 1px solid var(--fe-border); }
.fe-log-entry__time { color: var(--fe-text-muted); font-variant-numeric: tabular-nums; flex-shrink: 0; }
.fe-log-entry__text { color: var(--fe-text); }

.fe-empfaenger-modus {
    display: flex; align-items: center; gap: 10px; padding: 13px 6px; font-size: 14px; font-weight: 500;
    color: var(--fe-text); cursor: pointer; min-height: 48px; border-bottom: 1px solid var(--fe-border);
}
.fe-empfaenger-modus:last-of-type { border-bottom: none; }
.fe-empfaenger-modus input { width: 18px; height: 18px; accent-color: var(--fe-accent); flex-shrink: 0; }
.fe-empfaenger-optionen { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; margin: 4px 0 6px; }
.fe-empfaenger-option {
    display: flex; align-items: center; gap: 10px; padding: 12px 6px; font-size: 14px; font-weight: 500;
    color: var(--fe-text); cursor: pointer; min-height: 48px; border-bottom: 1px solid var(--fe-border);
}
.fe-empfaenger-option:last-child { border-bottom: none; }
.fe-empfaenger-option input { width: 18px; height: 18px; accent-color: var(--fe-accent); flex-shrink: 0; }

/* ── ABEK-Auswahl ── */
.fe-abek-results { max-height: 300px; overflow-y: auto; margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.fe-abek-result-row {
    text-align: left; background: var(--fe-surface-2); border: 1px solid var(--fe-border); border-radius: 10px;
    padding: 11px 13px; cursor: pointer; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif; width: 100%;
}
.fe-abek-result-row__top { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--fe-text); }
.fe-abek-result-row__code { font-size: 11px; color: var(--fe-text-muted); font-weight: 600; }
.fe-abek-result-row__meta { font-size: 12px; color: var(--fe-text-muted); margin-top: 3px; }

.fe-pdf-upload {
    display: flex; align-items: center; justify-content: center; text-align: center;
    min-height: 56px; padding: 16px; margin-bottom: 4px; border-radius: 12px;
    border: 1.5px dashed var(--fe-border-strong); background: var(--fe-surface-2);
    color: var(--fe-text-muted); font-size: 13px; font-weight: 600; cursor: pointer;
}
.fe-pdf-upload input[type="file"] {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.fe-abek-selected {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    background: var(--fe-surface-2); border: 1px solid var(--fe-accent); border-radius: 10px;
    padding: 12px 14px; margin-bottom: 10px; font-size: 14px; font-weight: 600; color: var(--fe-text);
}
.fe-abek-selected button {
    background: none; border: none; color: var(--fe-accent); font-size: 12px; font-weight: 700;
    cursor: pointer; text-transform: uppercase; flex-shrink: 0;
}

.fe-mini-map { height: 260px; border-radius: 12px; overflow: hidden; border: 1px solid var(--fe-border); }
.fe-dialog--einsatz .fe-field input { font-size: 15px; }

.fe-map-popup { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif; min-width: 150px; }
.fe-map-popup b { font-size: 14px; display: block; margin-bottom: 4px; }
.fe-map-popup .fe-map-popup__meta { font-size: 12px; color: var(--fe-text-muted); display: block; margin-bottom: 2px; }
.leaflet-popup-content-wrapper { background: var(--fe-surface) !important; color: var(--fe-text) !important; border: 1px solid var(--fe-border) !important; border-radius: 14px !important; box-shadow: 0 8px 32px rgba(0,0,0,.8) !important; }
.leaflet-popup-tip { background: var(--fe-surface) !important; }
.leaflet-popup-close-button { color: var(--fe-text-muted) !important; }
.leaflet-bar a { background: var(--fe-surface) !important; color: var(--fe-text) !important; border-color: var(--fe-border) !important; }
.leaflet-control-attribution { background: rgba(0,0,0,.6) !important; color: #555 !important; font-size: 10px !important; }
.fe-vehicle-eta-tooltip {
    background: var(--fe-surface) !important; color: var(--fe-text) !important; border: 1px solid var(--fe-blue) !important;
    border-radius: 6px !important; font-size: 11px !important; font-weight: 700 !important; padding: 2px 6px !important;
    box-shadow: none !important;
}
.fe-vehicle-eta-tooltip::before { border-top-color: var(--fe-blue) !important; }

@media (min-width: 640px) {
    .fe-sheet { max-width: 480px; margin: 0 auto; border-radius: 22px 22px 0 0; }
    .fe-sheet--wide { max-width: 640px; }
}

.fe-sheet--vehicle { max-height: 96vh; }
.fe-sheet--vehicle .fe-sheet__head h2 { font-size: 30px; }
.fe-sheet--vehicle .fe-em-modal-grid { padding: 20px 24px 8px; }
.fe-sheet--vehicle form { padding: 6px 24px 24px !important; }
.fe-sheet--vehicle .fe-besatzung-field input { min-height: 52px; font-size: 17px; }
.fe-sheet--vehicle .fe-chip { min-height: 40px; padding: 9px 16px; font-size: 12px; }

/* ── Atemschutz: Einsatzblock-Kopf + Buttons ── */
.fe-as-einsatz-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.fe-as-einsatz-head__label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--fe-amber); }
.fe-as-einsatz-head__name { font-size: 15px; font-weight: 700; color: var(--fe-text); margin-top: 2px; }
.fe-pill--danger { border-color: var(--fe-red); color: var(--fe-red); }
.fe-pill--info { border-color: var(--fe-blue); color: var(--fe-blue); }
button.fe-pill--danger, button.fe-pill--info { background: var(--fe-surface-2); }

/* ── Atemschutz: Trupp-Karten ── */
.fe-as-trupp-card {
    background: var(--fe-bg);
    border: 1.5px solid var(--fe-border);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
}
.fe-as-trupp-card.is-archived { opacity: 0.6; }
.fe-as-trupp-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.fe-as-trupp-card__nummer { font-size: 15px; font-weight: 700; color: var(--fe-text); }
.fe-as-trupp-card__head-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fe-as-mitglieder-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 4px; }
.fe-as-mitglied-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fe-text); background: var(--fe-surface); border-radius: 20px; padding: 5px 6px 5px 12px; }
.fe-as-trupp-card:has([data-as-timer]) .fe-as-mitglied-chip { cursor: pointer; }
.fe-as-mitglied-remove { background: none; border: none; color: var(--fe-text-muted); font-size: 17px; line-height: 1; cursor: pointer; padding: 2px 4px; }
.fe-as-mitglied-remove:hover { color: var(--fe-red); }
.fe-as-mitglieder-empty-hint { margin: 4px 0; }
.fe-as-card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fe-as-qr-reader { width: 100%; min-height: 220px; border-radius: 12px; overflow: hidden; background: #000; }
.fe-as-qr-reader video { width: 100% !important; border-radius: 12px; }
#at-qr-hint.is-error { color: var(--fe-red); }
#at-qr-hint.is-success { color: var(--fe-green); }

/* ── Dialog-Kopf mit Titel + Schliessen-Button (immer erreichbar, auch wenn
   der Inhalt darunter - z.B. Kamera-Vorschau - scrollt). ── */
.fe-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 20px 24px 0; }
.fe-dialog-head h2 { margin: 0; font-size: 18px; }
dialog .dialog-body { max-height: 72vh; overflow-y: auto; }

/* ── Atemschutz: Zeitmessung-Timer + Druck-Dokumentation ── */
.fe-as-timer { margin-top: 10px; padding: 10px 12px; background: var(--fe-surface); border-radius: 10px; }
.fe-as-timer__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fe-as-timer__remaining { font-size: 22px; font-weight: 700; color: var(--fe-text); font-variant-numeric: tabular-nums; }
.fe-as-timer__remaining.is-overdue { color: var(--fe-red); }
.fe-as-timer__bar { position: relative; height: 6px; border-radius: 3px; background: var(--fe-border); margin-top: 8px; }
.fe-as-timer__bar-fill { height: 100%; background: var(--fe-blue); border-radius: 3px; transition: width .3s; }
.fe-as-timer__bar-marker {
    position: absolute; top: 50%; width: 7px; height: 7px; border-radius: 50%;
    background: var(--fe-surface); border: 1.5px solid var(--fe-text-muted);
    transform: translate(-50%, -50%); pointer-events: none;
}
.fe-as-timer__bar-marker.is-complete { background: var(--fe-green); border-color: var(--fe-green); }
.fe-as-timer__bar-labels { position: relative; height: 14px; }
.fe-as-timer__bar-label {
    position: absolute; top: 2px; transform: translateX(-50%);
    font-size: 10px; font-weight: 700; color: var(--fe-green); white-space: nowrap;
}
.fe-as-timer__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.fe-as-timer-badge { border-color: var(--fe-amber); color: var(--fe-amber); animation: fe-as-badge-pulse 1.6s ease-in-out infinite; }
@keyframes fe-as-badge-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.fe-as-rueckzug-info {
    margin-top: 8px; padding: 8px 10px; border-radius: 8px; font-size: 11px; font-weight: 600;
    background: var(--fe-surface); border: 1px solid var(--fe-border); color: var(--fe-text-muted);
}
.fe-as-rueckzug-info.is-alarm {
    background: color-mix(in srgb, var(--fe-red) 15%, var(--fe-surface)); border-color: var(--fe-red); color: var(--fe-red);
    animation: fe-as-badge-pulse 1.2s ease-in-out infinite;
}
.fe-as-rueckzug-info.is-warning {
    background: color-mix(in srgb, var(--fe-amber) 15%, var(--fe-surface)); border-color: var(--fe-amber); color: var(--fe-amber);
    animation: fe-as-badge-pulse 2s ease-in-out infinite;
}
.fe-as-historie { margin-top: 10px; }
.fe-as-historie summary { cursor: pointer; }
.fe-as-historie__zyklus { padding: 6px 0; border-top: 1px solid var(--fe-border); margin-top: 6px; }
.fe-as-druck-row { padding: 10px 0; border-bottom: 1px solid var(--fe-border); }
.fe-as-druck-row:last-child { border-bottom: none; }
.fe-as-druck-row__name { display: block; font-weight: 600; color: var(--fe-text); margin-bottom: 4px; }
.fe-as-druck-bemerkung {
    width: 100%; min-height: 40px; margin-top: 8px; background: var(--fe-bg); border: 1.5px solid var(--fe-border);
    border-radius: 8px; padding: 8px 10px; color: var(--fe-text); font-size: 14px; font-family: inherit;
}
.fe-as-druck-bemerkung:focus { border-color: var(--fe-accent); outline: none; }
.fe-as-druck-status { margin: 4px 0 0; }
.fe-as-druck-status.is-error { color: var(--fe-red); }
.fe-as-druck-history { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.fe-as-druck-history li {
    display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--fe-text-muted);
    background: var(--fe-bg); border: 1px solid var(--fe-border); border-radius: 8px; padding: 5px 10px;
}
.fe-as-druck-history li span:first-child { color: var(--fe-text); font-weight: 600; }
.fe-as-beendete-liste { margin-top: 10px; }
.fe-as-rueckmeldungen-list { list-style: none; margin: 6px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.fe-as-rueckmeldungen-list li { display: flex; flex-direction: column; gap: 2px; background: var(--fe-surface); border-radius: 8px; padding: 6px 10px; }
.fe-as-rueckmeldung__meta { font-size: 11px; color: var(--fe-text-muted); }
.fe-as-rueckmeldung__text { font-size: 14px; color: var(--fe-text); word-break: break-word; }
.fe-as-rueckmeldung-form { display: flex; align-items: stretch; gap: 8px; margin-top: 12px; }
.fe-as-rueckmeldung-input {
    flex: 1; min-width: 0; min-height: 44px;
    background: var(--fe-surface); border: 1.5px solid var(--fe-border); border-radius: 8px;
    padding: 8px 12px; color: var(--fe-text); font-size: 14px; font-family: inherit;
}
.fe-as-rueckmeldung-input:focus { border-color: var(--fe-accent); outline: none; }
.fe-as-rueckmeldung-form .fe-btn { width: auto; min-height: 44px; flex-shrink: 0; }

/* ── Atemschutz auf schmalen Handy-Bildschirmen: Kopf- und Aktionszeilen
   untereinander statt nebeneinander gequetscht, damit nichts abgeschnitten
   wird oder ineinander rutscht (Laptop/Tablet nutzt die Zeilen weiterhin
   nebeneinander, siehe Basis-Regeln oben). ── */
@media (max-width: 420px) {
    .fe-as-trupp-card__head { flex-direction: column; align-items: flex-start; gap: 8px; }
    .fe-as-trupp-card__head-actions { width: 100%; }
    .fe-as-trupp-card__head-actions form { width: 100%; }
    .fe-as-trupp-card__head-actions form .fe-pill,
    .fe-as-trupp-card__head-actions > .fe-kanban-add-btn { width: 100%; justify-content: center; }
    .fe-as-card-actions { flex-direction: column; }
    .fe-as-card-actions .fe-pill { width: 100%; justify-content: center; text-align: center; }
    .fe-as-timer__row { flex-wrap: wrap; row-gap: 8px; }
    .fe-as-timer__row form { width: 100%; }
    .fe-as-timer__row form .fe-pill { width: 100%; justify-content: center; }
}

/* ── Durchsuchbares Dropdown (Fahrzeugtyp-Katalog, z.B. Fremdfahrzeug anlegen)
   - gleiches Markup/Verhalten wie im Backend (siehe backend.css/backend.js),
   hier mit den Frontend-Design-Tokens (hell/dunkel) statt Bootstrap. ── */
.searchable-select { position: relative; }
.searchable-select__toggle {
    width: 100%; min-height: 48px; text-align: left; cursor: pointer;
    background: var(--fe-bg); border: 1.5px solid var(--fe-border); border-radius: 10px;
    padding: 13px 14px; color: var(--fe-text); font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.searchable-select__toggle:focus { outline: none; border-color: var(--fe-accent); }
.searchable-select__native {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.searchable-select__panel {
    position: absolute; z-index: 60; top: calc(100% + 4px); left: 0; right: 0;
    display: flex; flex-direction: column; gap: 6px;
    background: var(--fe-surface); border: 1.5px solid var(--fe-border); border-radius: 10px;
    box-shadow: 0 8px 28px rgba(0,0,0,.35); padding: 8px; max-height: 280px;
}
.searchable-select__search {
    width: 100%; min-height: 40px; background: var(--fe-bg); border: 1.5px solid var(--fe-border);
    border-radius: 8px; padding: 8px 12px; color: var(--fe-text); font-size: 14px; font-family: inherit;
}
.searchable-select__search:focus { outline: none; border-color: var(--fe-accent); }
.searchable-select__list { overflow-y: auto; }
.searchable-select__group-label {
    font-size: 10px; text-transform: uppercase; font-weight: 700; letter-spacing: 0.5px;
    color: var(--fe-text-muted); padding: 8px 8px 3px;
}
.searchable-select__item {
    display: block; width: 100%; text-align: left; background: none; border: none;
    padding: 8px; border-radius: 6px; font-size: 14px; color: var(--fe-text); cursor: pointer;
}
.searchable-select__item:hover, .searchable-select__item:focus { background: var(--fe-surface-2); outline: none; }
