/* ==========================================================================
   Anpassung an die Bildschirmgröße. Wird NACH style.css geladen.
   Am PC (breiter als 1024 px) ändert diese Datei nichts außer Touch-Bedienung.
   Teil 1: Grundlagen und Tablet.  Teil 2 (Kalender) und Teil 3 (Verwaltung): responsive_phone.css
   ========================================================================== */

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
img { max-width: 100%; height: auto; }
.card, .toolbar, .filterbar, .overview, .reportcols { min-width: 0; }
.htable, .atable { max-width: 100%; }

/* Touchgeräte: größere Bedienflächen gegen Fehlbedienung */
@media (pointer: coarse) {
  button, select, input:not([type=checkbox]):not([type=radio]):not([type=color]) { min-height: 40px; }
  input[type=checkbox], input[type=radio] { width: 22px; height: 22px; }
  .linkbtn { padding: 8px 10px; }
  .checks label { padding: 10px 8px; }
}

/* Tablet und kleiner Laptop (bis 1024 px) */
@media (max-width: 1024px) {
  main { padding: 12px 14px; }
  header { padding: 8px 14px; gap: 6px; flex-wrap: wrap; }
  header h1 { font-size: 22px; }
  header .hlogo { height: 30px; }
  header .userbox { gap: 6px; }
  header nav button { padding: 7px 12px; font-size: 14px; }
  header #whoami { font-size: 13px; }
  header #pwBtn, header #logoutBtn { padding: 6px 8px; font-size: 13px; }
  .toolbar h2 { min-width: 0; font-size: 20px; }
  .toolbar .viewsw { margin-left: 14px; }
  .day { min-height: 92px; }
  .day .num { font-size: 20px; }
  .day.today .num { min-width: 32px; padding: 6px 3px; }
  .ev { font-size: 11px; }
  .filterbar { gap: 10px 16px; }
  .panehead { gap: 8px; }
  .paneactions input[type=search] { min-width: 160px; }
  .atable, .htable { font-size: 13px; }
  .atable td, .atable th { padding: 8px; }
  .redtabs button { padding: 10px 16px; font-size: 14px; }
  .subtabs button { padding: 10px 12px; font-size: 14px; }
  #eventDialog { width: min(720px, 94vw); }
  #list-vehicles, #list-helpers, #list-categories, #list-users, #hEntries { overflow-x: auto; }
  /* Einsätze ohne Stunden: Titel bekommt die volle Breite, Helfer und Knopf stehen darunter */
  .mitem { grid-template-columns: 86px 1fr; row-gap: 2px; }
  .mlist .mwho, .mlist .mgo { grid-column: 2; }
  .mlist .mtitle { overflow-wrap: break-word; word-break: normal; }
}

/* Schmales Tablet (601 bis 860 px): Benutzername ausblenden, damit die Kopfzeile in einer Zeile bleibt */
@media (min-width: 601px) and (max-width: 860px) { header #whoami { display: none; } }

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