/* ec-safe-area.css — §SAFE-AREA-2026-09-23
 *
 * Handy-Shell (nicht Tablet-Split): die Bottom-Nav steht IM Grid-Fluss
 * (#ec-mobile-shell: auto | minmax(0,1fr) | auto, nav position:relative) und
 * trägt die Gestenleiste selbst (padding-bottom: 14px + env(safe-area-inset-bottom)).
 *
 * mobile-overrides.css §24.7 reserviert auf .ecm-main trotzdem noch einmal
 * 60px + Inset "für die fixed Nav" — die es nicht gibt. Die Einstellungen legen
 * im Scroller (104px + Inset) und in .ec-tg-settings (28px + Inset) zweimal nach.
 * Ergebnis bei 48px Gestenleiste: 336px leerer Block unter dem letzten Eintrag,
 * 108px toter Streifen über der Nav in JEDEM Tab.
 *
 * Fünffache ID: die Gegenregeln haben bis zu 4 IDs (ec-settings-tg.css) bzw.
 * 2 IDs + !important (mobile-overrides.css), siehe Memory mobile-css-cascade.
 * Geprüft mit test-safe-area-e2e.js (CDP-Inset 0/24/48px).
 */

html body.ec-mobile-shell-active:not(.ec-split) #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ecm-main {
  padding-bottom: 0 !important;
}

html body.ec-mobile-shell-active:not(.ec-split) #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell [data-ecm-panel="more"] .ec-mobile-settings-frame {
  padding-bottom: 16px !important;
  scroll-padding-bottom: 16px !important;
}

html body.ec-mobile-shell-active:not(.ec-split) #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-settings {
  padding-bottom: 12px !important;
}

/* ══════════════════════════════════════════════════════════════════════════
 * §SPLIT-DEADSPACE-2026-09-26 — dieselbe Doppelreservierung, nur im Split
 * ══════════════════════════════════════════════════════════════════════════
 * Die drei Korrekturen oben haengen alle an `:not(.ec-split)`. Auf einem Tablet
 * ist `.ec-split` aber IMMER aktiv (ec-tablet-split.js ab 768 px, und
 * isMobileViewport() liefert auf jedem Touch-Geraet true) — dort griff also
 * keine einzige davon.
 * Nachgemessen in den Einstellungen, angemeldet, vier iPad-Groessen:
 *     Rahmen-Unterkante 1180 · letztes Element endet 1076 → 104 px leer
 *     padding-bottom des Scrollers: 104px · zusaetzlich .ec-tg-settings: 28px
 * Reserviert wird damit Platz fuer eine untere Navigationsleiste, die es im
 * Split-Layout gar nicht gibt — dort fuehrt eine Leiste am linken Rand. Die
 * Gestenleiste des Geraets bleibt ueber env(safe-area-inset-bottom) erhalten. */
html body.ec-mobile-shell-active.ec-split #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell [data-ecm-panel="more"] .ec-mobile-settings-frame {
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
  scroll-padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
}
html body.ec-mobile-shell-active.ec-split #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-tg-settings {
  padding-bottom: 12px !important;
}

/* §AUDIT-2026-09-23 — oberer Inset (Statusleiste / Notch / Dynamic Island).
 * .ec-mobile-app hatte padding:0 !important (mobile-overrides.css §5362), die
 * Standalone-Regel für #ec-mobile-shell verlor ohne !important — die Kopfzeile
 * saß bei jedem Inset auf y≈20, also unter der Statusleiste: in der iOS-PWA
 * (black-translucent + viewport-fit=cover) und in der Android-App, sobald
 * MainActivity das native Top-Padding abgibt (Sonde meldet env-top > 0).
 * Gilt für Handy UND Tablet-Split; die Split-Leiste polstert oben deshalb
 * nicht mehr selbst (ec-tablet-split.css). Test: test-safe-area-e2e.js (oben 47px). */
html body.ec-mobile-shell-active #ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell#ec-mobile-shell .ec-mobile-app {
  padding-top: env(safe-area-inset-top, 0px) !important;
}
/* §UI-AUDIT-2026-11-03 (O2): die zwei hohen Sheets (Inline max-height 90vh/90dvh) endeten ueber dem unteren Inset
 * und reichten oben bis y=50 — Griff + Kante lagen 9 px in der 59-px-Notch-Zone. Ohne Insets bleibt es 90dvh. */
@media (pointer: coarse) {
  html body #premium-modal > .modal,
  html body #group-settings-modal > .modal {
    max-height: min(90dvh, calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 12px)) !important;
  }
}
