/* ============================================================
   Atemschutztafel – Stylesheet
   Design-Prämisse: Ablesbarkeit auf Armlänge, Bedienung mit
   Handschuhen, alles Wesentliche ohne Scrollen auf einem iPad.
   Farbwelt nach Stadt Zwickau / ASÜ-Logo: Weiß als Grundfläche,
   Zwickau-Rot für Aktionen, Logo-Blau für Marke und Fokus.
   Die Ampel (Statuskante + Kontakt-Timer) bleibt immer das
   lauteste Element der Oberfläche.
   ============================================================ */

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/barlow-400.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/barlow-500.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/barlow-700.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url("../fonts/barlow-800.woff2") format("woff2");
}

:root {
  --bg: #f1f3f6;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --surface-3: #eceef1;
  --line: #d8dde4;
  --line-stark: #b7bfca;
  --text: #171c24;
  --muted: #5d6773;
  --ok: #178a50;
  --warn: #a85e00;   /* kontrastgeprüft auf Weiß (≥ 4,5:1) */
  --crit: #d31111;
  --akzent: #d3202a;          /* Zwickau-Rot: Aktionen */
  --brand: #27308f;           /* Logo-Blau: Marke + Fokus */
  --ok-flaeche: rgba(23, 138, 80, .1);
  --warn-flaeche: rgba(168, 94, 0, .12);
  --crit-flaeche: rgba(211, 17, 17, .09);
  --statusbar-h: 72px;
  --schatten: 0 2px 10px rgba(23, 28, 36, .08);
  --radius: 12px;
  --radius-klein: 9px;
  --touch: 48px;              /* Mindesthöhe für Handschuh-Bedienung */
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0c1015;
  --surface: #151b23;
  --surface-2: #1d2530;
  --surface-3: #26303d;
  --line: #2b3543;
  --line-stark: #3b4757;
  --text: #f2f5f9;
  --muted: #93a0b0;
  --ok: #2fbf71;
  --warn: #ffb020;
  --crit: #ff453a;
  --akzent: #e8433c;
  --brand: #9aa3ff;
  --ok-flaeche: rgba(47, 191, 113, .12);
  --warn-flaeche: rgba(255, 176, 32, .14);
  --crit-flaeche: rgba(255, 69, 58, .14);
  --schatten: 0 4px 16px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: "Barlow", -apple-system, "Segoe UI", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.3;
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(var(--statusbar-h) + 10px);
  -webkit-tap-highlight-color: transparent;
}

body.kein-scroll { overflow: hidden; }

/* Ziffern (Uhr, Timer, Druck) immer gleichbreit */
.uhr, .kontakt-timer, .slot-druck, .slot-zeit, .druck-btn, output {
  font-variant-numeric: tabular-nums;
}

input:focus-visible, select:focus-visible, button:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 1px;
}

/* ---------- Fehlerbanner (Speichern fehlgeschlagen) ---------- */

.fehler-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 60;
  background: var(--crit);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
  text-align: center;
  padding: 10px calc(16px + env(safe-area-inset-right)) 10px calc(16px + env(safe-area-inset-left));
}

.zeit-banner {
  position: fixed;
  top: 0; left: 50%;
  transform: translateX(-50%);
  z-index: 59;
  background: var(--warn);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border-radius: 0 0 10px 10px;
  padding: 8px 18px;
  max-width: 90vw;
  text-align: center;
}

/* ---------- Topbar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: calc(6px + env(safe-area-inset-top)) calc(14px + env(safe-area-inset-right)) 6px calc(14px + env(safe-area-inset-left));
  background: var(--surface);
  border-bottom: 2px solid var(--akzent);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-mark {
  width: 44px; height: 44px;
  flex: none;
  border-radius: 10px;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.12; min-width: 0; }
.brand-text strong {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: var(--brand);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand-text span { font-size: 12px; color: var(--muted); }

.mode-switch {
  display: flex;
  margin-left: auto;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-klein);
  padding: 3px;
  gap: 3px;
}
.mode-switch button {
  font: inherit;
  font-weight: 700;
  min-height: 48px;
  padding: 0 16px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.mode-switch button.aktiv { background: var(--akzent); color: #fff; }

.topbar-rechts { display: flex; align-items: center; gap: 10px; }
/* Ohne Modus-Umschalter (CBRN abgeschaltet) rückt die Uhr nach rechts */
.mode-switch[hidden] + .topbar-rechts { margin-left: auto; }

.uhr {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: .03em;
}

.icon-btn {
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-klein);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 20px;
  line-height: 1;
}
.icon-btn svg { width: 22px; height: 22px; }
.ic-sonne { display: none; }
.ic-mond { display: block; }
[data-theme="dark"] .ic-sonne { display: block; }
[data-theme="dark"] .ic-mond { display: none; }

