/* Ajustes partilhados para a experiência Nautilus em telemóvel. */
@media (max-width: 700px) {
  html { -webkit-text-size-adjust: 100%; }
  body:has(.rail),
  body:has(.side-rail) { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  button, a, input, select, textarea { touch-action: manipulation; }
  input, select, textarea { font-size: 16px !important; }

  .rail,
  .side-rail {
    display: flex !important;
    position: fixed !important;
    inset: auto 0 0 0 !important;
    width: 100% !important;
    height: calc(64px + env(safe-area-inset-bottom)) !important;
    padding: 5px 6px env(safe-area-inset-bottom) !important;
    flex-direction: row !important;
    align-items: stretch !important;
    justify-content: space-around !important;
    gap: 2px !important;
    overflow: hidden !important;
    background: rgba(255,255,255,.98) !important;
    border: 0 !important;
    border-top: 1px solid var(--line, #dedfe5) !important;
    box-shadow: 0 -8px 24px rgba(21,21,34,.08) !important;
    z-index: 1900 !important;
  }
  .rail a,
  .side-rail .rail-link {
    width: auto !important;
    min-width: 0 !important;
    min-height: 54px !important;
    flex: 1 1 0 !important;
    padding: 5px 2px !important;
    border-radius: 9px !important;
    font-size: 9px !important;
    line-height: 1.1 !important;
  }
  .rail a svg,
  .side-rail .rail-link svg { width: 20px !important; height: 20px !important; }
  .side-rail .rail-spacer,
  .side-rail > button:last-child { display: none !important; }

  .search-shell { padding: 8px 12px !important; }
  .compact-search { grid-template-columns: 1fr 1fr !important; gap: 8px !important; }
  .compact-search .location-control { grid-column: 1 / -1 !important; }
  .compact-search .filter-trigger,
  .compact-search .save-inline { width: 100% !important; justify-content: center !important; }
  .map-panel { height: 285px !important; }
  .results-pane { padding: 18px 12px 82px !important; }
  .results-pane .section-top { margin-bottom: 15px !important; }
  .results-pane .section-top h2 { font-size: 24px !important; }
  .card .card-body { padding: 15px !important; }
  .card .listing-price { font-size: 24px !important; }
  .decision-fact { font-size: 12px !important; }

  .property-dialog { height: 100dvh !important; }
  .property-top { height: 58px !important; padding: 0 12px !important; }
  .property-top strong { max-width: 52vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .property-content { padding: 12px !important; }
  .property-gallery { grid-template-rows: 245px !important; }
  .property-heading { display: block !important; }
  .property-heading h2 { font-size: 26px !important; }
  .property-facts { gap: 8px !important; }
  .property-fact { min-height: 66px !important; }
  .property-area-map { height: 220px !important; }
  .modal { padding: 0 !important; align-items: end !important; }
  .modal-box,
  .modal-box.compact {
    width: 100% !important;
    max-height: 92dvh !important;
    overflow: auto !important;
    border-radius: 20px 20px 0 0 !important;
    padding: 24px 16px calc(22px + env(safe-area-inset-bottom)) !important;
  }
  .form-actions { position: sticky; bottom: 0; background: #fff; padding-top: 12px; }

  main, .page { margin-left: 0 !important; }
  .page-head h1 { font-size: 28px !important; }
  .empty-state { min-height: calc(100dvh - 190px) !important; padding: 25px 16px 90px !important; }
  .tip { margin-top: 28px !important; }
  .workspace { gap: 16px !important; }
  .content, main.content { padding-bottom: 90px !important; }
  .results-panel { min-height: 390px !important; }
  .empty { min-height: 330px !important; padding: 28px 16px !important; }
  .toolbar { align-items: stretch !important; }
  .toolbar .filters { display: grid !important; grid-template-columns: 1fr !important; width: 100% !important; }
  .toolbar .select-wrap,
  .toolbar .select-wrap select { width: 100% !important; min-width: 0 !important; }
  .head-actions { width: 100%; justify-content: flex-start; flex-wrap: wrap; }

  .layout { height: calc(100dvh - 64px) !important; }
  .chat { height: calc(100dvh - 64px) !important; }
  .composer { padding-bottom: max(14px, env(safe-area-inset-bottom)) !important; }
  .connection span:last-child { display: none; }
}

@media (max-width: 480px) {
  .nav-right { gap: 7px !important; }
  .nav-right a[href^="login.html"],
  .nav-right a[href="conta.html"] {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    padding: 8px 10px !important;
    border: 1px solid var(--line, #dedfe5) !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: var(--navy, #171725) !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    white-space: nowrap !important;
  }
  .nav-right a[href="favoritos.html"] { display: none !important; }
  .actions .btn.red { padding-inline: 11px !important; font-size: 12px !important; }
  .property-facts { grid-template-columns: 1fr 1fr !important; }
  .feature-options { grid-template-columns: 1fr !important; }
}
