/* The reference's quiet surfaces, with EstateHub's compact phone layout. */
@media (max-width:760px) {
  :root { --page-gutter:16px; }

  .topbar { min-height:66px; padding:10px 16px; background:#fff; border-bottom:1px solid #ebebeb; }
  .topbar .brand-caption { display:none; }
  .topbar .mobile-top-controls { gap:6px; }
  .topbar .mobile-top-control { background:#fff; border:1px solid var(--line); border-radius:50%; box-shadow:none; }
  .topbar .mobile-top-control:focus-within { outline-color:var(--ink); }

  body[data-view=home] .market-hero { padding-top:16px; padding-bottom:12px; }
  body[data-view=home] .market-hero-content { gap:0; }
  body[data-view=home] .market-hero h1 { font-size:24px; line-height:1.2; letter-spacing:-.65px; font-weight:650; }
  body[data-view=home] .hero-subtitle { display:none; }

  /* No new positioning context: the filter sheet and its fixed footer keep
     their existing viewport geometry. */
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-composer {
    padding:0; border:0; border-radius:0; background:transparent; box-shadow:none;
  }
  .search-mode-tabs { grid-template-columns:1fr 1fr; gap:2px; padding:2px; margin-bottom:8px; border-radius:999px; background:var(--soft); }
  .search-mode-tabs > button { min-height:44px; padding:8px 6px; border-radius:999px; color:var(--muted); font-size:13px; }
  .search-mode-tabs > button[aria-selected=true] { color:var(--accent-ink); background:var(--accent-soft); box-shadow:none; }
  .search-mode-tabs > button[aria-selected=false] { color:var(--muted); background:transparent; box-shadow:none; }
  .search-mode-spark { color:var(--accent); }
  .search-composer #searchAssistantHost { margin:0; }
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) #searchAssistantHost,
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) #parameterSearchPanel {
    height:120px; min-height:120px;
  }
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) #parameterSearchPanel:not([hidden]) {
    display:flex; flex-direction:column;
  }
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) #parameterSearchPanel > #searchForm {
    order:1; flex:none;
  }
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) #parameterSearchPanel > .search-section-head {
    order:2; flex:none; height:44px; min-height:44px; margin:8px 0 0;
  }
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-composer .deal-tabs {
    width:100%; height:44px; gap:2px;
  }
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-composer .deal-tabs button {
    flex:1 1 0; min-width:0; height:44px; min-height:44px; padding:8px 3px; font-size:12px; line-height:20px; white-space:nowrap;
  }
  .search-composer .assistant-form {
    min-height:60px; padding:4px; gap:4px; border:1px solid var(--line); border-radius:999px;
    background:#fff; box-shadow:0 2px 8px #00000008;
  }
  .search-composer .assistant-form:focus-within { border-color:var(--ink); box-shadow:0 0 0 1px var(--ink); }
  /* The animated spark is already in the AI tab; give the query its width. */
  .search-composer .assistant-form .assistant-symbol { display:none; }
  .search-composer .assistant-form #assistantQuery {
    height:50px; min-height:50px; max-height:50px; padding:13px 4px 13px 12px;
    color:var(--ink); font-size:16px; line-height:24px; text-align:center;
  }
  .search-composer .assistant-form #assistantQuery::placeholder { color:var(--muted); }
  .search-composer .assistant-form .assistant-submit {
    flex-basis:78px; width:78px; height:50px; min-height:50px; padding:0;
    border-radius:999px; background:var(--action); color:#fff; box-shadow:none;
  }
  .search-composer .assistant-form .assistant-submit:hover { background:var(--accent-ink); }
  .search-composer .assistant-form .assistant-clear { flex-basis:24px; width:24px; color:var(--muted); }
  .search-composer .assistant-footer { margin-top:6px; min-height:30px; max-height:54px; overflow:auto; scrollbar-width:thin; }
  .search-composer .assistant-examples { gap:6px; }
  .search-composer .assistant-examples button {
    min-height:30px; height:30px; max-width:none; padding:5px 10px; border:1px solid #ebebeb;
    border-radius:999px; background:#fff; color:var(--muted); font-size:11px; line-height:18px; white-space:nowrap;
  }
  .search-composer .assistant-examples button:hover { border-color:var(--ink); color:var(--ink); }
  .search-composer .assistant-message, .search-composer .assistant-scope { color:var(--muted); }
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-composer #activeSearchFilters {
    height:36px; min-height:36px; padding:4px 0; margin:0;
  }
  .search-composer .active-filter-chip-group { border-color:#ebebeb; background:var(--soft); }
  .search-composer .active-filter-chip:hover, .search-composer .active-filter-remove:hover { color:var(--ink); background:#ebebeb; }
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-composer #searchForm.search-controls {
    padding:4px; border:1px solid var(--line); border-radius:999px; background:#fff; box-shadow:0 2px 8px #00000008;
  }
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-composer #searchForm.search-controls > .search-submit {
    border-radius:999px; background:var(--action); color:#fff;
  }
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-composer #searchForm.search-controls > .location-filter > summary { padding-left:16px; }

  body[data-view=home] .promo-carousel { padding-top:4px; }
  body[data-view=home] .promo-carousel .promo-banner { height:34px; min-height:34px; padding:6px 12px; border-color:#ebebeb; background:#fff; }
  body[data-view=home] .promo-carousel .promo-banner span { color:var(--muted); font-size:12px; }
  body[data-view=home] .promo-carousel .promo-banner:hover { border-color:var(--ink); background:var(--soft); }
  body[data-view=home] .results-toolbar {
    display:grid !important; grid-template-columns:minmax(0,1fr); align-items:center; gap:2px;
    padding-top:14px; padding-bottom:10px;
  }
  body[data-view=home] .results-heading { grid-column:1/-1; gap:6px 8px; }
  body[data-view=home] .results-heading h2 { font-size:18px; line-height:1.25; margin:0; letter-spacing:-.35px; }
  body[data-view=home] .results-heading p,
  body[data-view=home] .results-heading #statusLine { color:var(--muted); font-size:12px; line-height:1.4; font-weight:400; }
  body[data-view=home] .results-toolbar .search-sort { width:auto; min-width:0; justify-self:end; }
  body[data-view=home] .results-toolbar .sort-filter select {
    width:100%; max-width:none; min-height:44px; height:44px; padding:0 18px 0 0;
    border:0; border-radius:0; background-color:transparent; color:var(--ink); font-size:14px; font-weight:500;
  }

  /* Palette only for overlays: no changes to their stable actions or bounds. */
  .search-form .filter-dialog { border-color:var(--line); background:#fff; box-shadow:0 12px 48px #0000001a; }
  .search-form .filter-panel-heading, .search-form .filter-actions { border-color:#ebebeb; background:#fff; }
  .search-form .filter-panel-heading h2 { color:var(--ink); }
  .search-form .filter-panel-heading button, .mobile-filter-close { color:var(--ink); background:var(--soft); }
  .search-form .filter-actions .filter-apply,
  body.mobile-filters-open #searchForm > .search-submit { background:var(--action); color:#fff; }
  .search-form .filter-actions .filter-reset { color:var(--ink); background:transparent; }
  .mobile-bottom-nav { background:#fff; border-top:1px solid #ebebeb; box-shadow:none; }
  .mobile-bottom-nav button { color:var(--muted); }
  body[data-view=home]:not(.map-fullscreen-active) .mobile-bottom-nav [data-mobile-action=home] { color:var(--accent-ink); }
  body.map-fullscreen-active .mobile-bottom-nav [data-mobile-action=map] { color:var(--accent-ink); }
  .mobile-bottom-nav button:hover, .mobile-bottom-nav button:focus-visible { color:var(--ink); background:var(--soft); }
  .detail-redesign .detail-contact-actions { border-top-color:#ebebeb; background:#fff; box-shadow:0 -3px 18px #00000008; }
  .detail-redesign .detail-contact-actions .primary { background:var(--action); color:#fff; }
  .detail-redesign .detail-heading h1 { color:var(--ink); }
}

@media (max-width:359px) {
  body[data-view=home] .market-hero h1 { font-size:22px; letter-spacing:-.55px; }
  body[data-view=home] .results-heading h2 { font-size:16px; }
  body[data-view=home] .results-heading p,
  body[data-view=home] .results-heading #statusLine { font-size:11px; }
  body[data-view=home] .results-toolbar .sort-filter select { font-size:13px; }
  .search-mode-tabs > button { font-size:12px; }
  body[data-view=home]:not(.mobile-filters-open):not(.map-fullscreen-active) .search-composer .deal-tabs button { font-size:11px; }
}
