/* GB3D Scan Viewer - our own interface around the splat renderer. */

:root {
    color-scheme: dark;
    --gb-bg: #080b11;
    --gb-panel: rgba(16, 22, 32, 0.86);
    --gb-panel-solid: #121a27;
    --gb-line: rgba(255, 255, 255, 0.14);
    --gb-text: #f2f5fa;
    --gb-muted: #9aa6b8;
    --gb-accent: #36c6f4;
    --gb-accent-dark: #0b4d66;
    --gb-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    --gb-radius: 14px;
    --gb-safe-top: env(safe-area-inset-top, 0px);
    --gb-safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: var(--gb-bg);
    color: var(--gb-text);
    font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

#app { position: fixed; inset: 0; }
#stage { position: absolute; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }

/* ---------- top bar ---------- */
#topbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: calc(10px + var(--gb-safe-top)) 14px 10px;
    background: linear-gradient(180deg, rgba(5, 8, 13, 0.9) 0%, rgba(5, 8, 13, 0.55) 60%, transparent 100%);
    pointer-events: none;
    z-index: 3;
}
#topbar > * { pointer-events: auto; }

#brand {
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    color: var(--gb-text);
    flex: 0 0 auto;
}
#brand img { width: 30px; height: 35px; display: block; }
.brand-text { font-size: 1.05rem; letter-spacing: 0.02em; }
.brand-text strong { font-weight: 700; }
.brand-text em { font-style: normal; color: var(--gb-accent); }

#titles { min-width: 0; flex: 1 1 auto; }
#scan-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#scan-subtitle {
    margin: 0;
    font-size: 0.8rem;
    color: var(--gb-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#topbar-actions { display: flex; gap: 8px; flex: 0 0 auto; }

/* ---------- buttons ---------- */
.gb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid var(--gb-line);
    border-radius: var(--gb-radius);
    background: var(--gb-panel);
    color: var(--gb-text);
    font: inherit;
    font-size: 0.92rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    box-shadow: var(--gb-shadow);
    transition: background 0.15s, border-color 0.15s, transform 0.08s;
}
.gb-btn:active { transform: scale(0.97); }
.gb-btn[aria-pressed="true"], .gb-btn.active {
    background: var(--gb-accent);
    border-color: var(--gb-accent);
    color: #04202c;
    font-weight: 600;
}
.gb-btn[disabled] { opacity: 0.4; cursor: default; }
.gb-btn svg { width: 19px; height: 19px; flex: 0 0 auto; }
.gb-btn.icon-only { padding: 0; width: 44px; }

/* ---------- toolbar ---------- */
#toolbar {
    position: absolute;
    left: 50%;
    bottom: calc(14px + var(--gb-safe-bottom));
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    padding: 0 10px;
    max-width: calc(100% - 16px);
    overflow-x: auto;
    scrollbar-width: none;
    z-index: 3;
}
#toolbar::-webkit-scrollbar { display: none; }

/* ---------- hint line ---------- */
#hint {
    position: absolute;
    left: 50%;
    bottom: calc(72px + var(--gb-safe-bottom));
    transform: translateX(-50%);
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--gb-panel);
    border: 1px solid var(--gb-line);
    color: var(--gb-text);
    font-size: 0.85rem;
    text-align: center;
    max-width: calc(100% - 32px);
    z-index: 3;
    pointer-events: none;
}

/* ---------- side panel ---------- */
#panel {
    position: absolute;
    top: calc(64px + var(--gb-safe-top));
    right: 12px;
    width: min(340px, calc(100% - 24px));
    max-height: calc(100% - 150px - var(--gb-safe-top));
    overflow-y: auto;
    padding: 16px;
    border-radius: var(--gb-radius);
    background: var(--gb-panel);
    border: 1px solid var(--gb-line);
    box-shadow: var(--gb-shadow);
    backdrop-filter: blur(12px);
    /* Over the floor plan: the panel is the thing being used, and its Done and Delete
       buttons were unreachable underneath an expanded plan. */
    z-index: 6;
}
#panel h2 { margin: 0 0 6px; font-size: 1.05rem; }
#panel p { margin: 0 0 10px; color: var(--gb-muted); font-size: 0.9rem; }
.panel-close { position: absolute; top: 8px; right: 8px; }

