/* Mobile-only layout. Desktop remains unchanged. */
.mobile-menu-toggle,
.mobile-sheet-toggle {
    display: none;
}

@media (max-width: 767px) {
    html, body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .topbar {
        position: relative;
        z-index: 2100;
        height: 56px;
        padding: 0 12px;
        gap: 8px;
    }

    .topbar .brand {
        font-size: 18px;
        white-space: nowrap;
    }

    .mobile-menu-toggle {
        display: block;
        margin-left: auto;
        font-size: 23px;
        padding: 5px 12px;
    }

    .topbar nav,
    .topbar .actions {
        display: none;
    }

    .topbar.mobile-nav-open nav {
        display: flex;
        position: absolute;
        top: 56px;
        left: 0;
        right: 0;
        flex-direction: column;
        gap: 0;
        padding: 12px;
        background: white;
        box-shadow: 0 8px 20px #0002;
    }

    .topbar nav a {
        padding: 12px;
    }

    .search-strip {
        padding: 8px !important;
    }

    .apt-search-box {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px !important;
    }

    .apt-search-box select,
    #apartmentSelect,
    .apt-search-button {
        width: 100%;
        min-width: 0 !important;
        height: 38px;
        font-size: 12px;
    }

    .layout {
        display: block !important;
        min-height: 0 !important;
    }

    .map-panel {
        height: calc(100dvh - 154px) !important;
        min-height: 340px !important;
        border: 0;
    }

    .map-placeholder,
    .google-map-wrap,
    #search-map {
        height: 100% !important;
        min-height: 0 !important;
    }

    .map-toolbar {
        top: 8px;
        left: 6px;
        right: 6px;
        gap: 4px;
        flex-wrap: nowrap;
    }

    .map-toolbar button {
        padding: 7px 8px !important;
        font-size: 11px !important;
    }

    .roadview-toggle {
        top: 58px !important;
        right: 8px !important;
    }

    .detail-panel {
        position: fixed !important;
        z-index: 1800;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex !important;
        flex-direction: column;
        width: 100%;
        height: 72dvh;
        max-height: 72dvh !important;
        overflow-y: auto !important;
        border-radius: 18px 18px 0 0;
        background: white;
        box-shadow: 0 -4px 22px #18234638;
        transform: translateY(calc(100% - 100px));
        transition: transform .22s ease;
    }

    .detail-panel.mobile-sheet-open {
        transform: translateY(0);
    }

    .mobile-sheet-toggle {
        display: flex;
        position: sticky;
        top: 0;
        z-index: 5;
        width: 100%;
        min-height: 32px;
        align-items: center;
        justify-content: center;
        gap: 10px;
        border: 0;
        background: white;
        font-size: 12px;
        font-weight: 700;
    }

    .mobile-sheet-toggle::before {
        content: "";
        width: 40px;
        height: 5px;
        border-radius: 8px;
        background: #c7ccd7;
    }

    .detail-panel .complex-head {
        padding: 5px 14px 10px !important;
    }

    .detail-panel .complex-head h1 {
        font-size: 17px;
    }

    .detail-panel .complex-head p {
        font-size: 12px;
    }
}
