/* Dirham Life V8.8 — iPad / tablet responsive interface.
   Phones keep the original bottom navigation; desktop keeps its existing frame. */
@media (min-width: 768px) and (max-width: 1366px) {
  html, body { min-height: 100%; background: #eff3ed; }
  .page-frame { display: block; min-height: 100dvh; padding: 0; }
  .marketing { display: none; }

  /* Full-width native tablet canvas rather than a 430px phone preview. */
  .phone {
    width: 100%; max-width: none; height: 100dvh; min-height: 100dvh;
    border-radius: 0; box-shadow: none; background: #f7f8f4;
  }
  .phone::before { display: none; }
  .topbar {
    height: 80px; min-height: 80px;
    padding: 12px max(30px, env(safe-area-inset-right)) 12px max(30px, env(safe-area-inset-left));
    border-bottom: 1px solid #e5eae1;
    background: #fbfcf8;
  }
  .brand { font-size: 23px; gap: 11px; }
  .brand-mark { width: 44px; height: 44px; border-radius: 13px; font-size: 14px; }
  .version { font-size: 10px; }
  .header-actions { gap: 11px; }
  .header-actions .avatar-button { width: 43px; height: 43px; }
  .header-actions .avatar-button .ico { width: 19px; height: 19px; }
  .header-actions .small-pill { min-height: 43px; font-size: 13px; padding: 8px 13px; }
  .dlc-account-button { width: 43px; min-width: 43px; height: 43px; }
  .dlc-account-button .dlc-cloud-icon { font-size: 20px; }

  /* Permanent sidebar navigation gives the content more vertical room. */
  .bottom-nav {
    position: absolute; left: 0; top: 80px; bottom: 0;
    z-index: 12; height: auto; width: 114px;
    display: flex; flex-direction: column; justify-content: flex-start;
    padding: 25px 11px 20px max(11px, env(safe-area-inset-left));
    gap: 10px; border-top: 0; border-right: 1px solid #e0e7dd;
    background: #fbfcf8; box-shadow: none; overflow-y: auto;
  }
  .nav-item {
    flex: 0 0 auto; width: 100%; min-height: 77px;
    font-size: 12px; line-height: 1.25; padding: 10px 4px;
    gap: 4px; border-radius: 15px;
  }
  .nav-item .ico { width: 23px; height: 23px; }
  .nav-icon { padding: 7px; }
  .nav-item.active { background: #eaf3ec; color: #155b43; }
  .nav-item.active .nav-icon { background: #d7eade; }

  .scroller {
    margin-left: 114px; min-width: 0;
    padding: 25px clamp(28px, 4vw, 64px) max(44px, env(safe-area-inset-bottom));
    overflow-x: hidden; -webkit-overflow-scrolling: touch;
  }
  .scroller > * { max-width: 1090px; margin-left: auto; margin-right: auto; }
  .page-title { font-size: 31px; }
  .page-intro { font-size: 14px; line-height: 1.6; }
  .section-title { font-size: 19px; }
  .section-overline { font-size: 11px; }
  .hero { min-height: 215px; padding: 27px 31px; border-radius: 25px; }
  .hero-value { font-size: clamp(34px, 4vw, 44px); }
  .hero-stat strong { font-size: 14px; }
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .stat { min-height: 114px; padding: 17px 18px; }
  .stat-value { font-size: 21px; }
  .card { padding: 21px; border-radius: 20px; }
  .card + .card { margin-top: 14px; }
  .filter-grid { gap: 12px; }
  .property-grid, .car-grid, .v6-auction-grid { gap: 15px; }
  .v7-grid-2 { gap: 14px; }
  .v4-summary-grid { gap: 14px; }
  .v5-card-photo, .car-illustration { height: 150px; }
  .property-art-new { min-height: 145px; }
  .v6-car-thumb { height: 146px; }
  .v6-art-thumb { height: 145px; }
  .v6-gallery .v6-art-main, .v5-photo-main { height: 275px; }
  .v6-gallery-art.large { height: 275px!important; }
  .button { min-height: 43px; font-size: 13px; }
  .chip-btn, .segment { min-height: 42px; }
  .v7-tabs .chip-btn { min-height: 47px; }

  /* Center forms and story dialogs, instead of bottom-sheet phone dialogs. */
  .modal-overlay { align-items: center; padding: 28px 28px 28px 142px; }
  .modal-card {
    width: min(100%, 700px); max-height: min(90dvh, 900px);
    border-radius: 25px; padding: 33px 31px 27px;
    box-shadow: 0 30px 100px #0f322049;
  }
  .modal-close { width: 43px; height: 43px; }
  .v7-chat-modal {
    width: min(100%, 740px); height: min(82dvh, 820px);
    max-height: 90dvh; border-radius: 25px!important;
  }
  .v7-chat-shell { padding: 22px 26px 14px; }
  .v7-chat-title h3 { font-size: 20px; }
  .v7-chat-bubble { font-size: 14px; }
  .dlc-overlay { align-items: center; padding: 30px; }
  .dlc-dialog {
    width: min(100%, 650px); max-height: 85dvh;
    border-radius: 26px; padding: 29px 35px 31px;
  }
}

/* iPad landscape: use the extra horizontal space for listing cards and stats. */
@media (min-width: 1024px) and (max-width: 1366px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .property-grid, .car-grid, .v6-auction-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .v4-summary-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .v6-location-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .v6-feature-links { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .v6-action-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* iPad mini / portrait: compact sidebar with comfortable touch targets. */
@media (min-width: 768px) and (max-width: 900px) {
  .topbar { padding-left: 22px; padding-right: 22px; }
  .brand { font-size: 21px; gap: 9px; }
  .brand-mark { width: 41px; height: 41px; }
  .header-actions { gap: 8px; }
  .bottom-nav { width: 90px; padding-left: 8px; padding-right: 8px; }
  .nav-item { min-height: 75px; font-size: 11px; }
  .scroller { margin-left: 90px; padding: 22px 27px 40px; }
  .modal-overlay { padding-left: 109px; padding-right: 19px; }
  .modal-card { padding: 28px 24px 21px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 768px) and (max-width: 1366px) and (orientation: landscape) and (max-height: 760px) {
  .bottom-nav { gap: 4px; padding-top: 13px; }
  .nav-item { min-height: 67px; }
  .topbar { height: 70px; min-height: 70px; }
  .bottom-nav { top: 70px; }
  .scroller { padding-top: 17px; }
}
