/* ══ Einsatzprotokoll: Regeln des Bereichs ═════════════════════════
   Aus public/einsatzprotokoll/style.css übernommen (Verschmelzung M2, siehe
   docs/verschmelzung-oberflaeche.md). Alle Regeln gelten nur unter
   .bereich-einsatz; Kopfzeile, Menü, Anmeldung, Meldungen und Rückfragen
   kommen aus public/style.css.
   Regeln wie dort: nur Tokens, Größen in rem, bevorzugt iPad. Ab 960 px
   (iPad quer) Lage links haftend, Fahrzeuge mit Besatzung rechts.
   ═══════════════════════════════════════════════════════════════ */

/* Lange Wörter dürfen das Layout nie sprengen */
.bereich-einsatz .h-title,
.bereich-einsatz .u-name,
.bereich-einsatz .u-role,
.bereich-einsatz .fz-name {
  hyphens: auto;
  overflow-wrap: anywhere;
}

/* ── Kopfzeile ────────────────────────────────────────────────── */

/* Geräte-Anmeldung: auf LF10/GW dauerhaft sichtbar, unter welcher Kennung
   erfasst wird. Auf persönlichen Anmeldungen bleibt das Feld leer. */

/* ── Formular ─────────────────────────────────────────────────── */
.bereich-einsatz .card-form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bereich-einsatz .field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bereich-einsatz .row-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.bereich-einsatz .row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
/* Handy: drei Auswahlfelder sind zu schmal; zwei nebeneinander, das dritte darunter */
@media (max-width: 559px) {
  .bereich-einsatz .row-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bereich-einsatz .row-3 > :last-child:nth-child(3) { grid-column: 1 / -1; }
}
.bereich-einsatz .field > label,
.bereich-einsatz #user-dialog .field label {
  font-family: var(--display);
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
}
.bereich-einsatz input[type="date"],
.bereich-einsatz input[type="time"],
.bereich-einsatz input[type="text"],
.bereich-einsatz input[type="password"],
.bereich-einsatz input[type="search"],
.bereich-einsatz input[type="number"],
.bereich-einsatz select,
.bereich-einsatz textarea {
  width: 100%;
  font: inherit;
  font-size: 16px;            /* 16 px verhindert den Zoom auf iOS */
  padding: 12px 14px;
  min-height: 48px;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .15s;
}
@media (min-width: 700px) {
  /* Ab 18 px Basis mitwachsen; unter 16 px fällt die Schrift ohnehin nicht. */
  .bereich-einsatz input[type="date"],
.bereich-einsatz input[type="time"],
.bereich-einsatz input[type="text"],
.bereich-einsatz input[type="password"],
.bereich-einsatz input[type="search"],
.bereich-einsatz input[type="number"],
.bereich-einsatz select,
.bereich-einsatz textarea { font-size: 1rem; }
}
.bereich-einsatz input::placeholder,
.bereich-einsatz textarea::placeholder { color: var(--muted); opacity: .8; }
.bereich-einsatz select {
  /* Pfeil als Maske, damit er die Textfarbe des Satzes annimmt */
  background-image: none;
  padding-right: 40px;
}
.bereich-einsatz .field:has(> select),
.bereich-einsatz .pw-select { position: relative; }
.bereich-einsatz .field:has(> select)::after,
.bereich-einsatz .pw-select::after {
  content: '';
  position: absolute;
  right: 14px;
  bottom: 18px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}
.bereich-einsatz textarea { resize: vertical; min-height: 48px; line-height: 1.4; }
.bereich-einsatz input:focus,
.bereich-einsatz select:focus,
.bereich-einsatz textarea:focus { outline: none; border-color: var(--red); }
.bereich-einsatz input:focus-visible,
.bereich-einsatz select:focus-visible,
.bereich-einsatz textarea:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
  border-color: var(--red);
}
.bereich-einsatz input:disabled,
.bereich-einsatz select:disabled { opacity: .55; }

