/* Anpassung an alle Bildschirmgrößen: vom Handy bis zum 4K-Monitor. Wird nach style.css und nachtschicht.css geladen. */
.nur-klein { display: none; }
#kopf { min-width: 0; }
#kopf > * { flex-shrink: 0; }
.akte .spalten { grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr)); }
.modal-box { max-height: min(90vh, 90dvh); }

/* ---------- große Bildschirme (WQHD / 4K): alles etwas größer */
@media (min-width: 2200px) and (min-height: 1200px) {
  html, body { font-size: 15px; }
  #seite { width: 600px; }
  #kopf { height: 54px; } main { top: 54px; }
  .ffenster.max { top: 54px !important; height: calc(100vh - 54px) !important; }
  .modal-box { width: min(1200px, 94vw); }
}

/* ---------- Laptop (bis 1360 px breit): Kopfzeile verdichten */
@media (max-width: 1360px) {
  #kopf { gap: 10px; }
  .marke .sub { display: none; }
  .stand { font-size: 10px; }
  .boost { display: none !important; }
}
@media (max-width: 1200px) {
  .marke .wort { display: none; }
  #seite { width: clamp(340px, 36vw, 420px); }
  .keine-anrufe { width: 36px; max-width: 36px; overflow: hidden; white-space: nowrap; padding: 0 0 0 9px; text-align: left; text-overflow: clip; word-spacing: 60px; }
  .raffer button { padding: 4px 7px; }
  .uhr { font-size: 19px; }
}
@media (max-width: 1060px) {
  .neu-einsatz { max-width: 40px; overflow: hidden; white-space: nowrap; padding-left: 11px; padding-right: 11px; }
  .stand { white-space: nowrap; }
}

/* ---------- niedrige Bildschirme: Funk schmaler, mehr Platz für Karte und Listen */
@media (max-height: 820px) {
  main { bottom: 96px; }
  #funk { height: 88px; }
  #funk::before { height: 86px; padding-top: 10px; }
  #funk::after { display: none; }
}
@media (max-height: 620px) {
  main { bottom: 66px; }
  #funk { height: 58px; padding-left: 12px; }
  #funk::before { display: none; }
}

/* ---------- Tablet hochkant und Handy: Karte oben, Leitstelle darunter, Fenster bildschirmfüllend */
@media (max-width: 900px) {
  #kopf { gap: 8px; padding: 0 8px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  #kopf::-webkit-scrollbar { display: none; }
  .knoepfe { margin-left: auto; }
  main { flex-direction: column; padding: 6px 6px 0; gap: 6px; bottom: 70px; }
  #karte { flex: 0 0 34%; min-height: 150px; }
  #seite { width: auto !important; flex: 1 1 auto; min-height: 0; }
  #funk { height: 60px; left: 6px; right: 6px; bottom: 6px; padding-left: 10px; }
  #funk::before, #funk::after { display: none; }
  #tabs { overflow-x: auto; scrollbar-width: none; }
  #tabs::-webkit-scrollbar { display: none; }
  #tabs button { flex: 1 0 auto; padding-left: 10px; padding-right: 10px; }
  #btn-loesen { display: none; }
  /* Gespräch und alle Fenster füllen den Bildschirm unter der Kopfzeile */
  #gespraech.fenster, .ffenster { left: 0 !important; top: 46px !important; width: 100vw !important; height: calc(100vh - 46px) !important; height: calc(100dvh - 46px) !important;
    max-width: none; max-height: none; min-width: 0; border-radius: 0 !important; resize: none !important; }
  #gespraech .fenster-kopf, .ffenster .fenster-kopf { border-radius: 0 !important; cursor: default; flex-wrap: wrap; }
  .ffenster [data-max], .ff-max { display: none; }
  .modal { align-items: stretch; }
  .modal-box { width: 100vw; max-height: none; height: 100%; height: 100dvh; border-radius: 0 !important; padding: 14px 14px 20px; }
  .spalten { grid-template-columns: 1fr; }
  #tip { max-width: calc(100vw - 16px); }
  /* größere Tippflächen */
  .btn, .fragen button, .wahl label { min-height: 38px; }
}

/* ---------- Handy */
@media (max-width: 600px) {
  .raffer button[data-v="5"], .raffer button[data-v="10"], .raffer button[data-v="20"] { display: none; }
  .nur-klein { display: block; }
  .uhrbox { padding: 3px 8px 2px; } .uhr { font-size: 17px; }
  .stand { font-size: 0; white-space: nowrap; } .stand span { font-size: 14px; } #punkte::before { content: '★ '; color: var(--gelb); } #anzahl::before { content: ' · 🚑 '; font-size: 12px; }
  .knoepfe button { width: 32px; }
  #karte { flex-basis: 30%; }
  .fragen, .wahl.massn, .wahl.trwahl, .komp-knoepfe, .tiefen { grid-template-columns: 1fr; }
  .monitor.klein { grid-template-columns: repeat(3, 1fr); }
  .modal-box h2 { font-size: 18px; }
  #karte::before { display: none; }
}

/* ---------- Handy quer: Karte links, Leitstelle rechts, Funk minimal */
@media (max-height: 520px) and (orientation: landscape) {
  main { flex-direction: row; bottom: 6px; }
  #karte { flex: 1 1 45%; min-height: 0; }
  #seite { flex: 1 1 55%; width: auto !important; }
  #funk { display: none; }
}

/* ---------- Handy: Kopfzeile zweizeilig, alles sichtbar ohne Wischen */
@media (max-width: 600px) {
  #kopf { height: 92px; flex-wrap: wrap; align-content: center; row-gap: 6px; column-gap: 6px; overflow: visible; padding: 4px 8px; }
  #kopf .marke { order: 1; }
  #kopf .uhrbox { order: 2; }
  #kopf .stand { order: 3; margin-left: auto; }
  #kopf .knoepfe { order: 4; margin-left: 0; }
  #kopf .raffer { order: 5; }
  #kopf .keine-anrufe { order: 6; }
  #kopf .neu-einsatz { order: 7; flex: 1 1 auto; max-width: none; padding-left: 10px; padding-right: 10px; }
  #kopf .boost { display: none !important; }
  main { top: 92px; }
  #gespraech.fenster, .ffenster { top: 92px !important; height: calc(100vh - 92px) !important; height: calc(100dvh - 92px) !important; }
  .knoepfe button { width: 34px; height: 32px; }
}
@media (max-width: 380px) { .marke { display: none; } }