/* ---------- loading ---------- */
#loading {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 50% 40%, #16202e 0%, var(--gb-bg) 70%);
    z-index: 10;
    transition: opacity 0.5s;
}
#loading.done { opacity: 0; pointer-events: none; }
.loading-inner { width: min(320px, 80vw); text-align: center; }
.loading-mark { width: 72px; height: 85px; margin-bottom: 14px; }
.loading-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 14px; }
.loading-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}
.loading-bar i { display: block; height: 100%; width: 0; background: var(--gb-accent); transition: width 0.2s; }
.loading-status { margin-top: 10px; font-size: 0.85rem; color: var(--gb-muted); }

/* ---------- touch joystick (walk mode on phones) ---------- */
#joystick {
    position: absolute;
    left: calc(18px + env(safe-area-inset-left, 0px));
    bottom: calc(80px + var(--gb-safe-bottom));
    width: 118px;
    height: 118px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid var(--gb-line);
    touch-action: none;
    z-index: 3;
}
#joystick i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 48px;
    height: 48px;
    margin: -24px 0 0 -24px;
    border-radius: 50%;
    background: var(--gb-accent);
    opacity: 0.85;
}

@media (max-width: 640px) {
    #scan-subtitle { display: none; }
    .brand-text { display: none; }
    #panel { top: auto; bottom: calc(76px + var(--gb-safe-bottom)); right: 12px; left: 12px; width: auto; max-height: 45%; }
}

/* ---------- markers in the scan ---------- */
#poi-layer, #portal-layer, #measure-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}
#poi-layer > *, #portal-layer > * { pointer-events: auto; }
/* Measuring dots are meant to be grabbed and moved, so they take the pointer; the
   lines and the wording beside them stay out of the way. */
#measure-layer .measure-dot { pointer-events: auto; cursor: grab; }

.poi-marker, .portal-marker {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: -13px 0 0 -13px;
    border: 0;
    background: none;
    color: var(--gb-text);
    font: inherit;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
    /* Scale about the dot itself: the label hangs off to the right, so scaling
       about the middle of the whole row would walk the dot off its own point. */
    transform-origin: 13px 13px;
    opacity: var(--marker-fade, 1);
}
.portal-marker { margin: -17px 0 0 -17px; transform-origin: 17px 17px; }

/* Far enough away that the words are only clutter. The dot stays, so there is
   still something to walk towards. */
.poi-marker.far .poi-label,
.portal-marker.far .poi-label { display: none; }
/* Small on purpose. In a shop or a house the whole place is within twenty metres, so
   markers sized for a warehouse sit all over the view and the scan is what people came
   to look at. Still big enough to tap. */
.poi-dot {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--gb-accent);
    color: #04202c;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), 0 0 0 2px rgba(54, 198, 244, 0.25);
    flex: 0 0 auto;
}
.poi-dot i { font-style: normal; font-size: 0.8rem; }
.poi-label {
    padding: 5px 10px;
    border-radius: 8px;
    background: var(--gb-panel);
    border: 1px solid var(--gb-line);
    font-size: 0.85rem;
    max-width: 40vw;
    overflow: hidden;
    text-overflow: ellipsis;
}
.poi-marker.hidden-behind { opacity: calc(var(--marker-fade, 1) * 0.5); }
.poi-marker.selected .poi-dot { background: #fff; }
.poi-list { display: grid; gap: 8px; }
/* A point in the list, with the arrows that shuffle it up and down the order. */
.poi-row { display: flex; gap: 6px; align-items: stretch; }
.poi-row > .gb-btn:first-child { flex: 1 1 auto; min-width: 0; }
.poi-move {
    flex: 0 0 auto;
    width: 40px;
    padding: 0 !important;
    justify-content: center;
}
.poi-move:disabled { opacity: 0.35; cursor: default; }
.poi-list .gb-btn { justify-content: flex-start; text-align: left; }
.poi-nav { display: flex; gap: 8px; margin-top: 12px; }
@media (max-width: 640px) {
    .poi-label { display: none; }
}

#measure-readout {
    position: absolute;
    left: 50%;
    top: calc(68px + var(--gb-safe-top));
    transform: translateX(-50%);
    padding: 8px 16px;
    border-radius: 999px;
    background: var(--gb-accent);
    color: #04202c;
    font-weight: 600;
    z-index: 4;
    box-shadow: var(--gb-shadow);
}

