@media (max-width: 767px) {
    :root {
        --app-ink: #0b1720;
        --app-muted: #6c7780;
        --app-line: #e8ecef;
        --app-soft: #f5f7f8;
        --app-surface: #fcfcfc;
    }
    :root.dark {
        --app-ink: #edf3f7;
        --app-muted: #a3b0ba;
        --app-line: #2b3942;
        --app-soft: #18252e;
        --app-surface: #081418;
        color-scheme: dark;
    }
    body {
        background: var(--app-surface) !important;
        color: var(--app-ink) !important;
        font-family: Roboto, "Arial", sans-serif !important;
        -webkit-tap-highlight-color: transparent;
    }
    #app-wrapper { box-sizing: border-box; height: 100dvh; padding-top: env(safe-area-inset-top); padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
    body[data-mobile-page="view"] #app-wrapper { padding-bottom: env(safe-area-inset-bottom); }
    #app-wrapper > main, .catalog-layout, .dashboard-main { min-height: 0; }
    body[data-mobile-page="index"] .site-header,
    body[data-mobile-page="index"] .site-legal,
    .dashboard-main > #map-button,
    .dashboard-main > .dashboard-scroll { display: none !important; }
    .dashboard-main { background: var(--app-surface) !important; }
    .mobile-only.mobile-catalog {
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        scrollbar-width: none;
        color: var(--app-ink);
        background: var(--app-surface);
        line-height: 1.2;
    }
    .mobile-catalog svg, .mobile-bottom-nav svg { width: 24px; height: 24px; flex-shrink: 0; }
    .mobile-catalog button, .mobile-catalog a, .mobile-bottom-nav a { touch-action: manipulation; }
    .mobile-catalog button:focus-visible, .mobile-catalog a:focus-visible,
    .mobile-bottom-nav a:focus-visible { outline: 2px solid var(--app-ink); outline-offset: 3px; }
    .mobile-catalog button { cursor: pointer; }
    .mobile-controls { flex-shrink: 0; padding: 0 14px; }
    .is-home .mobile-controls { padding: 44px 22px 24px; }
    .mobile-controls h1 { font-size: 38px; line-height: 1.12; font-weight: 500; margin: 0 0 22px; letter-spacing: 0; }
    .mobile-controls h2 { font-size: 16px; font-weight: 500; margin: 20px 0 10px; }
    .mobile-search {
        display: flex;
        align-items: center;
        gap: 4px;
        padding: 0 4px 0 8px;
        min-height: 48px;
        border: 1px solid var(--app-line);
        border-radius: 15px;
        background: var(--app-soft);
    }
    .mobile-search input[type="search"], .mobile-search textarea {
        flex: 1;
        width: 0;
        min-width: 0;
        min-height: 46px;
        border: 0;
        outline: 0;
        padding: 8px;
        color: var(--app-ink);
        background: transparent;
        font: inherit;
        font-size: 16px;
    }
    .mobile-search:focus-within { border-color: var(--app-muted); }
    .mobile-search input::placeholder { color: var(--app-muted); opacity: 1; }
    .mobile-search textarea::placeholder { color: var(--app-muted); opacity: 1; }
    .mobile-search textarea { resize: none; line-height: 1.3; min-height: 72px; padding: 12px 8px; }
    .mobile-search button { display: grid; place-items: center; width: 34px; height: 40px; flex-shrink: 0; color: var(--app-ink); }
    .mobile-search button svg { width: 20px; height: 20px; }
    .is-home .mobile-search { min-height: 78px; padding-left: 8px; }
    .is-home .mobile-search button { width: 32px; }
    .is-home .mobile-search button svg { width: 16px; height: 16px; }
    .mobile-chips { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding: 4px 0; }
    .mobile-chips button { min-height: 38px; padding: 0 16px; border-radius: 20px; font-size: 13px; white-space: nowrap; background: var(--app-soft); border: 1px solid var(--app-line); }
    .mobile-chips [aria-pressed="true"] { background: var(--app-ink); color: var(--app-surface); }
    .mobile-control-row { display: flex; gap: 10px; margin-top: 12px; }
    .mobile-segment { display: flex; align-items: center; padding: 3px; min-height: 48px; border: 1px solid var(--app-line); border-radius: 14px; min-width: 0; }
    .mobile-purpose { flex: 1.55; }
    .mobile-view { flex: .95; }
    .mobile-segment > * { display: flex; justify-content: center; align-items: center; min-width: 0; height: 34px; border-radius: 11px; gap: 6px; font-size: 13px; }
    .mobile-purpose > * { width: 36px; flex-shrink: 0; }
    .mobile-purpose [aria-current] { flex: 1; padding: 0 10px; width: auto; }
    .mobile-purpose svg { width: 18px; height: 18px; }
    .mobile-view > * { flex: 1; height: 48px; }
    .mobile-segment [aria-current] { background: var(--app-ink); color: var(--app-surface); }
    .mobile-tools { display: flex; gap: 10px; margin-top: 10px; }
    .mobile-tools > * { display: grid; place-items: center; height: 48px; flex: 1; border: 1px solid var(--app-line); border-radius: 16px; background: var(--app-surface); }
    .mobile-tools > [aria-pressed="true"] { background: var(--app-ink); color: var(--app-surface); border-color: var(--app-ink); }
    .mobile-filter-summary { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; color: var(--app-muted); font-size: 14px; }
    .mobile-filter-summary a { padding: 10px 16px; border: 1px solid var(--app-line); border-radius: 12px; color: var(--app-ink); }
    .mobile-property-list { padding: 0 22px 24px; }
    .mobile-property { display: flex; align-items: flex-start; padding: 14px 0 0; border-bottom: 1px solid var(--app-line); }
    .mobile-property-link { display: flex; flex: 1; min-width: 0; align-items: flex-start; }
    .mobile-property-image { display: grid; place-items: center; width: 112px; height: 96px; flex-shrink: 0; border-radius: 16px; overflow: hidden; background: var(--app-soft); }
    .mobile-property-image img { width: 100%; height: 100%; object-fit: cover; }
    .mobile-property-image svg { width: 40px; height: 40px; color: var(--app-muted); }
    .mobile-property-details { flex: 1; min-width: 0; padding: 0 0 12px 14px; }
    .mobile-property-price { display: block; font-size: clamp(14px, 5vw, 21px); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .mobile-property-details h2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; font-weight: 400; line-height: 1.2; margin-top: 4px; overflow-wrap: anywhere; }
    .mobile-property-details p { color: var(--app-muted); font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }
    .mobile-property-specs { margin-top: 5px; }
    .mobile-property-city { margin-top: 3px; }
    .mobile-property-actions { display: flex; flex-direction: column; width: 48px; flex-shrink: 0; }
    .mobile-property-actions button { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 24px; }
    .mobile-property-actions [aria-pressed="true"] svg { fill: currentColor; }
    .mobile-property-actions button:disabled { opacity: .4; }
    .mobile-only.mobile-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        flex-shrink: 0;
        height: calc(72px + env(safe-area-inset-bottom));
        padding: 14px 16px env(safe-area-inset-bottom);
        background: var(--app-surface);
        color: var(--app-ink);
        z-index: 30;
    }
    .mobile-bottom-nav a { display: flex; flex: 1; flex-direction: column; justify-content: center; align-items: center; gap: 4px; font-size: 10px; line-height: 1.2; opacity: .58; }
    .mobile-bottom-nav svg { width: 18px; height: 18px; }
    .mobile-bottom-nav [aria-current] { opacity: 1; }
    .site-legal { display: none; }
    .mobile-recent > a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; margin-top: 10px; min-height: 64px; border: 1px solid var(--app-line); border-radius: 16px; font-size: 15px; overflow-wrap: anywhere; }
    .mobile-empty { text-align: center; padding: 48px 0; color: var(--app-muted); }
    .mobile-empty a, .mobile-pagination a { display: inline-block; padding: 14px 20px; border: 1px solid var(--app-line); border-radius: 12px; margin-top: 16px; color: var(--app-ink); }
    .mobile-pagination { display: flex; justify-content: space-between; gap: 12px; }
    .mobile-dialog { width: calc(100% - 44px); max-width: 440px; padding: 22px; margin: auto; background: var(--app-surface); color: var(--app-ink); border: 1px solid var(--app-line); border-radius: 20px; max-height: 85dvh; overflow-y: auto; }
    .mobile-dialog::backdrop { background: #0006; }
    .mobile-filter-screen {
        box-sizing: border-box;
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100dvh;
        max-width: none;
        max-height: none;
        margin: 0;
        padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
        border: 0;
        background: var(--app-surface);
        color: var(--app-ink);
        overflow: hidden;
    }
    .mobile-filter-screen[open] { display: flex; flex-direction: column; }
    .mobile-filter-screen::backdrop { background: var(--app-surface); }
    .mobile-screen-heading { display: flex; align-items: center; min-height: 58px; padding: 0 12px; flex-shrink: 0; }
    .mobile-screen-heading > button, .mobile-screen-heading > span { display: grid; place-items: center; width: 48px; height: 48px; flex-shrink: 0; }
    .mobile-screen-heading h2 { flex: 1; text-align: center; font-size: 19px; font-weight: 500; }
    .mobile-filter-content { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 22px 24px; }
    .mobile-secondary-button { width: 100%; min-height: 48px; padding: 12px 16px; border: 1px solid var(--app-line); border-radius: 12px; font-size: 14px; font-weight: 500; }
    .mobile-filter-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
    .mobile-choice { position: relative; display: inline-flex; }
    .mobile-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
    .mobile-choice span, .mobile-number-choice { display: flex; align-items: center; justify-content: center; min-height: 38px; padding: 8px 16px; font-size: 13px; border: 1px solid var(--app-line); border-radius: 20px; background: var(--app-soft); color: var(--app-ink); }
    .mobile-choice input:checked + span, .mobile-number-choice[aria-pressed="true"] { background: var(--app-ink); color: var(--app-surface); }
    .mobile-choice input:focus-visible + span { outline: 2px solid var(--app-ink); outline-offset: 3px; }
    .mobile-filter-field { display: block; margin-top: 14px; }
    .mobile-filter-field > span { display: block; margin-bottom: 8px; color: var(--app-muted); font-size: 14px; }
    .mobile-filter-content input:not([type="hidden"]):not([type="radio"]):not([type="checkbox"]), .mobile-filter-content select {
        display: block; width: 100%; min-width: 0; min-height: 54px; padding: 12px 16px; border: 1px solid var(--app-line); border-radius: 14px; color: var(--app-ink); background: var(--app-soft); font: inherit; font-size: 16px;
    }
    .mobile-filter-content input::placeholder { color: var(--app-muted); opacity: 1; }
    .mobile-filter-section { margin-top: 20px; min-width: 0; }
    .mobile-filter-section legend { padding: 0; font-size: 16px; font-weight: 500; }
    .mobile-filter-section > input { margin-top: 12px; }
    .mobile-filter-range { display: flex; gap: 8px; margin-top: 10px; }
    .mobile-filter-range > input { flex: 1; }
    .mobile-filter-footer { flex-shrink: 0; padding: 8px 22px 12px; }
    .mobile-filter-footer button { width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; background: var(--app-ink); color: var(--app-surface); }
    .mobile-dialog h2 { font-size: 21px; font-weight: 500; margin: 0 40px 18px 0; }
    .mobile-dialog > a { display: block; padding: 16px 12px; border-radius: 12px; }
    .mobile-dialog > a[aria-current] { background: var(--app-soft); font-weight: 500; }
    .mobile-dialog form { float: right; }
    .mobile-dialog form button { width: 32px; height: 32px; display: grid; place-items: center; }
    .mobile-dialog form button svg { width: 24px; height: 24px; }
    .mobile-theme-options > button { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 52px; padding: 12px 0; text-align: left; font-size: 16px; }
    .mobile-theme-radio { width: 20px; height: 20px; border: 2px solid var(--app-muted); border-radius: 50%; flex-shrink: 0; }
    [aria-pressed="true"] > .mobile-theme-radio { border-color: var(--app-ink); background: var(--app-ink); box-shadow: inset 0 0 0 3px var(--app-surface); }
    .mobile-dialog [data-mobile-clear-compare] { margin-top: 16px; padding: 14px; width: 100%; border: 1px solid var(--app-line); border-radius: 12px; }
    [data-mobile-comparison] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
    [data-mobile-comparison] a { min-width: 0; overflow-wrap: anywhere; }
    [data-mobile-comparison] strong, [data-mobile-comparison] span { display: block; margin-bottom: 10px; }
    .mobile-notice { position: fixed; bottom: calc(82px + env(safe-area-inset-bottom)); left: 22px; right: 22px; padding: 14px 18px; border-radius: 14px; background: var(--app-ink); color: var(--app-surface); z-index: 70; font-size: 14px; }
    #sidebar { width: 100% !important; border: 0; padding: max(12px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom)) !important; background: var(--app-surface) !important; color: var(--app-ink); }
    .mobile-filter-close { height: 48px; margin-bottom: 16px; font-size: 19px; font-weight: 500; }
    #sidebar input:not([type="hidden"]), #sidebar select { min-height: 54px; padding: 12px 16px; margin-top: 8px; border: 1px solid var(--app-line); border-radius: 14px; font-size: 16px; color: var(--app-ink); background: var(--app-soft); }
    #sidebar form > button { min-height: 48px; background: var(--app-ink); color: var(--app-surface); border-radius: 12px; font-size: 14px; font-weight: 500; }
    #sidebar form > a { color: var(--app-ink); }
    #sidebar form > label { color: var(--app-ink); }
    .site-header { position: relative; min-height: 58px !important; background: var(--app-surface) !important; border-color: var(--app-line) !important; backdrop-filter: none !important; }
    body[data-mobile-page] > #app-wrapper > main { background: var(--app-surface) !important; }
    body[data-mobile-page="profile"] main > div { padding: 10px 22px 24px; }
    body[data-mobile-page="profile"] main h1 { font-size: 26px; font-weight: 500; }
    body[data-mobile-page="profile"] main h2 { font-size: 19px; font-weight: 500; text-transform: none; letter-spacing: 0; scroll-margin-top: 16px; }
    body[data-mobile-page="profile"] main .rounded-\[2\.5rem\] { border-radius: 16px; background: var(--app-surface); border-color: var(--app-line); }
    body[data-mobile-page="profile"] main .opacity-0 { opacity: 1; }
    .mobile-profile-menu svg, .mobile-account-back svg { width: 24px; height: 24px; flex-shrink: 0; }
    .mobile-profile-menu a, .mobile-profile-menu button { display: flex; width: 100%; align-items: center; gap: 14px; min-height: 56px; font-size: 15px; text-align: left; color: var(--app-ink); }
    .mobile-profile-menu a > span:first-of-type, .mobile-profile-menu button > span:first-of-type { flex: 1; }
    .mobile-profile-menu a > span:last-child, .mobile-profile-menu button > span:last-child { font-size: 22px; color: var(--app-muted); }
    .mobile-profile-menu h2 { margin: 20px 0 8px; font-size: 16px !important; }
    .mobile-profile-menu .mobile-sign-out { justify-content: center; border: 1px solid var(--app-line); border-radius: 12px; margin-top: 22px; min-height: 48px; }
    .mobile-only.mobile-account-back { display: flex; align-items: center; gap: 12px; min-height: 48px; margin-bottom: 10px; }
    body[data-mobile-panel="profile"] .mobile-account-back,
    body[data-mobile-panel="profile"] .profile-account-grid,
    body[data-mobile-panel="personal"] .profile-account-grid,
    body[data-mobile-panel]:not([data-mobile-panel="profile"]) .mobile-profile-menu,
    body[data-mobile-panel]:not([data-mobile-panel="profile"]):not([data-mobile-panel="personal"]) .profile-identity { display: none; }
    body[data-mobile-panel="profile"] .profile-identity { margin: 22px 0; align-items: center; }
    body[data-mobile-panel="profile"] .profile-identity > div:first-child { text-align: center; }
    body[data-mobile-panel="profile"] .profile-identity #avatar-form,
    body[data-mobile-panel="profile"] .profile-identity > div:last-child,
    body[data-mobile-panel="profile"] .profile-identity #name-display + button { display: none; }
    body[data-mobile-panel="profile"] .profile-identity #name-display { width: 100%; font-size: 24px; }
    body[data-mobile-panel] .profile-account-grid { gap: 0; }
    body[data-mobile-panel] .profile-main-column > section,
    body[data-mobile-panel] .profile-secondary-column > * { display: none; }
    body[data-mobile-panel="listings"] .profile-main-column > .profile-listings,
    body[data-mobile-panel="saved"] .profile-main-column > .profile-saved,
    body[data-mobile-panel="subscription"] .profile-subscription,
    body[data-mobile-panel="messages"] .profile-messages-title,
    body[data-mobile-panel="messages"] .profile-messages-list { display: block; margin-top: 0; }
    body[data-mobile-panel="messages"] .profile-messages-list { border: 0; border-radius: 0; margin-top: 14px; }
    body[data-mobile-panel="messages"] .profile-messages-list > a { padding: 16px 0; border-color: var(--app-line); }
    body[data-mobile-panel="messages"] .profile-messages-list p { color: var(--app-ink); text-transform: none; letter-spacing: 0; font-size: 14px; }
    body[data-mobile-panel="messages"] .profile-messages-list p + p { color: var(--app-muted); font-size: 13px; }
    .profile-saved > .grid { gap: 0; }
    body[data-mobile-page="profile"] .profile-saved-card { display: flex; align-items: flex-start; padding: 14px 0; border: 0; border-bottom: 1px solid var(--app-line); border-radius: 0 !important; }
    .profile-saved-card > .aspect-video { width: 112px; height: 96px; flex-shrink: 0; border-radius: 16px; overflow: hidden; }
    .profile-saved-card > .p-6 { display: flex; flex-direction: column; flex: 1; min-width: 0; padding: 0 0 0 14px; }
    .profile-saved-card h3 { order: 2; font-size: 14px; font-weight: 400; white-space: normal; }
    .profile-saved-card .p-6 > p { order: 1; font-size: 21px; font-weight: 500; color: var(--app-ink); margin-bottom: 4px; }
    .profile-saved-card .p-6 > a { order: 3; min-height: 40px; padding: 10px 0; background: transparent; color: var(--app-muted); text-align: left; text-transform: none; letter-spacing: 0; font-size: 13px; font-weight: 400; }
    body[data-mobile-page="view"] main > div { padding: 10px 22px 24px; }
    body[data-mobile-page="view"] main h1 { font-size: 21px; font-weight: 500; letter-spacing: 0; }
    body[data-mobile-page="view"] main h2 { font-size: 16px; font-weight: 500; letter-spacing: 0; text-transform: none; }
    body[data-mobile-page="view"] .mobile-bottom-nav { display: none; }
    .property-layout { display: flex; flex-direction: column; }
    .property-layout > * { order: 3; }
    .property-layout > .property-gallery { order: 1; margin-bottom: 12px; }
    .property-layout > .property-heading { order: 2; margin-bottom: 18px; }
    .property-heading > nav { display: none; }
    .property-heading > div { flex-direction: column-reverse; gap: 8px; }
    .property-heading .text-right { text-align: left; }
    body[data-mobile-page="view"] main .aspect-\[21\/9\] { height: 258px; aspect-ratio: auto; border-radius: 16px; }
    body[data-mobile-page="view"] main .text-4xl { font-size: 34px; font-weight: 500; color: var(--app-ink); white-space: normal; }
    body[data-mobile-page="view"] main .rounded-\[2\.5rem\], body[data-mobile-page="view"] main .rounded-\[3rem\] { border-radius: 14px; border-color: var(--app-line); }
    body:has(#auth-form) { padding: 24px 22px; align-items: flex-start; }
    body:has(#auth-form) > div { max-width: none; }
    body:has(#auth-form) > div > div:first-child { margin: 20px 0 24px; }
    body:has(#auth-form) > div > div:first-child img { display: none; }
    body:has(#auth-form) > div > div:first-child span { font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 19px; }
    .mobile-auth-heading { font-size: 34px; font-weight: 500; line-height: 1.2; margin: 24px 0 14px; }
    .mobile-auth-caption { color: var(--app-muted); font-size: 14px; margin-bottom: 24px; }
    body[data-mobile-page="profile"] .site-header { display: none; }
    body[data-mobile-page="view"] .site-header img { display: none; }
    body[data-mobile-page="view"] .site-header #profile-btn { display: none; }
    .mobile-property-back { width: 48px; height: 48px; align-items: center; justify-content: center; }
    body[data-mobile-page="view"] .mobile-property-back { display: flex; }
    .mobile-property-back svg { width: 24px; height: 24px; }
    .mobile-property-title { position: absolute; left: 60px; right: 60px; text-align: center; font-size: 19px; font-weight: 500; pointer-events: none; }
    body:has(#auth-form) .rounded-\[3rem\] { padding: 0; background: var(--app-surface); border: 0; border-radius: 0; }
    body:has(#auth-form) input:not([type="hidden"]) { min-height: 54px; padding: 12px 16px; background: var(--app-soft); color: var(--app-ink); border: 1px solid var(--app-line); border-radius: 14px; font-size: 16px; }
    body:has(#auth-form) label { color: var(--app-muted); font-size: 14px; text-transform: none; letter-spacing: 0; margin-left: 0; font-weight: 400; }
    #submit-btn { min-height: 48px; padding: 12px 16px; border-radius: 12px; font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; background: var(--app-ink); color: var(--app-surface); }
    #tab-login, #tab-register { font-size: 14px; font-weight: 500; letter-spacing: 0; text-transform: none; border-radius: 11px; }
    .auth-tab.active { background: var(--app-ink) !important; color: var(--app-surface) !important; }
    body:has(input[name="main_image"]) > .max-w-4xl,
    body:has(input[name="main_image"]) .content > div { padding: 10px 22px 24px; border-radius: 0; background: var(--app-surface); }
    body:has(input[name="main_image"]) h1 { font-size: 26px; font-weight: 500; letter-spacing: 0; text-transform: none; }
    body:has(input[name="main_image"]) label:not(.amenity-card) { font-size: 14px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--app-muted); }
    body:has(input[name="main_image"]) input:not([type="hidden"]):not([type="file"]):not([type="checkbox"]),
    body:has(input[name="main_image"]) select, body:has(input[name="main_image"]) textarea {
        min-height: 54px; padding: 12px 16px; font-size: 16px; color: var(--app-ink); background: var(--app-soft); border: 1px solid var(--app-line); border-radius: 14px;
    }
    body:has(input[name="main_image"]) button[type="submit"] { min-height: 48px; padding: 14px 16px; border-radius: 12px; font-weight: 500; font-size: 14px; text-transform: none; letter-spacing: 0; background: var(--app-ink); color: var(--app-surface); }
    @media (prefers-reduced-motion: reduce) {
        .mobile-catalog *, #sidebar { scroll-behavior: auto !important; transition: none !important; }
    }
}
