/* Schmale Bildschirme: Leiste oben, Inhalt darunter, nichts läuft seitlich über */
@media (max-width: 47.99rem) {
  .rahmen { flex-direction: column; }
  .leiste { position: static; width: 100%; height: auto; flex-direction: row; align-items: center; justify-content: space-between; border-right: 0; border-bottom: 1px solid var(--rand); padding: 0.5rem 0.75rem; background: var(--flaeche); overflow: visible; }
  .leiste > nav { display: none; }
  .konto-menue { margin-top: 0; }
  .konto-person { display: none; }
  .menue { bottom: auto; top: calc(100% + 0.4rem); left: auto; right: 0; }
  .nur-mobil { display: block; }
  body.mit-leiste { padding-bottom: 4.75rem; }
  .tableiste { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; justify-content: space-around; background: var(--flaeche-leise); border-top: 1px solid var(--rand); padding: 0.25rem 0.25rem calc(0.25rem + env(safe-area-inset-bottom)); }
  .tableiste a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.15rem; min-width: 3.5rem; padding: 0.35rem 0.5rem; color: var(--text-leise); text-decoration: none; font-size: 0.72rem; border-radius: var(--radius); }
  .tableiste a.aktiv { color: var(--text); font-weight: 600; }
  .tableiste .zaehler { position: absolute; top: 0; right: 0.1rem; margin: 0; font-size: 0.7rem; min-width: 1.1rem; }
  main { padding: 1rem; }
  table.aufgaben, table.aufgaben tbody, table.aufgaben tr, table.aufgaben td { display: block; width: 100%; }
  table.aufgaben thead { position: absolute; left: -999px; }
  table.aufgaben tr { border: 1px solid var(--rand); border-radius: var(--radius); margin-bottom: 0.75rem; padding: 0.25rem 0.5rem; background: var(--flaeche); }
  table.aufgaben td { border: 0; padding: 0.2rem 0; }
  table.aufgaben td::before { content: attr(data-label) ": "; color: var(--text-leise); font-size: 0.85rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Rahmen des Betriebs am Handy (PB-3945a): Kopfzeile, darunter die Leiste als Klappe "Menü" (ohne Skript), dann der Inhalt.
   Breite Tabellen rollen im Inhalt, nicht die ganze Seite. */
@media (max-width: 47.99rem) {
  .bk { position: static; padding: 0 0.75rem; }
  .bk-stellung { display: none; }
  .bk-konto { flex: 0 1 auto; min-width: 0; } /* PB-8554: Der Kontoname kürzt sich mit „…“, statt rechts hinauszulaufen */
  .betrieb-rahmen { display: block; }
  .bl { position: static; width: auto; height: auto; overflow: visible; padding: 0.3rem 0.75rem; border-right: 0; border-bottom: 1px solid var(--rand); }
  .bl-nav { padding-bottom: 0.5rem; }
  .bl-nav a { padding: 0.6rem; font-size: 0.9375rem; }
  body.betrieb main { overflow-x: auto; }
}
/* Suchfeld der Kopfzeile am schmalen Handy (PB-3944b): Das Feld weicht, der Knopf mit der Lupe bleibt und führt zur Suchseite
   (dort steht das Feld groß). Der Text des Knopfs bleibt für Vorlese-Programme. So bleibt die Kopfzeile bei 375 px einzeilig.
   PB-8560: Grenze 45rem statt 30rem. Gemessen war das Feld bei 480 px 21 px breit, bei 640 px 37 px; erst ab 720 px ist es lesbar (117 px). */
@media (max-width: 44.99rem) {
  .bk-platz { display: flex; justify-content: flex-end; min-width: 2.75rem; } /* sonst schrumpft der Platz auf 0, und der Knopf liegt über „BETRIEB“ */
  .bk-suche label, .bk-suche input { display: none; }
  .bk-suche button { min-width: 2.75rem; min-height: 2.75rem; justify-content: center; padding: 0.35rem 0.6rem; }
  .bk-suche-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 31.99rem) {
  /* PB-8554: Seit dem Schalter Hell/Dunkel (PB-4390) reicht der Platz nicht mehr; der Kontoname lief bei 400 px rechts hinaus.
     Der Name bleibt im aria-label des Knopfs und oben im geöffneten Menü, das Wort neben dem Logo bleibt für Vorlese-Programme.
     PB-8560: 32rem statt 30rem, denn mit dem Lupen-Knopf blieben bei 480 px nur 23 px vom Namen („B…“). */
  .bk .konto-name { display: none; }
}
@media (max-width: 29.99rem) {
  .bk-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

@media print {
  .leiste, .tableiste, .fuss, .sprung, .nur-bildschirm, .banner, .bk, .bl { display: none; }
  body { background: #fff; color: #000; }
  main { max-width: none; padding: 0; }
}

.ohne-rahmen { border: 0; padding: 0; margin: 0 0 1rem; }