/* ---------- floor plan ---------- */
#plan-box {
    position: absolute;
    right: 12px;
    bottom: calc(76px + var(--gb-safe-bottom));
    width: min(300px, 42vw);
    border-radius: var(--gb-radius);
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--gb-line);
    box-shadow: var(--gb-shadow);
    z-index: 4;
    line-height: 0;
}
#plan-box.expanded {
    width: min(760px, 92vw);
    right: 50%;
    transform: translateX(50%);
    bottom: calc(84px + var(--gb-safe-bottom));
}
/* With a panel open there is room for both side by side, which beats drawing on a plan
   half covered by the thing you are drawing with. */
@media (min-width: 980px) {
    #panel:not([hidden]) ~ #plan-box.expanded {
        right: 376px;
        transform: none;
        width: min(680px, calc(100vw - 400px));
    }
}
#plan-box.walking { outline: 2px solid var(--gb-accent); }
#plan-box img { width: 100%; height: auto; display: block; cursor: crosshair; }
#plan-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}
/* What a tool is drawing right now: never in the way of a tap. */
#plan-draft {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}
.plan-poi { cursor: pointer; }
.plan-expand {
    position: absolute;
    top: 6px;
    right: 6px;
    min-height: 34px !important;
    width: 34px !important;
}
.plan-save {
    position: absolute;
    top: 6px;
    right: 46px;
    min-height: 34px !important;
    width: 34px !important;
}
/* The storeys of a house, along the bottom of its plan. */
.plan-floors {
    position: absolute;
    left: 6px;
    bottom: 6px;
    display: flex;
    gap: 6px;
    line-height: 1;
}
.plan-floors .gb-btn {
    min-height: 32px !important;
    padding: 0 10px !important;
    font-size: 0.8rem;
}

/* ---------- property details ---------- */
.detail-price {
    margin: 0 0 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gb-accent);
}
.detail-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid var(--gb-line);
}
.detail-label { color: var(--gb-muted); }
.detail-value { font-weight: 600; text-align: right; }
.detail-blurb { margin: 12px 0 0; }
.detail-agent { margin: 10px 0 0; color: var(--gb-muted); }
.gb-field-wide { display: block; margin-bottom: 10px; }
.gb-text { min-height: 90px; resize: vertical; font: inherit; }

/* Room names floating in the rooms themselves. */
#room-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}
.room-label {
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    justify-items: center;
    gap: 1px;
    margin: -14px 0 0 -60px;
    width: 120px;
    text-align: center;
    opacity: var(--marker-fade, 1);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
    color: #fff;
    transform-origin: 60px 14px;
}
.room-label .room-name { font-weight: 700; font-size: 0.95rem; }
.room-label .room-size { font-size: 0.8rem; opacity: 0.85; }
.room-label.far .room-size { display: none; }

/* The agent's plan, shown full screen so a corner can be hit properly. */
.sheet-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: grid;
    grid-template-rows: auto 1fr auto;
    justify-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(4, 10, 18, 0.92);
    overflow: auto;
}
.sheet-overlay img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    cursor: crosshair;
    background: #fff;
    border-radius: 6px;
}
.sheet-prompt { margin: 0; font-weight: 600; text-align: center; }

/* The room you are standing in, named along the top. */
#room-here {
    position: absolute;
    left: 50%;
    top: calc(70px + var(--gb-safe-top));
    transform: translateX(-50%);
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--gb-panel);
    border: 1px solid var(--gb-line);
    box-shadow: var(--gb-shadow);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    z-index: 3;
}
#room-here[hidden] { display: none; }
/* The quick list of room names in the editor, which wants to be wide and short. */
.room-names { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.room-names .gb-btn { justify-content: center; text-align: center; padding: 0 8px !important; }

/* A doorway stays a little bigger than a point: it is the one marker a visitor has to
   notice, because it is the way into the rest of the place. */
.portal-icon {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #f5a623;
    color: #2c1a02;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(245, 166, 35, 0.25);
}
.portal-icon svg { width: 20px; height: 20px; }

.gb-input {
    display: block;
    width: 100%;
    margin-bottom: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--gb-line);
    background: rgba(0, 0, 0, 0.35);
    color: var(--gb-text);
    font: inherit;
}
#edit-save.active { background: var(--gb-accent); border-color: var(--gb-accent); color: #04202c; font-weight: 700; }
#topbar-actions .gb-btn { font-size: 0.85rem; }

