/* Mobile search uses the same controls and saved-search contract as desktop. */
@media (max-width: 800px) {
  .search-section .search-panel {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(20, 23, 20, .035);
  }
  .search-panel .search-head { gap: 8px; margin-bottom: 8px; }
  .search-panel .search-caption { font-size: 12px; font-weight: 600; line-height: 1.5; }
  .search-panel .deal-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px;
    width: 100%;
    padding: 3px;
    border-radius: 9px;
  }
  .search-panel .deal-tabs button {
    min-width: 0;
    min-height: 34px;
    padding: 4px 3px;
    font-size: 11px;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: normal;
    border-radius: 7px;
  }
  .search-panel .deal-tabs button.selected { box-shadow: 0 2px 5px rgba(0, 0, 0, .08); }
  .search-panel .search-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .search-panel .search-fields > label {
    height: 54px;
    min-height: 54px;
    padding: 5px 10px;
    gap: 6px;
    background: var(--subtle);
    border: 1px solid transparent;
    border-radius: 10px;
  }
  .search-panel .search-fields > label > [data-icon] { display: none; }
  .search-panel .field-text { width: 100%; font-size: 9px; line-height: 1.35; }
  .search-panel .search-fields .custom-select { width: 100%; }
  .search-panel .search-fields .custom-select-trigger {
    height: 28px;
    min-height: 28px;
    padding: 1px 0 0;
    gap: 6px;
    font-size: 11px;
    line-height: 1.35;
  }
  .search-panel .search-fields .custom-select-value { white-space: normal; overflow: visible; overflow-wrap: normal; text-overflow: clip; line-height: 1.35; }
  .search-panel .search-budget-field {
    grid-column: 1 / -1;
    height: 54px;
    min-height: 54px;
    padding: 0;
    gap: 8px;
    background: transparent;
  }
  .search-panel .search-budget-heading { height: 54px; }
  .search-panel .search-budget-heading .currency-switch { padding: 3px; gap: 2px; }
  .search-panel .search-budget-heading .currency-button { min-width: 32px; height: 38px; padding: 0 6px; font-size: 13px; }
  .search-panel .search-budget-range { gap: 8px; }
  .search-panel .search-budget-range > label { height: 54px; padding: 5px 10px; gap: 1px; }
  .search-panel .search-price-label {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    clip-path: none;
    white-space: normal;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.5;
  }
  .search-panel .search-budget-range input {
    height: 26px;
    min-height: 26px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 16px;
    line-height: 1.5;
    font-weight: 600;
  }
  .search-panel .search-budget-range input:focus-visible { box-shadow: none; outline: none; }
  .search-panel .search-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 8px; }
  .search-panel .search-actions #advanced-toggle,
  .search-panel .search-actions .search-button { min-height: 42px; height: 42px; padding: 8px 10px; border-radius: 9px; font-size: 11px; line-height: 1.4; }
  .search-panel .search-filter-label-full { display: none; }
  .search-panel .search-filter-label-short { display: inline; }
  .search-panel .search-button svg { width: 17px; height: 17px; }
  .search-panel .search-budget-error { margin: 10px 2px 0; font-size: 11px; }

  .search-section .search-presets { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; margin-top: 5px; padding: 0 2px; }
  .search-section .search-presets .text-button { min-height: 34px; padding: 4px 0; font-size: 9px; color: var(--muted); }
  .search-section #home-save-search { grid-column: 1; grid-row: 1; justify-self: start; }
  .search-section #home-save-search svg { width: 15px; height: 15px; color: var(--orange-strong); }
  .search-section .search-presets > a { grid-column: 2; grid-row: 1; text-align: right; }
  .search-section .search-presets .preset-quick-list { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: nowrap; min-width: 0; overflow-x: auto; gap: 7px; scrollbar-width: none; }
  .search-section .search-presets .preset-quick-list:empty { display: none; }
  .search-section .preset-quick-list::-webkit-scrollbar { display: none; }
  .search-section .preset-quick { flex: none; min-height: 34px; font-size: 10px; padding: 7px 12px; }
  .search-section .search-presets-hint { grid-column: 1 / -1; grid-row: 3; margin-top: 0; font-size: 8px; line-height: 1.5; }
  body[data-page="home"] .listings-section { padding-top: 20px; }
  body[data-page="home"] .catalog-actions .currency-switch { display: none; }

  :is(#type-filter-options, #district-filter-options) .custom-select-option { min-height: 46px; font-size: 14px; padding: 10px 12px; }
  .search-filter-dialog .sf-grid input:not([type="checkbox"]) { font-size: 16px; }
  .search-filter-dialog .sf-check { font-size: 12px; }
}
@media (max-width: 359px) {
  .search-section .search-panel { padding: 10px; }
  .search-panel .deal-tabs button { font-size: 10px; }
  .search-panel .search-fields > label { padding: 5px 8px; }
  .search-panel .search-actions #advanced-toggle,
  .search-panel .search-actions .search-button { padding-left: 8px; padding-right: 8px; font-size: 11px; }
}