/* ---------- Kopfdaten ---------- */

.kopfdaten {
  display: grid;
  grid-template-columns: 2fr 1fr 1.4fr 1.4fr auto;
  gap: 8px;
  padding: 7px calc(14px + env(safe-area-inset-right)) 7px calc(14px + env(safe-area-inset-left));
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

/* Label sitzt IM Feldrahmen – spart eine ganze Zeile Höhe */
.feld {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-klein);
  padding-left: 10px;
  min-height: 44px;
}
.feld > span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  white-space: nowrap;
}

.feld input[type="text"] {
  font: inherit;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: none;
  min-height: 42px;
  padding: 0 10px 0 4px;
  width: 100%;
  min-width: 0;
}
.feld input[type="text"]:focus-visible { outline-offset: -3px; border-radius: var(--radius-klein); }

.feld-beginn output {
  display: grid;
  place-items: center;
  min-height: 42px;
  min-width: 64px;
  padding: 0 12px 0 6px;
  font-size: 18px;
  font-weight: 800;
}

/* ---------- Trupp-Liste ---------- */

.trupp-liste {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px calc(14px + env(safe-area-inset-right)) 0 calc(14px + env(safe-area-inset-left));
}

.leer-hinweis {
  margin: 36px auto 8px;
  max-width: 520px;
  text-align: center;
  color: var(--muted);
  font-size: 17px;
}
.leer-hinweis strong { color: var(--text); }

/* ---------- Trupp-Karte ---------- */

.trupp {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--schatten);
  padding: 8px 12px 8px 22px;
  overflow: hidden;
}

/* Signatur: die Ampel als durchgehende Statuskante */
.trupp::before {
  content: "";
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 12px;
  background: var(--line-stark);
}
.trupp.st-ok::before   { background: var(--ok); }
.trupp.st-warn::before { background: var(--warn); }
.trupp.st-crit::before { background: var(--crit); }

.trupp.st-fehler::before { background: var(--crit); }
.trupp.st-warn { border-color: var(--warn); }
.trupp.st-crit, .trupp.st-fehler { border-color: var(--crit); animation: puls-crit 1.6s ease-in-out infinite; }

@keyframes puls-crit {
  0%, 100% { box-shadow: var(--schatten), 0 0 0 0 rgba(211, 17, 17, 0); }
  50%      { box-shadow: var(--schatten), 0 0 0 6px rgba(211, 17, 17, .3); }
}

.trupp.st-done { opacity: .58; }
.trupp.st-done::before { background: var(--line-stark); }

/* Kopfzeile der Karte: Identität + Mitglieder + Status in EINER Zeile */

.trupp-kopf {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.trupp-kopf select, .trupp-kopf input[type="text"] {
  font: inherit;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-klein);
  min-height: 48px;
  padding: 0 10px;
}

.sel-funkruf {
  font-size: 18px !important;
  font-weight: 800;
  min-width: 96px;
}
.sel-feuerwehr { min-width: 78px; font-weight: 700; }
.inp-geraet { width: 100px; }
.inp-frei { width: 104px; }

.inp-mitglied { flex: 1 1 104px; min-width: 92px; max-width: 200px; font-weight: 500; }
.inp-mitglied.inp-tf { font-weight: 700; }  /* Truppführer fett, wie in der Live-App */

.trupp-status {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kontakt-timer {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 4px 12px;
  border-radius: var(--radius-klein);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.kontakt-timer .kt-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); max-width: 120px; line-height: 1.15; }
.kontakt-timer .kt-wert { font-size: 25px; font-weight: 800; line-height: 1.15; }
.st-ok   .kontakt-timer { background: var(--ok-flaeche); border-color: var(--ok); }
.st-ok   .kontakt-timer .kt-wert { color: var(--ok); }
.st-warn .kontakt-timer { background: var(--warn-flaeche); border-color: var(--warn); }
.st-warn .kontakt-timer .kt-wert,
.st-warn .kontakt-timer .kt-label { color: var(--warn); }
.st-crit .kontakt-timer, .st-fehler .kontakt-timer { background: var(--crit-flaeche); border-color: var(--crit); }
.st-crit .kontakt-timer .kt-wert,
.st-crit .kontakt-timer .kt-label,
.st-fehler .kontakt-timer .kt-wert,
.st-fehler .kontakt-timer .kt-label { color: var(--crit); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 2px 12px;
  font-weight: 800;
  border: 1px solid var(--line);
  border-radius: var(--radius-klein);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-size: 15px;
}
.chip small { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.chip.chip-crit { background: var(--crit-flaeche); border-color: var(--crit); color: var(--crit); }
.chip.chip-crit small { color: var(--crit); }

/* Mess-Slots */

.slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 6px;
}