/* ---------- up and down, for flying ---------- */
#vertical-controls {
    position: absolute;
    right: calc(14px + env(safe-area-inset-right, 0px));
    bottom: calc(150px + var(--gb-safe-bottom));
    display: grid;
    gap: 10px;
    z-index: 3;
}
#vertical-controls .gb-btn {
    width: 54px !important;
    min-height: 54px;
    border-radius: 50%;
    touch-action: none;
}
#vertical-controls .gb-btn svg { width: 24px; height: 24px; }

/* An id rule beats the browser's own [hidden] rule, so say it explicitly. */
#vertical-controls[hidden], #plan-box[hidden], #joystick[hidden] { display: none; }

.gb-label { display: block; margin-bottom: 4px; font-size: 0.8rem; color: var(--gb-muted); }

/* ---------- cut-away slider ---------- */
#cut-box {
    position: absolute;
    left: 50%;
    bottom: calc(72px + var(--gb-safe-bottom));
    transform: translateX(-50%);
    width: min(420px, calc(100% - 24px));
    display: grid;
    gap: 2px;
    padding: 8px 12px 6px;
    border-radius: var(--gb-radius);
    background: var(--gb-panel);
    border: 1px solid var(--gb-line);
    box-shadow: var(--gb-shadow);
    backdrop-filter: blur(12px);
    z-index: 4;
}
#cut-box[hidden] { display: none; }
.cut-readout { font-size: 0.78rem; color: var(--gb-muted); text-align: center; }
.cut-row { display: flex; align-items: center; gap: 10px; }
.cut-slider {
    width: 100%;
    height: 34px;
    accent-color: var(--gb-accent);
    background: none;
}

.hide-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid var(--gb-line);
    font-size: 0.9rem;
}
.hide-row .gb-btn { min-height: 36px; font-size: 0.8rem; }

/* ---------- aiming crosshair and bar ---------- */
#reticle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    pointer-events: none;
    z-index: 5;
}
#reticle[hidden] { display: none; }
#reticle i {
    position: absolute;
    background: var(--gb-accent);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
}
#reticle i:first-child { left: 50%; top: 6px; bottom: 6px; width: 2px; margin-left: -1px; }
#reticle i:last-child { top: 50%; left: 6px; right: 6px; height: 2px; margin-top: -1px; }

#aim-bar {
    position: absolute;
    left: 50%;
    bottom: calc(72px + var(--gb-safe-bottom));
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    justify-content: center;
    max-width: calc(100% - 24px);
    padding: 8px 10px;
    border-radius: var(--gb-radius);
    background: var(--gb-panel);
    border: 1px solid var(--gb-line);
    box-shadow: var(--gb-shadow);
    backdrop-filter: blur(12px);
    z-index: 5;
}
#aim-bar[hidden] { display: none; }
.aim-label { font-size: 0.84rem; color: var(--gb-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 38vw; }
#aim-bar .gb-btn { white-space: nowrap; }
.aim-place { background: var(--gb-accent) !important; color: #04202c !important; font-weight: 600; border-color: var(--gb-accent) !important; }

/* ---------- objects panel ---------- */
.gb-subhead { margin: 18px 0 8px; font-size: 0.95rem; }

.gb-fields {
    display: flex;
    gap: 8px;
    align-items: flex-end;
    margin-bottom: 10px;
}
.gb-field { flex: 1 1 0; min-width: 0; }
.gb-field > span {
    display: block;
    margin-bottom: 4px;
    font-size: 0.78rem;
    color: var(--gb-muted);
}
.gb-field .gb-input { margin-bottom: 0; }

/* Phones put spinners on number boxes that squeeze the figure out of sight. */
.gb-number { padding-right: 6px; }
.gb-number::-webkit-outer-spin-button,
.gb-number::-webkit-inner-spin-button { margin-left: 2px; }

.gb-colour {
    flex: 0 0 56px;
    width: 56px;
    height: 42px;
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--gb-line);
    background: rgba(0, 0, 0, 0.35);
    cursor: pointer;
}

/* ---------- pictures, documents and links on a point ---------- */
.media-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 12px;
}
.media-thumb {
    position: relative;
    width: 84px;
    height: 62px;
    padding: 0;
    border: 1px solid var(--gb-line);
    border-radius: 10px;
    overflow: hidden;
    background: #121a27;
    cursor: pointer;
}
.media-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-thumb.editing { cursor: default; }

