/* Stage 50 item 2: «جزئیات» opens right where you are. The four detail areas (property file, need, contact, match) used to be
   filled at the bottom of a long list; while one has content it is shown as a window over the page. Closing it (its own
   «بستن» button, Esc or a click outside) returns to the same place in the list. Visual only: the app fills and empties the
   areas exactly as before. */
#propertyDetail:not(:empty),#requirementDetail:not(:empty),#contactDetail:not(:empty),#matchDetail:not(:empty){
  position:fixed;z-index:60;inset:max(12px,3vh) 50% auto auto;transform:translateX(50%);
  width:min(980px,calc(100vw - 24px));max-height:calc(100vh - max(24px,6vh));overflow:auto;overscroll-behavior:contain;
  margin:0;padding:18px 20px;border-radius:16px;background:var(--u-surface,#fff);border:1px solid var(--u-line,#e4e7ec);
  box-shadow:0 0 0 100vmax rgba(15,39,64,.55),0 24px 60px -20px rgba(15,39,64,.6)}
html.s50-detail-open,html.s50-detail-open body{overflow:hidden}
/* one «✕ بستن» at the top of the window, always above the content (it presses the area's own close button); the app's own
   close buttons keep their places (a sticky one sank under the 3D-styled property section on phones) */
.s50-close{position:sticky;top:0;z-index:100;display:block;margin:-6px 0 8px auto;padding:7px 14px;border:1px solid var(--u-line-strong,#d0d5dd);
  border-radius:9px;background:var(--u-surface,#fff);color:var(--u-ink,#14202e);font:inherit;font-size:14px;cursor:pointer;box-shadow:0 4px 12px -8px #0f274066}
@media (max-width:720px){
  #propertyDetail:not(:empty),#requirementDetail:not(:empty),#contactDetail:not(:empty),#matchDetail:not(:empty){
    inset:0;transform:none;width:100%;max-height:none;height:100%;border-radius:0;padding:14px 14px 28px;box-shadow:none}
}

/* Stage 50 item 4: on a phone nothing is wider than the screen (measured page by page with t50_overflow.py) */
@media (max-width:720px){
  /* contact cards: the name, «🔒 محرمانه», role and date tags wrap instead of widening the page (it was 469 px on a 390 px phone) */
  .contact-card{flex-wrap:wrap;row-gap:6px}
  .contact-card-main{flex:1 1 60%}
  .contact-card .contact-chip,.contact-card .contact-source{flex:0 0 auto}
  .s48-private{white-space:normal;overflow-wrap:anywhere}
  /* property cards: area / rooms / … chips wrap instead of being cut off */
  .listing-specs{flex-wrap:wrap}
  .listing-image{transform:none}
  #content{overflow-wrap:anywhere}
}

/* Stage 50 item 2: the property / need / match cards were still drawn in 3D (the tilt effect itself was turned off in stage 49);
   their text area sat 28 px «in front», so a click on the middle of a «جزئیات» button sometimes landed on the area instead of the
   button. The cards are drawn flat (they look the same). */
.listing-card,.need-card,.match-card{transform-style:flat}
.listing-card .listing-body,.listing-card .listing-image,.listing-card .listing-image>*,.need-card>*,.match-card>*{transform:none}