/* Combobox (Eingabe mit Liste) */
.bereich-einsatz .combo { position: relative; }
.bereich-einsatz .combo input[type="text"] { padding-right: 48px; }
.bereich-einsatz .combo-toggle {
  position: absolute;
  right: 2px; top: 2px; bottom: 2px;
  width: 44px;
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  border-radius: 3px;
}
.bereich-einsatz .combo-toggle:active { background: var(--press); }
.bereich-einsatz .combo-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bereich-einsatz .combo-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--card);
  border: 1px solid var(--line-2);
  border-radius: 4px;
  list-style: none;
  padding: 4px 0;
  max-height: 16rem;
  overflow-y: auto;
  z-index: 60;
}
.bereich-einsatz .combo-item {
  padding: 12px 14px;
  min-height: 44px;
  cursor: pointer;
  color: var(--text);
}
.bereich-einsatz .combo-item:active { background: var(--press); }

/* ── Kleine Knöpfe der App = .btn-sm der Einsatztafel ──────────── */
.bereich-einsatz .chip {
  background: none;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 6px 12px;
  min-height: 40px;
  font-family: var(--display);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.bereich-einsatz .chip:active { background: var(--card-2); }
.bereich-einsatz .chip-danger { color: var(--err-text); border-color: var(--danger-line); }
.bereich-einsatz .chip-danger:active { background: var(--tint-bad); }

/* Kleine Knöpfe der App = .btn-sm der Einsatztafel */
.bereich-einsatz .chip {
  background: none;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  padding: 6px 12px;
  min-height: 44px;
  font-family: var(--display);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.bereich-einsatz .chip:active { background: var(--card-2); }
.bereich-einsatz .chip:disabled { opacity: .45; cursor: default; }

/* Abschnittstitel im Formular */
.bereich-einsatz .section-h {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 8px;
}
.bereich-einsatz .ep-lage > .section-h:first-child,
.bereich-einsatz .ep-kraefte > .section-h:first-child { margin-top: 0; }
.bereich-einsatz .muted { color: var(--muted); font-weight: 400; }

/* ── Erfassung: Lage und Kräfte ───────────────────────────────── */
.bereich-einsatz .ep-form { display: flex; flex-direction: column; gap: var(--gap); }
.bereich-einsatz .ep-kraefte { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.bereich-einsatz .ep-kraefte > .chip { align-self: flex-start; }
.bereich-einsatz #ffen-checklist { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 18px; }

/* Abgeschlossen oder nur lesen: Felder bleiben gut lesbar */
.bereich-einsatz #form-einsatz input:disabled,
.bereich-einsatz #form-einsatz select:disabled,
.bereich-einsatz #form-einsatz textarea:disabled {
  background: var(--card-2);
  color: var(--text);
  opacity: 1;
}

/* Live-Status über dem Formular (Einsatztafel .notice) */
.bereich-einsatz .live-banner {
  margin: 0 0 var(--gap);
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-left-width: 4px;
  border-radius: 4px;
  background: var(--card-2);
  font-size: .95rem;
}
.bereich-einsatz .live-banner.open { border-color: var(--green); background: linear-gradient(var(--tint-ok), var(--tint-ok)) var(--card); }
.bereich-einsatz .live-banner.open strong { color: var(--fb-ok); }

/* Fahrzeugkarte: Kopf als Auswahlzeile, eingesetzt = roter Rand */
.bereich-einsatz .fahrzeuge-list { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.bereich-einsatz .fahrzeug-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .12s;
}
.bereich-einsatz .fahrzeug-card:has(.fahrzeug-head input:checked) { border-color: var(--sel-line); }
.bereich-einsatz .fahrzeug-head .tag-check-row { min-height: 56px; padding: 6px 14px; }
.bereich-einsatz .fahrzeug-head strong {
  font-family: var(--display);
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.bereich-einsatz .fahrzeug-body { padding: 4px 14px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.bereich-einsatz .fahrzeug-body > .row-2 { margin-top: 10px; }
.bereich-einsatz .subsection-title {
  font-family: var(--display);
  font-size: .9rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .1em;
}
/* Positionskacheln: Kürzel als Kachel, Name daneben */
.bereich-einsatz .besatzung-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
  gap: 8px 14px;
}
.bereich-einsatz .besatzung-row { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); gap: 8px; align-items: stretch; }
.bereich-einsatz .pos-label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  background: var(--card-2);
  border: 2px solid var(--line-2);
  border-radius: 4px;
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.bereich-einsatz .besatzung-row:has(.personenwahl.belegt) .pos-label { border-color: var(--sel-line); background: var(--sel-bg); }
/* Personenwahl: Auswahlliste, bei „Andere …“ darunter das Textfeld */
.bereich-einsatz .personenwahl { display: grid; gap: 8px; min-width: 0; align-content: start; }
.bereich-einsatz .personenwahl select { text-overflow: ellipsis; }

/* Atemschutz und Kennzeichen: Name | Minuten | Entfernen */
.bereich-einsatz .pa-list,
.bereich-einsatz .ver-list { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.bereich-einsatz .pa-row { display: grid; grid-template-columns: minmax(0, 1fr) 5.5rem 44px; gap: 8px; align-items: center; }
.bereich-einsatz .ver-list .pa-row { grid-template-columns: minmax(0, 1fr) 44px; }
/* Hinweis aus dem Modul Atemschutz unter dem PA-Träger; blockiert nichts */
.bereich-einsatz .pa-hinweis {
  grid-column: 1 / -1;
  margin-top: -2px;
  padding: 4px 10px;
  border-left: 3px solid var(--line-2);
  border-radius: 2px;
  font-size: .88rem;
}
.bereich-einsatz .pa-hinweis.warn { border-left-color: var(--orange); background: var(--warn-tint); }
.bereich-einsatz .pa-hinweis.warn::before { content: '!\00a0'; font-weight: 700; color: var(--orange); }
.bereich-einsatz .pa-hinweis.info { color: var(--muted); }
.bereich-einsatz .ver-list .pa-row > span { display: none; }
.bereich-einsatz .icon-btn.icon-danger { color: var(--err-text); border-color: var(--danger-line); }
.bereich-einsatz .icon-btn.icon-danger:active { background: var(--tint-bad); }
.bereich-einsatz .icon-btn:disabled { opacity: .45; cursor: default; }

/* ── Untere Aktionsleiste ─────────────────────────────────────── */
.bereich-einsatz .action-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 12px var(--gap) calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 40;
}
.bereich-einsatz .action-row {
  display: flex;
  gap: 10px;
  max-width: 1120px;
  margin: 0 auto;
}
.bereich-einsatz .action-row .btn-primary { flex: 1; }
.bereich-einsatz .action-row .btn-secondary { flex: 0 0 auto; min-width: 56px; }
/* Detailansicht: Zurück und E-Mail als Symbol, Löschen füllt den Rest */
.bereich-einsatz #action-detail .btn-danger { flex: 1 1 auto; }
/* Symbolknöpfe in der Leiste: volle Knopfhöhe, quadratisch genug für den Daumen */
.bereich-einsatz .btn-icon { padding-left: 0; padding-right: 0; min-width: 64px; }
.bereich-einsatz .btn-icon svg,
.bereich-einsatz .history-item .h-edit svg,
.bereich-einsatz .icon-btn svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
/* Löschen: umrandeter Knopf in Fehlerfarbe (Einsatztafel .btn-danger) */
.bereich-einsatz .btn-danger {
  display: flex; align-items: center; justify-content: center;
  background: transparent;
  border: 2px solid var(--danger-line);
  border-radius: 4px;
  padding: 12px 20px;
  min-height: 52px;
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
}
.bereich-einsatz .dialog-actions .btn-primary,
.bereich-einsatz .dialog-actions .btn-secondary,
.bereich-einsatz .dialog-actions .btn-danger { flex: 1; }

/* Erfassung: ohne Speichern (Live) füllt Abschließen den Platz */
.bereich-einsatz #action-edit .btn-danger,
.bereich-einsatz #action-edit #btn-abschliessen { flex: 1 1 auto; }

/* ── Verlauf ──────────────────────────────────────────────────── */
.bereich-einsatz .history-list,
.bereich-einsatz .users-list {
  list-style: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}
.bereich-einsatz .history-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  align-items: stretch;
  overflow: hidden;
}
.bereich-einsatz .history-item .h-main { flex: 1; min-width: 0; padding: 14px 16px; cursor: pointer; }
.bereich-einsatz .history-item .h-main:active { background: var(--press); }
.bereich-einsatz .history-item .h-edit {
  flex: 0 0 auto;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-family: var(--display);
  font-size: .95rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 0 18px;
  min-width: 60px;
  cursor: pointer;
}
.bereich-einsatz .history-item .h-edit:active { background: var(--press); }
.bereich-einsatz .history-item .h-date { font-size: .85rem; color: var(--muted); margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.bereich-einsatz .history-item .h-title {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 8px;
}
.bereich-einsatz .history-item .h-meta {
  display: flex;
  gap: 6px 12px;
  font-size: .85rem;
  color: var(--muted);
  flex-wrap: wrap;
  align-items: center;
}
.bereich-einsatz .history-item .h-del { color: var(--err-text); }
.bereich-einsatz .history-item .h-del:active { background: var(--tint-bad); }
/* Status: Farbe UND Wort */
.bereich-einsatz .status-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 0 8px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  font-family: var(--display);
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.bereich-einsatz .status-badge.open { border-color: var(--green); background: var(--tint-ok); color: var(--fb-ok); }
.bereich-einsatz .status-badge.closed { background: var(--card-2); color: var(--muted); }
/* Nachgetragen: Herkunftshinweis, keine Warnung */
.bereich-einsatz .status-badge.migriert { background: transparent; color: var(--muted); font-weight: 600; }

.bereich-einsatz .empty { text-align: center; color: var(--muted); margin-top: 40px; }
.bereich-einsatz .empty-small { color: var(--muted); font-size: .9rem; }

/* ── Meldung (Toast) ──────────────────────────────────────────── */

/* Tints sind durchscheinend; über dem Inhalt brauchen sie eine deckende Karte */

/* ── Dialoge ──────────────────────────────────────────────────── */
.bereich-einsatz .dialog {
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  padding: 20px 18px;
  width: min(92vw, 24rem);
  max-height: 90vh;
  overflow-y: auto;
  margin: auto;
}
.bereich-einsatz .dialog::backdrop { background: rgba(0, 0, 0, .55); }
.bereich-einsatz .dialog form { display: flex; flex-direction: column; gap: 12px; }
.bereich-einsatz .dialog h3 {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  line-height: 1.1;
}
.bereich-einsatz .dialog p { font-size: .95rem; color: var(--muted); }
.bereich-einsatz .dialog-actions { display: flex; gap: 10px; margin-top: 4px; }

.bereich-einsatz .hint {
  padding: 10px 12px;
  font-size: .88rem;
  color: var(--text);
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.bereich-einsatz #user-dialog { width: min(92vw, 28rem); }

/* Ankreuzfelder außerhalb der Teilnehmerliste */
.bereich-einsatz .check-row,
.bereich-einsatz .tag-check-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  cursor: pointer;
}
.bereich-einsatz .check-row input[type="checkbox"],
.bereich-einsatz .tag-check-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  min-height: 0;
  padding: 0;
  border: 2px solid var(--line-2);
  border-radius: 3px;
  background: transparent;
  cursor: pointer;
  position: relative;
  flex: 0 0 auto;
  margin: 0;
}
.bereich-einsatz .check-row input[type="checkbox"]:checked,
.bereich-einsatz .tag-check-row input[type="checkbox"]:checked {
  background: var(--btn);
  border-color: var(--btn);
}
.bereich-einsatz .check-row input[type="checkbox"]:checked::after,
.bereich-einsatz .tag-check-row input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 6px; top: 2px;
  width: 6px; height: 11px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg);
}
.bereich-einsatz .tag-checklist { list-style: none; display: flex; flex-direction: column; gap: 2px; }