.media-remove, .media-open {
    position: absolute;
    border: 0;
    color: #fff;
    background: rgba(8, 11, 17, .82);
    font: inherit;
    cursor: pointer;
}
.media-remove {
    top: 3px; right: 3px;
    width: 22px; height: 22px;
    border-radius: 50%;
    font-size: 15px;
    line-height: 20px;
}
.media-open {
    left: 0; right: 0; bottom: 0;
    padding: 2px 0;
    font-size: .72rem;
}
.media-remove:hover, .media-open:hover { background: rgba(8, 11, 17, .95); }

a.media-link {
    display: flex;
    justify-content: flex-start;
    text-align: left;
    text-decoration: none;
    margin-bottom: 8px;
}

.doc-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.doc-row .gb-input { margin-bottom: 0; }

.gb-input.gb-wrong { border-color: #e4674f; }

/* ---------- full screen pictures and the video player ---------- */
.media-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(4, 6, 10, .92);
}
.media-frame {
    position: relative;
    max-width: min(1100px, 100%);
    max-height: 100%;
    display: grid;
    place-items: center;
}
.media-photo {
    max-width: 100%;
    max-height: calc(100vh - 110px);
    border-radius: 12px;
    display: block;
}
.media-video {
    width: min(1100px, 100%);
    aspect-ratio: 16 / 9;
}
.media-video iframe { width: 100%; height: 100%; border: 0; border-radius: 12px; }

.media-close {
    position: absolute;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: calc(12px + env(safe-area-inset-right, 0px));
    z-index: 2;
}
.media-step {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
}
.media-step.prev { left: -4px; }
/* Turned the same way: the up arrow then points left and the down arrow right. */
.media-step.next { right: -4px; }
.media-counter { margin-top: 10px; color: var(--gb-muted); font-size: .85rem; }

/* ---------- the play button on a video panel ---------- */
#video-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}
.video-play {
    position: absolute;
    left: 0; top: 0;
    margin: -21px 0 0 -21px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .9);
    background: rgba(8, 11, 17, .72);
    color: #fff;
    cursor: pointer;
    pointer-events: auto;
    backdrop-filter: blur(3px);
}
.video-play svg { width: 20px; height: 20px; margin-left: 2px; }
.video-play:hover { background: var(--gb-accent); color: #04202c; border-color: var(--gb-accent); }

/* ---------- pipe runs and other tick boxes ---------- */
.gb-check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 12px;
    cursor: pointer;
}
.gb-check {
    width: 20px;
    height: 20px;
    accent-color: var(--gb-accent);
    cursor: pointer;
}
select.gb-input { cursor: pointer; }

/* ---------- the guided tour ---------- */
#tour-launch {
    position: absolute;
    left: 14px;
    top: calc(62px + var(--gb-safe-top));
    z-index: 4;
    background: var(--gb-accent);
    border-color: var(--gb-accent);
    color: #04202c;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
}
#tour-launch svg { width: 20px; height: 20px; }

/* Up under the title, not down by the toolbar: the point's own panel sits in the
   middle of the screen and the controls must never land on top of what they are
   showing you. */
#tour-bar {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(62px + var(--gb-safe-top));
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 14px;
    border: 1px solid var(--gb-line);
    background: rgba(10, 14, 20, .92);
    backdrop-filter: blur(6px);
    z-index: 5;
}
.tour-progress {
    padding: 0 8px;
    color: var(--gb-muted);
    font-size: .85rem;
    white-space: nowrap;
}

/* Said plainly, because an id rule beats the browser's own [hidden] rule. */
#tour-launch[hidden], #tour-bar[hidden] { display: none; }


/* ---------- dressings ---------- */
.dressing-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border: 1px solid var(--gb-line);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
}
.dressing-name { flex: 1 1 140px; min-width: 0; display: grid; gap: 2px; }
.dressing-name span { color: var(--gb-muted); font-size: 0.8rem; }

/* The play button on a video panel fades with distance like a marker, and scales
   about its own middle because, unlike a point, it has no label hanging off it. */
.video-play {
    transform-origin: 21px 21px;
    opacity: var(--marker-fade, 1);
}
