/* SmartNav responsive layer. Loaded after the desktop styles. */

.mobile-map-title,
.mobile-profile-button,
.mobile-bottom-nav,
.mobile-profile-panel {
    display: none;
}

@media (min-width: 721px) {
    .smartnav-index-page .mobile-map-header {
        display: contents;
    }

    .smartnav-index-page .mobile-map-header .map-search-card {
        position: absolute;
        top: 20px;
        left: 20px;
        z-index: 6;
    }

    .smartnav-index-page .map-overlay-top {
        left: auto;
    }

    .smartnav-index-page .chat-panel {
        width: 390px;
        max-width: min(390px, calc(100vw - 40px));
        background: #f7fafc;
        border: 1px solid rgba(16, 42, 67, 0.12);
        border-radius: 18px;
        box-shadow: 0 22px 54px rgba(16, 42, 67, 0.22);
    }

    .smartnav-index-page .chat-panel .chat-header {
        min-height: 58px;
        padding: 15px 17px;
        background: #ffffff;
        color: #102a43;
        border-bottom-color: rgba(16, 42, 67, 0.12);
        box-shadow: 0 6px 18px rgba(16, 42, 67, 0.1);
    }

    .smartnav-index-page .chat-panel .chat-header .chat-title::after {
        content: '';
        display: none;
    }

    .smartnav-index-page .chat-panel .chat-header .chat-title {
        font-size: 1rem;
    }

    .smartnav-index-page .chat-panel .chat-close {
        background: #f1f5f9;
        border-color: rgba(16, 42, 67, 0.14);
        color: #102a43;
    }

    .smartnav-index-page .chat-panel .chat-close:hover,
    .smartnav-index-page .chat-panel .chat-close:focus-visible {
        background: #e2e8f0;
    }

    .smartnav-index-page .chat-panel .chat-body {
        max-height: 380px;
        min-height: 230px;
        padding: 16px 14px 12px;
        background: radial-gradient(circle at top right, rgba(14, 159, 157, 0.08), transparent 34%), #f7fafc;
    }

    .smartnav-index-page .chat-panel .chat-message.bot {
        background: #ffffff;
        border-color: rgba(16, 42, 67, 0.1);
        color: #243b53;
        box-shadow: 0 6px 16px rgba(16, 42, 67, 0.08);
    }

    .smartnav-index-page .chat-panel .chat-message.user {
        background: #0e9f9d;
        border-color: #0e9f9d;
        color: #ffffff;
        box-shadow: 0 6px 16px rgba(14, 159, 157, 0.18);
    }

    .smartnav-index-page .chat-panel .chat-message {
        padding: 11px 13px;
        line-height: 1.5;
    }

    .smartnav-index-page .chat-panel .quick-reply-btn {
        background: #ffffff;
        border-color: rgba(14, 159, 157, 0.32);
        color: #087f7d;
        box-shadow: 0 4px 10px rgba(16, 42, 67, 0.06);
    }

    .smartnav-index-page .chat-panel .quick-reply-btn:hover {
        background: #e8f7f6;
    }

    .smartnav-index-page .chat-panel .quick-reply-btn {
        padding: 8px 11px;
        font-size: 0.8rem;
    }

    .smartnav-index-page .chat-panel .chat-footer {
        padding: 11px 12px;
        background: #ffffff;
        border-top-color: rgba(16, 42, 67, 0.12);
    }

    .smartnav-index-page .chat-panel .chat-footer input {
        min-width: 0;
        min-height: 42px;
        padding: 10px 13px;
        background: #f8fafc;
        border-color: rgba(16, 42, 67, 0.16);
        color: #102a43;
    }

    .smartnav-index-page .chat-panel .chat-footer input::placeholder {
        color: #829ab1;
    }

    .smartnav-index-page .chat-panel .chat-footer button {
        min-height: 42px;
        padding: 10px 15px;
        background: #0e9f9d;
        box-shadow: 0 8px 16px rgba(14, 159, 157, 0.2);
    }
}

