/* =====================================================================
 * BRE · Tablet-Querformat-Anpassungen
 * --------------------------------------------------------------------
 * Greift bei Tablet-Querformat:
 *   - Breite 768–1366 px  (iPad 1024×768 / iPad Pro 1180×820 / Surface 1280×800)
 *   - Höhe   ≤ 900 px     (filtert Desktop-Monitore mit ähnlicher Breite aus)
 *
 * Bike-Desktop (≥1367 px ODER >900 px Höhe) bleibt unverändert.
 *
 * Strategie: alle BRE-Modals/Foldouts/Dashboards bekommen vh-basierte
 * Höhen + internes Scrolling; Padding und Font-Größen werden gestaucht.
 * ===================================================================== */

@media (min-width: 768px) and (max-width: 1366px) and (max-height: 900px) {

  /* ── HUB (Bereichs-Auswahl) ─────────────────────────────────────── */
  .bre-hub-screen          { padding:18px 14px !important; justify-content:flex-start !important; }
  .bre-hub-head            { margin-bottom:14px !important; }
  .bre-hub-greet           { font-size:22px !important; }
  .bre-hub-wrap            { gap:18px !important; }
  .bre-hub-card            { padding:18px 18px 16px !important; }
  .bre-hub-ic              { width:88px !important; height:88px !important; border-radius:22px !important; margin-bottom:14px !important; }
  .bre-hub-ic svg          { width:54px !important; height:54px !important; }
  .bre-hub-ic .bre-emoji-icon { font-size:54px !important; }
  .bre-hub-card h2         { font-size:18px !important; }
  .bre-hub-card p          { font-size:12.5px !important; line-height:1.45 !important; }
  .bre-hub-go              { margin-top:14px !important; }
  .bre-hub-foot            { margin-top:18px !important; }

  /* ── Bereichs-Dashboard (Ski/Para Hub-Layout) ───────────────────── */
  .bre-wrap                { padding:10px 0 24px !important; }
  .bre-wrap > div:first-child h1 { font-size:21px !important; }

  /* ── Admin-Foldout (Cards aufklappbar) ──────────────────────────── */
  #bre-admin-foldout,
  #bre-admin-foldout-bereich {
    padding:18px 20px !important;
    max-height:72vh !important;
    overflow-y:auto !important;
  }
  #bre-admin-foldout h2,
  #bre-admin-foldout-bereich h2 { font-size:17px !important; }
  .admin-tools-grid        { gap:14px !important; grid-template-columns:repeat(auto-fit, minmax(220px, 1fr)) !important; }
  .admin-tool-card         { padding:16px !important; }
  .admin-tool-card h3      { font-size:14px !important; margin-bottom:6px !important; }
  .admin-tool-card p       { font-size:12px !important; line-height:1.4 !important; }
  .admin-tool-card > div:first-of-type { width:38px !important; height:38px !important; margin-bottom:10px !important; }

  /* ── Modal-Backdrops: weniger Padding ───────────────────────────── */
  .bre-modal-backdrop,
  .bre-ski-modal-bd        { padding:12px !important; }

  /* ── Express-Ausgabe (Modal UND inline) ─────────────────────────── */
  .bre-skiex               { height:auto !important; max-height:88vh !important; max-width:100% !important; }
  .bre-skiex-head          { padding:12px 18px !important; }
  .bre-skiex-head h2       { font-size:16px !important; }
  .bre-skiex-body          { padding:14px 18px !important; }
  .bre-skiex-search input  { padding:11px 14px 11px 38px !important; font-size:14px !important; }
  .bre-skiex-fam           { padding:9px 12px !important; margin-bottom:6px !important; font-size:13px !important; }
  .bre-skiex-members       { gap:8px !important; margin:10px 0 14px !important; }
  .bre-skiex-mc            { padding:9px 12px !important; min-width:130px !important; }
  .bre-skiex-mc .nm        { font-size:13px !important; }
  /* Inline-Variante im Bereichs-Dashboard */
  #bre-ski-main-view       { min-height:auto !important; }
  #bre-ski-main-view .bre-skiex { min-height:auto !important; max-height:70vh !important; }

  /* ── Ski-Import-Modal ───────────────────────────────────────────── */
  .bre-skimp               { max-width:780px !important; max-height:88vh !important; }
  .bre-skimp > div:first-child { padding:14px 20px !important; }
  .bre-skimp > div:first-child h2 { font-size:16px !important; }
  #bre-skimp-phase-upload,
  #bre-skimp-phase-map,
  #bre-skimp-phase-done    { padding:16px 20px !important; }
  #bre-skimp-map           { grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)) !important; gap:8px !important; }
  #bre-skimp-map > div     { padding:8px 10px !important; }
  #bre-skimp-preview       { max-height:180px !important; }

  /* ── Skileasing-Verträge-Modal ──────────────────────────────────── */
  .bre-skic-wrap           { max-width:980px !important; max-height:88vh !important; height:auto !important; }

  /* ── CRM-Modal ──────────────────────────────────────────────────── */
  .bre-crm-wrapper         { max-height:88vh !important; height:88vh !important; max-width:1000px !important; }
  .bre-crm-header          { padding:12px 18px !important; }
  .bre-crm-header h2       { font-size:16px !important; }
  .bre-crm-header h2 svg   { width:20px !important; height:20px !important; }

  /* ── Settings-Modal ─────────────────────────────────────────────── */
  #bre-settings-modal      { padding:14px !important; }

  /* ── Sign-Terminal / Mietvertrag-Modal ──────────────────────────── */
  .bre-modal-content,
  .bre-pdf-modal-content   { max-height:90vh !important; }

  /* ── Bike-Foldouts (Tagescheck etc.) ────────────────────────────── */
  #bre-tagescheck-foldout  { max-height:80vh !important; overflow-y:auto !important; }

  /* ── Buttons in Top-Action-Bars: Touch-tauglich, aber kompakt ──── */
  .bsd-btn                 { padding:9px 14px !important; font-size:12.5px !important; }
  .bsd-btn svg             { width:14px !important; height:14px !important; }
}

/* Engerer Schwellwert NUR fürs klassische iPad 1024×768 ─────────── */
@media (max-width: 1024px) and (max-height: 800px) {
  .bre-hub-ic              { width:76px !important; height:76px !important; border-radius:18px !important; }
  .bre-hub-ic svg          { width:46px !important; height:46px !important; }
  .bre-hub-ic .bre-emoji-icon { font-size:46px !important; }
  .bre-hub-card h2         { font-size:17px !important; }
  .admin-tools-grid        { grid-template-columns:repeat(auto-fit, minmax(200px, 1fr)) !important; }
  .bre-skiex-members       { flex-wrap:wrap !important; }
  .bre-skiex-mc            { min-width:120px !important; flex:1 1 calc(50% - 8px) !important; }
}
