/* ============================================================================
   ZyRox Engineering — mobile-first-v1.css (v1.0.1)
   دفعة الجوال الأولى — تُحمَّل أخيرًا (بعد modern-ui.css مباشرة):
   1) إطار التطبيق 100dvh بدل 100vh (فجوة حقيقية غير مغطاة)
   2) أهداف لمس ‎≥44px‎ للرأس والمؤلّف على الشاشات الصغيرة
   3) منتقي النماذج شيت سفلي حتى ‎≤768px‎ (امتداد لقواعد modern-ui ≤600 بنفس نمط
      التتالي html body + صنف مضاعف حتى لا تُهزم أمام model-picker-v2)
   4) نافذة الإعدادات: سقف ارتفاع مريح ‎≤768px‎
   5) منع تكبير iOS عند الكتابة في المؤلّف
   حقوق المطور ZyRox — wormgpt.cam
   ========================================================================== */

/* 1) الإطار الرئيسي: ارتفاع ديناميكي حقيقي (شريط عنوان الجوال المتحرك) */
@supports (height: 100dvh) {
  .app-frame {
    height: 100dvh !important;
  }
}

/* 2) أهداف اللمس ‎≥44px‎ على الجوال واللوح الصغير */
@media (max-width: 768px) {
  .chat-header button {
    min-width: 44px !important;
    min-height: 44px !important;
  }
  .chat-composer button {
    min-width: 44px !important;
    min-height: 44px !important;
  }
  .chat-composer button[style*="38px"] {
    width: 44px !important;
    height: 44px !important;
  }
}

/* 3) منتقي النماذج: شيت سفلي حتى 768px (بعد 600 كان يظل نافذة معلّقة) */
@media (max-width: 768px) {
  html body .focused-model-menu.focused-model-menu {
    position: fixed !important;
    inset: auto 0 0 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    max-height: min(80dvh, calc(100dvh - 72px)) !important;
    padding: 8px 14px calc(16px + env(safe-area-inset-bottom, 0px) + var(--wg-kb, 0px)) !important;
    border-radius: 24px 24px 0 0 !important;
    border-bottom: 0 !important;
    box-shadow: 0 -30px 80px -30px rgba(0, 0, 0, 0.9) !important;
  }
  html body .focused-model-menu.focused-model-menu .focused-model-heading {
    top: -8px !important;
    padding: 14px 8px 12px !important;
  }
  html body .focused-model-menu.focused-model-menu .sheet-handle {
    display: block !important;
    width: 38px !important;
    height: 4px !important;
    margin: 4px auto 10px !important;
    border-radius: 999px !important;
    background: rgba(var(--zy-veil), 0.28) !important;
  }
  html body .focused-model-menu.focused-model-menu .focused-model-option {
    min-height: 68px !important;
  }
  html body .model-menu-scrim.model-menu-scrim {
    background: rgba(0, 0, 0, 0.5) !important;
    -webkit-backdrop-filter: blur(2px) !important;
    backdrop-filter: blur(2px) !important;
  }
  html body:has(.model-menu-scrim) {
    overflow: hidden !important;
  }
}

/* 4) الإعدادات + المؤلّف على الجوال */
@media (max-width: 768px) {
  html body .settings-dialog.settings-dialog {
    max-height: 92dvh !important;
  }
  .chat-composer textarea {
    font-size: 16px;
  }
}
