.mobile-app-nav { display: none; }
.mobile-book-sheet { display: none; }

@media (max-width: 640px) {
  .mobile-app-nav {
    align-items: center;
    background: rgba(251,250,247,.97);
    border-top: 1px solid #dcded9;
    bottom: 0;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: calc(66px + env(safe-area-inset-bottom));
    left: 0;
    padding: 5px 5px env(safe-area-inset-bottom);
    position: fixed;
    right: 0;
    z-index: 85;
  }

  body:has(.chat-toggle:checked) .mobile-app-nav,
  body.saved-drawer-open .mobile-app-nav { display: none; }

  body:has(.results-workspace:target) .app-header .header-actions > .saved-link,
  body:has(.results-workspace:target) .app-header .header-actions > .profile-button { display: none; }
  body:has(.results-workspace:target) .profile-menu { bottom: calc(73px + env(safe-area-inset-bottom)); right: 10px; top: auto; transform: translateY(7px); width: min(280px, calc(100vw - 20px)); }
  body:has(.results-workspace:target) .profile-menu.is-open { transform: translateY(0); }

  .mobile-nav-item {
    align-items: center;
    background: transparent;
    border: 0;
    color: #7a867f;
    display: flex;
    flex-direction: column;
    font-size: 9px;
    font-weight: 500;
    gap: 4px;
    height: 55px;
    justify-content: center;
    padding: 0;
    position: relative;
    transition: color 160ms ease, transform 160ms ease;
  }

  .mobile-nav-item svg { height: 21px; stroke-width: 1.7; transition: transform 180ms cubic-bezier(.22,.8,.25,1), stroke-width 160ms ease; width: 21px; }
  .mobile-nav-item.is-active { color: #183027; font-weight: 600; }
  .mobile-nav-item.is-active::after { animation: mobile-nav-dot-in 180ms ease-out both; background: #183027; border-radius: 50%; bottom: 1px; content: ""; height: 3px; position: absolute; width: 3px; }
  .mobile-nav-item.is-active svg { stroke-width: 2.15; transform: translateY(-1px); }
  .mobile-nav-item:active { transform: scale(.94); }
  .mobile-nav-profile-icon { align-items: center; background: #ddcdb9; border: 1px solid transparent; border-radius: 50%; display: flex; font-size: 8px; font-weight: 600; height: 22px; justify-content: center; width: 22px; }
  .mobile-nav-item.is-active .mobile-nav-profile-icon { border-color: #183027; }

  body:has(.results-workspace:target) .chat-panel:not(:has(.chat-toggle:checked)) { bottom: calc(74px + env(safe-area-inset-bottom)); }

  body:has(.results-workspace:target) .listing-panel { padding: 17px 10px calc(156px + env(safe-area-inset-bottom)); }
  body:has(.results-workspace:target) .listing-toolbar { align-items: center; }
  body:has(.results-workspace:target) .mobile-back { display: none; }
  body:has(.results-workspace:target) .result-title h1 { font-size: 28px; margin-top: 5px; }
  body:has(.results-workspace:target) .result-kicker { font-size: 9px; }
  body:has(.results-workspace:target) .view-actions { display: none; }
  body:has(.results-workspace:target) .filter-row {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin: 16px 0 0;
    overflow: visible;
    padding: 0 0 14px;
  }
  body:has(.results-workspace:target) .mobile-listing-search {
    align-items: center;
    background: #fff;
    border: 1px solid #d9ded9;
    border-radius: 24px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 46px;
    padding: 0 12px 0 15px;
  }
  body:has(.results-workspace:target) .mobile-listing-search:focus-within {
    border-color: #789085;
    box-shadow: 0 0 0 3px rgba(24, 48, 39, .08);
  }
  body:has(.results-workspace:target) .mobile-listing-search > svg {
    color: #607168;
    height: 17px;
    width: 17px;
  }
  body:has(.results-workspace:target) .mobile-listing-search input {
    background: transparent;
    border: 0;
    color: #172820;
    font: inherit;
    font-size: 13px;
    height: 44px;
    min-width: 0;
    outline: 0;
    padding: 0 9px;
    width: 100%;
  }
  body:has(.results-workspace:target) .mobile-listing-search input::placeholder { color: #8a9690; opacity: 1; }
  body:has(.results-workspace:target) .mobile-listing-search input::-webkit-search-cancel-button { display: none; }
  body:has(.results-workspace:target) .mobile-search-clear {
    align-items: center;
    background: #eef1ed;
    border: 0;
    border-radius: 50%;
    color: #53645b;
    display: flex;
    height: 26px;
    justify-content: center;
    padding: 0;
    width: 26px;
  }
  body:has(.results-workspace:target) .mobile-search-clear[hidden] { display: none; }
  body:has(.results-workspace:target) .mobile-search-clear svg { height: 13px; width: 13px; }
  body:has(.results-workspace:target) .filter-row .filter-chip {
    gap: 5px;
    justify-content: center;
    min-height: 42px;
    min-width: 0;
    padding: 0 9px;
    width: 100%;
  }
  body:has(.results-workspace:target) .filter-row .filter-chip > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body:has(.results-workspace:target) .filter-row .filter-chip > svg:first-child { flex: 0 0 auto; height: 14px; width: 14px; }
  body:has(.results-workspace:target) .filter-row .filter-chip > svg:last-child { flex: 0 0 auto; }
  body:has(.results-workspace:target) .filter-location,
  body:has(.results-workspace:target) .filter-dates,
  body:has(.results-workspace:target) .filter-guests,
  body:has(.results-workspace:target) .filter-price { display: none; }
  body:has(.results-workspace:target) .filter-all {
    border: 1px solid #183027;
    min-width: 106px;
  }
  body:has(.results-workspace:target) .sort-button { display: none; }
  body:has(.results-workspace:target) .result-context { font-size: 10px; padding: 13px 1px 11px; }
  body:has(.results-workspace:target) .result-context > span { display: none; }
  body:has(.results-workspace:target) .villa-grid { gap: 20px 8px; grid-template-columns: repeat(2, minmax(0,1fr)); }
  body:has(.results-workspace:target) .villa-photo { aspect-ratio: 1 / 1.08; height: auto; }
  body:has(.results-workspace:target) .match-badge { font-size: 8px; left: 6px; padding: 5px 6px; top: 6px; }
  body:has(.results-workspace:target) .match-badge svg { height: 9px; width: 9px; }
  body:has(.results-workspace:target) .heart-button { height: 29px; right: 6px; top: 6px; width: 29px; }
  body:has(.results-workspace:target) .photo-count { display: none; }
  body:has(.results-workspace:target) .villa-details { padding-top: 8px; }
  body:has(.results-workspace:target) .villa-details h2 { font-size: 18px; line-height: 1.05; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body:has(.results-workspace:target) .villa-details p { font-size: 9px; line-height: 1.4; }
  body:has(.results-workspace:target) .rating { font-size: 9px; padding-left: 4px; padding-top: 2px; }
  body:has(.results-workspace:target) .reason { display: none; }
  body:has(.results-workspace:target) .villa-bottom { border: 0; padding: 7px 0 0; }
  body:has(.results-workspace:target) .villa-bottom > span { display: none; }
  body:has(.results-workspace:target) .villa-bottom p { color: #647168; font-size: 9px; }
  body:has(.results-workspace:target) .villa-bottom p strong { font-size: 12px; }

  body:has(.results-workspace:target) .listing-panel.map-open { height: calc(100dvh - 39px); overflow: hidden; padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
  body:has(.results-workspace:target) .listing-panel.map-open .listing-toolbar,
  body:has(.results-workspace:target) .listing-panel.map-open .filter-row { display: none; }
  body:has(.results-workspace:target) .listing-panel.map-open .map-view { height: calc(100dvh - 39px - 74px - env(safe-area-inset-bottom)); margin: 0 -10px; min-height: 0; }
  body:has(.results-workspace:target) .listing-panel.map-open .map-close-button { display: none; }
  body:has(.listing-panel.map-open) .chat-panel:not(:has(.chat-toggle:checked)) { display: none; }

  .mobile-book-sheet { inset: 0; pointer-events: none; position: fixed; z-index: 205; }
  .mobile-book-sheet.is-open { display: block; pointer-events: auto; }
  .mobile-book-backdrop { background: rgba(14,28,22,.36); border: 0; inset: 0; opacity: 0; position: absolute; width: 100%; }
  .mobile-book-sheet.is-open .mobile-book-backdrop { opacity: 1; }
  .mobile-book-panel { background: #fbfaf7; border-radius: 22px 22px 0 0; bottom: 0; left: 0; padding: 12px 20px calc(28px + env(safe-area-inset-bottom)); position: absolute; transform: translateY(100%); transition: transform 240ms cubic-bezier(.22,.8,.25,1); width: 100%; }
  .mobile-book-sheet.is-open .mobile-book-panel { transform: translateY(0); }
  .mobile-sheet-handle { background: #ccd1cc; border-radius: 5px; height: 4px; margin: 0 auto 20px; width: 42px; }
  .mobile-book-panel header { align-items: center; display: flex; justify-content: space-between; }
  .mobile-book-panel header span { color: #718078; font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
  .mobile-book-panel h2 { font-family: "Instrument Serif", Georgia, serif; font-size: 34px; font-weight: 400; margin: 5px 0 0; }
  .mobile-book-close { align-items: center; background: transparent; border: 1px solid #d4d8d2; border-radius: 50%; display: flex; height: 36px; justify-content: center; width: 36px; }
  .mobile-book-close svg { height: 16px; width: 16px; }
  .mobile-book-empty { align-items: center; border: 1px solid #e0e2dc; display: flex; flex-direction: column; margin-top: 24px; padding: 32px 20px; text-align: center; }
  .mobile-book-empty > span { align-items: center; background: #edf1ec; border-radius: 50%; color: #53685e; display: flex; height: 52px; justify-content: center; width: 52px; }
  .mobile-book-empty svg { height: 23px; width: 23px; }
  .mobile-book-empty strong { font-size: 14px; margin-top: 15px; }
  .mobile-book-empty p { color: #718078; font-size: 11px; line-height: 1.6; margin: 7px 0 0; max-width: 280px; }
  .mobile-book-empty button { background: #183027; border: 0; color: white; font-size: 12px; margin-top: 18px; padding: 12px 18px; }

  .filter-sheet-panel {
    border-radius: 22px 22px 0 0;
    height: calc(100dvh - 42px);
    max-width: none;
    transform: translateY(100%);
  }
  .listing-filter-sheet.is-open .filter-sheet-panel { transform: translateY(0); }
  .filter-sheet-header { padding: 18px 18px 15px; }
  .filter-sheet-header h2 { font-size: 32px; }
  .filter-sheet-scroll { padding: 0 18px 22px; scroll-padding-top: 14px; }
  .filter-section { padding: 21px 0 23px; }
  .filter-section-title { grid-template-columns: 32px 1fr; }
  .filter-section-title > span { height: 32px; width: 32px; }
  .filter-choice-grid label > span,
  .filter-amenity-grid label > span { min-height: 46px; }
  .filter-date-grid { grid-template-columns: 1fr; }
  .filter-date-grid input { min-height: 48px; }
  .filter-sheet-footer { padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); }
  .filter-apply { min-height: 48px; }
  .listing-empty-state { min-height: 350px; padding: 55px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-book-panel { transition: none; }
}

@keyframes mobile-nav-dot-in {
  from { opacity: 0; transform: translateY(3px) scale(.4); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
