/* Phone/tablet modal layout: one scroll region and a safe, touchable footer. */
@media (max-width: 1023px) {
  .cc-modal-layer {
    top: var(--cc-visual-top, 0px) !important;
    bottom: auto !important;
    height: var(--cc-visual-height, 100vh);
    height: var(--cc-visual-height, 100dvh);
    overflow: hidden !important;
    z-index: 900 !important;
  }
  .cc-modal-layout {
    box-sizing: border-box; height: 100%; min-height: 0 !important;
    padding: max(8px, env(safe-area-inset-top, 0px)) 8px max(24px, env(safe-area-inset-bottom, 0px)) !important;
    align-items: center !important;
  }
  .cc-modal-card {
    height: 100%; max-height: 100% !important; min-height: 0;
    margin: 0 !important; border-radius: 16px !important; overflow: hidden;
    animation: none !important;
  }
  .cc-modal-header { padding: 12px 16px !important; min-height: 52px; }
  .cc-modal-header button { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
  .cc-modal-body { min-height: 0; padding: 16px 16px 32px !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; scroll-padding-bottom: 70px; }
  .cc-modal-body [class*="max-h-[75vh]"], .cc-modal-body [class*="max-h-[65vh]"] { max-height: none !important; overflow: visible !important; }
  .cc-modal-body input:not([type=checkbox]):not([type=radio]), .cc-modal-body select, .cc-modal-body textarea { font-size: 16px !important; }
  .cc-modal-body form > button[type="submit"]:last-child { position: sticky; bottom: 10px; z-index: 4; min-height: 48px; box-shadow: 0 0 0 8px var(--cc-modal-bg, white), 0 4px 14px rgba(15,23,42,.28); }
  .cc-modal-body .cc-med-actions { position: sticky; bottom: 8px; z-index: 4; padding: 10px 0 !important; background: var(--cc-modal-bg, white); box-shadow: 0 -8px 0 var(--cc-modal-bg, white); }
  .cc-modal-body .cc-med-actions button { min-height: 48px; }
  body:has(.cc-modal-layer) .mobile-app-nav { visibility: hidden !important; pointer-events: none !important; }
}
/* Prevent phone browsers zooming login and other inputs on focus. */
@media (max-width: 1023px) {
  input:not([type=checkbox]):not([type=radio]), textarea, select { font-size: 16px !important; }
}
