/* Textfelder übernehmen die App-Schrift (sonst Monospace in manchen Browsern) */
textarea { font-family: inherit; }

/* =========================================================
   Swim24h – Handy-Anpassungen (seit v1.166.0)
   Zentral für alle Seiten, wird als letzte Stylesheet-Datei geladen.
   Grundregeln:
   - Eingabefelder mind. 16px Schrift (iOS zoomt sonst beim Antippen)
   - Tap-Ziele mind. ~36px
   - kein waagerechtes Wegrutschen: Zeilen umbrechen statt abschneiden
========================================================= */

@media (max-width: 760px) {
  /* iOS-Zoom beim Antippen vermeiden */
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]),
  select, textarea { font-size: 16px !important; }

  /* Tap-Ziele */
  .btn-sm { min-height: 36px; }
  .aw-refresh-btn, .hl-refresh-btn, .au-refresh-btn, .drawer-close-btn { width: 38px !important; height: 38px !important; }
  .zc-lane-edit { width: 32px !important; height: 32px !important; }
  .rk-owner-edit { width: 30px !important; height: 30px !important; }
  .hm-tabs-arrow { width: 34px !important; height: 34px !important; }
  .msg-item-check, #msgSelectAll, .mg-table input[type=checkbox], #mgPickAll { width: 20px; height: 20px; }
  .nf-edit { min-height: 30px; padding: 4px 12px !important; }
  #hmContactSend { min-height: 38px; }
  .mg-filter select, .nf-when select { min-height: 34px; }
  .nf-when { line-height: 2.4; }
  .evl-pill { min-height: 34px; }
  .hl-btn-icon { width: 36px !important; height: 36px !important; }
  .hl-add-btn { min-height: 36px; }
  [data-hwtop], [data-agetop], [data-famtop], [data-nighttop], [data-teamtop], [data-medtop] { min-height: 34px; min-width: 36px; }

  /* Kopfzeilen mit Titel + Knopf: Knopf nicht zweizeilig */
  .ub-header .btn, .vm-head .btn { white-space: nowrap; }
  .ub-header { flex-wrap: wrap; }

  /* Kontextleiste „Sie arbeiten im Wettkampf …“ kompakter */
  #compContextBar { padding: 6px 14px !important; font-size: 12px !important; line-height: 1.35; }

  /* Formular-Zeilen untereinander (z. B. Benutzer-Dialog) */
  .form-row { grid-template-columns: minmax(0, 1fr) !important; gap: 12px !important; }

  /* Dialoge: volle Breite, Inhalt scrollt, Knöpfe bleiben sichtbar */
  #modalRoot .card { width: calc(100vw - 20px) !important; max-width: calc(100vw - 20px) !important; max-height: 92vh; }
  #modalRoot .modal-section { padding: 22px 18px 8px; }
  .modal-footer { flex-wrap: wrap; }

  /* ── Teilnehmer: Kennzahlen in einer Zeile ── */
  .tm-stats { grid-template-columns: 1fr auto 1fr auto 1fr !important; padding: 10px 8px !important; }
  .tm-stats .tm-stat-divider { display: block !important; }
  .tm-stat-val { font-size: 22px; }

  /* ── Nachrichten: eine Spalte, Ordner als waagerechte Leiste ── */
  .msg-layout { grid-template-columns: minmax(0, 1fr) !important; height: auto !important; max-height: none !important; min-height: 0 !important; }
  .msg-main { min-width: 0; min-height: 60vh; }
  .msg-sidebar { min-width: 0; }
  .msg-sidebar-header { display: none; }
  .msg-compose-btn { margin: 12px 12px 6px; min-height: 42px; }
  .msg-nav { flex-direction: row; overflow-x: auto; padding: 4px 10px 10px; gap: 6px; scrollbar-width: none; }
  .msg-nav::-webkit-scrollbar { display: none; }
  .msg-nav-btn { flex: 0 0 auto; gap: 6px; padding: 8px 12px; border: 1px solid var(--border); border-radius: 999px; white-space: nowrap; }
  .msg-toolbar { padding: 10px 12px; }
  .msg-org-filter { width: 100%; }

  /* ── Mitbring-Liste verwalten ── */
  .da-container { padding: 16px 14px 60px; }
  .da-add-card input { flex: 1 1 100% !important; width: auto !important; min-width: 0; height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--txt); padding: 0 12px; box-sizing: border-box; }
  .da-add-card #daNewQty { flex: 0 0 90px !important; }
  .da-add-card #daNewNote { flex: 1 1 0 !important; min-width: 0; }
  .da-add-card .btn { flex: 1 1 100%; }
  .da-hint a#daPublicLink { word-break: break-all; }

  /* ── Öffentliches Kalenderblatt: „Bevorstehend“ ist der Normalfall, Platz für den Titel ── */
  .kl-badge-upcoming { display: none; }

  /* ── Veranstaltungs-Team: Aufgaben als beschriftete Schalter je Person ── */
  .tm-team-head > div:last-child { width: 100%; }
  .tm-team-head .btn { flex: 1 1 auto; }
  .vm-card .nf-th { display: none; }
  .tm-team-row { flex-wrap: wrap; row-gap: 10px; position: relative; }
  .tm-team-row .nf-ev { flex: 1 1 calc(100% - 40px) !important; }
  .tm-team-row .tm-team-rm { position: absolute; top: 6px; right: 0; }
  .tm-team-cell { width: calc(50% - 6px) !important; justify-content: space-between !important; align-items: center; gap: 8px; font-size: 12.5px; }
  .tm-team-cell::before { content: attr(data-label); color: var(--muted); line-height: 1.25; }
  .tm-team-hints { grid-template-columns: minmax(0, 1fr) !important; }

  /* ── Benachrichtigungen: Schalter beschriftet ── */
  .nf-col[data-label] { flex: 0 0 auto !important; width: auto !important; gap: 8px; align-items: center; font-size: 12.5px; }
  .nf-col[data-label]::before { content: attr(data-label); color: var(--muted); }
}