@media (max-width: 1100px) {
    .smartnav-index-page .map-shell,
    .smartnav-index-page .map-panel {
        min-width: 0;
    }

    .smartnav-index-page .map-overlay-top {
        display: grid;
        grid-template-columns: minmax(220px, 1fr) auto;
        align-items: start;
    }

    .smartnav-index-page .map-action-buttons {
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        width: min(560px, 58vw);
        gap: 7px;
    }

    .smartnav-index-page .map-action-buttons button,
    .smartnav-index-page .map-action-buttons a,
    .smartnav-index-page .map-action-buttons .map-logout-form {
        flex: 0 1 auto;
    }

    .smartnav-index-page .map-action-buttons button,
    .smartnav-index-page .map-action-buttons a {
        min-height: 42px;
        padding: 9px 12px;
        font-size: 0.86rem;
    }

    .smartnav-index-page .mobile-map-header .map-search-card {
        width: min(340px, calc(100vw - 40px));
    }

    .smartnav-index-page .map-overlay-top {
        left: auto;
    }

    .smartnav-index-page .map-overlay-widgets {
        width: min(340px, calc(100% - 28px));
    }

    .tour-page .modal-box,
    .tour-page .panorama-view,
    .tour-page .panorama-viewer {
        min-width: 0;
        max-width: 100vw;
    }
}