/* Desktop search: one compact bar (type | location | budget | filters + search). */
@media (min-width: 801px) {
  .search-section .search-panel { padding: 16px 18px 18px; border-radius: 22px; }
  .search-panel .search-head { justify-content: flex-start; margin-bottom: 12px; }
  .search-panel .search-caption { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .search-panel .deal-tabs { padding: 3px; gap: 2px; border-radius: 999px; }
  .search-panel .deal-tabs button { min-height: 34px; padding: 6px 16px; border-radius: 999px; font-size: 12px; }
  .search-panel .search-fields { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1.35fr) auto; gap: 0; align-items: stretch; padding: 6px 6px 6px 6px; border: 1px solid var(--border); border-radius: 999px; background: var(--paper); }
  .search-panel .search-fields > label,
  .search-panel .search-fields > .search-budget-field { position: relative; min-height: 58px; height: auto; padding: 7px 20px; border: 0; border-radius: 999px; background: transparent; transition: background .15s; }
  .search-panel .search-fields > label:hover,
  .search-panel .search-fields > .search-budget-field:hover,
  .search-panel .search-fields > label:focus-within,
  .search-panel .search-fields > .search-budget-field:focus-within { background: var(--subtle); border-color: transparent; box-shadow: none; }
  .search-panel .search-fields > label + label::before,
  .search-panel .search-fields > .search-budget-field::before { content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 1px; background: var(--border); }
  .search-panel .search-fields > label:hover::before, .search-panel .search-fields > label:hover + .search-budget-field::before,
  .search-panel .search-fields > .search-budget-field:hover::before, .search-panel .search-fields > label:focus-within::before { opacity: 0; }
  .search-panel .search-fields > label > [data-icon] { display: none; }
  .search-panel .field-text { font-size: 11px; line-height: 1.5; }
  .search-panel .search-fields .custom-select-trigger { min-height: 26px; padding: 0; font-size: 14px; font-weight: 600; }
  .search-panel .search-budget-field { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-content: center; column-gap: 10px; row-gap: 0; }
  .search-panel .search-budget-heading { display: contents; }
  .search-panel .search-budget-field [data-currency-budget-label] { grid-row: 1; grid-column: 1; position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: nowrap; font-size: 11px; line-height: 1.5; color: var(--muted); }
  .search-panel .search-budget-heading .currency-switch { grid-row: 1 / span 2; grid-column: 2; align-self: center; padding: 2px; border-radius: 999px; }
  .search-panel .search-budget-heading .currency-button { height: 28px; min-width: 28px; border-radius: 999px; font-size: 12px; }
  .search-panel .search-budget-range { grid-row: 2; grid-column: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
  .search-panel .search-budget-range > label { height: auto; min-width: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .search-panel .search-budget-range > label:focus-within { background: transparent; box-shadow: none; }
  .search-panel .search-budget-range .search-price-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .search-panel .search-budget-range > span { display: inline; color: var(--muted); }
  .search-panel .search-budget-range input { height: 26px; min-height: 26px; line-height: 26px; font-size: 14px; }
  .search-panel .search-budget-range input::placeholder { color: var(--muted); opacity: .8; font-weight: 500; }
  .search-panel .search-actions { grid-column: auto; display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding-left: 8px; }
  .search-panel .search-actions #advanced-toggle { flex: 0 0 auto; width: 50px; height: 50px; min-height: 50px; padding: 0; gap: 0; border-radius: 999px; }
  .search-panel .search-actions #advanced-toggle .search-filter-label-full,
  .search-panel .search-actions #advanced-toggle .search-filter-label-short { display: none; }
  .search-panel .search-actions .search-button { height: 54px; min-height: 54px; min-width: 0; padding: 0 26px; border-radius: 999px; font-size: 13px; }
  .search-panel .search-budget-error { margin: 10px 18px 0; }
}
@media (min-width: 801px) and (max-width: 1050px) {
  .search-panel .search-fields > label, .search-panel .search-fields > .search-budget-field { padding: 7px 14px; }
  .search-panel .search-actions .search-button { padding: 0 18px; }
  .search-panel .search-fields .custom-select-trigger, .search-panel .search-budget-range input { font-size: 13px; }
}
/* v42 mobile: one grouped box (type | location / budget), pill deal tabs, round filter button. */
@media (max-width: 800px) {
  .search-section .search-panel { padding: 12px; border-radius: 18px; }
  .search-panel .search-head { margin-bottom: 10px; }
  .search-panel .search-caption { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .search-panel .deal-tabs { padding: 3px; gap: 2px; border-radius: 999px; }
  .search-panel .deal-tabs button { min-height: 34px; padding: 4px 2px; border-radius: 999px; font-size: 11px; white-space: nowrap; }
  .search-panel .search-fields { gap: 0; }
  .search-panel .search-fields > label,
  .search-panel .search-fields > .search-budget-field { position: relative; height: 56px; min-height: 56px; padding: 7px 14px; background: transparent; border: 1px solid var(--border); box-shadow: none; }
  .search-panel .search-fields > label:first-child { border-right: 0; border-bottom: 0; border-radius: 14px 0 0 0; }
  .search-panel .search-fields > label + label { border-bottom: 0; border-radius: 0 14px 0 0; }
  .search-panel .search-fields > label:focus-within,
  .search-panel .search-fields > .search-budget-field:focus-within { background: var(--subtle); box-shadow: none; }
  .search-panel .field-text { font-size: 10px; line-height: 1.5; color: var(--muted); }
  .search-panel .search-fields .custom-select-trigger { height: 26px; min-height: 26px; font-size: 13px; font-weight: 600; color: var(--ink); }
  .search-panel .search-fields .custom-select-value { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .search-panel .search-budget-field { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; align-content: center; column-gap: 10px; row-gap: 0; padding: 7px 8px 7px 14px; border-radius: 0 0 14px 14px; }
  .search-panel .search-budget-heading { display: contents; height: auto; }
  .search-panel .search-budget-field [data-currency-budget-label] { grid-row: 1; grid-column: 1; position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; white-space: nowrap; font-size: 10px; line-height: 1.5; color: var(--muted); }
  .search-panel .search-budget-heading .currency-switch { grid-row: 1 / span 2; grid-column: 2; align-self: center; padding: 2px; border-radius: 999px; }
  .search-panel .search-budget-heading .currency-button { height: 34px; min-width: 36px; border-radius: 999px; font-size: 13px; }
  .search-panel .search-budget-range { grid-row: 2; grid-column: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 6px; }
  .search-panel .search-budget-range > label { height: auto; min-width: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .search-panel .search-budget-range > label:focus-within { background: transparent; box-shadow: none; }
  .search-panel .search-budget-range .search-price-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .search-panel .search-budget-range > span { display: inline; color: var(--muted); }
  .search-panel .search-budget-range input { height: 26px; min-height: 26px; line-height: 26px; font-size: 16px; font-weight: 600; }
  .search-panel .search-budget-range input::placeholder { color: var(--muted); opacity: .8; font-weight: 500; }
  .search-panel .search-actions { grid-column: 1 / -1; display: flex; gap: 8px; margin-top: 10px; }
  .search-panel .search-actions #advanced-toggle { flex: 0 0 46px; width: 46px; height: 46px; min-height: 46px; padding: 0; gap: 0; border-radius: 999px; }
  .search-panel .search-actions #advanced-toggle .search-filter-label-full,
  .search-panel .search-actions #advanced-toggle .search-filter-label-short { display: none; }
  .search-panel .search-actions .search-button { flex: 1; height: 46px; min-height: 46px; border-radius: 999px; font-size: 13px; }
}
