:root {
    --nav-primary: #1a6fd4;
    --nav-primary-dark: #1458a8;
    --nav-bg: #eef2f6;
    --nav-surface: #ffffff;
    --nav-text: #1e293b;
    --nav-muted: #64748b;
    --nav-border: #e2e8f0;
    --nav-radius: 1rem;
    --nav-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
    --nav-sidebar-width: 300px;
    --nav-directions-width: 340px;
    --nav-gallery-height: 88px;
    /* Vùng pan/zoom quanh bản đồ (ảnh/SVG nền trắng) */
    --map-stage-bg: #c8d2de;
    --map-stage-surface: #ffffff;
    --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
}

html, body {
    font-family: var(--font-sans);
    color: var(--nav-text);
    background: var(--nav-bg);
    margin: 0;
    overflow: hidden;
    height: 100%;
}

.nav-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

.nav-main {
    display: flex;
    flex: 1;
    min-height: 0;
    gap: 0;
    position: relative;
}

.nav-shell.map-only .nav-main {
    flex: 1;
}

.nav-shell.map-only .nav-map-area {
    min-height: 0;
}

.nav-shell.gallery-hidden .nav-map-area,
.nav-shell.map-only .nav-map-area {
    flex: 1;
}

/* Sidebar */
.nav-sidebar {
    width: var(--nav-sidebar-width);
    flex-shrink: 0;
    background: var(--nav-surface);
    border-right: 1px solid var(--nav-border);
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    gap: 1.25rem;
    overflow-y: auto;
    box-shadow: var(--nav-shadow);
    z-index: 2;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-brand-logo {
    width: 44px;
    height: 44px;
    object-fit: contain;
    flex-shrink: 0;
}

.nav-brand-tagline {
    font-size: 0.65rem;
    color: var(--nav-muted);
    margin: 0.15rem 0 0;
    line-height: 1.3;
}

.nav-brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1a6fd4, #3b9aeb);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    flex-shrink: 0;
}

.nav-brand-title {
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: 0.02em;
    color: var(--nav-primary);
    margin: 0;
}

.nav-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--nav-muted);
    margin-bottom: 0.5rem;
}

.nav-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--nav-muted);
    margin-bottom: 0.25rem;
}

.nav-field .form-select {
    border-radius: 0.65rem;
    border-color: var(--nav-border);
    font-size: 0.85rem;
    padding: 0.55rem 0.75rem;
}

.location-floor-hint {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--nav-primary);
    background: #eff6ff;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
}

/* Kiosk buttons — đồng bộ với admin UI */
.nav-shell-rail .btn,
.nav-shell .btn {
    border-radius: 0.55rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}

.btn-find-route {
    background: var(--nav-primary);
    border: none;
    border-radius: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 0.75rem;
    font-size: 0.9rem;
}

.btn-find-route:hover {
    background: var(--nav-primary-dark);
}

.floor-pills {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.35rem;
    max-height: 96px;
    overflow-y: auto;
    padding-right: 0.15rem;
}

.floor-pill {
    border: 1px solid var(--nav-border);
    background: #f8fafc;
    border-radius: 0.5rem;
    padding: 0.4rem 0.15rem;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--nav-muted);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.floor-pill.active {
    background: var(--nav-primary);
    border-color: var(--nav-primary);
    color: #fff;
}

.nav-hotline {
    margin-top: auto;
    padding: 1rem;
    background: #f0f7ff;
    border-radius: var(--nav-radius);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.nav-hotline i {
    font-size: 1.25rem;
    color: var(--nav-primary);
}

.nav-hotline strong {
    display: block;
    font-size: 1.1rem;
    color: var(--nav-primary);
}

/* Map area */
.nav-map-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 360px;
    position: relative;
}

.map-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--nav-surface);
    border-bottom: 1px solid var(--nav-border);
}

.map-toolbar-floor {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--nav-primary);
}

.map-legend-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    align-items: center;
}

.map-legend-chip {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    color: var(--nav-muted);
    font-weight: 500;
}

.map-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.map-legend-dot.legend-dept { background: #4ade80; }
.map-legend-dot.legend-elevator { background: #a78bfa; }
.map-legend-dot.legend-stairs { background: #fb923c; }
.map-legend-dot.legend-restroom { background: #2dd4bf; }
.map-legend-dot.legend-service { background: #1e40af; }
.map-legend-dot.legend-you { background: #22c55e; }
.map-legend-dot.legend-visited { background: #4ade80; }
.map-legend-dot.legend-node { background: #bfdbfe; border: 1px solid #1a6fd4; }

.map-canvas-wrap {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: var(--map-stage-bg);
}

.map-canvas {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    cursor: grab;
    touch-action: none;
    overscroll-behavior: contain;
    -webkit-user-select: none;
    user-select: none;
}

.map-viewport-layer,
.map-svg-host,
.map-svg-host svg {
    touch-action: none;
}

.map-canvas.map-canvas--dragging {
    cursor: grabbing;
}

.map-canvas:active {
    cursor: grabbing;
}

.map-viewport-layer {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 0 0;
    will-change: transform;
}

.map-svg-host {
    display: inline-block;
    padding: 1rem;
    min-width: min(900px, 100%);
}

.map-svg-host svg {
    display: block;
    width: 100%;
    max-width: 900px;
    height: auto;
}

.map-loading,
.map-load-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    min-height: 280px;
    color: var(--nav-muted);
    padding: 2rem;
}

.map-canvas-fill.is-loading {
    position: relative;
}

.map-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 6;
    min-height: 0;
    background: rgba(248, 250, 252, 0.9);
    backdrop-filter: blur(2px);
}

.map-loading-spinner {
    width: 2.5rem;
    height: 2.5rem;
    border: 3px solid #e2e8f0;
    border-top-color: var(--nav-primary);
    border-radius: 50%;
    animation: map-loading-spin 0.75s linear infinite;
}

@keyframes map-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

.map-load-error i {
    font-size: 2rem;
    color: #f59e0b;
}

.map-zoom-controls {
    position: absolute;
    top: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    z-index: 5;
}

.map-zoom-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 0.65rem;
    background: var(--nav-surface);
    box-shadow: var(--nav-shadow);
    color: var(--nav-text);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-zoom-btn:hover {
    background: #f1f5f9;
}

.map-zoom-btn-locate {
    color: #16a34a;
}

.map-zoom-btn-locate:hover {
    background: #dcfce7;
}

.layout-toggle-bar {
    position: absolute;
    top: 4.75rem;
    right: 1rem;
    z-index: 8;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-shell.directions-hidden .layout-toggle-bar,
.nav-shell.map-only .layout-toggle-bar {
    right: 1rem;
}

.nav-shell:not(.directions-hidden):not(.map-only) .layout-toggle-bar {
    right: calc(var(--nav-directions-width) + 1rem);
}

.layout-toggle-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 0.65rem;
    background: var(--nav-surface);
    box-shadow: var(--nav-shadow);
    color: var(--nav-muted);
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layout-toggle-btn:hover {
    background: #f1f5f9;
    color: var(--nav-text);
}

.layout-toggle-btn.is-on {
    background: var(--nav-primary);
    color: #fff;
}

.layout-toggle-btn-map.is-on {
    background: #16a34a;
}

.layout-edge-tab {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 25;
    width: 28px;
    height: 56px;
    border: none;
    background: var(--nav-surface);
    box-shadow: var(--nav-shadow);
    color: var(--nav-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.layout-edge-tab-left {
    left: 0;
    border-radius: 0 0.65rem 0.65rem 0;
}

.layout-edge-tab-right {
    right: 0;
    border-radius: 0.65rem 0 0 0.65rem;
}

.map-legend-float {
    position: absolute;
    right: var(--map-overlay-right);
    bottom: var(--map-overlay-bottom);
    left: auto;
    top: auto;
    background: var(--nav-surface);
    border: 1px solid var(--nav-border);
    border-radius: var(--nav-radius);
    padding: 0.55rem 0.7rem 0.65rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
    font-size: 0.72rem;
    z-index: 13;
    width: min(220px, calc(100vw - 5.5rem));
    max-width: 220px;
    max-height: min(36vh, 280px);
    overflow: hidden;
    pointer-events: auto;
}

.map-legend-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
}

.map-legend-title {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--nav-text);
}

.map-legend-title .bi {
    font-size: 0.9rem;
    color: var(--nav-primary);
}

.map-legend-hide-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.2rem 0.45rem;
    border: 1px solid var(--nav-border);
    border-radius: 0.4rem;
    background: #f8fafc;
    color: var(--nav-muted);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.map-legend-hide-btn:hover {
    background: #eef2f6;
    color: var(--nav-text);
    border-color: #cbd5e1;
}

.map-legend-hide-btn .bi {
    font-size: 0.75rem;
}

.map-legend-restore {
    position: absolute;
    right: var(--map-overlay-right);
    bottom: var(--map-overlay-bottom);
    z-index: 13;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.65rem;
    border: 1px solid var(--nav-border);
    border-radius: 2rem;
    background: var(--nav-surface);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
    color: var(--nav-text);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    pointer-events: auto;
    transition: background 0.15s, box-shadow 0.15s, color 0.15s;
}

.map-legend-restore:hover {
    background: #f8fafc;
    color: var(--nav-primary);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.16);
}

.map-legend-restore .bi-info-circle {
    color: var(--nav-primary);
    font-size: 0.95rem;
}

.map-legend-restore .bi-chevron-up {
    font-size: 0.7rem;
    color: var(--nav-muted);
}

/* Chú thích: icon trigger + popup */
.map-legend-trigger {
    position: absolute;
    z-index: 13;
    right: auto;
    left: max(0.85rem, env(safe-area-inset-left, 0px));
    bottom: var(--map-overlay-bottom, 1rem);
    top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--nav-border);
    border-radius: 0.5rem;
    background: var(--nav-surface);
    color: var(--nav-primary);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    pointer-events: auto;
    touch-action: manipulation;
}

.map-legend-trigger.is-active {
    border-color: var(--nav-primary);
    background: #eff6ff;
}

.map-legend-trigger .bi {
    font-size: 1.05rem;
}

.map-legend-backdrop {
    position: fixed;
    inset: 0;
    z-index: 12040;
    border: none;
    padding: 0;
    margin: 0;
    background: rgba(15, 23, 42, 0.42);
    cursor: default;
}

.map-legend-popup {
    position: fixed;
    z-index: 12050;
    left: 50%;
    bottom: auto;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(300px, calc(100vw - 2rem));
    max-height: min(60dvh, 420px);
    overflow: hidden;
    background: var(--nav-surface);
    border: 1px solid var(--nav-border);
    border-radius: 0.55rem;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.22);
    pointer-events: auto;
}

.map-legend-popup .map-legend-head {
    padding: 0.75rem 0.85rem;
    margin-bottom: 0;
    border-bottom: 1px solid var(--nav-border);
}

.map-legend-popup .map-legend-title {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--nav-text);
}

.map-legend-popup .map-legend-hide-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.4rem;
    flex-shrink: 0;
}

.map-legend-popup .map-legend-body {
    max-height: min(48dvh, 340px);
    overflow-y: auto;
    padding: 0.5rem 0.85rem 0.75rem;
    margin-top: 0;
}

.map-legend-popup .legend-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0;
    padding: 0.45rem 0;
    min-height: 36px;
}

.map-legend-popup .legend-row + .legend-row {
    border-top: 1px solid #f1f5f9;
}

.map-legend-popup .legend-icon-badge {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.35rem;
    border: 1px solid var(--legend-border, #cbd5e1);
    background: var(--legend-bg, #f8fafc);
    color: var(--legend-icon, #334155);
    font-size: 0.85rem;
    line-height: 1;
}

.map-legend-popup .legend-label {
    flex: 1;
    min-width: 0;
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--nav-text);
}

.nav-rail-mobile-fab {
    display: none;
}

.nav-mobile-dock {
    display: none;
}

.nav-chrome-floors--mobile {
    display: none;
}

.nav-chrome-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--nav-border);
    border-radius: 0.5rem;
    background: var(--nav-surface);
    color: var(--nav-text);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    touch-action: manipulation;
}

.nav-chrome-icon-btn.active {
    border-color: var(--nav-primary);
    background: var(--nav-primary);
    color: #fff;
}

.nav-browse-sheet-backdrop {
    display: none;
}

.nav-browse-sheet {
    display: none;
}

.map-legend-body {
    margin-top: 0;
    max-height: min(30vh, 240px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.map-legend-float .legend-row {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 0.3rem;
    line-height: 1.35;
}

.map-legend-float .legend-row:last-child {
    margin-bottom: 0;
}

.map-legend-float .legend-icon-badge {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 0.45rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--legend-bg, #f1f5f9);
    border: 1px solid var(--legend-border, rgba(148, 163, 184, 0.25));
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.map-legend-float .legend-icon-badge .bi {
    font-size: 0.9rem;
    line-height: 1;
    color: var(--legend-icon, var(--nav-primary));
}

.map-legend-float .legend-label {
    flex: 1;
    min-width: 0;
    word-break: break-word;
    font-size: 0.72rem;
    font-weight: 500;
    color: #475569;
    letter-spacing: 0.01em;
}

/* Directions panel */
.nav-directions {
    width: var(--nav-directions-width);
    flex-shrink: 0;
    background: var(--nav-surface);
    border-left: 1px solid var(--nav-border);
    display: flex;
    flex-direction: column;
    box-shadow: var(--nav-shadow);
    z-index: 2;
}

.directions-header {
    padding: 1.25rem 1.25rem 0.75rem;
    border-bottom: 1px solid var(--nav-border);
}

.directions-header h2 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
}

.route-stats {
    display: flex;
    gap: 1.5rem;
}

.route-stat {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--nav-primary);
}

.directions-steps {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
    max-height: calc(100vh - 280px);
}

.route-step {
    display: flex;
    gap: 0.75rem;
    padding-bottom: 1rem;
    position: relative;
}

.route-step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 32px;
    bottom: 0;
    width: 2px;
    background: var(--nav-border);
}

.route-step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--nav-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
    font-size: 0.9rem;
}

