/* Theo Properties RC1.0.15.129.37.1 — Mobile Property Detail Safe-Area & Close Control Lock
   Presentation-only hotfix from the locked RC1.0.15.129.37 baseline.
   Keeps the property detail sheet clear of the authenticated mobile dock and exposes
   the existing canonical modal Close action in the sheet header. No routing or business logic changes. */

@media (max-width:700px){
  body.signed-mode .modal-backdrop.property-detail-open{
    --tp-property-sheet-dock-clearance:calc(92px + env(safe-area-inset-bottom));
    align-items:flex-end!important;
    padding:0 0 var(--tp-property-sheet-dock-clearance)!important;
  }

  body.signed-mode .modal-backdrop.property-detail-open .modal{
    position:relative!important;
    bottom:auto!important;
    width:100%!important;
    max-width:none!important;
    max-height:calc(100dvh - var(--tp-property-sheet-dock-clearance) - 10px)!important;
    margin:0!important;
    overflow:auto!important;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
    border-radius:14px 14px 0 0!important;
  }

  /* Keep the title clear of the persistent Close control. */
  body.signed-mode .modal-backdrop.property-detail-open .modal>h2{
    position:sticky!important;
    top:0!important;
    z-index:12!important;
    min-height:58px!important;
    margin:0!important;
    padding:20px 92px 14px 16px!important;
    background:rgba(255,255,255,.98)!important;
    border-bottom:1px solid #e6ecef!important;
    -webkit-backdrop-filter:blur(12px)!important;
    backdrop-filter:blur(12px)!important;
  }

  /* Reuse the canonical #modal-close button; move it into an always-visible header position. */
  body.signed-mode .modal-backdrop.property-detail-open .modal-actions{
    position:absolute!important;
    top:8px!important;
    right:10px!important;
    bottom:auto!important;
    left:auto!important;
    z-index:14!important;
    width:auto!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
    box-shadow:none!important;
    pointer-events:none!important;
  }
  body.signed-mode .modal-backdrop.property-detail-open .modal-actions #modal-close{
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    min-width:70px!important;
    min-height:44px!important;
    height:44px!important;
    padding:0 14px!important;
    border:1px solid #cfdbe1!important;
    border-radius:6px!important;
    background:#fff!important;
    color:#17364d!important;
    box-shadow:0 5px 14px rgba(16,43,67,.08)!important;
    font:750 13px/1 Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif!important;
    pointer-events:auto!important;
  }
  body.signed-mode .modal-backdrop.property-detail-open .modal-actions #modal-close:focus-visible{
    outline:2px solid #c89758!important;
    outline-offset:2px!important;
  }
  body.signed-mode .modal-backdrop.property-detail-open .modal-actions #modal-action{
    display:none!important;
  }

  /* The final property controls must never disappear underneath the fixed dock. */
  body.signed-mode .modal-backdrop.property-detail-open #modal-content{
    padding-bottom:18px!important;
  }
  body.signed-mode .modal-backdrop.property-detail-open .detail-action-dock{
    margin-bottom:4px!important;
    padding-bottom:18px!important;
  }
}

/* Portrait tablets also use the compact authenticated dock. Preserve a deliberate
   lower safe zone without converting the tablet property dialog into a phone sheet. */
@media (orientation:portrait) and (min-width:701px) and (max-width:1366px){
  body.signed-mode .modal-backdrop.property-detail-open{
    padding-bottom:calc(86px + env(safe-area-inset-bottom))!important;
  }
  body.signed-mode .modal-backdrop.property-detail-open .modal{
    max-height:calc(100dvh - 112px - env(safe-area-inset-bottom))!important;
  }
  body.signed-mode .modal-backdrop.property-detail-open .modal>h2{
    padding-right:104px!important;
  }
  body.signed-mode .modal-backdrop.property-detail-open .modal-actions{
    position:absolute!important;
    top:10px!important;
    right:12px!important;
    bottom:auto!important;
    z-index:14!important;
    width:auto!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    background:transparent!important;
  }
  body.signed-mode .modal-backdrop.property-detail-open .modal-actions #modal-close{
    min-width:76px!important;
    min-height:44px!important;
    border-radius:6px!important;
  }
  body.signed-mode .modal-backdrop.property-detail-open .modal-actions #modal-action{display:none!important;}
}