.slot {
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1px;
  min-height: 58px;
  padding: 5px 8px;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-klein);
  color: var(--text);
  cursor: pointer;
}
.slot:active { background: var(--surface-3); }

.slot-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  white-space: nowrap;
}

.slot-gesperrt {
  opacity: .45;
  cursor: default;
}
.slot-gesperrt .slot-plus { color: var(--muted); }

.slot-zeit { font-size: 13px; font-weight: 500; color: var(--muted); }
.slot-druck { font-size: 21px; font-weight: 800; line-height: 1.1; }
.slot-druck small { font-size: 12px; font-weight: 700; color: var(--muted); }

.slot.slot-leer .slot-plus {
  font-size: 21px;
  font-weight: 500;
  color: var(--akzent);
  line-height: 1.15;
}
.slot.slot-leer .slot-soll { font-size: 12px; color: var(--muted); }
.slot.slot-ueberfaellig { border-color: var(--warn); background: var(--warn-flaeche); }
.slot.slot-ueberfaellig .slot-soll { color: var(--warn); font-weight: 700; }
.slot.slot-aktiv { border-color: var(--akzent); outline: 2px solid var(--akzent); }

.slot-mehr {
  min-height: 58px;
  border: 1px dashed var(--line-stark);
  border-radius: var(--radius-klein);
  background: transparent;
  color: var(--akzent);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

/* ---------- Bottom-Sheet: Druck-/Zeitauswahl, gleitet iOS-artig
   von unten herein. Backdrop bewusst hell, damit die Ampeln der
   Karten sichtbar bleiben. ---------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(12, 16, 21, .3);
  opacity: 0;
  transition: opacity .28s ease;
}
.sheet-backdrop.offen { opacity: 1; }

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 71;
  background: var(--surface);
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
  box-shadow: 0 -10px 34px rgba(12, 16, 21, .28);
  padding: 6px 16px calc(14px + env(safe-area-inset-bottom)) 16px;
  max-height: 62vh;
  overflow-y: auto;
  transform: translateY(105%);
  transition: transform .32s cubic-bezier(.32, .72, .33, 1);
}
.sheet.offen { transform: translateY(0); }

.sheet-grabber {
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: var(--line-stark);
  margin: 4px auto 10px;
}

/* Ampeln aller aktiven Trupps bleiben im Sheet sichtbar */
.sheet-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.sheet-status .ss {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-variant-numeric: tabular-nums;
}
.sheet-status .ss b { font-size: 15px; }
.sheet-status .ss.st-ok   { border-color: var(--ok); color: var(--ok); background: var(--ok-flaeche); }
.sheet-status .ss.st-warn { border-color: var(--warn); color: var(--warn); background: var(--warn-flaeche); }
.sheet-status .ss.st-crit,
.sheet-status .ss.st-fehler { border-color: var(--crit); color: var(--crit); background: var(--crit-flaeche); }

.editor-warnbox {
  margin-top: 10px;
  padding: 12px;
  border: 2px solid var(--crit);
  border-radius: var(--radius-klein);
  background: var(--crit-flaeche);
}
.editor-warnbox p { margin: 0 0 8px; font-weight: 700; color: var(--crit); }
.editor-warnbox .editor-aktionen { margin-top: 4px; }

.editor-kopf {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.editor-titel { font-size: 18px; font-weight: 800; margin-right: auto; }
.editor-wer { font-size: 13px; font-weight: 700; color: var(--muted); margin-left: 6px; }

.editor-zeit { display: flex; align-items: center; gap: 8px; }
.editor-zeit input[type="time"] {
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-klein);
  min-height: 46px;
  padding: 0 10px;
}

.editor-hinweis { font-size: 13px; color: var(--muted); margin: 0 0 8px; }

.druck-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 6px;
}
.druck-btn {
  font: inherit;
  font-size: 19px;
  font-weight: 700;
  min-height: var(--touch);
  border: 1px solid var(--line);
  border-radius: var(--radius-klein);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}