@media (max-width: 600px) {
  /* Seiten-Inhalt: weniger Rand, damit Karten nicht „Karte in Karte“ schrumpfen */
  .container { padding-left: 12px !important; padding-right: 12px !important; }
  .st-content { padding: 18px 14px !important; border-radius: 14px; }
}

/* Öffentliche Kopfzeile auf Startseite/Kalenderblatt (index.css .ix-land-*) wie public-header.js */
.ix-land-logo, .ix-land-header-actions .btn { white-space: nowrap; }
.s24-ph-short { display: none; }
@media (max-width: 520px) {
  .ix-land-header-actions { gap: 8px; }
  .ix-land-header-sep, .s24-ph-long { display: none; }
  .s24-ph-short { display: inline; }
  .ix-land-header { padding: 12px 16px; gap: 10px; }
  .ix-land-logo { font-size: 16px; }
}

@media (max-width: 820px) {
  /* Kopfleiste (Menü + Konto) schwebt fest oben – auf dem Handy scrollt die
     ganze Seite, ohne Hintergrund lagen die Knöpfe über dem Inhalt. */
  .nav-right { left: 0; justify-content: flex-end; padding: 0 16px !important;
    background: color-mix(in srgb, var(--bg, #eef3f9) 88%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid var(--border); }
}

@media (max-width: 760px) {
  /* Tabellen: waagerecht wischen statt abschneiden */
  .st-content table:not(.mg-table), .vb-table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Mitgliederliste als Karten */
  .mg-table thead { display: none; }
  .mg-table, .mg-table tbody { display: block; width: 100%; }
  .mg-table tbody tr { display: grid; grid-template-columns: 30px minmax(0, 1fr); column-gap: 8px; row-gap: 5px; padding: 12px 4px; border-bottom: 1px solid var(--border); }
  .mg-table td { display: block; grid-column: 2; padding: 0 !important; border: 0 !important; text-align: left !important; white-space: normal !important; }
  .mg-table td:first-child { grid-column: 1; grid-row: 1 / span 9; padding-top: 2px !important; }
  .mg-table td:nth-child(2) { font-size: 14.5px; font-weight: 600; }
  .mg-table td span { overflow-wrap: anywhere; }
  .mg-table td:last-child .btn { margin-top: 4px; }

  /* Mitglieder-Filter: zwei je Zeile, Suche über die volle Breite */
  .mg-filters { gap: 8px; }
  .mg-filter { flex: 1 1 calc(50% - 6px); min-width: 0; box-sizing: border-box; }
  .mg-filter select { flex: 1 1 auto; max-width: none !important; min-width: 0; }
  .mg-search { flex: 1 1 100%; order: -1; }
}
