/* Phone menus as iPhone-style bottom sheets (user, 2026-10-20: picked B of three drafts). static/js/aiq-phone-sheet.js
   marks the open menu .ph-sheet. Edge to edge from the bottom, rounded top, grabber, dim behind, slides up.
   A phone-only exception to the pop-up kit's "no drawers" rule (docs/features/popups.md).
   Same rules as every aiq-phone*.css file: inside the phone media query, every selector starts with html.aiq-phone.
   `.ph-sheet:not(#_):not(#__)` outranks the per-menu placement rules in aiq-phone-pop.css and the frosted kit. */
@media (max-width: 767px) {
  /* ── dim behind ── */
  html.aiq-phone #ph-sheet-scrim { position: fixed; inset: 0; z-index: 1240; background: rgba(0,0,0,.38); animation: phSheetFade .2s ease-out; }
  html.aiq-phone #ph-sheet-scrim[hidden], html.aiq-phone #ph-sheet-top[hidden] { display: none !important; }

  /* ── the sheet ── */
  html.aiq-phone.aiq-phone[data-theme] .ph-sheet.ph-sheet:not(#_):not(#__) {
    position: fixed !important; top: auto !important; left: 0 !important; right: 0 !important; bottom: 0 !important; z-index: 1250 !important;
    width: auto !important; min-width: 0 !important; max-width: none !important; max-height: 78dvh !important; overflow-y: auto !important;
    box-sizing: border-box !important; transform: none; translate: none !important;
    padding: 22px 8px calc(14px + env(safe-area-inset-bottom)) !important; border-radius: 22px 22px 0 0 !important;
    background: var(--ph-card) !important; border: 0 !important; box-shadow: 0 -8px 30px rgba(15,17,21,.16) !important;
    -webkit-backdrop-filter: none; backdrop-filter: none; animation: phSheetUp .34s cubic-bezier(.22,1,.36,1) !important; }
  /* big pickers keep a fixed height (their insides are grids) */
  html.aiq-phone.aiq-phone[data-theme] .ph-sheet.ph-sheet:is(#scx-screens, #scx-add, #wl-col-panel, #col-cfg-panel):not(#_):not(#__) { height: 82dvh !important; max-height: 82dvh !important; }

  /* ── grabber on the top edge ── */
  html.aiq-phone #ph-sheet-top { position: fixed; z-index: 1260; left: 0; right: 0; height: 22px; pointer-events: none;
    display: flex; align-items: center; justify-content: center; animation: phSheetUp .34s cubic-bezier(.22,1,.36,1); }
  html.aiq-phone #ph-sheet-top .grab { display: block; width: 38px; height: 5px; border-radius: 999px; background: var(--ph-faint); opacity: .55; margin-top: 4px; }

  /* rows: roomier, iOS sizes */
  html.aiq-phone.aiq-phone[data-theme] .ph-sheet :is(.aiq-mi, .cfg-preset, .pop-opt, .ec-mi, .si-thf-item, #seg-type button, #gm-pop .opt,
      .wl-col-item, #aiq-help-menu a, #aiq-help-menu button) {
    min-height: 50px !important; font-size: 16px !important; padding-left: 16px !important; padding-right: 16px !important; }
  html.aiq-phone.aiq-phone[data-theme] .ph-sheet .pop-q { margin: 10px 8px 6px !important; width: calc(100% - 16px) !important; height: 42px !important;
    border-radius: var(--ph-r-sm) !important; font-size: 16px !important; }

  /* the page under an open sheet doesn't scroll */
  html.aiq-phone.ph-sheet-open body { overflow: hidden; }

  @keyframes phSheetUp { from { transform: translateY(100%); } to { transform: none; } }
  @keyframes phSheetFade { from { opacity: 0; } to { opacity: 1; } }
}
