.guided-view[hidden], .guided-view [hidden] { display: none !important; }
.guided-view {
    --guide-ink: #153836;
    --guide-subtle: #54716d;
    --guide-line: #cfe0dd;
    position: absolute;
    inset: 0;
    z-index: 16;
    display: grid;
    grid-template-rows: auto minmax(0, 1.15fr) minmax(0, 1fr) auto;
    background: #ecf4f1;
    color: var(--guide-ink);
}
.guided-open #visitorMapUI, .guided-open #navigationCard, .guided-open #navDock { display: none !important; }
.guided-open #notice:not(.error) { display: none; }
.guided-header {
    padding: max(10px, env(safe-area-inset-top)) clamp(10px, 3vw, 28px) 10px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(90px, 25%);
    align-items: center;
    gap: 12px;
    background: #fff;
    border-bottom: 1px solid var(--guide-line);
}
.guided-symbol { display: grid; place-items: center; width: 49px; height: 49px; border-radius: 12px; background: #e3f3ef; color: #0a7163; font-size: 34px; font-weight: 800; }
.guided-mode { font-size: 11px; font-weight: 700; color: #206960; }
.guided-cue-group p, .guided-next p { margin: 3px 0; }
#guidedCue { font-size: clamp(15px, 2.6vw, 23px); line-height: 1.22; display: block; }
#guidedDestination { color: var(--guide-subtle); font-size: 12px; }
.guided-next { border-left: 1px solid var(--guide-line); padding-left: 12px; font-size: 12px; }
.guided-next small { font-weight: 750; color: #22645b; }
.guided-scene, .guided-plan { position: relative; min-height: 0; overflow: hidden; }
.guided-scene { background: #dceae8; }
.guided-scene canvas, .guided-scene video { position: absolute; inset: 0; width: 100%; height: 100%; }
.guided-scene canvas { touch-action: none; }
.guided-scene video { object-fit: cover; background: #183734; }
.guided-scene-controls, .guided-look, .guided-map-tools { position: absolute; z-index: 2; display: flex; gap: 6px; align-items: center; }
.guided-scene-controls { top: 9px; right: 10px; flex-wrap: wrap; justify-content: end; }
.guided-look { bottom: 11px; right: 11px; }
.guided-view button { min-height: 35px; padding: 7px 11px; font-size: 12px; font-weight: 650; }
.guided-view button[aria-pressed="true"] { background: #0d6268; color: white; border-color: #0d6268; }
.guided-scene-status { position: absolute; bottom: 10px; left: 10px; max-width: min(52%, 470px); margin: 0; border-radius: 8px; background: #102f2ce8; color: #fff; padding: 8px 10px; font-size: 11px; }
.guided-scene-status:empty { display: none; }
.guided-camera-direction { position: absolute; top: 52%; left: 50%; transform: translate(-50%, -50%); margin: 0; padding: 8px 12px; border-radius: 10px; background: #263a33e8; color: #fff; text-align: center; font-weight: 750; }
.guided-plan { border-top: 3px solid #fff; }
#guidedMapSlot { position: absolute; inset: 0; }
.guided-plan #mapHost { inset: 0; min-height: 0; width: 100%; height: 100%; }
.guided-map-tools { top: 8px; left: 10px; }
#guidedFloor { background: #fff; color: #234c47; padding: 7px 10px; font-size: 12px; border-radius: 8px; }
.guided-open #mapHost [data-route-segment] { stroke: #e6af20; }
.guided-open #mapHost [data-route-chevron] { stroke: #694c07; }
.route-floor-link { cursor: pointer; }
.guided-footer { padding: 8px clamp(10px, 3vw, 28px) max(8px, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--guide-line); }
.guided-metrics { display: flex; flex-wrap: wrap; gap: 5px 18px; color: #244d47; font-size: 13px; font-weight: 700; }
#guidedProgress { width: 100%; height: 7px; margin: 7px 0 0; display: block; accent-color: #0b8577; }
#guidedStatus { margin: 5px 0; font-size: 12px; color: var(--guide-subtle); }
#guidedStatus:empty { display: none; }
.guided-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
#guidedFinish { color: #973b32; }
.guided-view[data-expanded="true"] { grid-template-rows: auto minmax(0, 1fr) auto; }
.guided-view[data-expanded="true"] .guided-plan { display: none; }
.guided-view[data-transition="true"] .guided-header { background: #fff2c7; }

/* The live feed and the transparent arrow canvas share the full viewport. */
.guided-view[data-mode="camera"] {
    grid-template: "camera" minmax(0, 1fr) / minmax(0, 1fr);
    background: #131b20;
    color: #fff;
    isolation: isolate;
    --camera-top: max(12px, env(safe-area-inset-top));
    --camera-left: max(12px, env(safe-area-inset-left));
    --camera-right: max(12px, env(safe-area-inset-right));
    --camera-bottom: max(12px, env(safe-area-inset-bottom));
    --camera-card: #131c24ed;
    --camera-line: #ffffff36;
}
.guided-view[data-mode="camera"] .guided-scene,
.guided-view[data-mode="camera"] .guided-header,
.guided-view[data-mode="camera"] .guided-footer { grid-area: camera; }
.guided-view[data-mode="camera"] .guided-plan,
.guided-view[data-mode="camera"] .guided-scene-controls,
.guided-view[data-mode="camera"] .guided-next,
.guided-view[data-mode="camera"] .guided-mode,
.guided-view[data-mode="camera"] :is(#guidedTime, #guidedETA, #guidedProgress, #guidedSimulate,
    #guidedResumeLive, #guidedSteps, #guidedMapOnly, #guidedFinish) { display: none; }
.guided-view[data-mode="camera"] .guided-scene { background: #131b20; }
.guided-view[data-mode="camera"] video { max-height: none; border-radius: 0; }
.guided-view[data-mode="camera"] .guided-scene::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, #0b121966, transparent 27%, transparent 67%, #0b12195e);
    pointer-events: none;
}
.guided-view[data-mode="camera"] canvas { pointer-events: none; }
.guided-view[data-mode="camera"] :is(.guided-header, .guided-footer) {
    z-index: 3;
    margin: 0;
    border: 1px solid var(--camera-line);
    border-radius: 16px;
    background: var(--camera-card);
    box-shadow: 0 6px 24px #080d1847;
}
.guided-view[data-mode="camera"] .guided-header {
    align-self: start;
    justify-self: end;
    width: min(480px, calc(100% - var(--camera-left) - var(--camera-right) - 118px));
    margin: var(--camera-top) var(--camera-right) 0 0;
    padding: 10px 13px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
}
.guided-view[data-mode="camera"] .guided-symbol { background: #f43c492a; color: #ff6470; }
.guided-view[data-mode="camera"] #guidedDestination { color: #d6e0e8; overflow-wrap: anywhere; }
.guided-view[data-mode="camera"] .guided-footer {
    align-self: end;
    justify-self: center;
    width: min(450px, calc(100% - var(--camera-left) - var(--camera-right)));
    margin: 0 var(--camera-right) var(--camera-bottom) var(--camera-left);
    padding: 9px 12px;
    text-align: left;
}
.guided-view[data-mode="camera"] .guided-metrics { color: #fff; }
.guided-view[data-mode="camera"] #guidedStatus { color: #d6e0e8; font-size: 11px; }
.guided-view[data-mode="camera"] .guided-actions { margin-top: 7px; }
.guided-view[data-mode="camera"] .guided-actions button {
    min-height: 40px;
    border-color: var(--camera-line);
    background: #ffffff14;
    color: #fff;
}
.guided-view[data-mode="camera"] .guided-scene-status {
    top: 35%;
    bottom: auto;
    left: 50%;
    z-index: 1;
    width: max-content;
    max-width: calc(100% - 30px);
    transform: translateX(-50%);
    background: var(--camera-card);
    text-align: center;
}
.guided-view[data-mode="camera"] .guided-camera-direction { z-index: 1; background: var(--camera-card); }
.guided-camera-menu {
    position: absolute;
    top: var(--camera-top);
    left: var(--camera-left);
    z-index: 5;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
}
.guided-camera-menu summary {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 8px 13px;
    list-style: none;
    cursor: pointer;
    border: 1px solid var(--camera-line);
    border-radius: 12px;
    background: var(--camera-card);
    color: #fff;
    font-weight: 700;
}
.guided-camera-menu summary::-webkit-details-marker { display: none; }
.guided-menu-icon { width: 16px; height: 12px; border-block: 2px solid currentColor; position: relative; }
.guided-menu-icon::after { content: ""; position: absolute; inset: 3px 0 auto; border-top: 2px solid currentColor; }
.guided-menu-items {
    display: grid;
    gap: 2px;
    margin-top: 6px;
    padding: 5px;
    border: 1px solid var(--camera-line);
    border-radius: 12px;
    background: var(--camera-card);
    box-shadow: 0 6px 24px #080d1847;
}
.guided-view .guided-menu-items button { min-height: 44px; border: 0; background: transparent; color: #fff; text-align: left; }
.guided-view .guided-menu-items button:hover { background: #ffffff1c; }
.guided-camera-menu :focus-visible { outline: 2px solid #fca8af; outline-offset: 2px; }
@media (max-width: 580px) {
    .guided-view[data-mode="camera"] .guided-header {
        justify-self: stretch;
        width: auto;
        margin: calc(var(--camera-top) + 53px) var(--camera-right) 0 var(--camera-left);
    }
}
.vm-nearby { list-style: none; padding: 0; margin: 7px 0; display: grid; gap: 4px; max-height: 178px; overflow: auto; }
#visitorMapUI .vm-nearby button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 9px; text-align: left; padding: 6px 8px; background: #f6faf8; }
.vm-nearby button[aria-current="true"] { border-color: #00877b; background: #e8f5f0 !important; }
.vm-nearby button span:first-child { min-width: 0; }
.vm-nearby strong, .vm-nearby small { display: block; }
.vm-nearby small { font-size: 10px; color: #516c65; }
.vm-nearby-distance { white-space: nowrap; text-align: right; font-size: 11px; }
.vm-here { margin: 7px 0 0; color: #0b675c; font-size: 12px; font-weight: 700; }
.vm-target-modes { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0; }
#vmRouteDirections { margin: 6px 0; font-size: 12px; }
#vmRouteDirections ol { max-height: 150px; overflow: auto; padding-left: 20px; }
.route-live #vmTargetCard .vm-target-modes, .route-live #vmRouteDirections { display: none; }
@media (max-width: 580px) {
    .guided-header { grid-template-columns: auto minmax(0, 1fr) minmax(65px, 23%); gap: 8px; }
    .guided-symbol { width: 39px; height: 39px; font-size: 28px; }
    .guided-next { padding-left: 7px; font-size: 10px; }
    .guided-mode, #guidedDestination { font-size: 10px; }
    .guided-view button { padding: 6px 8px; min-height: 32px; font-size: 11px; }
    .guided-scene-status { max-width: 55%; font-size: 10px; }
    .guided-actions { gap: 4px; }
}