.route-step-btn {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 0;
    margin: 0;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: background 0.15s ease;
}

.route-step-btn:hover {
    background: #f8fafc;
}

.route-step.active .route-step-icon {
    background: #22c55e;
    color: #fff;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
}

.route-step.completed .route-step-icon {
    background: #22c55e;
    color: #fff;
}

.route-step.completed .route-step-title {
    color: #15803d;
}

.route-step.destination .route-step-icon {
    background: #dc2626;
    color: #fff;
}

.route-step-floor {
    font-size: 0.65rem;
    margin-top: 0.2rem;
}

.nav-dot-ring {
    transform-box: fill-box;
    transform-origin: center;
    animation: dot-ring-pulse 1.6s ease-in-out infinite;
}

.nav-route-waypoint,
.nav-route-waypoint-label {
    cursor: pointer;
    pointer-events: all;
}

.route-step-markers {
    pointer-events: all;
}

.nav-route-step-marker {
    cursor: pointer;
    pointer-events: all;
}

@keyframes dot-ring-pulse {
    0%, 100% {
        stroke-width: 1.5;
        opacity: 0.35;
    }
    50% {
        stroke-width: 2.5;
        opacity: 0.65;
    }
}

.route-step-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.route-step-detail {
    font-size: 0.75rem;
    color: var(--nav-muted);
    margin: 0.15rem 0 0;
}

.directions-footer {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--nav-border);
}

.btn-start-nav {
    width: 100%;
    background: var(--nav-primary);
    border: none;
    border-radius: 0.55rem;
    font-weight: 700;
    padding: 0.85rem;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

.btn-start-nav:hover {
    background: var(--nav-primary-dark);
}

/* Floor gallery */
.nav-gallery {
    height: var(--nav-gallery-height);
    background: var(--nav-surface);
    border-top: 1px solid var(--nav-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    overflow-x: auto;
}

.gallery-thumb {
    flex-shrink: 0;
    width: 120px;
    height: 68px;
    border-radius: 0.65rem;
    border: 2px solid transparent;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    background: #e2e8f0;
    padding: 0;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.gallery-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    pointer-events: none;
}

.gallery-thumb:hover {
    transform: translateY(-2px);
}

.gallery-thumb.active {
    border-color: var(--nav-primary);
    box-shadow: 0 0 0 2px rgba(26, 111, 212, 0.2);
}

.gallery-thumb-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.65);
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    text-align: center;
    padding: 0.2rem;
}

.gallery-thumb-overview {
    width: 140px;
}

/* Route line — mockup: viền sáng + đường xanh + mũi tên trắng */
.route-visible .route-overlay {
    opacity: 1;
}

.route-overlay {
    opacity: 0;
    transition: opacity 0.35s ease;
}

.route-completed path {
    stroke: #22c55e !important;
}

.route-completed .route-arrows path {
    fill: #ffffff !important;
}

.route-remaining path {
    stroke: #1a6fd4 !important;
}

.route-arrows path {
    filter: drop-shadow(0 0 1px rgba(26, 111, 212, 0.6));
}

.elevator-shaft-line {
    animation: elevator-flow 1.4s linear infinite;
}

/* Chuyển tầng trong tòa — thanh dưới bản đồ, đồng bộ callout lộ trình */
.map-svg-host .route-floor-transition {
    pointer-events: none;
}

.map-svg-host .route-floor-transition text {
    user-select: none;
}

@keyframes elevator-flow {
    to { stroke-dashoffset: -18; }
}