.druck-btn:active { background: var(--surface-3); }
.druck-btn.gewaehlt { background: var(--akzent); border-color: var(--akzent); color: #fff; }

.editor-aktionen { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* Auftrag / Notizen / CBRN – kompakte Fußzeile der Karte */

.trupp-text {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  align-items: center;
}
.trupp-text label {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-klein);
  padding: 0 0 0 10px;
}
.trupp-text label > span {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  white-space: nowrap;
}
.trupp-text input {
  font: inherit;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  border: none;
  min-height: 44px;
  padding: 0 10px 0 4px;
  width: 100%;
  min-width: 0;
}
.trupp-text input:focus-visible { outline-offset: -3px; border-radius: var(--radius-klein); }

.btn-entfernen {
  flex: none;
  min-height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: var(--radius-klein);
  cursor: pointer;
}

/* ---------- Buttons allgemein ---------- */

.btn {
  font: inherit;
  font-weight: 700;
  min-height: var(--touch);
  padding: 0 18px;
  border: 1px solid var(--line-stark);
  border-radius: var(--radius-klein);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}
.btn:active { background: var(--surface-3); }
.btn-primaer { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.btn-primaer:active { filter: brightness(1.12); background: var(--akzent); }
.btn-gefahr { background: transparent; border-color: var(--crit); color: var(--crit); }
.btn-gefahr:active { background: var(--crit-flaeche); }
.btn-gross { font-size: 18px; min-height: 56px; }

/* ---------- Statusbar ---------- */

.statusbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px calc(14px + env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) calc(14px + env(safe-area-inset-left));
  background: var(--surface);
  border-top: 1px solid var(--line);
}

.status-aktionen { display: flex; gap: 8px; flex: none; }

.status-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  min-width: 0;
}

/* Statusangaben bewusst als schlichter, kleiner Text – keine Badges.
   Nur Fehler und Warnungen dürfen laut werden. */
.status-text {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}
.status-text.fehler { color: var(--crit); font-weight: 700; }
.status-text.warnung { color: var(--warn); font-weight: 700; white-space: normal; }

.status-link {
  font: inherit;
  font-size: 12.5px;
  background: none;
  border: none;
  padding: 6px 2px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.btn-update {
  min-height: 40px;
  font-size: 13px;
  padding: 0 12px;
  border-color: var(--ok);
  color: var(--ok);
  background: var(--ok-flaeche);
}

.btn-install {
  min-height: 40px;
  font-size: 13px;
  padding: 0 12px;
  border-color: var(--akzent);
  color: var(--akzent);
  background: transparent;
}

.status-rechts { margin-left: auto; display: flex; gap: 8px; flex: none; }

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

.dialog {
  border: 1px solid var(--line-stark);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 22px;
  max-width: 460px;
  width: calc(100vw - 48px);
}
.dialog::backdrop { background: rgba(0, 0, 0, .5); }

/* Fallback ohne native <dialog>-Unterstützung */
.dialog.fallback {
  display: block;
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 91;
}
.fallback-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, .5);
}

/* Stillgelegte Instanz (Tafel in anderem Fenster übernommen) */
.gesperrt-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(12, 16, 21, .8);
  display: grid;
  place-items: center;
  padding: 24px;
}
.gesperrt-inhalt {
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius);
  padding: 26px;
  max-width: 460px;
  text-align: center;
}
.gesperrt-inhalt h2 { margin: 0 0 10px; }
.gesperrt-inhalt p { margin: 0 0 16px; }
.dialog h2 { margin: 0 0 8px; font-size: 21px; }
.dialog a { color: var(--akzent); }
.dialog .info-anleitung {
  display: inline-block;
  font-weight: 700;
  font-size: 17px;
  padding: 6px 0;
}
.dialog p { margin: 0 0 8px; }
.dialog-hinweis { color: var(--muted); font-size: 14px; }
.dialog-aktionen { display: flex; gap: 10px; margin-top: 16px; }
.dialog-aktionen .btn { flex: 1; }

/* ---------- Schmale Viewports (iPad hochkant, Telefon) ---------- */

@media (max-width: 900px) {
  .kopfdaten { grid-template-columns: 1fr 1fr; }
  .feld-breit { grid-column: 1 / -1; }
  .brand-text span { display: none; }
  .uhr { font-size: 22px; }
  .topbar { flex-wrap: wrap; }
  .mode-switch { order: 3; width: 100%; margin-left: 0; }
  .mode-switch button { flex: 1; }
  .trupp-status { margin-left: 0; width: 100%; justify-content: space-between; }
  .statusbar { flex-wrap: wrap; }
  .status-links { order: 3; }
}

@media (max-width: 520px) {
  .status-rechts { gap: 6px; }
  .btn { padding: 0 12px; }
  .trupp-text { flex-wrap: wrap; }
}

/* ---------- Reduzierte Bewegung ---------- */

@media (prefers-reduced-motion: reduce) {
  .trupp.st-crit { animation: none; box-shadow: var(--schatten), 0 0 0 4px var(--crit-flaeche); }
  .sheet, .sheet-backdrop { transition: none; }
}

/* ---------- Druckansicht (Notlösung, PDF ist der Standardweg) ---------- */

@media print {
  .topbar, .statusbar, .editor, .fehler-banner { display: none !important; }
  body { background: #fff; color: #000; padding: 0; }
  .trupp { break-inside: avoid; box-shadow: none; }
}