/* ── Anmeldung ────────────────────────────────────────────────── */

/* Warnstreifen Fluor-Lime/Rot wie die Fahrzeugmarkierung: unter der Kopfzeile
   und über der Anmeldekarte. Harte Kanten, kein Farbverlauf. */

/* ── Menü-Blatt ───────────────────────────────────────────────── */

/* ── Benutzer, Stammdaten ─────────────────────────────────────── */
.bereich-einsatz .user-item {
  flex-wrap: wrap;            /* Knöpfe rutschen auf dem Handy unter den Namen */
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.bereich-einsatz .u-info { min-width: min(9rem, 100%); flex: 1 1 9rem; }
.bereich-einsatz .u-name { font-weight: 600; }
.bereich-einsatz .u-role { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.bereich-einsatz .u-actions { display: flex; gap: 6px; justify-content: flex-end; margin-left: auto; }
/* Löschen als Symbol: Fehlerfarbe wie .chip-danger */
.bereich-einsatz .icon-btn.icon-danger { color: var(--err-text); border-color: var(--danger-line); }
.bereich-einsatz .icon-btn.icon-danger:active { background: var(--tint-bad); }

/* ── Benutzer, Stammdaten ─────────────────────────────────────── */
.bereich-einsatz .user-item {
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.bereich-einsatz .u-info { min-width: min(9rem, 100%); flex: 1 1 9rem; }
.bereich-einsatz .u-name { font-weight: 600; }
.bereich-einsatz .u-role { font-size: .85rem; color: var(--muted); margin-top: 2px; }
.bereich-einsatz .u-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; margin-left: auto; }
.bereich-einsatz #view-fahrzeuge > .btn-primary,
.bereich-einsatz #view-ffen > .btn-primary,
.bereich-einsatz #view-users > .btn-primary,
.bereich-einsatz #view-webhooks > .btn-primary,
.bereich-einsatz #view-geraete > .btn-primary { width: auto; margin: 12px 0 14px !important; }
.bereich-einsatz #view-webhooks > .hint,
.bereich-einsatz #view-geraete > .hint { margin-bottom: 4px; }
.bereich-einsatz .hint code { font-size: .85em; }

/* Einrichtungs-Dialog für Geräte. Der QR-Code braucht hellen Grund zum Scannen. */
.bereich-einsatz .enroll-qr {
  display: flex;
  justify-content: center;
  min-height: 220px;
  margin: 14px 0;
  padding: 12px;
  background: #fff;
  border-radius: 4px;
}
.bereich-einsatz .enroll-qr img,
.bereich-einsatz .enroll-qr canvas { display: block; }
.bereich-einsatz .enroll-link { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem !important; }
.bereich-einsatz #enroll-dialog { display: none; }
.bereich-einsatz #enroll-dialog[open] { display: flex; flex-direction: column; gap: 10px; }

/* ── Sichtbarkeit nach Rolle ──────────────────────────────────── */
body:not(.ep-admin) .bereich-einsatz .ep-admin-only { display: none !important; }
/* Export + Drucken nur für Admin + Leser (alle, die alle Einsätze sehen) */
body:not(.ep-alle) .bereich-einsatz .ep-alle-only { display: none !important; }

/* ── Hover nur mit Maus ───────────────────────────────────────── */
@media (hover: hover) {
  .bereich-einsatz .chip:hover,
.bereich-einsatz .combo-toggle:hover { border-color: var(--text); }
  .bereich-einsatz .history-item .h-main:hover,
.bereich-einsatz .history-item .h-edit:hover,
.bereich-einsatz .combo-item:hover { background: var(--press); }
  .bereich-einsatz .history-item .h-del:hover { background: var(--tint-bad); }
  .bereich-einsatz .btn-danger:hover { background: var(--tint-bad); }
  .bereich-einsatz .fahrzeug-card:hover { border-color: var(--line-2); }
}

/* ── Verlauf: Monate und Kalenderblatt ────────────────────────── */
/* Monatsüberschrift über die ganze Breite */
.bereich-einsatz .h-monat {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 4px 2px;
  border-bottom: 1px solid var(--line);
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.bereich-einsatz .h-monat:first-child { margin-top: 0; }
.bereich-einsatz .h-monat span { font-size: .85rem; font-weight: 600; color: var(--muted); }
/* Kalenderblatt links im Eintrag */
.bereich-einsatz .h-kachel {
  flex: 0 0 auto;
  width: 3.6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--card-2);
  border-right: 1px solid var(--line);
  font-family: var(--display);
}
.bereich-einsatz .h-kachel .k-tag { font-size: 1.75rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.bereich-einsatz .h-kachel .k-wt { font-size: .8rem; font-weight: 600; letter-spacing: .1em; color: var(--muted); margin-top: 2px; }

/* ── Speicherstatus im Live-Hinweis ───────────────────────────── */
.bereich-einsatz .live-banner.warn { border-color: var(--orange); background: linear-gradient(var(--warn-tint), var(--warn-tint)) var(--card); }
.bereich-einsatz .live-banner.warn strong { color: var(--orange); }
.bereich-einsatz .live-punkt {
  display: inline-block;
  width: 10px; height: 10px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--green);
  vertical-align: 0;
}

/* ── Stärke: eine Kachel je Fahrzeug, dazu die Summe ───────────── */
.bereich-einsatz .staerke-leiste { display: flex; flex-wrap: wrap; gap: 8px; }
.bereich-einsatz .staerke {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 8.5rem;
  min-height: 56px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--card);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
}
.bereich-einsatz .staerke:active { background: var(--press); }
.bereich-einsatz .staerke-summe { background: var(--card-2); border-color: var(--line-2); cursor: default; }
.bereich-einsatz .staerke .s-k {
  font-family: var(--display);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.bereich-einsatz .staerke .s-v {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.bereich-einsatz .fahrzeug-head { display: flex; align-items: center; gap: 8px; padding-right: 14px; }
.bereich-einsatz .fahrzeug-head .tag-check-row { flex: 1; }
.bereich-einsatz .fz-besetzt {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--muted);
  white-space: nowrap;
}
.bereich-einsatz .fahrzeug-card { scroll-margin-top: calc(var(--header-h) + var(--gap)); }

/* Rückfrage-Dialog (statt confirm/alert) */

/* Meldung mit "Rückgängig" und ablaufendem Balken */

/* ── Seitenkopf mit Kennzahl ──────────────────────────────────── */
.bereich-einsatz .seitenkopf {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin: 6px 0 14px;
}
.bereich-einsatz .sk-titel {
  font-family: var(--display);
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1;
}
.bereich-einsatz .sk-zahl {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* Kopfzeilen-Titel nur, wenn der große Kopf weggescrollt ist */

/* ── Leerzustand ──────────────────────────────────────────────── */
.bereich-einsatz .leer {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 28px auto;
  max-width: 22rem;
  padding: 24px 18px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  text-align: center;
}
.bereich-einsatz .leer-icon {
  width: 44px; height: 44px;
  fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.bereich-einsatz .leer-titel {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.bereich-einsatz .leer-text { color: var(--muted); font-size: .95rem; }
.bereich-einsatz .leer-aktion { margin-top: 6px; }
.bereich-einsatz .empty:has(.leer) { margin: 0; text-align: left; color: inherit; }

/* ── Bewegung ─────────────────────────────────────────────────────
   Kurz (unter 200 ms) und nur dort, wo sie etwas anzeigt: eine Ansicht
   kommt, ein Haken sitzt, eine Meldung erscheint. Wer am Gerät
   "Bewegung reduzieren" eingestellt hat, bekommt nichts davon. */
@media (prefers-reduced-motion: no-preference) {
  .bereich-einsatz .view:not(.hidden) { animation: ansicht-ein .18s ease-out; }
  @keyframes ansicht-ein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

  
  @keyframes meldung-ein { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

  .bereich-einsatz dialog[open] { animation: dialog-ein .16s ease-out; }
  .bereich-einsatz dialog[open]::backdrop { animation: abdunkeln .16s ease-out; }
  @keyframes dialog-ein { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
  @keyframes abdunkeln { from { opacity: 0; } to { opacity: 1; } }

  .bereich-einsatz .tag-check-row input[type="checkbox"]:checked::after,
.bereich-einsatz .check-row input[type="checkbox"]:checked::after { animation: haken-sitzt .16s ease-out; }
  @keyframes haken-sitzt { from { transform: rotate(45deg) scale(.3); opacity: 0; } to { transform: rotate(45deg) scale(1); opacity: 1; } }

  .bereich-einsatz .fahrzeug-body { animation: aufklappen .18s ease-out; }
  @keyframes aufklappen { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
  .bereich-einsatz .fahrzeug-card { transition: border-color .15s; }
  /* Live-Punkt atmet langsam: zeigt, dass die Verbindung steht */
  .bereich-einsatz .live-punkt { animation: atmen 2.4s ease-in-out infinite; }
  @keyframes atmen { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
  .bereich-einsatz .staerke .s-v.tick { animation: zaehler .22s ease-out; }
  @keyframes zaehler { 0% { color: var(--text); } 40% { transform: translateY(-2px); } 100% { transform: none; } }
}

/* ══ Responsive ═══════════════════════════════════════════════════ */

/* Handy quer: wenig Höhe, deshalb haftet nichts */
@media (max-height: 480px) and (orientation: landscape) {
  
  .bereich-einsatz .action-bar { position: static; padding-bottom: 12px; }
  
  
}

/* iPad hochkant: Lage paarweise, Listen zweispaltig */
@media (min-width: 700px) {
  
  .bereich-einsatz .card-form { padding: 24px; }
  .bereich-einsatz .ep-lage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px 18px;
    align-items: start;
  }
  .bereich-einsatz .ep-lage > * { grid-column: 1 / -1; }
  .bereich-einsatz .ep-lage > .field:has(#alarmierte-einheit),
.bereich-einsatz .ep-lage > .field:has(#einsatzort),
.bereich-einsatz .ep-lage > .field:has(#einsatzgrund),
.bereich-einsatz .ep-lage > .field:has(#einsatzleiter) { grid-column: auto; }
  .bereich-einsatz #ffen-checklist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bereich-einsatz .pa-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
  .bereich-einsatz .history-list,
.bereich-einsatz .users-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  
  
}

/* iPad quer: Lage links (haftet, scrollt für sich), Kräfte rechts */
@media (min-width: 960px) {
  
  .bereich-einsatz .ep-form {
    display: grid;
    grid-template-columns: minmax(19rem, 24rem) minmax(0, 1fr);
    column-gap: 24px;
    align-items: start;
  }
  .bereich-einsatz .ep-lage {
    display: flex;
    align-items: stretch;   /* aus der 700-px-Regel kommt start: Felder wären zu schmal */
    position: sticky;
    top: calc(var(--header-h) + var(--gap));
    max-height: calc(100vh - var(--header-h) - var(--footer-h) - 2 * var(--gap));
    overflow-y: auto;
  }
  .bereich-einsatz #ffen-checklist { grid-template-columns: minmax(0, 1fr); }
  .bereich-einsatz .pa-list { grid-template-columns: minmax(0, 1fr); }
  .bereich-einsatz .besatzung-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bereich-einsatz .history-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1280px) {
  .bereich-einsatz .pa-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Leiste ausblenden, wenn die Ansicht keine Aktionen hat (Verwaltung) */
.bereich-einsatz .action-bar:not(:has(.action-row:not(.hidden))) { display: none; }