.nav-branch-gate {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 2rem;
    text-align: center;
    background: var(--nav-bg, #f0f4f8);
}

/* Trang chọn chi nhánh (/) */
.nav-branch-portal {
    min-height: 100vh;
    min-height: 100dvh;
    padding: max(1.5rem, env(safe-area-inset-top, 0px)) 1.25rem max(2rem, env(safe-area-inset-bottom, 0px));
    background: linear-gradient(165deg, #e8f1fb 0%, #f4f7fa 45%, #ffffff 100%);
    overflow-y: auto;
}

.nav-branch-portal-header {
    text-align: center;
    max-width: 36rem;
    margin: 0 auto 2rem;
}

.nav-branch-portal-logo {
    max-height: 4.5rem;
    width: auto;
    margin-bottom: 0.75rem;
}

.nav-branch-portal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4rem;
    height: 4rem;
    border-radius: 1rem;
    background: #fff;
    color: var(--nav-primary, #1a6fd4);
    font-size: 2rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 4px 16px rgba(26, 111, 212, 0.15);
}

.nav-branch-portal-title {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.35rem;
}

.nav-branch-portal-slogan {
    color: #475569;
    margin: 0 0 0.5rem;
    font-size: 1rem;
}

.nav-branch-portal-hint {
    color: #64748b;
    margin: 0;
    font-size: 0.95rem;
}

.nav-branch-portal-empty {
    text-align: center;
    color: #64748b;
    padding: 3rem 1rem;
}

.nav-branch-portal-empty .bi {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

.nav-branch-portal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
    gap: 1rem;
    max-width: 56rem;
    margin: 0 auto;
}

.nav-branch-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.15rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 1rem;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.nav-branch-card:hover,
.nav-branch-card:focus-visible {
    transform: translateY(-2px);
    border-color: var(--branch-accent, var(--nav-primary, #1a6fd4));
    box-shadow: 0 8px 24px rgba(26, 111, 212, 0.18);
    outline: none;
}

.nav-branch-card-disabled {
    cursor: not-allowed;
    opacity: 0.72;
    background: #f8fafc;
}

.nav-branch-card-disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    border-color: rgba(148, 163, 184, 0.35);
}

.nav-branch-card-icon {
    flex-shrink: 0;
    width: 3.25rem;
    height: 3.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
}

.nav-branch-card-icon img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.nav-branch-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.nav-branch-card-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: #0f172a;
    line-height: 1.3;
}

.nav-branch-card-tagline,
.nav-branch-card-meta,
.nav-branch-card-status {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.35;
}

.nav-branch-card-status {
    color: #b45309;
}

.nav-branch-card-action {
    flex-shrink: 0;
    font-size: 1.75rem;
    color: var(--branch-accent, var(--nav-primary, #1a6fd4));
    opacity: 0.85;
}

/* Map-first: panel trái trên bản đồ, nút tầng/zoom phải */
.nav-shell-rail {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.nav-main-map {
    flex: 1;
    min-width: 0;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    overflow: hidden;
    --map-overlay-right: 0.85rem;
    --map-overlay-top: max(0.85rem, env(safe-area-inset-top, 0px));
    --map-overlay-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
}

/* Bản đồ phủ toàn vùng kiosk — SVG lớn fit theo khung màn hình */
.nav-shell-rail .nav-main-map > .nav-map-area {
    position: absolute;
    inset: 0;
    z-index: 1;
    flex: none;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.nav-rail {
    width: min(300px, 38vw);
    flex-shrink: 0;
    background: var(--nav-surface);
    display: flex;
    flex-direction: column;
    min-height: 0;
    z-index: 10;
}

.nav-rail-on-map {
    position: absolute;
    left: 0.85rem;
    top: 0.85rem;
    bottom: auto;
    height: auto;
    max-height: min(50vh, 520px);
    width: min(300px, calc(100vw - 6.5rem));
    /* Không dùng backdrop-filter — phá containing block của position:fixed trong dropdown */
    background: color-mix(in srgb, var(--nav-surface) 96%, transparent);
    border: 1px solid color-mix(in srgb, var(--nav-border) 85%, transparent);
    border-radius: 1rem;
    box-shadow: 0 10px 36px rgba(15, 23, 42, 0.12);
    pointer-events: auto;
    overflow: hidden;
    z-index: 40;
}

.nav-rail-on-map.nav-rail--search {
    max-height: min(62vh, 580px);
    overflow: visible;
    --nav-rail-pad-x: 0.85rem;
    --nav-rail-pad-block: 0.7rem;
    --nav-rail-stack-gap: 0.75rem;
}

.nav-rail--search .nav-rail-head,
.nav-rail--search .nav-rail-search,
.nav-rail--search .nav-rail-field-group,
.nav-rail--search .nav-rail-input-qr,
.nav-rail--search .nav-rail-route-fields {
    overflow: visible;
}

.nav-rail--search .nav-rail-head {
    padding: var(--nav-rail-pad-block) var(--nav-rail-pad-x);
}

.nav-rail--search .nav-rail-search {
    padding: var(--nav-rail-pad-block) var(--nav-rail-pad-x) calc(var(--nav-rail-pad-block) + 0.1rem);
}

.nav-rail--search .nav-rail-route-fields {
    gap: 0.5rem;
}

.nav-rail--search .nav-rail-swap-row {
    margin: -0.2rem 0;
    padding: 0;
    line-height: 0;
}

.nav-rail--search .nav-rail-btn-find {
    margin-top: var(--nav-rail-stack-gap);
}

.nav-rail-connector-switch {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    margin-top: 0.35rem;
}

.nav-rail-connector-opt {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-height: 3.1rem;
    padding: 0.35rem 0.25rem;
    border: 1px solid var(--nav-border, #dbeafe);
    border-radius: 0.65rem;
    background: #fff;
    color: var(--nav-muted, #64748b);
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.nav-rail-connector-opt .bi {
    font-size: 1rem;
}

.nav-rail-connector-opt.active {
    border-color: var(--nav-primary, #1a6fd4);
    background: #eff6ff;
    color: var(--nav-primary, #1a6fd4);
    box-shadow: 0 0 0 1px rgba(26, 111, 212, 0.12);
}

.nav-rail-connector-opt:hover:not(.active) {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--nav-text, #334155);
}

.nav-rail-route-error {
    margin-top: 0.45rem;
    color: #b45309;
    font-weight: 600;
}

/* Panel dẫn đường: cao hơn để xem nhiều bước */
.nav-rail-on-map.nav-rail--directions {
    display: flex;
    flex-direction: column;
    height: min(72vh, 640px);
    max-height: min(72vh, 640px);
}

.nav-rail--directions .nav-rail-head,
.nav-rail--directions .nav-rail-route-meta {
    flex-shrink: 0;
}

.nav-rail--directions .nav-rail-steps {
    flex: 1 1 auto;
    min-height: 10rem;
    max-height: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.nav-chrome-map-tools {
    z-index: 12;
}

.nav-rail-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--nav-border);
}

.nav-rail-change-branch {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 0.5rem;
    color: var(--nav-primary, #1a6fd4);
    background: rgba(26, 111, 212, 0.08);
    text-decoration: none;
    margin-left: auto;
}

.nav-rail-head:has(.nav-rail-collapse-btn) .nav-rail-change-branch {
    margin-left: 0;
}

.nav-rail-collapse-btn {
    display: none;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-left: auto;
    border: none;
    border-radius: 0.5rem;
    background: #f1f5f9;
    color: var(--nav-muted);
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.nav-rail-change-branch + .nav-rail-collapse-btn {
    margin-left: 0.35rem;
}

.nav-rail-collapse-btn:hover {
    background: #e2e8f0;
    color: var(--nav-primary);
}

.nav-rail-head-hint {
    display: none;
    margin-left: auto;
    margin-right: 0.35rem;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    background: rgba(26, 111, 212, 0.1);
    color: var(--nav-primary);
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.nav-rail-head--expandable {
    cursor: pointer;
}

.nav-rail-change-branch:hover {
    background: rgba(26, 111, 212, 0.16);
    color: var(--nav-primary-dark, #1458a8);
}

.nav-rail-back {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 0.5rem;
    background: #f1f5f9;
    flex-shrink: 0;
    touch-action: manipulation;
}

.nav-rail-brand {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--nav-primary);
    min-width: 0;
}

.nav-rail-brand span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-rail-search {
    padding: 0.75rem 0.85rem;
    flex-shrink: 0;
}

.nav-rail-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--nav-muted);
    margin-bottom: 0.25rem;
}

.nav-rail-route-fields {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.nav-rail-swap-row {
    display: flex;
    justify-content: center;
    margin: 0;
    padding: 0;
    line-height: 0;
}

.nav-rail-field-group {
    min-width: 0;
}

.nav-rail-input-qr {
    display: flex;
    align-items: stretch;
    gap: 0.35rem;
}

.nav-rail-input-qr .kiosk-hierarchy-select,
.nav-rail-input-qr .kiosk-hierarchy-select .form-select,
.nav-rail-input-qr .nav-rail-searchable,
.nav-rail-input-qr .searchable-select {
    flex: 1;
    min-width: 0;
}

.kiosk-hierarchy-select {
    width: 100%;
    min-width: 0;
}

.kiosk-hierarchy-select .form-select {
    width: 100%;
    max-width: 100%;
}

.kiosk-hierarchy-select optgroup {
    font-weight: 700;
    color: var(--nav-muted);
}

.kiosk-hierarchy-select option {
    font-weight: 500;
    color: var(--nav-text);
    padding: 0.15rem 0;
}

/* Searchable dropdown */
.searchable-select {
    position: relative;
    width: 100%;
}

.searchable-select-backdrop {
    position: fixed;
    inset: 0;
    z-index: 11990;
    border: none;
    padding: 0;
    margin: 0;
    background: transparent;
    cursor: default;
}

.searchable-select-sheet-head {
    display: none;
}

.searchable-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.35rem;
    width: 100%;
    min-height: calc(1.5em + 0.5rem + 2px);
    padding: 0.25rem 0.55rem;
    border: 1px solid var(--nav-border);
    border-radius: 0.375rem;
    background: #fff;
    color: var(--nav-text);
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: left;
    cursor: pointer;
}

.searchable-select-trigger:hover {
    border-color: #cbd5e1;
}

.searchable-select.is-open .searchable-select-trigger {
    border-color: var(--nav-primary);
    box-shadow: 0 0 0 2px rgba(26, 111, 212, 0.15);
}

.searchable-select-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.searchable-select-value.is-placeholder {
    color: var(--nav-muted);
}

.searchable-select-chevron {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--nav-muted);
    transition: transform 0.15s ease;
}

.searchable-select.is-open .searchable-select-chevron {
    transform: rotate(180deg);
}

.searchable-select.is-open {
    z-index: 12001;
}

.searchable-select-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    z-index: 12000;
    background: #fff;
    border: 1px solid var(--nav-border);
    border-radius: 0.5rem;
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
    overflow: hidden;
    min-width: 16rem;
}

.searchable-select-panel--wide {
    min-width: 25rem;
}

.searchable-select-search-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.55rem;
    border-bottom: 1px solid var(--nav-border);
    background: #f8fafc;
}

.searchable-select-search-wrap .bi-search {
    flex-shrink: 0;
    font-size: 0.85rem;
    color: var(--nav-muted);
}

.searchable-select-search {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 0.8rem;
    padding: 0.15rem 0;
    outline: none;
}

.searchable-select-list {
    list-style: none;
    margin: 0;
    padding: 0.25rem 0;
    max-height: min(240px, 40dvh);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.searchable-select-group {
    padding: 0.4rem 0.75rem 0.2rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--nav-muted);
    user-select: none;
}

.searchable-select-group + .searchable-select-group {
    padding-top: 0.55rem;
}

.searchable-select-option {
    display: block;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 0.45rem 0.65rem;
    font-size: 0.8rem;
    line-height: 1.35;
    color: var(--nav-text);
    cursor: pointer;
}

.searchable-select-option:hover {
    background: #f1f5f9;
}

.searchable-select-option.selected {
    background: #eff6ff;
    color: var(--nav-primary);
    font-weight: 600;
}

.searchable-select-empty {
    padding: 0.65rem 0.75rem;
    font-size: 0.78rem;
    color: var(--nav-muted);
    text-align: center;
}

.searchable-select-group-rich {
    text-transform: none;
    letter-spacing: normal;
    font-weight: 500;
    font-size: 0.78rem;
    padding-left: calc(0.65rem + var(--select-depth, 0) * 1.1rem);
    padding-right: 0.65rem;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.searchable-select-item-rich {
    list-style: none;
}

.searchable-select-option-rich {
    padding-left: calc(0.65rem + var(--select-depth, 0) * 1.1rem);
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.searchable-select-panel .searchable-select-row {
    align-items: flex-start;
    gap: 0.35rem 0.45rem;
}

.searchable-select-row {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    min-width: 0;
}

.searchable-select-row-icon {
    flex-shrink: 0;
    font-size: 0.95rem;
    color: var(--nav-primary);
    opacity: 0.85;
    margin-top: 0.1rem;
}

.searchable-select-panel .searchable-select-row-label {
    flex: 1 1 0;
    min-width: 6rem;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
}

.searchable-select-row-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.searchable-select-code {
    flex-shrink: 0;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--nav-muted);
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 0.25rem;
    padding: 0.05rem 0.35rem;
    line-height: 1.35;
}

.searchable-select-panel .searchable-select-tag {
    margin-left: auto;
    align-self: flex-start;
    margin-top: 0.05rem;
    white-space: nowrap;
}

.searchable-select-tag {
    flex-shrink: 0;
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    border-radius: 999px;
    padding: 0.12rem 0.45rem;
    line-height: 1.2;
}

.searchable-select-tag--zone {
    background: #dbeafe;
    color: #1d4ed8;
}

.searchable-select-tag--floor {
    background: #fef3c7;
    color: #b45309;
}

.nav-rail-qr-btn {
    flex-shrink: 0;
    width: 44px;
    min-height: 44px;
    border: 1px solid var(--nav-border);
    border-radius: 0.5rem;
    background: #f8fafc;
    color: var(--nav-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.nav-rail-qr-btn:hover {
    background: var(--nav-primary);
    border-color: var(--nav-primary);
    color: #fff;
}

.nav-rail-qr-btn .bi {
    font-size: 1.15rem;
}

.nav-rail-qr-feedback {
    color: #15803d;
    margin: 0.15rem 0 0;
}

.nav-qr-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.nav-qr-panel {
    width: min(400px, 100%);
    background: var(--nav-surface);
    border-radius: var(--nav-radius);
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.25);
    padding: 1rem 1rem 1.1rem;
}

.nav-qr-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.nav-qr-title {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--nav-text);
}

.nav-qr-reader {
    width: 100%;
    min-height: 280px;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #0f172a;
}

.nav-qr-reader video {
    border-radius: 0.5rem;
}

.nav-rail-swap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--nav-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26, 111, 212, 0.32);
    transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.nav-rail-swap:hover {
    background: #1558a8;
    box-shadow: 0 3px 12px rgba(26, 111, 212, 0.4);
    transform: scale(1.05);
}

.nav-rail-swap .bi {
    font-size: 1rem;
    line-height: 1;
}

.nav-rail-access .form-check-label {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.35rem;
    font-size: 0.78rem;
    line-height: 1.35;
}

.nav-rail-access .form-check-label .bi {
    flex-shrink: 0;
    margin-top: 0.1rem;
    font-size: 1rem;
    color: var(--nav-primary);
}

.nav-rail-btn-find,
.nav-rail-btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.nav-rail-btn-find .bi,
.nav-rail-btn-icon .bi {
    font-size: 1rem;
    line-height: 1;
}

.nav-rail-route-meta {
    padding: 0.75rem 0.85rem;
    border-bottom: 1px solid var(--nav-border);
}

.nav-rail-meta-title {
    font-size: 0.72rem;
    color: var(--nav-muted);
    margin: 0 0 0.2rem;
}

.nav-rail-meta-value {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
}

.nav-rail-dest {
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.nav-rail-steps {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0.65rem;
    min-height: 0;
}

.nav-rail-step {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    padding: 0.55rem 0.45rem;
    border-radius: 0.5rem;
    margin-bottom: 0.15rem;
    position: relative;
    transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.nav-rail-step:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 1.15rem;
    top: 2rem;
    bottom: -0.15rem;
    width: 2px;
    background: var(--nav-border);
}

.nav-rail-step.done::before {
    background: #86efac;
}

.nav-rail-step:hover {
    background: #f8fafc;
}

.nav-rail-step.active {
    background: #dcfce7;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.22);
}

.nav-rail-step-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--nav-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    z-index: 1;
    font-size: 0.85rem;
}

.nav-rail-step.active .nav-rail-step-icon {
    background: #bbf7d0;
    color: #15803d;
    box-shadow: inset 0 0 0 2px #16a34a;
}

.nav-rail-step.active .nav-rail-step-title {
    color: #14532d;
    font-weight: 700;
}

.nav-rail-step.done .nav-rail-step-icon {
    background: #dcfce7;
    color: #16a34a;
}

.nav-rail-step.pending .nav-rail-step-icon {
    background: #f1f5f9;
    color: var(--nav-muted);
}

.nav-rail-step.pending .nav-rail-step-title {
    color: var(--nav-muted);
}

.nav-rail-step-body {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.nav-rail-step-title {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.35;
}

.nav-rail-step-detail {
    font-size: 0.72rem;
    color: var(--nav-muted);
}

.nav-rail-foot {
    padding: 0.65rem 0.85rem;
    border-top: 1px solid var(--nav-border);
    flex-shrink: 0;
}

/* Desktop — chuyển lộ trình sang điện thoại */
.nav-route-handoff {
    display: none;
    flex-shrink: 0;
    margin: 0.35rem 0.55rem 0.5rem;
    padding: 0.55rem 0.65rem 0.6rem;
    border-radius: 0.65rem;
    border: 1px solid #bfdbfe;
    background:
        linear-gradient(145deg, #eff6ff 0%, #dbeafe 48%, #f0f9ff 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.85),
        0 4px 14px rgba(26, 111, 212, 0.12);
}

.nav-route-handoff-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    text-align: center;
}

.nav-route-handoff-qr-frame {
    width: 5.75rem;
    height: 5.75rem;
    padding: 0.28rem;
    border-radius: 0.5rem;
    border: 1px solid #fff;
    background: #fff;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.1);
}

.nav-route-handoff-qr-img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 0.35rem;
    object-fit: contain;
}

.nav-route-handoff-qr-placeholder {
    width: 100%;
    height: 100%;
    border-radius: 0.35rem;
    border: 1px dashed #cbd5e1;
    background:
        repeating-linear-gradient(
            0deg,
            #f1f5f9 0,
            #f1f5f9 3px,
            #ffffff 3px,
            #ffffff 6px
        ),
        repeating-linear-gradient(
            90deg,
            #f1f5f9 0,
            #f1f5f9 3px,
            #ffffff 3px,
            #ffffff 6px
        );
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 1.65rem;
}

.nav-route-handoff-caption {
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: #1e40af;
    line-height: 1.2;
    white-space: nowrap;
}

.nav-route-handoff-caption-icon {
    font-size: 0.82rem;
    color: #2563eb;
}

@media (min-width: 992px) {
    .nav-rail--directions:not(.nav-rail--collapsed) .nav-route-handoff {
        display: block;
    }
}

.nav-map-home-back {
    position: absolute;
    z-index: 14;
    top: var(--map-overlay-top, 0.85rem);
    left: max(0.85rem, env(safe-area-inset-left, 0px));
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.8rem 0.45rem 0.6rem;
    border: 1px solid #93c5fd;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.96);
    color: #1d4ed8;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(4px);
    pointer-events: auto;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.nav-map-home-back:hover,
.nav-map-home-back:focus-visible {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
    outline: none;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.18);
}

.nav-map-home-back .bi {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.nav-chrome-map-tools {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 50;
}

.nav-chrome-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nav-chrome-dot-from {
    background: #22c55e;
}

.nav-chrome-dot-to {
    background: #dc2626;
}

/* Map-first kiosk layout (legacy) */
.nav-shell-map-first {
    height: 100vh;
    height: 100dvh;
}

.nav-main-fill {
    flex: 1;
    position: relative;
    min-height: 0;
    min-width: 0;
}

.nav-map-area-fill {
    flex: 1;
    min-height: 0;
    height: 100%;
}

.map-canvas-wrap-fill {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.map-canvas-fill {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

/* Kiosk: nền ngoài khác màu trắng của ảnh bản đồ — gợi ý còn kéo/phóng rộng */
.nav-shell-rail .map-canvas-wrap-fill {
    background-color: var(--map-stage-bg);
    background-image: radial-gradient(
        circle at 1px 1px,
        rgba(100, 116, 139, 0.2) 1px,
        transparent 0
    );
    background-size: 22px 22px;
}

.nav-shell-rail .map-canvas-fill {
    background: transparent;
}

.nav-shell-rail .map-svg-host {
    display: inline-block;
    flex-shrink: 0;
    line-height: 0;
    padding: 0;
    min-width: 0;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

.nav-shell-rail .map-svg-host svg {
    display: block;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    margin: 0;
}

/* Chi nhánh demo (/demo): nền trắng để SVG/ảnh bản đồ nổi bật */
.nav-app:has(.nav-shell-map-bg-light) {
    background: #ffffff;
}

.nav-shell-map-bg-light {
    --map-stage-bg: #ffffff;
    --map-stage-surface: #ffffff;
}

.nav-shell-map-bg-light .map-canvas-wrap-fill {
    background-color: #ffffff;
    background-image: none;
}

.map-svg-host {
    display: inline-block;
    flex-shrink: 0;
    line-height: 0;
}

.nav-chrome {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 12;
}

.nav-chrome-route,
.nav-chrome-floors,
.nav-chrome-side,
.nav-chrome-zoom,
.nav-mobile-dock,
.nav-browse-sheet-backdrop,
.nav-browse-sheet {
    pointer-events: auto;
}

.nav-chrome-card {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    width: min(300px, calc(100vw - 4.5rem));
    background: var(--nav-surface);
    border-radius: 1rem;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
    border: 1px solid var(--nav-border);
    padding: 0.65rem 0.75rem 0.75rem;
}

.nav-chrome-card-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.nav-chrome-menu {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 0.65rem;
    background: #f1f5f9;
    color: var(--nav-text);
    flex-shrink: 0;
}

.nav-chrome-brand {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    flex: 1;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--nav-primary);
}

.nav-chrome-brand-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-chrome-stats {
    display: flex;
    gap: 0.65rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--nav-primary);
    width: 100%;
}

.nav-chrome-fields {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-chrome-field {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-chrome-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nav-chrome-dot-from {
    background: #22c55e;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #22c55e;
}

.nav-chrome-dot-to {
    background: #dc2626;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #dc2626;
}

.nav-chrome-swap {
    align-self: center;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--nav-muted);
}

.nav-chrome-summary {
    cursor: pointer;
    font-size: 0.82rem;
}

.nav-chrome-summary-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0;
}

.nav-chrome-step-bar {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--nav-border);
}

.nav-chrome-step-text {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
}

.nav-chrome-actions {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.45rem;
}

.nav-chrome-hint {
    font-size: 0.68rem;
    color: var(--nav-muted);
    margin-top: 0.35rem;
}

.nav-chrome-floors {
    position: absolute;
    left: 50%;
    right: auto;
    bottom: var(--map-overlay-bottom, 1rem);
    top: auto;
    transform: translateX(-50%);
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem;
    pointer-events: auto;
    max-width: min(720px, calc(100% - 8.5rem));
    padding: 0.45rem 0.65rem;
    background: rgba(241, 245, 249, 0.94);
    border: 1px solid var(--nav-border);
    border-radius: 999px;
    box-shadow: var(--nav-shadow);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.nav-chrome-floor-btn {
    flex-shrink: 0;
    min-width: 44px;
    height: 40px;
    padding: 0 0.75rem;
    border-radius: 999px;
    border: 2px solid transparent;
    background: var(--nav-surface);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    color: #334155;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.nav-chrome-floor-btn:hover:not(.active) {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: var(--nav-primary);
}

.nav-chrome-floor-btn.active {
    background: var(--nav-primary);
    color: #fff;
    border-color: var(--nav-primary-dark);
    box-shadow: 0 2px 8px rgba(26, 111, 212, 0.28);
}

.nav-chrome-floor-btn.active i {
    color: #fff;
}

.nav-chrome-zone-btn {
    max-width: 8.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-chrome-level-sep {
    flex-shrink: 0;
    width: 1px;
    height: 22px;
    background: #cbd5e1;
    margin: 0 0.1rem;
}

.nav-chrome-floor-btn.parent {
    background: #e0f2fe;
    color: var(--nav-primary);
    border-color: #93c5fd;
    box-shadow: none;
}

.nav-chrome-floor-btn.parent:hover {
    background: #bae6fd;
    border-color: #60a5fa;
    color: var(--nav-primary-dark);
}

.nav-chrome-side {
    position: absolute;
    right: var(--map-overlay-right, 0.85rem);
    top: var(--map-overlay-top, 0.85rem);
    bottom: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
    pointer-events: auto;
    z-index: 12;
}

.nav-chrome-zoom {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-end;
}

.nav-chrome-tool {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 0.65rem;
    background: var(--nav-surface);
    box-shadow: var(--nav-shadow);
    color: var(--nav-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.nav-chrome-tool-locate {
    color: #16a34a;
}

.nav-chrome-tool-rating {
    color: #eab308;
}

.nav-chrome-tool-rating:hover {
    color: #ca8a04;
}

.nav-chrome-tool-hotline {
    color: var(--nav-primary);
    text-decoration: none;
}

.nav-chrome-tool-hotline:hover {
    color: var(--nav-primary-dark);
}

.nav-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    z-index: 20;
}

.nav-drawer {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 92vw);
    z-index: 25;
    background: var(--nav-surface);
    box-shadow: 8px 0 32px rgba(15, 23, 42, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nav-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--nav-border);
}

.nav-drawer .nav-sidebar {
    width: 100%;
    border: none;
    box-shadow: none;
    flex: 1;
    min-height: 0;
}

/* Popup ghi chú điểm trên bản đồ */
.nav-map-note-overlay {
    position: fixed;
    inset: 0;
    z-index: 10090;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.nav-map-note-panel {
    width: min(520px, 100%);
    max-height: min(80vh, 640px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: var(--nav-surface);
    border-radius: var(--nav-radius);
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.28);
}

.nav-map-note-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--nav-border);
}

.nav-map-note-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--nav-text);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nav-map-note-title .bi {
    color: var(--nav-primary);
}

.nav-map-note-body {
    padding: 1rem;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--nav-text);
}

.nav-map-note-html p:last-child,
.nav-map-note-html ul:last-child,
.nav-map-note-html ol:last-child {
    margin-bottom: 0;
}

.nav-waypoint-info {
    cursor: pointer;
}

.nav-waypoint-info-hit {
    filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.22));
}

.map-svg-host .map-wp-pin {
    pointer-events: none;
}

.map-svg-host .kiosk-wp-hit {
    cursor: pointer;
}

.map-svg-host .map-wp-pin .nav-waypoint-info {
    pointer-events: all;
    cursor: pointer;
}

.map-svg-host .map-wp-label-row {
    pointer-events: none;
}

.map-svg-host .map-wp-label {
    font-size: 8px;
    font-weight: 600;
    dominant-baseline: central;
    paint-order: stroke fill;
    stroke: rgba(255, 255, 255, 0.95);
    stroke-width: 2px;
    stroke-linejoin: round;
    pointer-events: none;
}

.map-svg-host .nav-waypoint-info-glyph {
    font-size: 7px;
    font-weight: 700;
    dominant-baseline: central;
    pointer-events: none;
}

.map-svg-host .map-wp-marker {
    pointer-events: none;
}

.map-svg-host .kiosk-wp-hit {
    cursor: pointer;
}

.map-svg-host .kiosk-wp-hit .map-wp-marker {
    pointer-events: none;
}

.nav-toast-wrap {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    max-width: 90vw;
}

/* Đánh giá hài lòng */
.nav-satisfaction-overlay {
    position: fixed;
    inset: 0;
    z-index: 10080;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.nav-satisfaction-panel {
    width: min(680px, 96vw);
    max-height: min(94vh, 860px);
    overflow: auto;
    background: var(--nav-surface);
    border-radius: 1.1rem;
    box-shadow: 0 20px 56px rgba(15, 23, 42, 0.28);
    padding: 1.5rem 1.75rem 1.6rem;
}

.nav-satisfaction-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.nav-satisfaction-title {
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--nav-text);
}

.nav-satisfaction-title .bi {
    color: #f59e0b;
}

.nav-satisfaction-lead {
    font-size: 0.98rem;
    color: var(--nav-muted);
    margin: 0 0 1rem;
}

.nav-satisfaction-form-top {
    margin-bottom: 0.5rem;
}

.nav-satisfaction-criteria-label {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--nav-text);
    margin: 0 0 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nav-satisfaction-level-num {
    display: block;
    font-size: 0.85rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.2rem;
    opacity: 0.85;
}

.nav-satisfaction-levels {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.55rem;
    margin-bottom: 1rem;
}

.nav-satisfaction-level {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    min-height: 5.5rem;
    padding: 0.55rem 0.35rem;
    border: 1.5px solid var(--nav-border);
    border-radius: 0.75rem;
    background: #f8fafc;
    color: var(--nav-text);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.12s;
}

.nav-satisfaction-level .bi {
    font-size: 1.85rem;
    line-height: 1;
}

.nav-satisfaction-level.tone-5 .bi { color: #16a34a; }
.nav-satisfaction-level.tone-4 .bi { color: #65a30d; }
.nav-satisfaction-level.tone-3 .bi { color: #ca8a04; }
.nav-satisfaction-level.tone-2 .bi { color: #ea580c; }
.nav-satisfaction-level.tone-1 .bi { color: #dc2626; }

.nav-satisfaction-level:hover {
    border-color: #cbd5e1;
    background: #fff;
}

.nav-satisfaction-level.is-selected {
    border-color: var(--nav-primary);
    background: #eff6ff;
    box-shadow: 0 0 0 2px rgba(26, 111, 212, 0.18);
    transform: translateY(-1px);
}

.nav-satisfaction-error {
    color: #dc2626;
}

.nav-satisfaction-form .form-label {
    color: var(--nav-text);
    font-size: 0.95rem;
    font-weight: 600;
}

.nav-satisfaction-form .form-control,
.nav-satisfaction-form .form-select {
    font-size: 1rem;
    padding: 0.65rem 0.85rem;
    border-radius: 0.65rem;
}

.nav-satisfaction-required {
    color: #dc2626;
    font-weight: 700;
}

.nav-satisfaction-contact-row > [class*="col-"] {
    min-width: 0;
}

.nav-satisfaction-file .btn-link {
    font-size: 0.75rem;
}

.nav-satisfaction-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.1rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--nav-border);
}

.nav-satisfaction-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 1rem;
    padding: 0.6rem 1.15rem;
    border-radius: 0.65rem;
}

.nav-satisfaction-thanks {
    text-align: center;
    padding: 1.5rem 0.5rem 1rem;
    color: var(--nav-text);
}

.nav-satisfaction-thanks .bi {
    font-size: 2.5rem;
    color: #16a34a;
    margin-bottom: 0.5rem;
}

@media (max-width: 480px) {
    .nav-satisfaction-levels {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-satisfaction-level {
        flex: 1 1 calc(33% - 0.35rem);
        min-width: 6.5rem;
        max-width: calc(50% - 0.2rem);
        min-height: 4.75rem;
        font-size: 0.72rem;
    }
}

/* Kiosk — màn hình chính (idle reset) */
.kiosk-home-hub {
    position: fixed;
    inset: 0;
    z-index: 10070;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(1rem, env(safe-area-inset-top, 0px)) 1.25rem max(1.25rem, env(safe-area-inset-bottom, 0px));
    background: linear-gradient(165deg, #e8f1fb 0%, #f4f7fa 45%, #ffffff 100%);
    overflow-y: auto;
}

.kiosk-home-hub--page {
    position: relative;
    inset: auto;
    z-index: auto;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    box-sizing: border-box;
    background-color: #f4f7fa;
    overflow: hidden;
}

.kiosk-home-hub--page::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url('/images/bg-axis-199.png');
    background-repeat: no-repeat;
    background-position: right bottom;
    background-size: 100% 100%;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.kiosk-home-hub--page > * {
    position: relative;
    z-index: 1;
}

.nav-app:has(.kiosk-home-hub--page) {
    min-height: 100vh;
    min-height: 100dvh;
    height: 100%;
    background-color: #f4f7fa;
}

.kiosk-home-hub-panel {
    width: min(40rem, 100%);
    margin: 0 auto;
}

.kiosk-home-hub-head {
    text-align: center;
    margin-bottom: 1.75rem;
}

.kiosk-home-hub-logo {
    max-height: 4.5rem;
    width: auto;
    margin-bottom: 0.75rem;
}

.kiosk-home-hub-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.25rem;
    height: 4.25rem;
    border-radius: 1rem;
    background: #fff;
    color: var(--nav-primary, #1a6fd4);
    font-size: 2rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 4px 16px rgba(26, 111, 212, 0.15);
}

.kiosk-home-hub-title {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.35rem;
}

.kiosk-home-hub-tagline {
    color: #64748b;
    margin: 0;
    font-size: 0.95rem;
}

.kiosk-home-hub-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 720px) {
    .kiosk-home-hub-grid {
        grid-template-columns: 1fr;
    }
}

.kiosk-home-tile {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    min-height: 6.5rem;
    padding: 1.1rem 1.15rem;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 1rem;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
}

.kiosk-home-tile:hover,
.kiosk-home-tile:focus-visible {
    transform: translateY(-2px);
    border-color: var(--nav-primary, #1a6fd4);
    box-shadow: 0 10px 28px rgba(26, 111, 212, 0.16);
    outline: none;
}

.kiosk-home-tile-icon {
    flex-shrink: 0;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.85rem;
    font-size: 1.65rem;
}

.kiosk-home-tile--service .kiosk-home-tile-icon {
    background: #ecfdf5;
    color: #059669;
}

.kiosk-home-tile--route .kiosk-home-tile-icon {
    background: #eff6ff;
    color: #2563eb;
}

.kiosk-home-tile--satisfaction .kiosk-home-tile-icon {
    background: #fffbeb;
    color: #d97706;
}

.kiosk-home-tile--invoice .kiosk-home-tile-icon {
    background: #f5f3ff;
    color: #7c3aed;
}

a.kiosk-home-tile {
    text-decoration: none;
    color: inherit;
}

.kiosk-home-tile-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.kiosk-home-tile-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: #0f172a;
    line-height: 1.3;
}

.kiosk-home-tile-desc {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.35;
}

.kiosk-home-tile-arrow {
    flex-shrink: 0;
    font-size: 1.65rem;
    color: var(--nav-primary, #1a6fd4);
    opacity: 0.85;
}

.kiosk-home-service-panel {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.kiosk-home-service-back {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.55rem;
    border: none;
    border-radius: 0.45rem;
    background: transparent;
    color: #475569;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
}

.kiosk-home-service-card {
    text-align: center;
    padding: 1.5rem 1.25rem;
    border-radius: 1rem;
    border: 1px solid #dbeafe;
    background: #fff;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
}

.kiosk-home-service-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 0.85rem;
    background: #ecfdf5;
    color: #059669;
    font-size: 1.5rem;
    margin-bottom: 0.65rem;
}

.kiosk-home-service-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: #0f172a;
}

.kiosk-home-service-card-lead {
    margin: 0 0 1rem;
    color: #64748b;
    font-size: 0.92rem;
    line-height: 1.45;
}

.kiosk-home-service-hotline {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 1rem;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-weight: 700;
    text-decoration: none;
}

/* Kiosk — cảnh báo idle */
.kiosk-idle-overlay {
    position: fixed;
    inset: 0;
    z-index: 10090;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.kiosk-idle-panel {
    width: min(24rem, 100%);
    padding: 1.35rem 1.25rem 1.2rem;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
    text-align: center;
}

.kiosk-idle-icon {
    font-size: 2rem;
    color: #f59e0b;
    margin-bottom: 0.5rem;
}

.kiosk-idle-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 0.45rem;
    color: #0f172a;
}

.kiosk-idle-lead {
    margin: 0 0 0.65rem;
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.45;
}

.kiosk-idle-countdown {
    margin: 0 0 1rem;
    font-size: 0.82rem;
    color: #64748b;
}

.kiosk-idle-continue {
    width: 100%;
    font-weight: 700;
    padding: 0.55rem 1rem;
}

/* Kiosk — tra cứu giá dịch vụ */
.kiosk-service-page {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    padding: max(0.75rem, env(safe-area-inset-top, 0px)) 1rem max(1.25rem, env(safe-area-inset-bottom, 0px));
    background-color: #f4f7fa;
    overflow: hidden;
}

.kiosk-service-page::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: url('/images/bg-axis-199.png');
    background-repeat: no-repeat;
    background-position: right bottom;
    background-size: 100% 100%;
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.kiosk-service-page > * {
    position: relative;
    z-index: 1;
}

.nav-app:has(.kiosk-service-page) {
    min-height: 100vh;
    min-height: 100dvh;
    height: 100%;
    background-color: #f4f7fa;
}

.kiosk-service-page-head {
    max-width: 52rem;
    margin: 0 auto 1rem;
    padding: 0.85rem 1rem 1rem;
    border-radius: 1rem;
    border: 1px solid #bfdbfe;
    background: linear-gradient(145deg, #eff6ff 0%, #dbeafe 52%, #f8fafc 100%);
    box-shadow: 0 8px 24px rgba(26, 111, 212, 0.12);
}

.kiosk-service-page-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0.9rem 0.5rem 0.65rem;
    border: 1px solid #60a5fa;
    border-radius: 999px;
    background: #fff;
    color: #1d4ed8;
    font-size: 0.88rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.16);
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.kiosk-service-page-back:hover,
.kiosk-service-page-back:focus-visible {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
    outline: none;
}

.kiosk-service-page-back .bi {
    font-size: 1.1rem;
}

.kiosk-service-page-hero {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.kiosk-service-page-hero-icon {
    flex-shrink: 0;
    width: 3.25rem;
    height: 3.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.85rem;
    background: #fff;
    color: #059669;
    font-size: 1.55rem;
    box-shadow: inset 0 0 0 1px rgba(5, 150, 105, 0.15);
}

.kiosk-service-page-title {
    margin: 0 0 0.15rem;
    font-size: clamp(1.2rem, 2.8vw, 1.55rem);
    font-weight: 800;
    color: #0f172a;
    line-height: 1.25;
}

.kiosk-service-page-sub {
    margin: 0;
    color: #475569;
    font-size: 0.88rem;
    font-weight: 600;
}

.kiosk-service-filters {
    display: grid;
    grid-template-columns: minmax(0, 14rem) minmax(0, 1fr);
    gap: 0.75rem;
    max-width: 52rem;
    margin: 0 auto 0.75rem;
}

.kiosk-service-filter-label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
}

.kiosk-service-search-row {
    display: flex;
    gap: 0.4rem;
}

.kiosk-service-list {
    display: grid;
    gap: 0;
    max-width: 52rem;
    margin: 0 auto;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 0.65rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.05);
}

.kiosk-service-row {
    margin: 0;
}

.kiosk-service-row + .kiosk-service-row .kiosk-service-row-hit {
    border-top: 1px solid #e2e8f0;
}

.kiosk-service-row-hit {
    width: 100%;
    display: grid;
    grid-template-columns: 4.25rem minmax(0, 1fr) 9.5rem 6.25rem 1.15rem;
    align-items: center;
    gap: 0.2rem 0.5rem;
    padding: 0.38rem 0.6rem;
    border: none;
    border-radius: 0;
    background: #fff;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.kiosk-service-row-hit:hover,
.kiosk-service-row-hit:focus-visible {
    background: #f0f7ff;
    outline: none;
}

.kiosk-service-row:nth-child(even) .kiosk-service-row-hit {
    background: #f8fafc;
}

.kiosk-service-row:nth-child(even) .kiosk-service-row-hit:hover,
.kiosk-service-row:nth-child(even) .kiosk-service-row-hit:focus-visible {
    background: #e8f2ff;
}

.kiosk-service-row-code {
    font-size: 0.68rem;
    font-weight: 700;
    color: #64748b;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kiosk-service-row-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kiosk-service-row-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    overflow: hidden;
}

.kiosk-service-row-group {
    font-size: 0.68rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kiosk-service-row-type {
    flex-shrink: 0;
    font-size: 0.62rem;
    font-weight: 700;
    color: #2563eb;
    padding: 0.08rem 0.35rem;
    border-radius: 999px;
    background: #eff6ff;
    white-space: nowrap;
}

.kiosk-service-row-price {
    font-size: 0.8rem;
    font-weight: 800;
    color: #059669;
    text-align: right;
    white-space: nowrap;
}

.kiosk-service-row-chevron {
    color: #94a3b8;
    font-size: 0.95rem;
    display: inline-flex;
    justify-content: center;
}

.kiosk-service-empty,
.kiosk-service-status {
    max-width: 52rem;
    margin: 1.5rem auto;
    text-align: center;
}

.kiosk-service-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    max-width: 52rem;
    margin: 0.85rem auto 0;
    padding: 0.25rem 0;
}

.kiosk-service-pagination .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-height: 2.5rem;
    padding-inline: 0.85rem;
}

.kiosk-service-pagination-meta {
    font-size: 0.88rem;
    font-weight: 600;
    color: #334155;
    text-align: center;
}

.kiosk-service-pagination-count {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: #64748b;
}

.kiosk-service-empty .bi {
    font-size: 2rem;
    color: #94a3b8;
    display: block;
    margin-bottom: 0.5rem;
}

.kiosk-service-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10090;
    background: rgba(15, 23, 42, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: max(0.75rem, env(safe-area-inset-top, 0px)) 1rem max(0.75rem, env(safe-area-inset-bottom, 0px));
}

.kiosk-service-modal-panel {
    width: min(46rem, 100%);
    max-height: min(92vh, 860px);
    overflow: auto;
    padding: 1.15rem 1.2rem 1.2rem;
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 20px 56px rgba(15, 23, 42, 0.28);
}

.kiosk-service-modal-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.9rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.kiosk-service-modal-head-main {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    min-width: 0;
}

.kiosk-service-modal-head-icon {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.7rem;
    background: #ecfdf5;
    color: #059669;
    font-size: 1.25rem;
}

.kiosk-service-modal-kicker {
    margin: 0 0 0.15rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #64748b;
}

.kiosk-service-modal-title {
    margin: 0;
    font-size: clamp(1.05rem, 2.5vw, 1.35rem);
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
}

.kiosk-service-modal-price-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
    padding: 0.75rem 0.9rem;
    border-radius: 0.75rem;
    border: 1px solid #bbf7d0;
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
}

.kiosk-service-modal-price-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.82rem;
    font-weight: 700;
    color: #166534;
}

.kiosk-service-modal-price-value {
    font-size: clamp(1.15rem, 3vw, 1.45rem);
    font-weight: 800;
    color: #059669;
    line-height: 1.2;
}

.kiosk-service-modal-dl {
    margin: 0 0 1rem;
}

.kiosk-service-modal-row {
    display: grid;
    grid-template-columns: 11rem 1fr;
    gap: 0.5rem 0.85rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.92rem;
}

.kiosk-service-modal-row dt {
    margin: 0;
    display: inline-flex;
    align-items: flex-start;
    gap: 0.35rem;
    color: #475569;
    font-weight: 700;
}

.kiosk-service-modal-row dt .bi {
    color: #2563eb;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.kiosk-service-modal-row dd {
    margin: 0;
    color: #0f172a;
    line-height: 1.45;
    word-break: break-word;
}

.kiosk-service-modal-row--notes dd {
    white-space: pre-wrap;
}

.kiosk-service-modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-weight: 700;
    min-height: 2.75rem;
}

@media (max-width: 900px) {
    .kiosk-service-row-hit {
        grid-template-columns: 3.75rem minmax(0, 1fr) 5.5rem 1rem;
        grid-template-areas:
            "code name price chevron"
            "code meta price chevron";
    }

    .kiosk-service-row-code { grid-area: code; }
    .kiosk-service-row-name { grid-area: name; }
    .kiosk-service-row-meta { grid-area: meta; }
    .kiosk-service-row-price { grid-area: price; }
    .kiosk-service-row-chevron { grid-area: chevron; }
}

@media (max-width: 720px) {
    .kiosk-service-filters {
        grid-template-columns: 1fr;
    }

    .kiosk-service-page-head {
        padding: 0.75rem 0.85rem 0.9rem;
    }

    .kiosk-service-page-hero-icon {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.3rem;
    }

    .kiosk-service-modal-row {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .kiosk-service-modal-price-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

.map-instruction-callout {
    /* Không animate — overlay được cập nhật theo bước, fade gây nháy liên tục. */
}

.map-svg-host .map-instruction-callout__bubble {
    fill: #ffffff;
    stroke: #16a34a;
    stroke-width: 1.5;
    filter: drop-shadow(0 2px 8px rgba(15, 23, 42, 0.14));
}

.map-svg-host .map-instruction-callout__label {
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 600;
    fill: #0f172a;
    letter-spacing: 0.01em;
    dominant-baseline: central;
    text-anchor: middle;
}

.map-svg-host .map-instruction-callout__tip {
    fill: #16a34a;
}

.map-svg-host .nav-route-step-marker--active .nav-step-dot-fill {
    fill: #16a34a;
    stroke: #ffffff;
    stroke-width: 2.5;
}

.map-svg-host .nav-route-step-marker--active .nav-step-dot-ring {
    fill: none;
    stroke: #4ade80;
    stroke-width: 2;
}

.map-svg-host .nav-route-step-marker--active .nav-step-dot-label {
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    fill: #ffffff;
}

.map-svg-host .nav-route-step-marker--reached .nav-step-dot-fill {
    fill: #4ade80;
    stroke: #15803d;
    stroke-width: 1.5;
}

.map-svg-host .nav-route-step-marker--reached .nav-step-dot-label {
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 700;
    fill: #14532d;
}

.map-svg-host .nav-route-step-marker--pending .nav-step-dot-fill {
    fill: #dbeafe;
    stroke: var(--nav-primary);
    stroke-width: 1.5;
}

.map-svg-host .nav-route-step-marker--pending .nav-step-dot-label {
    font-family: var(--font-sans);
    font-size: 9px;
    font-weight: 700;
    fill: #1e40af;
}

.map-svg-host .nav-waypoint-active .nav-step-dot-fill {
    fill: #16a34a;
    stroke: #ffffff;
    stroke-width: 2.5;
}

.map-svg-host .nav-waypoint-active .nav-step-dot-ring {
    fill: none;
    stroke: #4ade80;
    stroke-width: 2;
}

.map-svg-host .nav-waypoint-active .nav-step-dot-label {
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 700;
    fill: #ffffff;
}

.map-svg-host .route-vertical-connector .map-wp-marker {
    filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.16));
}

.map-svg-host .route-connector-label text {
    paint-order: stroke fill;
    stroke: #ffffff;
    stroke-width: 2px;
    stroke-linejoin: round;
}

/* Mobile */
.mobile-toggle-directions {
    display: none;
}

.nav-rail-sheet-handle {
    display: none;
    width: 2.25rem;
    height: 0.28rem;
    border-radius: 999px;
    background: #cbd5e1;
    margin: 0.45rem auto 0;
    flex-shrink: 0;
}

@media (max-width: 991.98px) {
    /* ── Mobile kiosk: map-first, bottom sheets ── */
    .nav-main-map {
        --map-floor-bar-h: 3.35rem;
        --map-search-chip-h: 0px;
        --map-overlay-right: max(0.5rem, env(safe-area-inset-right, 0px));
        --map-overlay-top: max(0.5rem, env(safe-area-inset-top, 0px));
        --map-overlay-bottom: calc(var(--map-floor-bar-h) + max(0.65rem, env(safe-area-inset-bottom, 0px)));
        --map-rail-search-max: min(52dvh, 420px);
        --map-rail-route-max: min(44dvh, 360px);
    }

    .nav-rail--fab-hidden {
        display: none !important;
    }

    .nav-mobile-dock {
        display: inline-flex;
        align-items: flex-end;
        gap: 0.45rem;
        position: absolute;
        z-index: 12080;
        pointer-events: auto;
        left: 50%;
        right: auto;
        bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
        transform: translateX(-50%);
        max-width: calc(100vw - 1rem);
        padding: 0.35rem 0.55rem 0.28rem;
        border: 1px solid var(--nav-border);
        border-radius: 1rem;
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 4px 18px rgba(15, 23, 42, 0.12);
        touch-action: manipulation;
    }

    .nav-mobile-dock-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        padding: 0;
        border: 1px solid transparent;
        border-radius: 999px;
        background: transparent;
        color: var(--nav-text);
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        flex-shrink: 0;
    }

    .nav-mobile-dock-btn--labeled {
        flex-direction: column;
        gap: 0.18rem;
        width: auto;
        min-width: 3.1rem;
        height: auto;
        padding: 0.12rem 0.2rem 0.05rem;
        border-radius: 0.45rem;
    }

    .nav-mobile-dock-btn-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border-radius: 999px;
        border: 1px solid transparent;
        line-height: 1;
    }

    .nav-mobile-dock-btn--labeled .bi {
        font-size: 1.02rem;
        line-height: 1;
    }

    .nav-mobile-dock-btn-label {
        max-width: 4.75rem;
        font-size: 0.58rem;
        font-weight: 600;
        line-height: 1.15;
        letter-spacing: -0.01em;
        color: var(--nav-muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        text-align: center;
    }

    .nav-mobile-dock-btn .bi {
        font-size: 1.05rem;
        line-height: 1;
    }

    .nav-mobile-dock-btn.is-active {
        border-color: transparent;
        background: transparent;
        color: var(--nav-text);
    }

    .nav-mobile-dock-btn--labeled.is-active .nav-mobile-dock-btn-icon {
        border-color: var(--nav-primary);
        background: var(--nav-primary);
        color: #fff;
    }

    .nav-mobile-dock-btn--labeled.is-active .nav-mobile-dock-btn-label {
        color: var(--nav-primary);
    }

    .nav-mobile-dock-btn:not(.nav-mobile-dock-btn--labeled).is-active {
        border-color: var(--nav-primary);
        background: var(--nav-primary);
        color: #fff;
    }

    .nav-mobile-dock-btn--browse.is-active .bi,
    .nav-mobile-dock-btn--labeled.is-active .bi.bi-x-lg {
        font-size: 0.92rem;
    }

    .nav-rail-head-hint--desktop {
        display: none !important;
    }

    .nav-rail-sheet-handle {
        display: block;
        order: -1;
    }

    .nav-rail-collapse-btn {
        display: inline-flex;
    }

    .nav-rail-head-hint {
        display: inline-flex;
        align-items: center;
        margin-left: auto;
        margin-right: 0.35rem;
        padding: 0.32rem 0.75rem;
        border-radius: 999px;
        background: var(--nav-primary);
        color: #fff;
        font-size: 0.75rem;
        font-weight: 600;
        box-shadow: 0 2px 8px rgba(26, 111, 212, 0.28);
    }

    .nav-rail--search.nav-rail--collapsed .nav-rail-brand span {
        max-width: 6.5rem;
    }

    .nav-rail-head--expandable:active {
        background: rgba(248, 250, 252, 0.92);
    }

    /* Tìm đường: bottom sheet (mặc định thu gọn = chip trên thanh tầng) */
    .nav-main-map:not(:has(.nav-rail--directions)) {
        --map-overlay-top: max(0.5rem, env(safe-area-inset-top, 0px));
    }

    .nav-main-map:not(:has(.nav-rail--directions)):not(:has(.nav-rail--collapsed)) {
        --map-overlay-bottom: calc(var(--map-rail-search-max) + max(0.5rem, env(safe-area-inset-bottom, 0px)));
    }

    .nav-main-map:not(:has(.nav-rail--directions)) .nav-rail-on-map {
        left: max(0.5rem, env(safe-area-inset-left, 0px));
        right: max(0.5rem, env(safe-area-inset-right, 0px));
        top: auto;
        bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
        width: auto;
        max-height: var(--map-rail-search-max);
        overflow: hidden;
        border-radius: 0.5rem 0.5rem 0.35rem 0.35rem;
        box-shadow: 0 -6px 24px rgba(15, 23, 42, 0.12);
    }

    .nav-main-map:not(:has(.nav-rail--directions)):not(:has(.nav-rail--collapsed)) .nav-mobile-dock {
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
    }

    .nav-rail-on-map.nav-rail--search {
        display: flex;
        flex-direction: column;
    }

    .nav-rail--search.nav-rail--collapsed .nav-rail-search,
    .nav-rail--search.nav-rail--collapsed .nav-rail-sheet-handle {
        display: none;
    }

    .nav-rail--search.nav-rail--collapsed .nav-rail-head {
        border-bottom: none;
        padding: 0.45rem 0.65rem;
    }

    .nav-rail--search:not(.nav-rail--collapsed) .nav-rail-sheet-handle {
        margin: 0.4rem auto 0.15rem;
    }

    .nav-rail--search .nav-rail-search {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    /* Dẫn đường: panel dưới */
    .nav-main-map:has(.nav-rail--directions) {
        --map-overlay-bottom: calc(var(--map-rail-route-max) + max(0.65rem, env(safe-area-inset-bottom, 0px)));
    }

    .nav-main-map:has(.nav-rail--directions):has(.nav-rail--collapsed) {
        --map-overlay-bottom: calc(3.15rem + max(0.5rem, env(safe-area-inset-bottom, 0px)));
    }

    .nav-main-map:has(.nav-rail--directions) .nav-rail-on-map {
        left: max(0.5rem, env(safe-area-inset-left, 0px));
        right: max(0.5rem, env(safe-area-inset-right, 0px));
        top: auto;
        bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
        width: auto;
        height: var(--map-rail-route-max);
        max-height: none;
        border-radius: 1rem 1rem 0.85rem 0.85rem;
        box-shadow: 0 -6px 28px rgba(15, 23, 42, 0.14);
    }

    .nav-rail-on-map.nav-rail--directions.nav-rail--collapsed {
        height: auto;
        max-height: var(--map-rail-collapsed-top);
    }

    .nav-rail--directions.nav-rail--collapsed .nav-rail-steps,
    .nav-rail--directions.nav-rail--collapsed .nav-rail-foot,
    .nav-rail--directions.nav-rail--collapsed .nav-rail-sheet-handle {
        display: none;
    }

    .nav-main-map:has(.nav-rail--directions) .map-legend-float,
    .nav-main-map:has(.nav-rail--directions) .map-legend-restore {
        display: none !important;
    }

    /* Picker vị trí: full-width bottom sheet, che toàn màn */
    .nav-rail-on-map .searchable-select.is-open .searchable-select-backdrop {
        background: rgba(15, 23, 42, 0.48);
        z-index: 12990;
    }

    .nav-rail-on-map .searchable-select-sheet-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.55rem 0.75rem 0.45rem;
        border-bottom: 1px solid var(--nav-border);
        background: #fff;
    }

    .nav-rail-on-map .searchable-select-panel--mobile-sheet .searchable-select-sheet-head {
        display: flex;
    }

    .searchable-select-sheet-title {
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--nav-text);
    }

    .searchable-select-sheet-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: none;
        border-radius: 0.5rem;
        background: #f1f5f9;
        color: var(--nav-muted);
        touch-action: manipulation;
    }

    .nav-main-map:has(.searchable-select.is-open) .nav-chrome-map-tools,
    .nav-main-map:has(.searchable-select.is-open) .map-legend-float,
    .nav-main-map:has(.searchable-select.is-open) .map-legend-restore,
    .nav-main-map:has(.searchable-select.is-open) .nav-map-home-back {
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
    }

    .nav-rail-on-map:has(.searchable-select.is-open) {
        z-index: 12995;
    }

    /* Chú thích: icon góc trái, popup giữa màn */
    .nav-map-home-back {
        top: calc(var(--map-overlay-top) + 0.35rem);
        left: max(0.5rem, env(safe-area-inset-left, 0px));
        max-width: calc(100% - 5.5rem);
        font-size: 0.78rem;
        padding: 0.4rem 0.65rem 0.4rem 0.5rem;
    }

    .nav-main-map:has(.nav-map-home-back) .map-legend-trigger {
        top: calc(var(--map-overlay-top) + 2.85rem);
    }

    .map-legend-trigger {
        top: calc(var(--map-overlay-top) + 0.35rem);
        bottom: auto;
        left: max(0.5rem, env(safe-area-inset-left, 0px));
        width: 32px;
        height: 32px;
        border-radius: 0.4rem;
    }

    .map-legend-trigger .bi {
        font-size: 0.95rem;
    }

    .map-legend-popup {
        border-radius: 0.55rem;
    }

    /* Zoom + góp ý: cột góc phải, nút nhỏ có viền */
    .nav-chrome-side {
        position: absolute;
        top: calc(var(--map-overlay-top) + 0.35rem);
        bottom: auto;
        right: max(0.5rem, env(safe-area-inset-right, 0px));
        left: auto;
        max-height: none;
        overflow: visible;
    }

    .nav-chrome-zoom {
        flex-direction: column;
        align-items: center;
        gap: 0.3rem;
        padding: 0;
        border: none;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .nav-chrome-tool-extra,
    .nav-chrome-tool-hotline {
        display: none;
    }

    .nav-chrome-tool {
        width: 32px;
        height: 32px;
        border: 1px solid var(--nav-border);
        border-radius: 0.4rem;
        background: #fff;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
        font-size: 0.85rem;
    }

    .nav-chrome-tool-rating {
        color: #eab308;
    }

    .nav-main-map:not(:has(.nav-rail--directions)):not(:has(.nav-rail--collapsed)) .nav-chrome-side,
    .nav-main-map:not(:has(.nav-rail--directions)):not(:has(.nav-rail--collapsed)) .map-legend-trigger {
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
    }

    /* Thanh dock mobile — đã gộp ở .nav-mobile-dock */
    .nav-chrome-floors--desktop {
        display: none !important;
    }

    .nav-browse-sheet-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 12090;
        border: none;
        padding: 0;
        margin: 0;
        background: rgba(15, 23, 42, 0.45);
        cursor: default;
        pointer-events: auto;
        touch-action: manipulation;
    }

    .nav-browse-sheet {
        display: flex;
        flex-direction: column;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 12100;
        max-height: min(70dvh, 480px);
        background: #fff;
        border-radius: 0.55rem 0.55rem 0 0;
        box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.18);
        overflow: hidden;
        pointer-events: auto;
        touch-action: manipulation;
    }

    .nav-browse-sheet-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.65rem 0.75rem;
        border-bottom: 1px solid var(--nav-border);
        flex-shrink: 0;
    }

    .nav-browse-sheet-title {
        font-size: 1rem;
        font-weight: 700;
        color: var(--nav-text);
        letter-spacing: -0.01em;
    }

    .nav-browse-sheet-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: none;
        border-radius: 0.4rem;
        background: #f1f5f9;
        color: var(--nav-muted);
    }

    .nav-browse-sheet-body {
        flex: 1 1 auto;
        overflow-y: auto;
        overscroll-behavior: contain;
        padding: 0.35rem 0.5rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
        -webkit-overflow-scrolling: touch;
        touch-action: pan-y;
    }

    .nav-browse-sheet-section {
        margin: 0.55rem 0.35rem 0.25rem;
        font-size: 0.68rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--nav-muted);
    }

    .nav-browse-sheet-item {
        display: flex;
        align-items: center;
        gap: 0.65rem;
        width: 100%;
        min-height: 48px;
        padding: 0.6rem 0.75rem;
        border: none;
        border-radius: 0.4rem;
        background: transparent;
        color: var(--nav-text);
        font-size: 0.9rem;
        font-weight: 500;
        text-align: left;
        cursor: pointer;
        pointer-events: auto;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-browse-sheet-item span {
        flex: 1;
        min-width: 0;
        line-height: 1.35;
    }

    .nav-browse-sheet-item .bi {
        flex-shrink: 0;
        font-size: 1rem;
        color: var(--nav-primary);
    }

    .nav-browse-sheet-item.active {
        background: #eff6ff;
        color: var(--nav-primary);
        font-weight: 600;
    }

    .nav-main-map:has(.nav-browse-sheet) .nav-chrome-side,
    .nav-main-map:has(.nav-browse-sheet) .map-legend-trigger {
        opacity: 0;
        pointer-events: none;
        visibility: hidden;
    }

    .nav-chrome-map-tools:has(.nav-browse-sheet) .nav-mobile-dock {
        display: none;
    }

    .nav-toast-wrap {
        bottom: calc(var(--map-overlay-bottom) + 0.5rem);
        left: max(0.75rem, env(safe-area-inset-left, 0px));
        right: max(0.75rem, env(safe-area-inset-right, 0px));
        transform: none;
        max-width: none;
    }

    .searchable-select-trigger {
        min-height: 44px;
        padding: 0.35rem 0.65rem;
        font-size: 16px;
        border-radius: 0.4rem;
    }

    .searchable-select-search {
        font-size: 16px;
    }

    .searchable-select-option {
        min-height: 44px;
        padding: 0.55rem 0.75rem;
    }

    .nav-rail-btn-find {
        min-height: 44px;
        font-size: 0.95rem;
        border-radius: 0.4rem;
    }

    .nav-rail-on-map {
        border-radius: 0.5rem 0.5rem 0.35rem 0.35rem;
    }

    .nav-rail--directions .nav-rail-head {
        padding: 0.45rem 0.65rem 0.35rem;
    }

    .nav-rail--directions .nav-rail-route-meta {
        padding: 0.45rem 0.65rem;
    }

    .nav-rail--directions .nav-rail-meta-title {
        display: none;
    }

    .nav-rail--directions .nav-rail-meta-value {
        font-size: 0.88rem;
        margin-bottom: 0.25rem;
    }

    .nav-rail--directions .nav-rail-dest {
        font-size: 0.76rem;
    }

    .nav-rail--directions .nav-rail-steps {
        padding: 0.35rem 0.5rem calc(3.25rem + env(safe-area-inset-bottom, 0px));
        flex: 1 1 auto;
        min-height: 7rem;
        max-height: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }

    .nav-rail--directions .nav-rail-step {
        padding: 0.55rem 0.4rem;
        gap: 0.45rem;
        min-height: 44px;
    }

    .nav-rail--directions .nav-rail-step-icon {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }

    .nav-rail--directions .nav-rail-step-title {
        font-size: 0.8rem;
    }

    .nav-rail--directions .nav-rail-step-detail {
        font-size: 0.7rem;
    }

    .nav-rail--directions .nav-rail-foot {
        padding: 0.45rem 0.55rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
        display: block;
    }

    .nav-rail--directions .nav-rail-foot .btn {
        margin: 0 !important;
        font-size: 0.82rem;
        min-height: 44px;
        padding: 0.55rem 0.75rem;
    }

    .nav-rail-on-map.nav-rail--search {
        --nav-rail-pad-x: 0.6rem;
        --nav-rail-pad-block: 0.45rem;
        --nav-rail-stack-gap: 0.5rem;
    }

    .nav-rail--search .nav-rail-search {
        padding: var(--nav-rail-pad-block) var(--nav-rail-pad-x) calc(var(--nav-rail-pad-block) + 0.1rem);
    }

    .nav-rail--search .nav-rail-head {
        padding: calc(var(--nav-rail-pad-block) + 0.05rem) var(--nav-rail-pad-x) var(--nav-rail-pad-block);
        border-bottom: 1px solid var(--nav-border);
    }

    .nav-rail--search .nav-rail-route-fields {
        gap: 0.45rem;
    }

    .nav-rail--search .nav-rail-label {
        font-size: 0.68rem;
        margin-bottom: 0.15rem;
    }

    .nav-main-map:not(:has(.nav-rail--directions)) .nav-rail-on-map .nav-rail-sheet-handle {
        margin: 0.25rem auto 0.05rem;
    }

    .nav-rail--search .nav-rail-brand span {
        font-size: 0.68rem;
    }

    .nav-rail-connector-opt {
        min-height: 2.85rem;
        font-size: 0.62rem;
    }
}

