/* ============================================================
   mobile.css — Globale Mobile-Anpassungen
   Wird auf allen internen Seiten eingebunden und ueberschreibt
   nur fuer kleine Bildschirme (<= 700px) die Header-Layouts.
   ============================================================ */

@media (max-width: 700px) {

  /* ── HEADER: alle Varianten zusammenfassen ───────────────── */
  .intern-header,
  .forum-header,
  .demo-header,
  .hdr,
  .sp-header {
    padding: 0.55rem 0.75rem !important;
    height: auto !important;
    min-height: 56px;
    flex-wrap: wrap !important;
    gap: 0.4rem !important;
    row-gap: 0.5rem !important;
  }

  /* Brand auf 100% der Breite, eigene Zeile */
  .intern-brand,
  .forum-header-brand,
  .demo-header-title,
  .hdr-brand,
  .sp-brand {
    font-size: 1.05rem !important;
    letter-spacing: 0.06em !important;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Right-Side: Badges + Toggle + Buttons in EINER neuen Zeile */
  .intern-header-right,
  .forum-header-right,
  .demo-header-right,
  .hdr-right {
    width: 100% !important;
    gap: 0.4rem !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
  }

  /* User-Badge kompakter */
  .user-badge {
    font-size: 0.6rem !important;
    padding: 0.18rem 0.4rem !important;
    letter-spacing: 0.05em !important;
  }
  .role-chip {
    font-size: 0.55rem !important;
    padding: 0.15rem 0.35rem !important;
  }

  /* Theme-Toggle: Label ausblenden, nur Schalter sichtbar */
  .theme-toggle-wrap > span,
  .theme-toggle-wrap > #themeLabel {
    display: none !important;
  }

  /* Buttons im Header kleiner & touch-freundlich (min 36px hoch) */
  .intern-header .btn,
  .forum-header .btn,
  .demo-header .btn,
  .hdr .btn,
  .sp-header .btn {
    padding: 0.4rem 0.6rem !important;
    font-size: 0.62rem !important;
    min-height: 36px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
  }

  /* ── PAGE BODY: weniger Padding ────────────────────────── */
  .page-body {
    padding: 1rem !important;
  }
  .page-title { font-size: 1.6rem !important; }
  .page-sub   { font-size: 0.7rem !important; }

  /* ── BTN-Touch-Targets: alle .btn ≥ 36px Hoehe ──────────── */
  .btn {
    min-height: 36px;
  }
  .btn-sm { min-height: 32px; }

  /* ── EINKAUFSLISTE: Drop-Hint statt 'Drag & Drop' ──────── */
  .drop-hint { font-size: .75rem !important; }

  /* ── MODAL OVERLAYS: bessere Mobile-Groesse ────────────── */
  .modal-box,
  .g-modal,
  .cc-modal {
    width: 95% !important;
    max-width: 95% !important;
    max-height: 92vh !important;
  }

  /* ── DRAG-DROP-Zone Touch-Hinweis ──────────────────────── */
  .g-dropzone .g-dropzone-text { font-size: .9rem !important; }
  .g-dropzone .g-dropzone-sub  { font-size: .65rem !important; }

  /* ── INTERN-Nav (Forum/Team/Tactics Dropdowns) ─────────── */
  .intern-nav {
    width: 100% !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
  }

  /* ── KALENDER ──────────────────────────────────────────── */
  /* Modal: volle Breite + scrollbar */
  .cal-modal-body { padding: .8rem !important; }
  .cal-modal { width: 96% !important; max-width: 96% !important; max-height: 92vh !important; }

  /* Top-Nav: ◀ Mai 2026 ▶ Heute … + EINTRAG → in 2 Zeilen umbrechen */
  .cal-nav {
    flex-wrap: wrap !important;
    gap: .4rem !important;
    row-gap: .5rem !important;
  }
  /* Den inline-Spacer (flex:1 div) auf Mobile ausblenden */
  .cal-nav > div[style*="flex:1"] { display: none !important; }
  /* + EINTRAG: volle Breite, gut sichtbar */
  #calAddBtn {
    width: 100% !important;
    text-align: center !important;
  }
  .cal-nav-btn { min-height: 36px; padding: .4rem .7rem !important; }
  .cal-month-label { font-size: 1rem !important; }

  /* Event-Liste: jede LAN als gestapelte Karte */
  .cal-event-row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: .55rem !important;
    padding: .7rem .8rem !important;
  }
  .cal-event-info { width: 100% !important; min-width: 0 !important; }
  .cal-event-actions {
    width: 100% !important;
    flex-wrap: wrap !important;
    gap: .35rem !important;
  }
  /* Buttons im Event-Row: 2 pro Zeile, fairer flex-grow */
  .cal-event-actions .btn {
    flex: 1 1 calc(50% - .2rem) !important;
    min-width: 0 !important;
    font-size: .62rem !important;
    padding: .45rem .35rem !important;
    letter-spacing: .04em !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Kalender-Gitter (Wochentage) leserlicher */
  .cal-grid { font-size: .8rem !important; }
  .cal-day { padding: .3rem !important; min-height: 44px !important; }

  /* Form-Felder im LAN-Edit-Modal */
  .cal-form-row input[type=text],
  .cal-form-row input[type=date] {
    width: 100% !important;
    box-sizing: border-box;
  }
  .cal-form-row > div[style*="display:flex"] { flex-wrap: wrap !important; }

  /* ── EINKAUFSLISTE Layout ──────────────────────────────── */
  .shop-layout {
    grid-template-columns: 1fr !important;
  }
  .palette-panel {
    position: static !important;
    max-height: none !important;
  }

  /* ── GALERIE Mobile-spezifisch ─────────────────────────── */
  .album-head { padding: .65rem .8rem !important; gap: .6rem !important; }
  .album-cover, .album-cover-placeholder { width: 44px !important; height: 44px !important; }
  .album-title-line { font-size: 1.05rem !important; }
  .album-actions { gap: .3rem !important; }
  .image-grid { grid-template-columns: repeat(auto-fill, minmax(95px, 1fr)) !important; gap: .35rem !important; }
  .g-lb-prev, .g-lb-next { width: 44px !important; height: 64px !important; font-size: 2rem !important; }
  .g-lb-prev { left: 0 !important; }
  .g-lb-next { right: 0 !important; }
  .g-lb-close { width: 36px !important; height: 36px !important; font-size: 1.3rem !important; }

}

/* ── NOCH KLEINER (< 400px): extra Schrumpf ──────────────── */
@media (max-width: 399px) {
  .intern-brand,
  .forum-header-brand,
  .demo-header-title,
  .hdr-brand,
  .sp-brand {
    font-size: 0.95rem !important;
  }
  .user-badge { font-size: 0.55rem !important; }
  .image-grid { grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)) !important; }
}