@media (max-width: 720px) {
    .admin-header .admin-menu-toggle {
        top: 16px;
        right: 16px;
    }

    .admin-building-tab .building-editor-toggle {
        top: auto;
        left: auto;
    }

    .admin-building-tab .building-map-actions {
        top: 16px;
        right: 16px;
        left: auto;
        flex-direction: column;
        align-items: flex-end;
    }

    .admin-building-tab .building-map-primary-actions { justify-content: flex-end; }

    body.admin-building-editor-open .admin-building-tab .building-map-actions {
        top: 16px;
        left: 16px;
        right: 16px;
        align-items: flex-start;
    }

    body.admin-building-editor-open .admin-building-tab .building-editor-panel {
        margin-top: 190px;
    }

    .admin-building-tab .building-editor-panel {
        width: calc(100% - 32px);
        margin: 132px 16px 0 auto;
    }

    .admin-map-branding {
        bottom: 16px;
        max-width: calc(100% - 32px);
        padding: 10px 14px;
    }

    .admin-map-branding h1 { font-size: 1rem; }
    .admin-map-branding p { font-size: 0.78rem; }

    body.admin-building-editor-open .admin-building-tab .building-editor-panel {
        margin-top: 16px;
    }

    body.admin-building-editor-open .admin-building-tab #building-editor-panel {
        top: 190px;
        right: 16px;
        margin-top: 0;
    }

    .admin-building-tab .building-manage-card {
        top: 190px;
        right: 16px;
        max-height: calc(100vh - 206px);
    }

    .admin-building-tab .building-map-actions > .action-row {
        top: auto;
        right: auto;
        width: calc(100% - 32px);
        justify-content: flex-start;
    }

    body.admin-building-editor-open .admin-building-tab .building-map-actions > .action-row {
        top: auto;
    }

    .smartnav-index-page {
        --mobile-footer-height: calc(66px + env(safe-area-inset-bottom));
    }

    .smartnav-index-page .chat-panel.show {
        position: fixed;
        inset: 0;
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: none;
        height: 100dvh;
        min-height: 0;
        border: 0;
        border-radius: 0;
        background: #f7fafc;
        box-shadow: none;
        z-index: 100;
    }

    .smartnav-index-page .chat-panel.show .chat-header {
        flex: 0 0 auto;
        padding: max(16px, env(safe-area-inset-top)) 18px 16px;
        background: #ffffff;
        color: #102a43;
        border-bottom: 1px solid rgba(16, 42, 67, 0.12);
        box-shadow: 0 6px 18px rgba(16, 42, 67, 0.1);
    }

    .smartnav-index-page .chat-panel.show .chat-header .chat-title {
        font-size: 1.05rem;
        letter-spacing: 0;
    }

    .smartnav-index-page .chat-panel.show .chat-header-actions {
        gap: 5px;
    }

    .smartnav-index-page .chat-panel.show .chat-session-drawer {
        width: min(320px, 86vw);
    }

    .smartnav-index-page .chat-panel.show .chat-session-control {
        min-height: 32px;
        padding: 5px 8px;
        border-color: rgba(16, 42, 67, 0.14);
        background: #f1f5f9;
        color: #102a43;
    }

    .smartnav-index-page .chat-panel.show .chat-session-control:hover,
    .smartnav-index-page .chat-panel.show .chat-session-control:focus-visible {
        background: #e2e8f0;
    }

    .smartnav-index-page .chat-panel.show .chat-sessions {
        max-height: 28dvh;
    }

    .smartnav-index-page .chat-panel.show .chat-header .chat-title::after {
        content: '';
        display: none;
    }

    .smartnav-index-page .chat-panel.show .chat-close {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        font-size: 1.5rem;
        background: #f1f5f9;
        border-color: rgba(16, 42, 67, 0.14);
        color: #102a43;
    }

    .smartnav-index-page .chat-panel.show .chat-body {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        padding: 20px 16px 14px;
        background: radial-gradient(circle at top right, rgba(14, 159, 157, 0.08), transparent 34%), #f7fafc;
    }

    .smartnav-index-page .chat-panel.show .chat-message {
        max-width: 88%;
        padding: 12px 14px;
        font-size: 0.96rem;
    }

    .smartnav-index-page .chat-panel.show .chat-message.bot {
        background: #ffffff;
        border-color: rgba(16, 42, 67, 0.1);
        color: #243b53;
        box-shadow: 0 6px 16px rgba(16, 42, 67, 0.08);
    }

    .smartnav-index-page .chat-panel.show .chat-message.user {
        background: #0e9f9d;
        border-color: #0e9f9d;
        color: #ffffff;
        box-shadow: 0 6px 16px rgba(14, 159, 157, 0.18);
    }

    .smartnav-index-page .chat-panel.show .quick-replies {
        justify-content: flex-start;
        gap: 8px;
    }

    .smartnav-index-page .chat-panel.show .quick-reply-btn {
        background: #ffffff;
        border-color: rgba(14, 159, 157, 0.32);
        color: #087f7d;
        box-shadow: 0 4px 10px rgba(16, 42, 67, 0.06);
    }

    .smartnav-index-page .chat-panel.show .quick-reply-btn:hover {
        background: #e8f7f6;
    }

    .smartnav-index-page .chat-panel.show .chat-footer {
        flex: 0 0 auto;
        padding: 12px 14px max(12px, env(safe-area-inset-bottom));
        background: #ffffff;
        border-top-color: rgba(16, 42, 67, 0.12);
    }

    .smartnav-index-page .chat-panel.show .chat-footer input {
        min-width: 0;
        min-height: 46px;
        padding: 12px 15px;
        background: #f8fafc;
        border-color: rgba(16, 42, 67, 0.16);
        color: #102a43;
    }

    .smartnav-index-page .chat-panel.show .chat-footer input::placeholder {
        color: #829ab1;
    }

    .smartnav-index-page .chat-panel.show .chat-footer button {
        min-width: 70px;
        min-height: 46px;
        padding: 10px 16px;
        background: #0e9f9d;
        box-shadow: 0 8px 16px rgba(14, 159, 157, 0.2);
    }

    .smartnav-index-page .report-modal {
        padding: 14px;
        background: rgba(15, 23, 42, 0.34);
    }

    .smartnav-index-page .report-modal-box {
        width: 100%;
        max-height: calc(100dvh - 28px);
        overflow-y: auto;
        padding: 20px 18px;
        border: 1px solid rgba(16, 42, 67, 0.1);
        border-radius: 18px;
        background: #ffffff;
        color: #102a43;
        box-shadow: 0 24px 60px rgba(16, 42, 67, 0.2);
    }

    .smartnav-index-page .report-modal-header {
        margin-bottom: 18px;
    }

    .smartnav-index-page .report-modal-header h3 {
        color: #102a43;
        font-size: 1.28rem;
    }

    .smartnav-index-page .report-close-btn {
        width: 34px;
        height: 34px;
        background: #f1f5f9;
        color: #102a43;
        font-size: 1.35rem;
    }

    .smartnav-index-page .report-form label {
        color: #243b53;
        font-size: 0.88rem;
    }

    .smartnav-index-page .report-form textarea,
    .smartnav-index-page .report-form input[type="file"],
    .smartnav-index-page .report-form select,
    .smartnav-index-page .report-form input[type="text"] {
        border-color: rgba(16, 42, 67, 0.16);
        background: #f8fafc;
        color: #102a43;
    }

    .smartnav-index-page .report-form textarea::placeholder,
    .smartnav-index-page .report-form input[type="text"]::placeholder {
        color: #829ab1;
    }

    .smartnav-index-page .report-form small {
        color: #627d98;
    }

    .smartnav-index-page .report-form-actions .btn-secondary {
        background: #f1f5f9;
        border-color: rgba(16, 42, 67, 0.12);
        color: #243b53;
    }

    .smartnav-index-page .report-form-actions .btn-primary {
        background: #0e9f9d;
        box-shadow: 0 8px 16px rgba(14, 159, 157, 0.2);
    }

    html,
    body {
        min-width: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
    }

    .smartnav-index-page main,
    .smartnav-index-page .dashboard,
    .smartnav-index-page .map-panel,
    .smartnav-index-page .map-shell {
        width: 100%;
        min-width: 0;
        height: 100dvh;
        min-height: 0;
    }

    .smartnav-index-page main,
    .smartnav-index-page .dashboard,
    .smartnav-index-page .map-panel,
    .smartnav-index-page .map-shell,
    .smartnav-index-page .map-inner {
        margin: 0;
        padding: 0;
        border-radius: 0;
        border: 0;
    }

    .smartnav-index-page .map-panel {
        overflow: hidden;
        background: transparent;
        box-shadow: none;
    }

    .smartnav-index-page .map-inner {
        width: 100%;
        height: calc(100dvh - var(--mobile-footer-height));
        min-height: 0;
        box-sizing: border-box;
        overflow: hidden;
    }

    .smartnav-index-page #campus-map-image,
    .smartnav-index-page #map-hotspots,
    .smartnav-index-page #map-paths {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
    }

    .smartnav-index-page #campus-map-image {
        object-fit: fill;
        object-position: center;
    }

    .smartnav-index-page #map-paths polyline.animated-path {
        stroke-width: var(--mobile-path-stroke-width, 7px);
    }

    .smartnav-index-page .map-overlay-top {
        top: max(10px, env(safe-area-inset-top));
        left: 10px;
        right: 10px;
        display: block;
    }

    .smartnav-index-page .mobile-map-header {
        position: absolute;
        z-index: 12;
        top: 0;
        left: 0;
        right: 0;
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-rows: 44px;
        align-items: center;
        min-height: 52px;
        padding: max(7px, env(safe-area-inset-top)) 14px 7px;
        background: #ffffff;
        border-bottom: 1px solid rgba(15, 23, 42, 0.14);
    }

    .smartnav-index-page .mobile-map-title {
        display: block;
        grid-column: 1;
        grid-row: 1;
        color: #0f172a;
        font-size: 0.96rem;
        font-weight: 800;
        text-decoration: none;
    }

    .smartnav-index-page .mobile-profile-button {
        display: grid;
        position: absolute;
        top: 50%;
        right: 17px;
        place-items: center;
        width: 38px;
        height: 38px;
        min-height: 34px;
        padding: 7px;
        border: 1px solid rgba(15, 23, 42, 0.14);
        border-radius: 50%;
        background: #f1f5f9;
        color: #0f172a;
        cursor: pointer;
        transform: translateY(-50%);
    }

    .smartnav-index-page .mobile-profile-icon {
        position: relative;
        display: block;
        width: 17px;
        height: 17px;
        border: 2px solid #0f172a;
        border-radius: 50%;
    }

    .smartnav-index-page .mobile-profile-icon::before {
        content: '';
        position: absolute;
        top: 3px;
        left: 50%;
        width: 5px;
        right: auto;
        left: 16px;
        border-radius: 50%;
        transform: translateX(-50%);
    }

    .smartnav-index-page .mobile-profile-icon::after {
        content: '';
        position: absolute;
        bottom: 2px;
        left: 50%;
        width: 9px;
        height: 4px;
        border: 1px solid #0f172a;
        border-bottom: 0;
        border-radius: 8px 8px 0 0;
        transform: translateX(-50%);
    }

    .smartnav-index-page .map-overlay-top {
        top: 62px;
    }

    .smartnav-index-page .mobile-map-header .map-search-card {
        display: flex;
        position: static;
        grid-column: 2;
        grid-row: 1;
        width: auto;
        min-width: 0;
        margin: 0 0 0 10px;
        padding-right: 52px;
    }

    .smartnav-index-page .mobile-map-header .map-search-card button {
        display: none;
    }

    .smartnav-index-page .mobile-map-title {
        order: 1;
    }

    .smartnav-index-page .map-action-buttons:not(.mobile-menu-open) {
        display: none;
    }

    .smartnav-index-page .map-action-buttons.mobile-menu-open {
        display: flex;
        position: absolute;
        top: 0;
        right: 0;
        width: auto;
        margin: 0;
        padding: 8px;
        background: rgba(8, 25, 47, 0.96);
        border-radius: 0 0 0 12px;
        z-index: 25;
    }

    .smartnav-index-page .map-search-card {
        width: 100%;
        min-height: 44px;
        padding: 7px 9px 7px 13px;
        border-radius: 14px;
    }

    .smartnav-index-page .map-search-card input {
        min-width: 0;
        font-size: 0.92rem;
    }

    .smartnav-index-page .map-action-buttons {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-start;
        width: 100%;
        margin-top: 8px;
        padding: 1px 2px 5px;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
    }

    .smartnav-index-page .map-action-buttons::-webkit-scrollbar {
        display: none;
    }

    .smartnav-index-page .map-action-buttons button,
    .smartnav-index-page .map-action-buttons a,
    .smartnav-index-page .map-action-buttons .map-logout-form,
    .smartnav-index-page .map-action-buttons .map-logout-btn {
        flex: 0 0 auto;
    }

    .smartnav-index-page .map-action-buttons button,
    .smartnav-index-page .map-action-buttons a,
    .smartnav-index-page .map-action-buttons .map-logout-btn {
        min-height: 40px;
        padding: 9px 13px;
        border-radius: 11px;
        font-size: 0.78rem;
    }

    .smartnav-index-page .map-action-buttons .inline-chat-button {
        width: 42px;
        padding: 9px;
    }

    .smartnav-index-page .map-controls {
        left: 10px;
        bottom: calc(var(--mobile-footer-height) + 12px);
        gap: 7px;
    }

    .smartnav-index-page .map-control {
        width: 42px;
        height: 42px;
        font-size: 1.35rem;
    }

    .smartnav-index-page .map-branding {
        display: none;
    }

    .smartnav-index-page .map-overlay-widgets {
        right: 8px;
        left: 8px;
        bottom: var(--mobile-footer-height);
        width: auto;
    }

    .smartnav-index-page .mobile-bottom-nav {
        position: absolute;
        z-index: 20;
        right: 0;
        bottom: 0;
        left: 0;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
        gap: 4px;
        height: var(--mobile-footer-height);
        padding: 8px 8px env(safe-area-inset-bottom);
        background: #ffffff;
        border-top: 1px solid rgba(15, 23, 42, 0.14);
        box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.12);
        box-sizing: border-box;
    }

    .smartnav-index-page .mobile-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-width: 0;
        min-height: 46px;
        padding: 8px 3px;
        border: 0;
        border-radius: 10px;
        background: transparent;
        color: #0f172a;
        font-size: clamp(0.62rem, 2.5vw, 0.76rem);
        font-weight: 700;
        text-decoration: none;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.1;
        transition: background 160ms ease, color 160ms ease, transform 160ms ease;
    }

    .smartnav-index-page .mobile-nav-icon {
        display: grid;
        place-items: center;
        width: 30px;
        height: 30px;
        margin-bottom: 4px;
        border-radius: 50%;
        background: transparent;
        color: #0f172a;
        font-size: 1.18rem;
        line-height: 1;
        font-weight: 800;
        transition: background 160ms ease, color 160ms ease, transform 160ms ease;
    }

    .smartnav-index-page .mobile-nav-assistant {
        position: relative;
        z-index: 1;
        background: transparent;
        color: #0f172a;
        box-shadow: none;
        transform: none;
        border: 0;
        outline: 0;
    }

    .smartnav-index-page .mobile-nav-item.active,
    .smartnav-index-page .mobile-nav-item:active {
        background: transparent;
        color: #0f172a;
    }

    .smartnav-index-page .mobile-nav-item.active .mobile-nav-icon,
    .smartnav-index-page .mobile-nav-item:active .mobile-nav-icon {
        position: relative;
        z-index: 1;
        background: #0e9f9d;
        color: #ffffff;
        transform: scale(1.18);
        box-shadow: 0 0 0 3px rgba(14, 159, 157, 0.12), 0 4px 9px rgba(14, 159, 157, 0.2);
        text-shadow: 0 1px 1px rgba(0, 70, 72, 0.32);
        animation: mobile-footer-icon-pulse 1.8s ease-in-out infinite;
    }

    @keyframes mobile-footer-icon-pulse {
        0%, 100% { box-shadow: 0 0 0 2px rgba(14, 159, 157, 0.1), 0 3px 8px rgba(14, 159, 157, 0.16); }
        50% { box-shadow: 0 0 0 4px rgba(14, 159, 157, 0.05), 0 4px 10px rgba(14, 159, 157, 0.2); }
    }

    .smartnav-index-page .mobile-nav-item:not(.mobile-nav-assistant):hover,
    .smartnav-index-page .mobile-nav-item:not(.mobile-nav-assistant):focus-visible {
        background: transparent;
        color: #0f172a;
    }

    .smartnav-index-page .mobile-nav-item:not(.mobile-nav-assistant):hover .mobile-nav-icon,
    .smartnav-index-page .mobile-nav-item:not(.mobile-nav-assistant):focus-visible .mobile-nav-icon {
        background: #f1f5f9;
    }

    .smartnav-index-page .map-overlay-widgets .nav-widget {
        border-radius: 16px 16px 0 0;
    }

    .smartnav-index-page .map-overlay-widgets .nav-widget.info-card.is-expanded,
    .smartnav-index-page .map-overlay-widgets .nav-widget.directory-card.is-expanded,
    .smartnav-index-page .map-overlay-widgets .nav-widget.buildings-card.is-expanded {
        transform: translateY(0);
    }

    .smartnav-index-page .map-hotspot {
        min-width: clamp(22px, 6cqw, 32px);
        min-height: clamp(18px, 4.5cqw, 25px);
        width: max-content;
        max-width: min(32cqw, 180px);
        padding: clamp(1px, 0.55cqw, 3px) clamp(2px, 0.7cqw, 5px);
        font-size: clamp(0.42rem, 1.35cqw, 0.62rem);
        line-height: 1.05;
        white-space: normal;
        overflow: visible;
        overflow-wrap: anywhere;
        text-align: center;
        transform: translate(-50%, -50%) scale(var(--mobile-map-label-scale, 1));
        animation: none;
    }

    .smartnav-index-page .map-hotspot.selected {
        min-width: clamp(24px, 6.5cqw, 34px);
        max-width: min(34cqw, 190px);
        transform: translate(-50%, -50%) scale(calc(var(--mobile-map-label-scale, 1) * 1.08));
        animation: none;
    }

    .smartnav-index-page .login-required-modal .modal-box {
        width: min(440px, calc(100vw - 24px));
    }

    .tour-page .modal-box .topbar {
        padding: max(12px, env(safe-area-inset-top)) 12px 12px;
    }

    .tour-page .modal-box .topbar h3 {
        font-size: 1rem;
    }

    .tour-page .modal-box .topbar .btn-secondary {
        min-height: 40px;
        padding: 9px 14px;
        border-radius: 10px;
    }

    .tour-page .pnlm-controls-container {
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
    }

    .tour-page .pnlm-controls-container button {
        width: 42px;
        height: 42px;
    }

    .tour-mini-map {
        left: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        width: 138px;
        height: 82px;
        border-width: 1px;
    }

    .tour-mini-map:hover {
        height: 82px;
    }

    .tour-mini-map-controls button,
    .tour-mini-map-zoom-controls button {
        width: 34px;
        height: 34px;
    }

    .tour-mini-map-zoom-controls,
    .tour-mini-map:hover .tour-mini-map-zoom-controls {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .tour-page.tour-split-view .tour-mini-map {
        top: auto;
        bottom: 0;
        height: var(--expanded-map-height, 40dvh);
    }

    .tour-page.tour-split-view .tour-split-divider {
        top: auto;
        bottom: calc(var(--expanded-map-height, 40dvh) - 10px);
    }

    .tour-page.tour-split-view.tour-panorama-half .panorama-viewer {
        top: 0;
        right: 0;
        bottom: auto;
        left: 0;
        height: calc(100% - var(--expanded-map-height, 40dvh));
    }

    .smartnav-index-page .mobile-profile-panel {
        position: fixed;
        z-index: 100;
        inset: 0;
        display: none;
        align-items: flex-end;
        padding: 12px;
        background: rgba(2, 10, 22, 0.42);
    }

    .smartnav-index-page .mobile-profile-panel.show {
        display: flex;
    }

    .smartnav-index-page .mobile-profile-card {
        width: 100%;
        padding: 18px;
        border: 1px solid rgba(255, 255, 255, 0.16);
        border-radius: 18px;
        background: #f4f7f7;
        color: #142942;
        box-shadow: 0 18px 50px rgba(2, 6, 23, 0.28);
    }

    .smartnav-index-page .mobile-profile-heading {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 16px;
    }

    .smartnav-index-page .mobile-profile-eyebrow {
        color: #0e9f9d;
        font-size: 0.7rem;
        font-weight: 800;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .smartnav-index-page .mobile-profile-card h2 {
        margin: 3px 0 0;
        font-size: 1.25rem;
    }

    .smartnav-index-page .mobile-profile-close {
        width: 34px;
        height: 34px;
        border: 0;
        border-radius: 9px;
        background: rgba(20, 41, 66, 0.08);
        color: #142942;
        font-size: 1.35rem;
        line-height: 1;
    }

    .smartnav-index-page .mobile-profile-details {
        display: grid;
        gap: 10px;
    }

    .smartnav-index-page .mobile-profile-details div {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        padding-bottom: 9px;
        border-bottom: 1px solid rgba(20, 41, 66, 0.1);
    }

    .smartnav-index-page .mobile-profile-details span {
        color: rgba(20, 41, 66, 0.62);
        font-size: 0.8rem;
    }

    .smartnav-index-page .mobile-profile-details strong {
        max-width: 65%;
        overflow: hidden;
        text-align: right;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.86rem;
    }

    .smartnav-index-page .mobile-profile-logout-form {
        margin-top: 16px;
    }

    .smartnav-index-page .mobile-profile-logout {
        width: 100%;
        min-height: 43px;
        border: 0;
        border-radius: 11px;
        background: linear-gradient(135deg, #0ea5a4, #2563eb);
        color: #ffffff;
        font-weight: 800;
}

@media (max-width: 380px) {
    .smartnav-index-page .map-overlay-top {
        left: 7px;
        right: 7px;
    }

    .smartnav-index-page .map-action-buttons button,
    .smartnav-index-page .map-action-buttons a,
    .smartnav-index-page .map-action-buttons .map-logout-btn {
        padding-right: 10px;
        padding-left: 10px;
    }

    .smartnav-index-page .mobile-bottom-nav {
        gap: 0;
        padding-right: 3px;
        padding-left: 3px;
    }

    .smartnav-index-page .mobile-nav-item {
        padding-right: 1px;
        padding-left: 1px;
        font-size: 0.52rem;
    }

    .smartnav-index-page .mobile-nav-assistant {
        border-width: 2px;
    }
}

@media (max-width: 720px) and (max-height: 560px) {
    .smartnav-index-page .mobile-map-header {
        min-height: 44px;
    }

    .smartnav-index-page .map-overlay-top {
        top: 50px;
    }

    .smartnav-index-page .map-search-card {
        min-height: 38px;
    }

    .smartnav-index-page .map-action-buttons {
        margin-top: 5px;
    }

    .smartnav-index-page .map-branding {
        display: none;
    }

    .smartnav-index-page .map-overlay-widgets .nav-widget.info-card {
        max-height: 42dvh;
    }

    .smartnav-index-page .map-controls {
        bottom: calc(66px + env(safe-area-inset-bottom));
    }

    .tour-page .modal-box .topbar {
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .tour-mini-map {
        width: 116px;
        height: 68px;
    }

    .tour-page .pnlm-controls-container {
        bottom: calc(8px + env(safe-area-inset-bottom));
    }
}

@media (min-width: 721px) and (max-width: 1024px) {
    .tour-page .modal-box .topbar {
        padding: 14px 16px;
    }

    .tour-mini-map {
        left: 16px;
        bottom: 16px;
        width: 180px;
        height: 100px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tour-mini-map,
    .tour-page.tour-split-view .tour-mini-map,
    .smartnav-index-page .map-overlay-widgets .nav-widget {
        transition: none;
    }
}