@media (min-width: 992px) {
    .nav-rail-sheet-handle {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .map-legend-bar {
        display: none;
    }

    .nav-main-map {
        --map-rail-search-max: min(58dvh, 460px);
        --map-rail-route-max: min(46dvh, 340px);
    }

    .nav-chrome-zone-btn {
        max-width: 5.5rem;
    }

    .nav-rail-connector-opt span {
        display: none;
    }

    .nav-rail-connector-opt {
        min-height: 2.65rem;
    }

    .nav-rail-connector-opt .bi {
        font-size: 1.1rem;
    }

    .nav-rail-on-map .searchable-select-option-rich {
        min-height: 48px;
    }
}

@media (max-width: 991.98px) and (max-height: 480px) and (orientation: landscape) {
    .nav-main-map {
        --map-rail-search-max: calc(100dvh - max(1rem, env(safe-area-inset-top, 0px)) - max(1rem, env(safe-area-inset-bottom, 0px)));
        --map-rail-route-max: min(52dvh, 260px);
    }

    .nav-main-map:not(:has(.nav-rail--directions)) {
        --map-overlay-top: max(0.5rem, env(safe-area-inset-top, 0px));
    }

    .nav-main-map:not(:has(.nav-rail--directions)):not(:has(.nav-rail--collapsed)) {
        --map-overlay-top: 0;
    }

    .nav-main-map:not(:has(.nav-rail--directions)) .nav-rail-on-map {
        left: auto;
        right: max(0.5rem, env(safe-area-inset-right, 0px));
        top: max(0.5rem, env(safe-area-inset-top, 0px));
        bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
        width: min(340px, 46vw);
        max-height: none;
    }

    .nav-main-map:not(:has(.nav-rail--directions)):has(.nav-rail--collapsed) {
        --map-overlay-top: max(0.5rem, env(safe-area-inset-top, 0px));
    }

    .nav-chrome-side {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 0.35rem;
        max-width: calc(100% - min(360px, 48vw) - 1rem);
    }

    .nav-chrome-zoom {
        flex-direction: row;
        align-items: center;
    }

    .map-legend-float {
        max-height: min(36dvh, 140px);
    }
}
