/* Copyright (c) 2026 geofront.eu. All rights reserved. */

html,
body,
#app {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
}

#app {
    position: relative;
    /* A pinch never zooms the page, also when a finger is on a button or the logo: in the top-down view, a pinch
       zooms the map, and a zoomed page would move the controls and, in Safari on iOS, the touch positions. Lists
       and panels still scroll. */
    touch-action: pan-x pan-y;
}

/* The tour interface: dark buttons with text in the accent color, which the client can change, and light panels.
   The font stays. The edit panel of the geofront interface keeps these values, so that it looks as in the tour. */
#app,
#app.ui-geofront .edit-panel {
    --tour-accent: #29abe2;
    --tour-accent-contrast: #fff;
    --tour-surface: rgb(60 60 60 / 0.88);
    --tour-surface-hover: rgb(84 84 84 / 0.9);
    --tour-panel: rgb(242 242 242 / 0.95);
    /* The help panel keeps this opacity: the background opacity of the branding does not change it. */
    --tour-help-panel: rgb(242 242 242 / 0.95);
    --tour-panel-text: #1a1a1a;
    --tour-radius: 10px;
    --tour-margin: 20px;
    --tour-control-height: 40px;
    --tour-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
    /* The UI scale of the client and the width of the buttons of the points of interest (branding.js). */
    --tour-ui-scale: 1;
    --tour-poi-width: 234px;
    /* The width of the joystick of touch screens. */
    --tour-stick-size: 128px;
}

/* The UI scale zooms each tour control, with its distance from the edges of the view, so the controls keep their
   places relative to each other. A centered control stays centered. In a zoomed element, vw units grow with the
   zoom, and percentages do not. */
.tour-top-left,
#bottomLeftStack,
.player-menu,
.tour-end-button,
.tour-brand-logo,
.tour-center-aid,
.tour-esc-hint,
.tour-help-panel,
.phone-rotate-hint,
.top-down-projection-toggle,
.top-down-exit,
.load-progress {
    zoom: var(--tour-ui-scale);
}

.geosplat-webgpu-host {
    position: relative;
    width: 100%;
    height: 100%;
}

body {
    background: #050505;
    color: white;
    font-family: "Ubuntu Sans", Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    user-select: none;
}

[hidden] {
    display: none !important;
}

button,
input,
select {
    font: inherit;
}

/* All sliders are a thin line with a round white knob. */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 16px;
    margin: 0;
    background: transparent;
    cursor: pointer;
}

input[type="range"]:disabled {
    cursor: default;
}

input[type="range"]:focus-visible {
    outline: none;
}

input[type="range"]::-webkit-slider-runnable-track {
    height: 2px;
    border-radius: 1px;
    background: rgb(255 255 255 / 0.3);
}

input[type="range"]::-moz-range-track {
    height: 2px;
    border-radius: 1px;
    background: rgb(255 255 255 / 0.3);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    margin-top: -5px;
    border: 0;
    border-radius: 50%;
    background: #f4f4f4;
}

input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border: 0;
    border-radius: 50%;
    background: #f4f4f4;
}

input[type="range"]:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 3px rgb(255 255 255 / 0.35);
}

input[type="range"]:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 3px rgb(255 255 255 / 0.35);
}

#webgpuCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    outline: none;
    touch-action: none;
}

#app.comparison-mode {
    --comparison-panel-width: 360px;
    --comparison-pane-gap: 12px;
    --comparison-view-width: max(1px, calc((100vw - var(--comparison-panel-width) - 60px) / 2));
    --comparison-view-height: calc(100vh - 24px);
    --comparison-view-top: 12px;
    --comparison-render-left: 12px;
    --comparison-reference-left: calc(
        var(--comparison-render-left) + var(--comparison-view-width) + var(--comparison-pane-gap)
    );
    --comparison-blend: 0.5;
}

#app.comparison-mode #webgpuCanvas {
    inset: auto;
    top: var(--comparison-view-top);
    left: var(--comparison-render-left);
    width: var(--comparison-view-width);
    height: var(--comparison-view-height);
    background: #000;
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.22);
}

#app.comparison-mode #toolbar,
#app.comparison-mode #secondaryToolbar,
#app.comparison-mode #bottomLeftStack,
#app.comparison-mode #stats,
#app.comparison-mode .tour-top-left,
#app.comparison-mode .scene-labels,
#app.comparison-mode .touch-joystick,
#app.comparison-mode .touch-control-toggle,
#app.comparison-mode .phone-rotate-hint,
#app.comparison-mode .top-down-projection-toggle,
#app.comparison-mode .top-down-exit,
#app.comparison-mode .top-down-brush-cursor,
#app.comparison-mode .scene-ruler-overlay,
#app.comparison-mode .poi-hover-cursor,
#app.comparison-mode .tour-center-aid,
#app.comparison-mode .tour-esc-hint,
#app.comparison-mode .tour-end-button,
#app.comparison-mode .tour-brand-logo,
#app.comparison-mode .tour-help,
#app.comparison-mode .edit-panel {
    display: none;
}

#comparisonReferenceFrame {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

#app:not(.comparison-mode) #comparisonReferenceFrame {
    display: none;
}

#comparisonReferenceImage,
#comparisonDifferenceCanvas {
    position: absolute;
    top: var(--comparison-view-top);
    left: var(--comparison-reference-left);
    width: var(--comparison-view-width);
    height: var(--comparison-view-height);
    background: #000;
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.22);
}

#comparisonReferenceImage {
    object-fit: fill;
}

#comparisonDifferenceCanvas {
    display: none;
}

#app[data-comparison-view="overlay"] #comparisonReferenceImage {
    left: var(--comparison-render-left);
    opacity: var(--comparison-blend);
}

#app[data-comparison-view="difference"] #comparisonReferenceImage {
    display: none;
}

#app[data-comparison-view="difference"] #comparisonDifferenceCanvas {
    display: block;
}

.comparison-image-label {
    position: absolute;
    top: calc(var(--comparison-view-top) + 8px);
    z-index: 2;
    padding: 4px 7px;
    border-radius: 4px;
    background: rgb(0 0 0 / 0.68);
    color: white;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
}

#comparisonRenderedLabel {
    left: calc(var(--comparison-render-left) + 8px);
}

#comparisonOriginalLabel {
    left: calc(var(--comparison-reference-left) + 8px);
}

#comparisonDifferenceLabel {
    display: none;
    left: calc(var(--comparison-reference-left) + 8px);
}

#app[data-comparison-view="overlay"] #comparisonOriginalLabel {
    left: calc(var(--comparison-render-left) + var(--comparison-view-width) - 8px);
    transform: translateX(-100%);
}

#app[data-comparison-view="difference"] #comparisonRenderedLabel,
#app[data-comparison-view="difference"] #comparisonOriginalLabel {
    display: none;
}

#app[data-comparison-view="difference"] #comparisonDifferenceLabel {
    display: block;
}

#toolbar,
#secondaryToolbar {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 320px;
    max-width: calc(100% - 24px);
    max-height: calc(100% - 24px);
    padding: 8px;
    overflow: hidden auto;
    background: rgb(10 10 10 / 0.78);
    border: 1px solid rgb(255 255 255 / 0.22);
    border-radius: 6px;
    backdrop-filter: blur(12px);
}

#toolbar:not([hidden]) + #secondaryToolbar {
    left: 340px;
}

#toolbar .toolbar-group,
#secondaryToolbar .toolbar-group {
    display: grid;
    gap: 6px;
}

#toolbar .toolbar-group + .toolbar-group,
#secondaryToolbar .toolbar-group + .toolbar-group {
    padding-top: 8px;
    border-top: 1px solid rgb(255 255 255 / 0.15);
}

#toolbar .toolbar-group-title,
#secondaryToolbar .toolbar-group-title {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgb(255 255 255 / 0.6);
}

#toolbar .toolbar-row,
#secondaryToolbar .toolbar-row {
    display: flex;
    gap: 8px;
}

#toolbar .toolbar-row > select,
#secondaryToolbar .toolbar-row > select,
#toolbar .toolbar-row > button,
#secondaryToolbar .toolbar-row > button {
    flex: 1 1 auto;
    min-width: 0;
}

#toolbar label,
#secondaryToolbar label {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

#toolbar .section-toggle,
#secondaryToolbar .section-toggle {
    text-align: left;
}

#toolbar .section-toggle::after,
#secondaryToolbar .section-toggle::after {
    content: "\25B8";
    float: right;
}

#toolbar .section-toggle[aria-expanded="true"]::after,
#secondaryToolbar .section-toggle[aria-expanded="true"]::after {
    content: "\25BE";
}

#toolbar input[type="number"],
#secondaryToolbar input[type="number"] {
    box-sizing: border-box;
    height: 28px;
    width: 100%;
    padding: 0 6px;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 5px;
    background: #111;
    color: white;
    font-variant-numeric: tabular-nums;
}

#toolbar select,
#toolbar button,
#secondaryToolbar select,
#secondaryToolbar button {
    height: 32px;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 5px;
    background: #111;
    color: white;
    padding: 0 10px;
}

#toolbar button,
#secondaryToolbar button {
    cursor: pointer;
}

#toolbar button:hover,
#secondaryToolbar button:hover {
    background: #2c2c2c;
}

#toolbar button.active,
#secondaryToolbar button.active {
    background: #f4f4f4;
    color: #111;
}

/* The tour controls at the bottom left: the camera modes, the settings and help buttons, Record and the camera path
   button, and the quality buttons above them. They wrap in a narrow window, beside the logo. A group has 2 px
   between its buttons and round outer corners. */
#bottomLeftStack {
    position: absolute;
    left: var(--tour-margin);
    bottom: var(--tour-margin);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    max-width: calc(100% - 2 * var(--tour-margin) - 60px);
}

/* The menu of the settings button in the player mode for customers, above the buttons at the bottom left: the
   quality and the size of the interface. */
.player-menu {
    position: absolute;
    left: var(--tour-margin);
    bottom: calc(var(--tour-margin) + var(--tour-control-height) + 10px);
    z-index: 4;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    border-radius: var(--tour-radius);
    background: var(--tour-surface);
    font-family: var(--tour-font);
}

.player-menu[hidden] {
    display: none;
}

.player-menu-size {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.player-menu-size button {
    min-width: var(--tour-control-height);
    height: var(--tour-control-height);
    border: 0;
    border-radius: 6px;
    background: rgb(255 255 255 / 0.08);
    color: var(--tour-accent);
    font: 700 20px var(--tour-font);
    cursor: pointer;
}

.player-menu-size button:disabled {
    opacity: 0.4;
    cursor: default;
}

.player-menu-size-value {
    min-width: 56px;
    color: white;
    text-align: center;
    font-size: 14px;
}

/* STICK POSITION: a slider as wide as the rest of the menu, whose round knob in the accent color stands where the
   stick stands along the bottom edge. */
.player-menu-stick {
    display: flex;
    align-items: center;
    gap: 10px;
}

.player-menu-stick input[type="range"] {
    flex: 1 1 0;
    min-width: 110px;
    height: var(--tour-control-height);
    margin: 0;
    padding: 0 2px;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.player-menu-stick input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: rgb(255 255 255 / 0.18);
}

.player-menu-stick input[type="range"]::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    margin-top: -9px;
    border: 0;
    border-radius: 50%;
    background: var(--tour-accent);
    -webkit-appearance: none;
    appearance: none;
}

.player-menu-stick input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: rgb(255 255 255 / 0.18);
}

.player-menu-stick input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: var(--tour-accent);
}

.player-menu-stick input[type="range"]:focus-visible {
    outline: 2px solid var(--tour-accent);
    outline-offset: 2px;
    border-radius: 6px;
}

#bottomLeftControls {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 10px;
}

#cameraModeControls,
.tour-button-group,
#qualityControls {
    display: inline-flex;
    gap: 2px;
    min-width: 0;
}

#cameraModeControls[hidden] {
    display: none;
}

#cameraModeControls button,
.tour-button-group button,
#qualityControls button,
#qualityControls .quality-label,
#recordBtn,
#cameraPathBtn,
.tour-end-button,
.top-down-projection-toggle,
.top-down-exit {
    box-sizing: border-box;
    height: var(--tour-control-height);
    padding: 0 14px;
    border: 0;
    border-radius: 0;
    background: var(--tour-surface);
    color: var(--tour-accent);
    font: 700 16px/1 var(--tour-font);
    text-transform: uppercase;
    cursor: pointer;
}

#cameraModeControls button {
    min-width: 70px;
}

#qualityControls .quality-label {
    display: inline-flex;
    align-items: center;
    color: rgb(255 255 255 / 0.75);
    font-size: 13px;
    cursor: default;
}

#cameraModeControls button:hover:not(.active),
.tour-button-group button:hover:not(.active, [aria-expanded="true"]),
#qualityControls button:hover:not(.active),
#recordBtn:hover:not([aria-pressed="true"]),
#cameraPathBtn:hover:not(:disabled, [aria-pressed="true"]),
.tour-end-button:hover,
.top-down-projection-toggle:hover:not([aria-pressed="true"]),
.top-down-exit:hover {
    background: var(--tour-surface-hover);
}

#cameraModeControls button.active,
.tour-button-group button.active,
.tour-button-group button[aria-expanded="true"],
#qualityControls button.active,
#cameraPathBtn[aria-pressed="true"],
.top-down-projection-toggle[aria-pressed="true"] {
    background: var(--tour-accent);
    color: var(--tour-accent-contrast);
}

#cameraModeControls button:focus-visible,
.tour-button-group button:focus-visible,
#qualityControls button:focus-visible,
#recordBtn:focus-visible,
#cameraPathBtn:focus-visible,
.tour-end-button:focus-visible,
.tour-help-close:focus-visible {
    outline: 2px solid var(--tour-accent-contrast);
    outline-offset: -4px;
}

.tour-help-close:focus-visible {
    outline-color: var(--tour-accent);
}

/* The scene can hide some mode buttons; the first and the last shown ones get the round corners. */
#cameraModeControls button:nth-child(1 of :not([hidden])),
.tour-button-group > :nth-child(1 of :not([hidden])),
#qualityControls > :first-child {
    border-top-left-radius: var(--tour-radius);
    border-bottom-left-radius: var(--tour-radius);
}

#cameraModeControls button:nth-last-child(1 of :not([hidden])),
.tour-button-group > :nth-last-child(1 of :not([hidden])),
#qualityControls > :last-child {
    border-top-right-radius: var(--tour-radius);
    border-bottom-right-radius: var(--tour-radius);
}

#recordBtn,
#cameraPathBtn,
.tour-end-button,
.top-down-projection-toggle,
.top-down-exit {
    border-radius: var(--tour-radius);
}

.tour-button-group button {
    display: grid;
    place-items: center;
    width: var(--tour-control-height);
    padding: 0;
}

/* Drone mode shows the Record button. While it records, the button is red and shows the time. */
#recordBtn,
#cameraPathBtn {
    display: flex;
    align-items: center;
    gap: 8px;
    font-variant-numeric: tabular-nums;
}

#recordBtn[hidden],
#cameraPathBtn[hidden] {
    display: none;
}

#recordBtn .record-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e53935;
}

#recordBtn[aria-pressed="true"] {
    background: #c62828;
    color: white;
}

/* The dot becomes a square: a click stops the recording. */
#recordBtn[aria-pressed="true"] .record-dot {
    border-radius: 2px;
    background: white;
}

/* The camera path button: Play and Stop for an automatic path, Next for a path with stops. */
#cameraPathBtn:disabled {
    cursor: default;
    opacity: 0.6;
}

/* A triangle that points to the right; a square while the path plays. */
#cameraPathBtn .camera-path-icon {
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 10px solid currentColor;
}

#cameraPathBtn[aria-pressed="true"] .camera-path-icon {
    width: 10px;
    height: 10px;
    border: 0;
    border-radius: 2px;
    background: currentColor;
}

/* Exit Tour at the top right, in capital letters as the other buttons. On touch devices and in narrow windows, its
   two words go on two lines. */
.tour-end-button {
    position: absolute;
    top: var(--tour-margin);
    right: var(--tour-margin);
    z-index: 2;
    padding: 0 16px;
}

#app.tour-touch .tour-end-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    font-size: 14px;
    line-height: 1.05;
}

@media (max-width: 760px) {
    .tour-end-button {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 0 12px;
        font-size: 14px;
        line-height: 1.05;
    }
}

/* The realitour logo at the bottom right, which opens realitour.at in a new window. */
.tour-brand-logo {
    position: absolute;
    right: var(--tour-margin);
    bottom: var(--tour-margin);
    z-index: 2;
    display: block;
    line-height: 0;
}

.tour-brand-logo svg {
    display: block;
}

/* The orientation aid at the screen center in the flight modes: a fixed ring and a dot that follows the movement
   input. */
.tour-center-aid {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    width: 25px;
    height: 25px;
    margin: -12.5px 0 0 -12.5px;
    color: var(--tour-accent);
    pointer-events: none;
}

.tour-center-aid[hidden] {
    display: none;
}

.tour-center-aid svg {
    position: absolute;
    left: 0;
    top: 0;
    display: block;
}

.tour-center-aid .tour-center-dot {
    transition: transform 80ms linear;
}

/* The hint at the bottom center that Escape frees the pointer, which stays while a flight mode is on. */
.tour-esc-hint {
    position: absolute;
    left: 50%;
    bottom: var(--tour-margin);
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    box-sizing: border-box;
    height: var(--tour-control-height);
    padding: 0 16px 0 12px;
    border-radius: var(--tour-radius);
    background: var(--tour-surface);
    color: var(--tour-accent);
    font: 400 16px/1 var(--tour-font);
    white-space: nowrap;
    transform: translateX(-50%);
    pointer-events: none;
}

.tour-esc-hint[hidden] {
    display: none;
}

.tour-esc-hint svg {
    flex: none;
}

/* In a narrow window the hint goes above the bottom left controls, and in a very narrow one away. */
@media (max-width: 1440px) {
    .tour-esc-hint {
        bottom: calc(var(--tour-margin) + 2 * var(--tour-control-height) + 20px);
    }
}

@media (max-width: 760px) {
    .tour-esc-hint {
        display: none;
    }
}

/* The help, which the ? button opens: a light panel over the view with the controls of the camera mode. */
.tour-help {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    padding: var(--tour-margin);
    overflow: auto;
    background: rgb(0 0 0 / 0.2);
    font-family: var(--tour-font);
}

.tour-help[hidden] {
    display: none;
}

.tour-help-panel {
    position: relative;
    box-sizing: border-box;
    width: min(1090px, 100%);
    padding: 80px 50px 70px;
    border-radius: 20px;
    background: var(--tour-help-panel);
    color: var(--tour-accent);
    box-shadow: 0 12px 40px rgb(0 0 0 / 0.25);
}

.tour-help-close {
    position: absolute;
    top: 14px;
    right: 18px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--tour-radius);
    background: none;
    color: var(--tour-accent);
    font: 700 30px/1 var(--tour-font);
    cursor: pointer;
}

.tour-help-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-evenly;
    gap: 50px 30px;
}

.tour-help-section[hidden],
.tour-help-item[hidden] {
    display: none;
}

.tour-help-item {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.25;
    white-space: pre;
}

.tour-help-item.wide {
    justify-content: center;
    width: 100%;
    gap: 34px;
    text-align: center;
}

.tour-help-icon {
    display: grid;
    flex: none;
    place-items: center;
    min-width: 64px;
}

.tour-help-item.wide .tour-help-icon {
    min-width: 0;
}

.tour-help-item.text-only:not(.wide) {
    padding-left: 80px;
}

/* The ring and the dot of the orientation aid, and the ring and the knob of the joystick, lie on each other. */
.tour-help-icon > svg {
    grid-area: 1 / 1;
}

@media (max-width: 760px) {
    .tour-help-panel {
        padding: 64px 20px 32px;
    }

    .tour-help-section {
        gap: 24px;
    }

    .tour-help-item,
    .tour-help-item.wide {
        justify-content: flex-start;
        width: 100%;
        gap: 14px;
        text-align: left;
        white-space: pre-line;
    }
}

@media (hover: none), (pointer: coarse) {
    #app {
        --tour-control-height: 44px;
    }

    #cameraModeControls button,
    #qualityControls button {
        min-width: 44px;
    }

    .settings-rows label {
        grid-template-columns: 104px minmax(0, 1fr) 40px 28px;
    }

    .settings-rows .slider-reset {
        width: 28px;
        height: 28px;
    }

    #filmicPanel #filmicEnabled {
        width: 24px;
        height: 24px;
    }

}

#toolbar input[type="color"],
#secondaryToolbar input[type="color"] {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 5px;
    background: #111;
}

#toolbar input[type="range"],
#secondaryToolbar input[type="range"] {
    width: 100%;
    min-width: 0;
}

#toolbar .section-panel,
#secondaryToolbar .section-panel {
    display: grid;
    gap: 8px;
    padding-top: 4px;
}

#toolbar .lod-config-group,
#secondaryToolbar .lod-config-group {
    display: grid;
    gap: 6px;
}

#toolbar .lod-field,
#secondaryToolbar .lod-field {
    grid-template-columns: 88px minmax(0, 1fr) 84px;
}

#toolbar .lod-field span,
#secondaryToolbar .lod-field span {
    white-space: normal;
    line-height: 1.15;
    font-size: 12px;
}


.interaction-panel {
    position: absolute;
    top: 64px;
    left: 12px;
    z-index: 2;
    display: grid;
    gap: 10px;
    width: min(340px, calc(100% - 24px));
    max-height: calc(100% - 88px);
    overflow: auto;
    padding: 10px;
    background: rgb(10 10 10 / 0.78);
    border: 1px solid rgb(255 255 255 / 0.22);
    border-radius: 6px;
    backdrop-filter: blur(12px);
}

.interaction-panel-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.interaction-panel-actions {
    display: flex;
    gap: 8px;
}

.interaction-panel button,
.small-action {
    min-height: 30px;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 5px;
    background: #111;
    color: white;
    padding: 0 9px;
    cursor: pointer;
}

.interaction-panel button:hover,
.small-action:hover {
    background: #2c2c2c;
}

.interaction-panel button.active {
    background: #f4f4f4;
    color: #111;
}

.interaction-panel-state,
.interaction-list-empty {
    color: rgb(255 255 255 / 0.68);
    font-size: 12px;
}

.interaction-list {
    display: grid;
    gap: 6px;
}

.interaction-list-title {
    margin-top: 4px;
    color: rgb(255 255 255 / 0.82);
    font-size: 12px;
    font-weight: 700;
}

.interaction-list-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 6px;
    min-height: 30px;
}

.interaction-list-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.interaction-list-row.subtle {
    padding-left: 12px;
    color: rgb(255 255 255 / 0.72);
}

.small-action {
    min-height: 26px;
    padding: 0 7px;
    font-size: 12px;
}

#comparisonPanel {
    top: 12px;
    right: 12px;
    bottom: 12px;
    left: auto;
    z-index: 4;
    box-sizing: border-box;
    grid-template-rows: auto auto auto minmax(120px, 1fr) auto auto;
    width: var(--comparison-panel-width, 360px);
    max-height: none;
    overflow: hidden;
}

.comparison-panel-header,
.comparison-camera-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.comparison-shortcut-hint {
    margin-top: 3px;
    color: rgb(255 255 255 / 0.62);
    font-size: 11px;
}

.comparison-shortcut-hint kbd {
    display: inline-block;
    min-width: 17px;
    box-sizing: border-box;
    border: 1px solid rgb(255 255 255 / 0.28);
    border-radius: 3px;
    background: rgb(255 255 255 / 0.08);
    padding: 1px 4px;
    color: white;
    font: inherit;
    font-weight: 700;
    text-align: center;
}

#comparisonPanel .comparison-close-button {
    width: 30px;
    min-height: 30px;
    padding: 0;
    font-size: 20px;
    line-height: 1;
}

.comparison-section {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding-top: 9px;
    border-top: 1px solid rgb(255 255 255 / 0.14);
}

.comparison-section-title {
    color: rgb(255 255 255 / 0.82);
    font-size: 12px;
    font-weight: 700;
}

.comparison-load-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.comparison-view-buttons,
.comparison-export-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.comparison-load-grid button,
.comparison-view-buttons button,
.comparison-export-actions button {
    min-width: 0;
    height: auto;
    padding: 6px;
    line-height: 1.2;
}

.comparison-blend-control {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    color: rgb(255 255 255 / 0.78);
    font-size: 12px;
    white-space: nowrap;
}

.comparison-blend-control input {
    width: 100%;
    margin: 0;
}

.comparison-camera-section {
    grid-template-rows: auto auto minmax(80px, 1fr);
    min-height: 0;
}

.comparison-camera-header {
    align-items: center;
}

.comparison-order-control {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgb(255 255 255 / 0.68);
    font-size: 11px;
}

#comparisonOrder {
    min-width: 0;
    height: 28px;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 5px;
    background: #111;
    color: white;
    padding: 0 6px;
}

.comparison-selection-actions {
    justify-content: flex-end;
}

.comparison-camera-list {
    min-height: 80px;
    overflow: auto;
    border: 1px solid rgb(255 255 255 / 0.16);
    border-radius: 5px;
    background: rgb(0 0 0 / 0.22);
}

.comparison-camera-list:empty::before {
    content: "No cameras loaded";
    display: block;
    padding: 10px;
    color: rgb(255 255 255 / 0.56);
    font-size: 12px;
}

.comparison-camera-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 3px 7px;
    border-bottom: 1px solid rgb(255 255 255 / 0.1);
    cursor: pointer;
}

.comparison-camera-row > input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin: 0 2px;
    cursor: pointer;
}

#comparisonPanel .comparison-camera-row > button {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    min-width: 0;
    min-height: 26px;
    border: 0;
    background: transparent;
    padding: 0;
    text-align: left;
}

#comparisonPanel .comparison-camera-row > button:hover {
    background: transparent;
}

.comparison-camera-row:last-child {
    border-bottom: 0;
}

.comparison-camera-row:hover {
    background: rgb(255 255 255 / 0.08);
}

.comparison-camera-row.current {
    background: rgb(255 255 255 / 0.16);
    box-shadow: inset 3px 0 #65ef91;
}

.comparison-camera-row.missing {
    opacity: 0.58;
}

.comparison-camera-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.comparison-camera-score,
.comparison-camera-psnr {
    color: rgb(255 255 255 / 0.72);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.comparison-progress-group {
    display: grid;
    gap: 5px;
}

#comparisonProgress {
    width: 100%;
    height: 8px;
    accent-color: #65ef91;
}

.comparison-export-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#comparisonComputeBtn,
#comparisonCancelBtn {
    grid-column: 1 / -1;
}

#comparisonPanel button:disabled {
    opacity: 0.45;
    cursor: default;
}

.walk-camera-cursor {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
    width: 30px;
    height: 30px;
    border: 2px solid rgb(255 255 255 / 0.92);
    border-radius: 50%;
    background: rgb(255 255 255 / 0.08);
    box-shadow: 0 0 0 1px rgb(0 0 0 / 0.45), 0 0 16px rgb(255 255 255 / 0.28);
    pointer-events: none;
    transform: translate(-50%, -50%);
    will-change: transform;
}

.walk-camera-target {
    width: 54px;
    height: 54px;
}

.top-down-camera-cursor {
    width: 34px;
    height: 34px;
}

/* Ring on a new orbit center: grows in, then fades out while it stays on the clicked point. */
.orbit-center-marker {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
    width: 44px;
    height: 44px;
    border: 2px solid rgb(255 255 255 / 0.92);
    border-radius: 50%;
    background: rgb(255 255 255 / 0.08);
    box-shadow: 0 0 0 1px rgb(0 0 0 / 0.45), 0 0 16px rgb(255 255 255 / 0.28);
    opacity: 0;
    pointer-events: none;
    translate: -50% -50%;
    will-change: scale, opacity;
}

.orbit-center-marker-active {
    animation: orbit-center-marker 900ms ease-out forwards;
}

@keyframes orbit-center-marker {
    0% {
        opacity: 0;
        scale: 0.45;
    }
    20% {
        opacity: 1;
        scale: 1;
    }
    100% {
        opacity: 0;
        scale: 1.3;
    }
}

@media (prefers-reduced-motion: reduce) {
    @keyframes orbit-center-marker {
        0% {
            opacity: 0;
        }
        20% {
            opacity: 1;
        }
        100% {
            opacity: 0;
        }
    }
}

.room-view-editor label {
    display: grid;
    gap: 6px;
}

.room-view-editor input[type="text"] {
    height: 32px;
    box-sizing: border-box;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 5px;
    background: #111;
    color: white;
    padding: 0 9px;
}

.room-view-list {
    position: absolute;
    left: 12px;
    top: 50%;
    z-index: 2;
    display: grid;
    gap: 8px;
    width: min(220px, calc(100% - 24px));
    transform: translateY(-50%);
}

.room-view-list button {
    min-height: 36px;
    overflow: hidden;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 5px;
    background: rgb(10 10 10 / 0.78);
    color: white;
    padding: 0 12px;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    backdrop-filter: blur(12px);
}

.room-view-list button:hover {
    background: rgb(44 44 44 / 0.9);
}

#status,
#stats {
    position: absolute;
    z-index: 2;
    background: rgb(10 10 10 / 0.72);
    border: 1px solid rgb(255 255 255 / 0.18);
    border-radius: 6px;
    padding: 8px 10px;
    line-height: 1.4;
    backdrop-filter: blur(12px);
}

#status {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
}

#status.hidden {
    display: none;
}

#stats {
    right: 12px;
    bottom: 84px;
    min-width: 172px;
    color: rgb(255 255 255 / 0.86);
}

#app.drag-over:not(.comparison-mode)::after,
#app.comparison-mode.drag-over::before,
#app.comparison-mode.drag-over::after {
    position: absolute;
    z-index: 6;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    border: 2px dashed rgb(255 255 255 / 0.72);
    border-radius: 8px;
    background: rgb(0 0 0 / 0.48);
    color: white;
    font-size: 24px;
    font-weight: 700;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

#app.drag-over:not(.comparison-mode)::after {
    content: "Drop SOG model";
    inset: 12px;
}

#app.comparison-mode.drag-over::before,
#app.comparison-mode.drag-over::after {
    top: 12px;
    bottom: 12px;
    width: calc(50% - 18px);
}

#app.comparison-mode.drag-over::before {
    content: "Drop model";
    left: 12px;
}

#app.comparison-mode.drag-over::after {
    content: "Drop COLMAP folder";
    right: 12px;
}

@media (max-width: 760px) {
    #app {
        --tour-margin: 12px;
    }

    #toolbar,
    #secondaryToolbar {
        right: 12px;
        width: auto;
    }

    #toolbar:not([hidden]) {
        max-height: calc(50% - 16px);
    }

    #toolbar:not([hidden]) + #secondaryToolbar {
        left: 12px;
        top: 50%;
        max-height: calc(50% - 20px);
    }

    #cameraModeControls button,
    #qualityControls button,
    #qualityControls .quality-label {
        min-width: 44px;
        padding: 0 10px;
        font-size: 14px;
    }

    /* The bottom left controls can take three rows, so the stats and the load percentage go below End
       Tour. */
    #stats {
        top: calc(var(--tour-margin) + var(--tour-control-height) + 12px);
        bottom: auto;
    }

    /* The rule of the load percentage comes later in this file, so this one needs the #app to win; with both top
       and bottom set, the bar would fill the height of the view. */
    #app .load-progress {
        top: calc(var(--tour-margin) + var(--tour-control-height) + 12px);
        bottom: auto;
    }
}

.room-bounds-editor {
    width: min(380px, calc(100% - 24px));
}

.room-bounds-editor .interaction-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.room-bounds-editor .interaction-list button {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.room-bounds-editor .interaction-list button.current {
    border-color: #65ef91;
}

.room-bounds-properties {
    display: grid;
    gap: 9px;
    padding-top: 2px;
}

.room-bounds-properties .interaction-panel-actions {
    flex-wrap: wrap;
}

.room-bounds-properties > label {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.room-bounds-properties input {
    min-width: 0;
    height: 30px;
    box-sizing: border-box;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 5px;
    background: #111;
    color: white;
    padding: 0 7px;
}

.room-bounds-vector {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 0;
    padding: 7px;
    border: 1px solid rgb(255 255 255 / 0.2);
    border-radius: 5px;
}

.room-bounds-vector legend {
    padding: 0 4px;
    color: rgb(255 255 255 / 0.76);
    font-size: 12px;
}

.room-bounds-vector label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

.room-bounds-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    touch-action: none;
}

.room-bounds-edge {
    stroke: #63d9ff;
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

.room-bounds-edge.current {
    stroke: #65ef91;
    stroke-width: 2;
}

.room-bounds-edge.selected {
    stroke: #ffc857;
    stroke-width: 2.5;
}

.room-bounds-edge.selected.hovered {
    stroke-width: 5;
    filter: drop-shadow(0 0 3px rgb(255 255 255 / 0.9));
}

.room-bounds-edge-hit {
    stroke: rgb(255 255 255 / 0.001);
    stroke-width: 16;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    pointer-events: stroke;
    cursor: grab;
}

.room-bounds-overlay.face-resizing .room-bounds-edge-hit {
    cursor: grabbing;
}

.room-bounds-label {
    fill: #63d9ff;
    paint-order: stroke;
    stroke: rgb(0 0 0 / 0.8);
    stroke-width: 3px;
    font-size: 13px;
    text-anchor: middle;
}

.room-bounds-label.current {
    fill: #65ef91;
}

.room-bounds-label.selected {
    fill: #ffc857;
    font-weight: 700;
}

.room-bounds-gizmo-axis {
    stroke-width: 3;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

.room-bounds-gizmo-hit {
    stroke: rgb(255 255 255 / 0.001);
    stroke-width: 18;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    pointer-events: stroke;
    cursor: grab;
}

.room-bounds-overlay.dragging .room-bounds-gizmo-hit {
    cursor: grabbing;
}

.room-bounds-overlay.scaling .room-bounds-gizmo-axis {
    stroke-dasharray: 5 3;
}

.room-bounds-overlay.scaling .room-bounds-gizmo-hit {
    cursor: crosshair;
}

.room-bounds-rotation-ring {
    fill: none;
    stroke-width: 2.5;
    vector-effect: non-scaling-stroke;
    pointer-events: none;
}

.room-bounds-rotation-hit {
    fill: none;
    stroke: rgb(255 255 255 / 0.001);
    stroke-width: 14;
    vector-effect: non-scaling-stroke;
    pointer-events: stroke;
    cursor: grab;
}

.room-bounds-overlay.rotating .room-bounds-rotation-hit {
    cursor: grabbing;
}

.room-bounds-overlay.face-resize-enabled .room-bounds-gizmo-hit,
.room-bounds-overlay.face-resize-enabled .room-bounds-rotation-hit,
.room-bounds-overlay.face-resizing .room-bounds-gizmo-hit,
.room-bounds-overlay.face-resizing .room-bounds-rotation-hit {
    pointer-events: none;
}

.room-bounds-gizmo-axis.hovered,
.room-bounds-rotation-ring.hovered {
    stroke-width: 5;
    filter: drop-shadow(0 0 3px rgb(255 255 255 / 0.9));
}

.room-bounds-gizmo-handle.hovered {
    stroke-width: 3;
    filter: drop-shadow(0 0 3px rgb(255 255 255 / 0.9));
}

.room-bounds-gizmo-label.hovered {
    filter: drop-shadow(0 0 3px rgb(255 255 255 / 0.9));
}

.room-bounds-gizmo-center {
    fill: white;
    stroke: rgb(0 0 0 / 0.8);
    stroke-width: 2;
    pointer-events: none;
}

.room-bounds-gizmo-handle {
    stroke: white;
    stroke-width: 1.5;
    pointer-events: none;
}

.room-bounds-gizmo-label {
    paint-order: stroke;
    stroke: rgb(0 0 0 / 0.9);
    stroke-width: 3px;
    font-size: 12px;
    font-weight: 800;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

.room-bounds-gizmo-axis.axis-x {
    stroke: #ff5c64;
}

.room-bounds-rotation-ring.axis-x {
    stroke: #ff5c64;
}

.room-bounds-gizmo-handle.axis-x,
.room-bounds-gizmo-label.axis-x {
    fill: #ff5c64;
}

.room-bounds-gizmo-axis.axis-y {
    stroke: #65ef91;
}

.room-bounds-rotation-ring.axis-y {
    stroke: #65ef91;
}

.room-bounds-gizmo-handle.axis-y,
.room-bounds-gizmo-label.axis-y {
    fill: #65ef91;
}

.room-bounds-gizmo-axis.axis-z {
    stroke: #58a6ff;
}

.room-bounds-rotation-ring.axis-z {
    stroke: #58a6ff;
}

.room-bounds-gizmo-handle.axis-z,
.room-bounds-gizmo-label.axis-z {
    fill: #58a6ff;
}

/* The top left of the tour: the client logo, and under it Lageplan and the points of interest. The selected point is
   in the accent color and shows its text below. The list scrolls above the bottom left controls. */
.tour-top-left {
    position: absolute;
    top: var(--tour-margin);
    left: var(--tour-margin);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    /* Narrow windows take a part of the width. */
    --tour-poi-factor: 1;
    width: calc(var(--tour-poi-width) * var(--tour-poi-factor));
    max-width: calc(100% - 2 * var(--tour-margin));
    max-height: calc(100% - 2 * var(--tour-margin) - 2 * var(--tour-control-height) - 40px);
    font-family: var(--tour-font);
    pointer-events: none;
}

.tour-top-left > * {
    pointer-events: auto;
}

/* The client logo: at most 300 x 100 pixels at logo scale 1, and less on small screens. It may be wider than the
   list. The logo sets its width in --logo-width and its shape when it has loaded. */
.tour-client-logo {
    --tour-logo-factor: 1;
    flex: none;
    line-height: 0;
}

.tour-client-logo a {
    display: inline-block;
    border-radius: 4px;
}

.tour-client-logo a:focus-visible {
    outline: 2px solid var(--tour-accent);
    outline-offset: 4px;
}

.tour-client-logo img {
    display: block;
    width: calc(var(--logo-width) * var(--tour-logo-scale, 1) * var(--tour-logo-factor));
    height: auto;
    max-width: calc(100vw / var(--tour-ui-scale) - 2 * var(--tour-margin));
    user-select: none;
}

.tour-client-logo[hidden],
.tour-poi-list[hidden] {
    display: none;
}

.tour-poi-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    border-radius: var(--tour-radius);
}

.tour-poi-button {
    flex: none;
    box-sizing: border-box;
    width: 100%;
    min-height: var(--tour-control-height);
    padding: 11px 15px;
    border: 0;
    border-radius: var(--tour-radius);
    background: var(--tour-surface);
    color: var(--tour-accent);
    font: 700 16px/1.15 var(--tour-font);
    text-align: left;
    overflow-wrap: anywhere;
    cursor: pointer;
    /* The lower corners round again when the text below has folded away. */
    transition: background-color 200ms ease, color 200ms ease, border-radius 0s linear 280ms;
}

/* Lageplan is a button as the other buttons of the tour; the points of interest keep their titles as written. */
.tour-poi-button.tour-lageplan {
    text-transform: uppercase;
}

.tour-poi-button:hover:not(.active) {
    background: var(--tour-surface-hover);
}

.tour-poi-button.active {
    background: var(--tour-accent);
    color: var(--tour-accent-contrast);
}

.tour-poi-button:focus-visible {
    outline: 2px solid var(--tour-accent-contrast);
    outline-offset: -4px;
}

.tour-poi-button.expanded {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    transition: background-color 200ms ease, color 200ms ease, border-radius 0s;
}

/* The text of a point, right below its title. It unfolds when the point is selected and folds away again: the
   grid row grows from 0fr to 1fr, and the text fades in. */
.tour-poi-info-fold {
    flex: none;
    display: grid;
    grid-template-rows: 0fr;
    width: 100%;
    margin-top: -2px;
    transition: grid-template-rows 280ms ease;
}

.tour-poi-info-fold.expanded {
    grid-template-rows: 1fr;
}

.tour-poi-info-clip {
    min-height: 0;
    overflow: hidden;
    border-radius: 0 0 var(--tour-radius) var(--tour-radius);
}

.tour-poi-info {
    box-sizing: border-box;
    width: 100%;
    opacity: 0;
    transition: opacity 180ms ease;
    padding: 14px 15px 16px;
    border-radius: 0 0 var(--tour-radius) var(--tour-radius);
    background: var(--tour-panel);
    color: var(--tour-panel-text);
    font: 400 13px/1.3 var(--tour-font);
    overflow-wrap: anywhere;
    user-select: text;
}

.tour-poi-info-fold.expanded .tour-poi-info {
    opacity: 1;
    transition: opacity 220ms ease 60ms;
}

@media (prefers-reduced-motion: reduce) {
    .tour-poi-button,
    .tour-poi-info-fold,
    .tour-poi-info {
        transition: none !important;
    }
}

.tour-poi-info > :first-child,
.poi-text > :first-child {
    margin-top: 0;
}

.tour-poi-info > :last-child,
.poi-text > :last-child {
    margin-bottom: 0;
}

.tour-poi-info h3,
.poi-text h3 {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 700;
}

.tour-poi-info h4,
.poi-text h4 {
    margin: 10px 0 4px;
    font-size: 13px;
    font-weight: 700;
}

.tour-poi-info p,
.poi-text p,
.tour-poi-info div,
.poi-text div {
    margin: 0 0 6px;
}

.tour-poi-info ul,
.tour-poi-info ol,
.poi-text ul,
.poi-text ol {
    margin: 0 0 6px;
    padding-left: 18px;
}

.tour-poi-info a,
.poi-text a {
    color: inherit;
    text-decoration: underline;
}

@media (max-width: 760px) {
    .tour-top-left {
        --tour-poi-factor: 0.81;
        gap: 12px;
    }

    .tour-client-logo {
        --tour-logo-factor: 0.56;
    }

    .tour-poi-button {
        padding: 9px 12px;
        font-size: 14px;
    }
}

/* The points of interest in the edit panel: the list, and the title, the view, the place and the text of the
   selected point. The text field shows the text as the tour does. */
.poi-editor,
.poi-properties {
    display: grid;
    gap: 8px;
}

.poi-properties[hidden] {
    display: none;
}

.poi-thumbnail {
    width: 100%;
    border-radius: 4px;
}

.poi-thumbnail[hidden] {
    display: none;
}

.poi-actions button:disabled {
    opacity: 0.45;
    cursor: default;
}

.poi-text-editor {
    display: grid;
    gap: 4px;
}

.poi-text-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.poi-text-toolbar select,
.poi-text-toolbar button,
.poi-text-toolbar input[type="color"] {
    box-sizing: border-box;
    height: 26px;
    min-width: 26px;
    padding: 0 6px;
    border: 1px solid rgb(255 255 255 / 0.25);
    border-radius: 4px;
    background: #1b1b1b;
    color: white;
    font: inherit;
    cursor: pointer;
}

.poi-text-toolbar input[type="color"] {
    width: 30px;
    padding: 2px;
}

.poi-text-toolbar button:hover {
    background: #2c2c2c;
}

.poi-text {
    box-sizing: border-box;
    min-height: 140px;
    max-height: 320px;
    overflow-y: auto;
    padding: 10px 12px;
    border: 1px solid rgb(255 255 255 / 0.25);
    border-radius: 4px;
    background: var(--tour-panel);
    color: var(--tour-panel-text);
    font: 400 13px/1.3 var(--tour-font);
    outline: none;
    user-select: text;
    cursor: text;
}

.poi-text:focus {
    border-color: var(--tour-accent);
}

.poi-text:empty::before {
    content: attr(data-placeholder);
    color: rgb(0 0 0 / 0.4);
}

/* The client logo and the colors in the edit panel. The preview shows the logo on a dark checkerboard, as over the
   scene. */
.branding-logo-preview {
    display: grid;
    place-items: center;
    min-height: 64px;
    padding: 10px;
    border: 1px solid rgb(255 255 255 / 0.25);
    border-radius: 4px;
    background: repeating-conic-gradient(#2a2a2a 0 25%, #1e1e1e 0 50%) 0 0 / 16px 16px;
}

.branding-logo-preview img {
    width: calc(var(--logo-width) * var(--tour-logo-scale, 1));
    height: auto;
    max-width: 100%;
}

.branding-logo-preview [hidden] {
    display: none;
}

.branding-logo-preview span {
    color: rgb(255 255 255 / 0.55);
}

.branding-editor button:disabled {
    opacity: 0.45;
    cursor: default;
}

.branding-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
}

.branding-row input[type="url"],
.branding-row input[type="text"] {
    grid-column: 2 / 4;
    min-width: 0;
}

.branding-row select {
    grid-column: 2 / 4;
    min-width: 0;
    height: 26px;
    box-sizing: border-box;
    padding: 0 7px;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 5px;
    background: #111;
    color: white;
}

.branding-row input[type="range"] {
    min-width: 0;
    margin: 0;
}

.branding-row input[type="number"] {
    width: 56px;
}

.branding-row input[type="color"] {
    width: 100%;
    height: 26px;
    padding: 1px 2px;
    border: 1px solid rgb(255 255 255 / 0.25);
    border-radius: 4px;
    background: #1b1b1b;
    cursor: pointer;
}

.walk-path-editor button:disabled {
    opacity: 0.45;
    cursor: default;
}

.walk-path-properties {
    display: grid;
    gap: 9px;
}

/* Walk paths on the floor: the highlight in walk mode and the path editor. */
.walk-path-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    touch-action: none;
}

.walk-path-point,
.walk-path-insert {
    stroke: rgb(0 0 0 / 0.75);
    stroke-width: 1.5;
    pointer-events: all;
    cursor: grab;
}

.walk-path-point {
    fill: #ffc857;
}

.walk-path-point.end {
    fill: #fff3d6;
}

.walk-path-point.selected {
    fill: #ff5c64;
    stroke: white;
    stroke-width: 2;
}

.walk-path-insert {
    fill: rgb(17 17 17 / 0.8);
    stroke: #ffc857;
}

.walk-path-insert-plus {
    stroke: #ffc857;
    stroke-width: 1.5;
    pointer-events: none;
}

.walk-path-overlay.dragging .walk-path-point,
.walk-path-overlay.dragging .walk-path-insert {
    cursor: grabbing;
}

/* The lines of the floor line editors, such as the invisible walls. */
.floor-line-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    touch-action: none;
}

.floor-line-point,
.floor-line-insert {
    stroke: rgb(0 0 0 / 0.75);
    stroke-width: 1.5;
    pointer-events: all;
    cursor: grab;
}

.floor-line-point {
    fill: #ff785a;
}

.floor-line-point.selected {
    fill: #fff3d6;
    stroke: #ff785a;
    stroke-width: 2;
}

.floor-line-insert {
    fill: rgb(17 17 17 / 0.8);
    stroke: #ff785a;
}

.floor-line-insert-plus {
    stroke: #ff785a;
    stroke-width: 1.5;
    pointer-events: none;
}

.floor-line-overlay.dragging .floor-line-point,
.floor-line-overlay.dragging .floor-line-insert {
    cursor: grabbing;
}

/* The handle on the top of a wall, which sets its height. */
.floor-line-height-handle {
    fill: white;
    stroke: #ff785a;
    stroke-width: 2;
    pointer-events: all;
    cursor: ns-resize;
}

.floor-line-height-handle.active,
.floor-line-height-handle:hover {
    fill: #ff785a;
    stroke: white;
}

/* The point cloud boundaries are cyan, apart from the orange walls. */
.point-cloud-boundary-editor-overlay .floor-line-insert,
.point-cloud-boundary-editor-overlay .floor-line-insert-plus {
    stroke: #5ad2ff;
}

.point-cloud-boundary-editor-overlay .floor-line-point {
    fill: #5ad2ff;
}

.point-cloud-boundary-editor-overlay .floor-line-point.selected {
    fill: #e6f8ff;
    stroke: #5ad2ff;
}

/* The invisible boxes are orange, as the walls. */
.invisible-box-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    touch-action: none;
}

.invisible-box-face-handle {
    stroke: rgb(0 0 0 / 0.75);
    stroke-width: 1.5;
    pointer-events: all;
    cursor: grab;
}

.invisible-box-face-handle.axis-x {
    fill: #ff5c64;
}

.invisible-box-face-handle.axis-y {
    fill: #65ef91;
}

.invisible-box-face-handle.axis-z {
    fill: #58a6ff;
}

.invisible-box-face-handle:hover,
.invisible-box-face-handle.active {
    stroke: white;
    stroke-width: 2.5;
}

.invisible-box-overlay.dragging .invisible-box-face-handle,
.invisible-box-overlay.dragging .invisible-box-center-handle {
    cursor: grabbing;
}

/* In Top down mode, the point at the center of the selected box moves it in the horizontal plane. */
.invisible-box-center-handle {
    fill: white;
    stroke: rgb(0 0 0 / 0.75);
    stroke-width: 1.5;
    pointer-events: all;
    cursor: grab;
}

.invisible-box-center-handle:hover,
.invisible-box-center-handle.active {
    stroke: #ffd166;
    stroke-width: 2.5;
}

.edit-panel-row.invisible-box-vector {
    grid-template-columns: 64px repeat(3, minmax(0, 1fr));
}

.edit-panel-row.invisible-box-rotation {
    grid-template-columns: 64px minmax(0, 1fr) 16px;
}

/* The rings around the selected box that turn it about the vertical axis and tilt it. */
.invisible-box-rotation-line {
    fill: none;
    stroke: #ffd166;
    stroke-width: 2;
    stroke-opacity: 0.85;
}

.invisible-box-rotation-hit {
    fill: none;
    stroke: transparent;
    stroke-width: 14;
    pointer-events: stroke;
    cursor: grab;
}

.invisible-box-rotation:hover .invisible-box-rotation-line,
.invisible-box-rotation.active .invisible-box-rotation-line {
    stroke: white;
    stroke-width: 3;
    stroke-opacity: 1;
}

/* The ring that tilts the selected box about its X axis, in the color of that axis. */
.invisible-box-tilt .invisible-box-rotation-line {
    stroke: #ff5c64;
}

/* The circle at the camera position of the point of interest that the mouse is over in the tour list. */
/* The ruler of the scene scale: its line, its ends and its length over the scene. */
.scene-ruler-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.scene-ruler-line {
    stroke: #ffd166;
    stroke-width: 2.5;
    stroke-dasharray: 8 4;
}

.scene-ruler-end {
    fill: #ffd166;
    stroke: rgb(0 0 0 / 0.75);
    stroke-width: 1.5;
}

/* The ring around the start point while the ruler waits for the end point. */
.scene-ruler-start {
    fill: rgb(255 209 102 / 0.18);
    stroke: #ffd166;
    stroke-width: 2;
    filter: drop-shadow(0 0 1.5px rgb(0 0 0 / 0.8));
}

.scene-ruler-label {
    fill: white;
    font: 600 14px system-ui, sans-serif;
    text-anchor: middle;
    paint-order: stroke;
    stroke: rgb(0 0 0 / 0.8);
    stroke-width: 3px;
}

.edit-panel-row.scene-ruler-row {
    grid-template-columns: 64px minmax(0, 1fr) 16px;
}

.edit-panel-row.scene-ruler-fit {
    grid-template-columns: 64px minmax(0, 1fr) 16px auto;
}

.edit-panel-row.scene-ruler-fit[hidden] {
    display: none;
}

.floor-line-ground {
    display: grid;
    gap: 6px;
    margin: 6px 0;
}

.floor-line-ground[hidden],
.floor-line-editor button[hidden] {
    display: none;
}

.edit-panel-row.floor-line-ground-height {
    grid-template-columns: 64px minmax(0, 1fr) auto;
}

.floor-line-editor button:disabled {
    opacity: 0.45;
    cursor: default;
}

.floor-line-properties {
    display: grid;
    gap: 9px;
}

.floor-line-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.floor-line-check[hidden] {
    display: none;
}

.floor-line-check input {
    margin: 0;
}

/* Edit panel: the camera positions, walk paths and LOD sphere sections at the right side, opened with E. The header
   and the footer stay in place, and the sections between them scroll. */
.edit-panel {
    top: 12px;
    right: 12px;
    left: auto;
    z-index: 3;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    width: min(340px, calc(100% - 24px));
    max-height: calc(100% - 24px);
    gap: 8px;
    overflow: hidden;
    padding: 8px;
    font-size: 12px;
    /* Solid, unlike the other interaction panels, so the scene does not show through. */
    background: rgb(10 10 10);
    backdrop-filter: none;
}

.edit-panel-header {
    display: flex;
    flex: none;
    align-items: center;
    gap: 6px;
}

.edit-panel-title {
    margin-right: auto;
    font-size: 13px;
    font-weight: 700;
}

.edit-panel button {
    min-height: 26px;
}

.edit-panel button.edit-panel-expand-all {
    min-height: 22px;
    padding: 0 6px;
    font-size: 11px;
}

.edit-panel button.edit-panel-close {
    width: 24px;
    min-height: 24px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
}

/* The model drop-down under the header. */
.edit-panel-model {
    flex: none;
}

/* A modal dialog with a choice, such as whether to download the changed settings before another model loads. */
.choice-dialog {
    width: min(360px, calc(100% - 32px));
    box-sizing: border-box;
    padding: 14px;
    border: 1px solid rgb(255 255 255 / 0.22);
    border-radius: 6px;
    background: rgb(10 10 10);
    color: white;
    font-size: 13px;
}

.choice-dialog::backdrop {
    background: rgb(0 0 0 / 0.45);
}

.choice-dialog-title {
    font-weight: 700;
}

.choice-dialog-text {
    margin: 8px 0 14px;
    color: rgb(255 255 255 / 0.8);
    line-height: 1.4;
}

.choice-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.choice-dialog-actions button {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 5px;
    background: #111;
    color: white;
    font: inherit;
    cursor: pointer;
}

.choice-dialog-actions button:hover {
    background: #2c2c2c;
}

.choice-dialog-actions button:first-child {
    background: #f4f4f4;
    color: #111;
}

/* The search field under the header. A search hides the sections without the search text. */
.edit-panel-search {
    flex: none;
    box-sizing: border-box;
    width: 100%;
    height: 26px;
    padding: 0 8px;
    border: 1px solid rgb(255 255 255 / 0.22);
    border-radius: 7px;
    background: rgb(36 36 36);
    color: white;
    font: inherit;
}

.edit-panel-search::placeholder {
    color: rgb(255 255 255 / 0.45);
}

.edit-panel-search:focus-visible {
    outline: 2px solid rgb(255 255 255 / 0.55);
    outline-offset: 0;
}

.edit-panel-section.search-hidden {
    display: none;
}

.edit-panel-search-empty {
    padding: 4px 2px;
    color: rgb(255 255 255 / 0.62);
}

/* The scroll bar sits in the padding of the panel, so the sections line up with the header without it. */
.edit-panel-sections {
    display: grid;
    flex: 1 1 auto;
    align-content: start;
    gap: 7px;
    min-height: 0;
    margin-right: -6px;
    padding-right: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

/* Each section is a dark-grey card with rounded corners. */
.edit-panel-section {
    display: grid;
    padding: 0 8px;
    border-radius: 7px;
    background: rgb(36 36 36);
    transition: background-color 120ms ease;
}

/* A collapsed section gets brighter under the pointer. */
.edit-panel-section:has(> .edit-panel-section-title[aria-expanded="false"]:hover) {
    background: rgb(50 50 50);
}

/* The title of a section is a button over the full width of the card that collapses and expands the section body. */
.edit-panel button.edit-panel-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 30px;
    margin: 0 -8px;
    padding: 0 8px;
    border: 0;
    background: none;
    color: rgb(255 255 255 / 0.86);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
}

.edit-panel button.edit-panel-section-title:hover {
    background: none;
    color: white;
}

/* A chevron that points down while the section is open and to the right while it is collapsed. */
.edit-panel-section-title::after {
    content: "";
    width: 6px;
    height: 6px;
    margin-right: 4px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform 0.18s ease-out;
}

.edit-panel-section-title[aria-expanded="false"]::after {
    transform: rotate(-45deg);
}

/* The frame grows from no height to the height of the body and back, and the clip cuts the body meanwhile. A
   collapsed body is hidden, so its controls do not take the focus. */
.edit-panel-section-frame {
    display: grid;
    grid-template-rows: 0fr;
    visibility: hidden;
    transition: grid-template-rows 0.18s ease-out, visibility 0s linear 0.18s;
}

.edit-panel-section-title[aria-expanded="true"] + .edit-panel-section-frame {
    grid-template-rows: 1fr;
    visibility: visible;
    transition: grid-template-rows 0.18s ease-out, visibility 0s;
}

/* The negative margin keeps the focus rings at the sides of the body in the clip. */
.edit-panel-section-clip {
    min-height: 0;
    margin: 0 -3px;
    overflow: hidden;
}

.edit-panel-section-body {
    display: grid;
    gap: 6px;
    padding: 2px 3px 8px;
}

@media (prefers-reduced-motion: reduce) {
    .edit-panel-section-title::after,
    .edit-panel-section-frame,
    .edit-panel-section-title[aria-expanded="true"] + .edit-panel-section-frame {
        transition: none;
    }
}

.edit-panel-body {
    display: grid;
    gap: 6px;
}

/* A scrollable list of named items (itemList.js). A click on an entry selects it; the three-dot button, shown while
   the pointer is on the entry, opens the menu with Rename and Delete. */
.item-list {
    display: grid;
    gap: 2px;
    max-height: 164px;
    margin: 0;
    padding: 2px;
    overflow-y: auto;
    list-style: none;
    border-radius: 6px;
    background: rgb(0 0 0 / 0.3);
    scrollbar-width: thin;
}

.item-list[hidden] {
    display: none;
}

.item-list-entry {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 5px;
}

.item-list-entry:hover,
.item-list-entry:focus-within,
.item-list-entry.menu-open {
    background: rgb(255 255 255 / 0.08);
}

.item-list-entry.selected {
    background: rgb(255 255 255 / 0.17);
}

.edit-panel .item-list button.item-list-select {
    display: flex;
    flex: 1;
    min-width: 0;
    align-items: center;
    gap: 8px;
    min-height: 26px;
    padding: 0 30px 0 8px;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
}

.item-list-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-list-detail {
    flex: none;
    color: rgb(255 255 255 / 0.5);
    font-size: 11px;
}

.item-list-entry.selected .item-list-name {
    font-weight: 700;
}

.edit-panel .item-list button.item-list-more {
    position: absolute;
    top: 50%;
    right: 2px;
    width: 24px;
    min-height: 22px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: none;
    color: rgb(255 255 255 / 0.8);
    font-size: 16px;
    line-height: 1;
    opacity: 0;
    transform: translateY(-50%);
}

.item-list-entry:hover button.item-list-more,
.item-list-entry:focus-within button.item-list-more,
.item-list-entry.menu-open button.item-list-more {
    opacity: 1;
}

.edit-panel .item-list button.item-list-more:hover,
.edit-panel .item-list-entry.menu-open button.item-list-more {
    background: rgb(255 255 255 / 0.14);
    color: white;
}

/* Without a pointer that hovers, the three-dot button stays on the screen. */
@media (hover: none) {
    .edit-panel .item-list button.item-list-more {
        opacity: 1;
    }
}

/* The entry whose item is edited looks like a button that is on. */
.item-list-entry.editing,
.item-list-entry.editing:hover,
.item-list-entry.editing:focus-within {
    background: #f4f4f4;
    color: #111;
}

.item-list-entry.editing .item-list-detail {
    color: rgb(0 0 0 / 0.55);
}

.edit-panel .item-list-entry.editing button.item-list-more,
.edit-panel .item-list-entry.editing button.item-list-more:hover {
    color: #111;
}

.edit-panel .item-list-entry.editing button.item-list-more:hover,
.edit-panel .item-list-entry.editing.menu-open button.item-list-more {
    background: rgb(0 0 0 / 0.1);
}

.item-list-rename {
    flex: 1;
    box-sizing: border-box;
    min-width: 0;
    height: 24px;
    margin: 1px 30px 1px 2px;
    padding: 0 6px;
    border: 1px solid rgb(255 255 255 / 0.55);
    border-radius: 4px;
    background: rgb(0 0 0 / 0.6);
    color: white;
    font: inherit;
}

.item-list-rename:focus {
    border-color: white;
    outline: none;
}

.item-list-menu {
    position: fixed;
    z-index: 10;
    display: grid;
    min-width: 112px;
    padding: 3px;
    border: 1px solid rgb(255 255 255 / 0.22);
    border-radius: 6px;
    background: rgb(28 28 28);
    box-shadow: 0 6px 18px rgb(0 0 0 / 0.5);
}

.item-list-menu[hidden] {
    display: none;
}

.edit-panel .item-list-menu button {
    min-height: 26px;
    padding: 0 8px;
    border: 0;
    border-radius: 4px;
    background: none;
    font: inherit;
    text-align: left;
}

.edit-panel .item-list-menu button:hover,
.edit-panel .item-list-menu button:focus-visible {
    background: rgb(255 255 255 / 0.12);
    outline: none;
}

.edit-panel .item-list-menu button[data-action="delete"] {
    color: #ff8a80;
}

.edit-panel-row {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 64px;
    align-items: center;
    gap: 6px;
}

.edit-panel-row.edit-panel-row-wide {
    grid-template-columns: 64px minmax(0, 1fr);
}

/* The check boxes of a camera setting with a list of values, such as the mode buttons, and the camera modes of a
   wall or a box. */
.camera-settings-set {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
}

.camera-settings-set label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.camera-settings-set input {
    margin: 0;
}

.edit-panel-subtitle {
    margin-top: 2px;
    color: rgb(255 255 255 / 0.62);
    font-weight: 600;
}

/* A line above each subsection after the first one separates it from the subsection before it. */
.edit-panel-subtitle:not(:first-child) {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid rgb(255 255 255 / 0.16);
}

.edit-panel-row input[type="range"] {
    min-width: 0;
    margin: 0;
}

.edit-panel-row input[type="number"],
.edit-panel-row input[type="text"],
.edit-panel-row select {
    min-width: 0;
    height: 26px;
    box-sizing: border-box;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 5px;
    background: #111;
    color: white;
    padding: 0 7px;
}

.edit-panel .interaction-panel-actions {
    flex-wrap: wrap;
}

.edit-panel-footer {
    flex: none;
    justify-content: flex-end;
    padding-top: 8px;
    border-top: 1px solid rgb(255 255 255 / 0.18);
}

.edit-panel-footer button:disabled {
    opacity: 0.45;
    cursor: default;
}

/* The drone bumper, color edit and filmic settings in their sections of the edit panel: dense rows of a label, a
   slider, its value and a reset button. */
.settings-rows {
    display: grid;
    gap: 2px;
}

.settings-rows label {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr) 40px 22px;
    align-items: center;
    gap: 6px;
    /* The negative margin lets the hover band reach the sides of the section clip. */
    margin: 0 -3px;
    padding: 1px 3px;
    border-radius: 4px;
    color: rgb(255 255 255 / 0.9);
    line-height: 1.2;
}

.settings-rows label:hover {
    background: rgb(255 255 255 / 0.05);
}

.settings-rows label:has(input:disabled) {
    opacity: 0.42;
}

.settings-rows label.filmic-number-control,
.settings-rows label.filmic-select-control {
    grid-template-columns: 104px minmax(0, 1fr);
}

.settings-rows input[type="range"],
.settings-rows input[type="checkbox"] {
    margin: 0;
    accent-color: #f4f4f4;
}

.settings-rows input[type="range"] {
    width: 100%;
    min-width: 0;
}

.settings-rows input[type="number"],
.settings-rows select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 24px;
    padding: 0 6px;
    border: 1px solid rgb(255 255 255 / 0.3);
    border-radius: 4px;
    background: #111;
    color: white;
    font: inherit;
}

.settings-rows output {
    color: rgb(255 255 255 / 0.78);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.settings-rows .slider-reset {
    width: 20px;
    height: 20px;
    min-height: 0;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 0.16);
    border-radius: 4px;
    background: transparent;
    color: rgb(255 255 255 / 0.5);
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

.settings-rows label:hover .slider-reset {
    border-color: rgb(255 255 255 / 0.32);
    color: rgb(255 255 255 / 0.85);
}

.settings-rows .slider-reset:hover {
    background: rgb(255 255 255 / 0.12);
    color: white;
}

.settings-rows button:focus-visible,
.settings-rows select:focus-visible,
.settings-rows input:focus-visible {
    outline: 2px solid rgb(255 255 255 / 0.55);
    outline-offset: 1px;
}

.settings-rows .settings-note {
    color: rgb(255 255 255 / 0.62);
    line-height: 1.35;
}

/* The subtitles of the filmic settings look like those of the other sections. */
.filmic-section-title {
    margin-top: 6px;
    padding-bottom: 2px;
    color: rgb(255 255 255 / 0.62);
    font-weight: 600;
}

#filmicPanel .filmic-section-title:first-child {
    margin-top: 0;
}

/* The master switch reads as a header rather than one more setting. */
#filmicPanel label.filmic-master-toggle {
    grid-template-columns: 1fr auto;
    margin-bottom: 2px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgb(255 255 255 / 0.14);
    border-radius: 0;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

#filmicPanel label.filmic-master-toggle:hover {
    background: none;
}

/* Deliberately larger than the other checkboxes: it governs the whole section. */
#filmicPanel #filmicEnabled {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* The buttons at the end of a section, such as a load and a download of only its settings. */
.settings-rows .section-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    padding-top: 4px;
}

/* The Applies to drop-down at the top of the Color edit and the Filmic settings sections, with its note and the Use
   global button. */
.settings-rows .look-target {
    display: grid;
    gap: 3px;
    margin-bottom: 4px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgb(255 255 255 / 0.14);
}

.settings-rows .look-target-state {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.edit-panel .settings-rows .look-target-state button {
    flex: none;
    min-height: 22px;
    padding: 0 8px;
}

/* Camera path: the options, the keyframe list and the overlay with the curve and the numbered keyframes. */
.camera-path-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.camera-path-check input {
    margin: 0;
}

.camera-path-check:has(input:disabled) {
    opacity: 0.45;
    cursor: default;
}

.camera-path-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.camera-path-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto 30px;
    align-items: center;
    gap: 6px;
}

.camera-path-row button {
    padding: 0 8px;
}

.camera-path-row button:disabled {
    opacity: 0.45;
    cursor: default;
}

.camera-path-row .camera-path-select {
    text-align: left;
}

.camera-path-row.selected .camera-path-select {
    border-color: #c792ff;
    color: #e6d2ff;
}

.camera-path-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.camera-path-overlay[hidden] {
    display: none;
}

.camera-path-keyframe circle {
    fill: #7b3fc4;
    stroke: white;
    stroke-width: 1.5;
    pointer-events: all;
    cursor: pointer;
}

.camera-path-keyframe.selected circle {
    fill: #c792ff;
}

.camera-path-keyframe text {
    fill: white;
    font-size: 11px;
    font-weight: 700;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

/* The Bezier handles of the selected keyframe. */
.camera-path-handle {
    fill: #1b1225;
    stroke: #c792ff;
    stroke-width: 2;
    pointer-events: all;
    cursor: pointer;
}

.camera-path-handle.selected {
    fill: #c792ff;
    stroke: white;
}

/* LOD sphere: the panel, the outline of the sphere and the arrows that move it. */
.lod-sphere-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
}

.lod-sphere-check input {
    margin: 0;
}

.lod-sphere-check:has(input:disabled) {
    opacity: 0.45;
    cursor: default;
}

.edit-panel-row.lod-sphere-center {
    grid-template-columns: 64px repeat(3, minmax(0, 1fr));
}

.lod-sphere-editor input:disabled,
.lod-sphere-editor button:disabled {
    opacity: 0.45;
    cursor: default;
}

.lod-sphere-overlay {
    --sphere-color: #63d9ff;
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    touch-action: none;
}

.bounding-sphere-overlay {
    --sphere-color: #ffb454;
}

/* The X, Y and Z arrows of translateGizmo.js, in the overlays of the sphere and point editors. */
/* The axis line and the mode of a move or a scale with the G and S keys. */
.key-transform-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.key-transform-axis {
    stroke-width: 1.5;
    stroke-dasharray: 8 6;
}

.key-transform-axis.axis-x {
    stroke: #ff5c64;
}

.key-transform-axis.axis-y {
    stroke: #65ef91;
}

.key-transform-axis.axis-z {
    stroke: #58a6ff;
}

.key-transform-label {
    paint-order: stroke;
    fill: #ffffff;
    stroke: rgb(0 0 0 / 0.85);
    stroke-width: 3px;
    font-size: 12px;
    font-weight: 700;
}

.gizmo-axis-line {
    stroke-width: 3;
    stroke-linecap: round;
    pointer-events: none;
}

.gizmo-axis-tip {
    stroke: rgb(0 0 0 / 0.6);
    stroke-width: 1;
    pointer-events: none;
}

.gizmo-axis-label {
    paint-order: stroke;
    stroke: rgb(0 0 0 / 0.9);
    stroke-width: 3px;
    font-size: 12px;
    font-weight: 800;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
}

.gizmo-axis-hit {
    stroke: rgb(255 255 255 / 0.001);
    stroke-width: 18;
    stroke-linecap: round;
    pointer-events: stroke;
    cursor: grab;
}

.dragging .gizmo-axis-hit {
    cursor: grabbing;
}

.gizmo-axis:hover .gizmo-axis-line,
.gizmo-axis.active .gizmo-axis-line {
    stroke-width: 5;
    filter: drop-shadow(0 0 3px rgb(255 255 255 / 0.9));
}

.gizmo-axis.axis-x .gizmo-axis-line {
    stroke: #ff5c64;
}

.gizmo-axis.axis-y .gizmo-axis-line {
    stroke: #65ef91;
}

.gizmo-axis.axis-z .gizmo-axis-line {
    stroke: #58a6ff;
}

.gizmo-axis.axis-x .gizmo-axis-tip,
.gizmo-axis.axis-x .gizmo-axis-label {
    fill: #ff5c64;
}

.gizmo-axis.axis-y .gizmo-axis-tip,
.gizmo-axis.axis-y .gizmo-axis-label {
    fill: #65ef91;
}

.gizmo-axis.axis-z .gizmo-axis-tip,
.gizmo-axis.axis-z .gizmo-axis-label {
    fill: #58a6ff;
}

.lod-sphere-radius-handle {
    fill: white;
    stroke: var(--sphere-color);
    stroke-width: 2.5;
    filter: drop-shadow(0 0 2px rgb(0 0 0 / 0.9));
    pointer-events: all;
    cursor: grab;
}

.lod-sphere-radius-handle:hover,
.lod-sphere-radius-handle.active {
    fill: var(--sphere-color);
    stroke: white;
}

.lod-sphere-overlay.dragging .lod-sphere-radius-handle {
    cursor: grabbing;
}

.lod-sphere-center {
    fill: white;
    stroke: rgb(0 0 0 / 0.8);
    stroke-width: 2;
    pointer-events: none;
}

/* In Top down mode, the center point moves the sphere in the horizontal plane. */
.lod-sphere-center.plane-drag {
    pointer-events: all;
    cursor: grab;
}

.lod-sphere-center.plane-drag:hover {
    stroke: #ffd166;
}

@media (max-width: 760px) {
    #app.comparison-mode {
        --comparison-panel-width: calc(100vw - 24px);
        --comparison-view-width: max(1px, calc((100vw - 36px) / 2));
        --comparison-view-height: max(1px, calc(52vh - 24px));
        --comparison-view-top: 12px;
        --comparison-render-left: 6px;
        --comparison-reference-left: calc(
            var(--comparison-render-left) + var(--comparison-view-width) + 6px
        );
    }

    #comparisonPanel {
        top: auto;
        right: 12px;
        bottom: 12px;
        left: 12px;
        width: auto;
        height: min(46vh, 480px);
        max-height: calc(100% - 24px);
        overflow-y: auto;
    }

    #comparisonPanel .comparison-camera-section {
        min-height: 130px;
    }

    .comparison-image-label {
        top: calc(var(--comparison-view-top) + 5px);
        padding: 3px 5px;
        font-size: 10px;
    }

    #comparisonRenderedLabel {
        left: calc(var(--comparison-render-left) + 5px);
    }

    #comparisonOriginalLabel {
        left: calc(var(--comparison-reference-left) + 5px);
    }

    #app[data-comparison-view="overlay"] #comparisonOriginalLabel {
        left: calc(var(--comparison-render-left) + var(--comparison-view-width) - 5px);
    }
}

@media (max-width: 420px) {
    .comparison-camera-header {
        display: grid;
    }

    .comparison-order-control {
        justify-content: space-between;
    }

    #comparisonOrder {
        flex: 1;
    }

    .comparison-load-grid button,
    .comparison-view-buttons button {
        padding-right: 3px;
        padding-left: 3px;
        font-size: 11px;
    }
}

/* Labels in the scene: a dot on the labelled point and the text to its right. */
.scene-labels {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0s linear 0s;
}

/* The top-down view hides all labels: they fade out and take no clicks. */
.scene-labels.off {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.scene-labels.off .scene-label {
    pointer-events: none;
}

.scene-label {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    margin: -7px 0 0 -7px;
    padding: 0;
    border: 0;
    background: none;
    color: white;
    font: inherit;
    cursor: pointer;
    pointer-events: auto;
    transition: opacity 0.35s ease;
    will-change: transform;
}

.scene-label-dot {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    box-sizing: border-box;
    border: 2px solid rgb(0 0 0 / 0.6);
    border-radius: 50%;
    background: var(--label-color, #ffffff);
    box-shadow: 0 1px 4px rgb(0 0 0 / 0.5);
}

.scene-label-text {
    max-width: 240px;
    padding: 3px 8px;
    overflow: hidden;
    border-radius: 5px;
    background: var(--label-background, rgb(16 17 20 / 0.86));
    color: var(--label-text-color, #ffffff);
    font-size: var(--label-text-size, 12px);
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgb(0 0 0 / 0.35);
}

/* A label whose point the scene hides fades out, and so does a label beyond the hide distance. */
.scene-label.occluded,
.scene-label.far {
    opacity: 0;
    pointer-events: none;
}

.scene-label:hover .scene-label-dot {
    outline: 2px solid white;
    outline-offset: 1px;
}

#app.adding-label #webgpuCanvas {
    cursor: crosshair;
}

/* The label controls of the edit panel: "Add label" and the dot color of new labels in one line, then a card for
   each label. */
.scene-label-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.scene-label-new-color {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    color: rgb(255 255 255 / 0.75);
    cursor: pointer;
}

/* The slider of the distance beyond which all labels hide. */
.scene-label-distance {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 44px;
    align-items: center;
    gap: 8px;
    color: rgb(255 255 255 / 0.75);
}

.scene-label-distance input[type="range"] {
    min-width: 0;
    margin: 0;
}

.scene-label-distance output {
    color: white;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.scene-label-list {
    display: grid;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* A card: the dot color, the text, Show and Delete in the first line, the text style under the text. */
.scene-label-row {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto 26px;
    align-items: center;
    gap: 6px;
    padding: 6px;
    border-radius: 6px;
    background: rgb(0 0 0 / 0.28);
}

.scene-label-row:focus-within {
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.22);
}

.scene-label-style {
    display: flex;
    flex-wrap: wrap;
    grid-column: 2 / -1;
    align-items: center;
    gap: 4px 12px;
    color: rgb(255 255 255 / 0.75);
}

.scene-label-style label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

/* The color pickers show their color in a swatch with a light edge, so that a dark color shows on the dark panel. */
.scene-label-editor input[type="color"] {
    width: 22px;
    height: 22px;
    padding: 0;
    box-sizing: border-box;
    border: 0;
    border-radius: 4px;
    background: none;
    cursor: pointer;
}

.scene-label-editor input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.scene-label-editor input[type="color"]::-webkit-color-swatch {
    border: 1px solid rgb(255 255 255 / 0.5);
    border-radius: 4px;
}

.scene-label-editor input[type="color"]::-moz-color-swatch {
    border: 1px solid rgb(255 255 255 / 0.5);
    border-radius: 4px;
}

/* The dot color is round, as the dot of the label in the scene. */
.scene-label-editor input[type="color"].scene-label-dot-input {
    width: 20px;
    height: 20px;
    justify-self: center;
    border-radius: 50%;
}

.scene-label-editor input.scene-label-dot-input::-webkit-color-swatch {
    border: 2px solid rgb(0 0 0 / 0.6);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.5);
}

.scene-label-editor input.scene-label-dot-input::-moz-color-swatch {
    border: 2px solid rgb(0 0 0 / 0.6);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.5);
}

/* The text field shows the text in the text color on the background color of the label. */
.scene-label-row input.scene-label-text-input {
    min-width: 0;
    height: 28px;
    box-sizing: border-box;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 5px;
    background: var(--label-background, #111);
    color: var(--label-text-color, white);
    padding: 0 7px;
    user-select: text;
}

.scene-label-row input.scene-label-text-input::placeholder {
    color: currentColor;
    opacity: 0.5;
}

.scene-label-style input[type="number"] {
    width: 48px;
    height: 24px;
    box-sizing: border-box;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 5px;
    background: #111;
    color: white;
    padding: 0 4px;
}

.edit-panel .scene-label-row button {
    min-height: 28px;
    padding: 0;
}

.edit-panel .scene-label-row button.scene-label-show {
    padding: 0 8px;
}

.edit-panel .scene-label-row button.scene-label-delete {
    font-size: 15px;
    line-height: 1;
}

/* The color picker of the label colors (colorPopover.js), in place of the browser's picker: the recent colors, a
   field of saturation and brightness, a hue slider, the hex value and the eyedropper, in a dark box under the field. */
.color-popover {
    position: fixed;
    z-index: 20;
    display: grid;
    gap: 8px;
    box-sizing: border-box;
    width: 220px;
    padding: 10px;
    border: 1px solid rgb(255 255 255 / 0.18);
    border-radius: 8px;
    background: rgb(28 28 28);
    color: white;
    font-size: 12px;
    box-shadow: 0 10px 30px rgb(0 0 0 / 0.5);
}

.color-popover[hidden],
.color-popover-recent[hidden],
.color-popover-pick[hidden] {
    display: none;
}

.color-popover-recent {
    display: flex;
    gap: 6px;
}

.color-popover-recent button {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 0.45);
    border-radius: 5px;
    cursor: pointer;
}

.color-popover-recent button:hover {
    border-color: white;
}

/* The recent color that the picker has now. */
.color-popover-recent button.current {
    box-shadow: 0 0 0 2px rgb(28 28 28), 0 0 0 3px white;
}

.color-popover-recent button:focus-visible,
.color-popover-pick:focus-visible {
    outline: 2px solid rgb(255 255 255 / 0.7);
    outline-offset: 1px;
}

/* Saturation grows to the right and brightness to the top. */
.color-popover-area {
    position: relative;
    height: 132px;
    border-radius: 6px;
    background:
        linear-gradient(to top, #000, transparent),
        linear-gradient(to right, #fff, var(--hue-color, #f00));
    cursor: crosshair;
    touch-action: none;
    outline: none;
}

.color-popover-area:focus-visible {
    box-shadow: 0 0 0 2px rgb(255 255 255 / 0.55);
}

.color-popover-thumb {
    position: absolute;
    width: 14px;
    height: 14px;
    box-sizing: border-box;
    margin: -7px 0 0 -7px;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgb(0 0 0 / 0.55), 0 1px 3px rgb(0 0 0 / 0.5);
    pointer-events: none;
}

.color-popover-hue {
    width: 100%;
}

.color-popover input.color-popover-hue::-webkit-slider-runnable-track {
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, #f00, #ff0 16.67%, #0f0 33.33%, #0ff 50%, #00f 66.67%, #f0f 83.33%, #f00);
}

.color-popover input.color-popover-hue::-moz-range-track {
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(to right, #f00, #ff0 16.67%, #0f0 33.33%, #0ff 50%, #00f 66.67%, #f0f 83.33%, #f00);
}

.color-popover input.color-popover-hue::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
    box-sizing: border-box;
    margin-top: -2px;
    border: 2px solid white;
    background: transparent;
    box-shadow: 0 0 0 1px rgb(0 0 0 / 0.55);
}

.color-popover input.color-popover-hue::-moz-range-thumb {
    width: 14px;
    height: 14px;
    box-sizing: border-box;
    border: 2px solid white;
    background: transparent;
    box-shadow: 0 0 0 1px rgb(0 0 0 / 0.55);
}

.color-popover-row {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 6px;
}

.color-popover-preview {
    height: 28px;
    box-sizing: border-box;
    border: 1px solid rgb(255 255 255 / 0.45);
    border-radius: 5px;
}

.color-popover-hex {
    min-width: 0;
    height: 28px;
    box-sizing: border-box;
    padding: 0 8px;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 5px;
    background: #111;
    color: white;
    font: inherit;
    font-variant-numeric: tabular-nums;
    user-select: text;
}

.color-popover-hex:focus-visible {
    outline: 2px solid rgb(255 255 255 / 0.55);
    outline-offset: 0;
}

.color-popover-pick {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 5px;
    background: #111;
    color: white;
    cursor: pointer;
}

.color-popover-pick:hover {
    background: #2c2c2c;
}

/* The joystick of Frei and Walk mode on touch screens. The UI scale multiplies its size and its distances from the
   edges, instead of a CSS zoom: Safari gives the bounding box of a zoomed element divided by the zoom, but the touch
   positions not, so that the knob would follow another point than the finger. Along the bottom edge, it stands at
   `--tour-stick-position` of its free space, which STICK POSITION in the settings menu sets (stickPosition.js): from
   `--tour-stick-left` at 0 to 20px beside the Gyro button and the realitour logo at 1. On a tablet, it stands 16px
   above the rows of buttons at the bottom left, the quality row and the camera mode row, or only the camera mode row
   in the player, so its free space starts at the left margin. */
.touch-joystick {
    --tour-stick-left: calc(var(--tour-margin) * var(--tour-ui-scale));
    --tour-stick-right: calc((var(--tour-margin) + 61px) * var(--tour-ui-scale));
    position: absolute;
    left: calc(var(--tour-stick-left) + var(--tour-stick-position, 1) * max(0px, 100% - var(--tour-stick-left) -
        var(--tour-stick-right) - var(--tour-stick-size) * var(--tour-ui-scale)));
    bottom: calc((var(--tour-margin) + 2 * var(--tour-control-height) + 26px) * var(--tour-ui-scale));
    z-index: 3;
    width: calc(var(--tour-stick-size) * var(--tour-ui-scale));
    height: calc(var(--tour-stick-size) * var(--tour-ui-scale));
    border-radius: 50%;
    color: var(--tour-accent);
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

#app.player-mode .touch-joystick {
    bottom: calc((var(--tour-margin) + var(--tour-control-height) + 16px) * var(--tour-ui-scale));
}

.touch-joystick[hidden] {
    display: none;
}

.touch-joystick > svg,
.touch-joystick-knob svg {
    display: block;
    width: 100%;
    height: 100%;
    /* The joystick itself is the target of the touch, for its offsetX and offsetY (touchJoystick.js). */
    pointer-events: none;
}

.touch-joystick-knob {
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(var(--tour-stick-size) * 0.55 * var(--tour-ui-scale));
    height: calc(var(--tour-stick-size) * 0.55 * var(--tour-ui-scale));
    margin: calc(var(--tour-stick-size) * -0.275 * var(--tour-ui-scale)) 0 0
        calc(var(--tour-stick-size) * -0.275 * var(--tour-ui-scale));
    pointer-events: none;
    transition: transform 0.12s ease-out;
}

.touch-joystick.dragging .touch-joystick-knob {
    transition: none;
}

/* The Gyro button stands alone above the realitour logo, as large as the logo, without a background: its gyro icon
   has the color of the other icons, and red while the gyro is off, also when the browser sends no orientation. */
#app .touch-control-toggle {
    position: absolute;
    right: calc(var(--tour-margin) - 1px);
    bottom: calc(var(--tour-margin) + 74px);
    z-index: 3;
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    padding: 0;
    border: 0;
    border-radius: var(--tour-radius);
    background: none;
    color: var(--tour-accent);
    cursor: pointer;
    touch-action: manipulation;
    zoom: var(--tour-ui-scale);
}

#app .touch-control-toggle.gyro-off {
    color: #ff4d4f;
}

#app .touch-control-toggle[hidden] {
    display: none;
}

#app .touch-control-toggle svg {
    display: block;
    width: 43px;
    height: 43px;
}

#app .touch-control-toggle:focus-visible {
    outline: 2px solid var(--tour-accent);
    outline-offset: 2px;
}

/* The menu button of the list of Lageplan and the points of interest shows only on phones. */
#app:not(.phone-layout) .tour-menu-button {
    display: none;
}

#app:not(.phone-layout) .tour-menu-button + button {
    border-top-left-radius: var(--tour-radius);
    border-bottom-left-radius: var(--tour-radius);
}

/* The layout of phones, as the realitour design: the controls are 40px high, 10px from the edges, and the joystick
   is 100px wide. The camera mode buttons are gone: portrait is Walk mode and landscape Fly mode. The menu, help and
   settings buttons stand over each other at the bottom left, and the settings button opens the quality menu. The list
   of Lageplan and the points of interest shows only from the menu button, above the buttons. */
#app.phone-layout {
    --tour-margin: 10px;
    --tour-control-height: 40px;
    --tour-stick-size: 100px;
}

#app.phone-layout #cameraModeControls {
    display: none;
}

/* The tool buttons are one group, as on the desktop, in a column: the first shown button has the round corners at the
   top, the last shown one at the bottom. */
#app.phone-layout #tourToolButtons {
    flex-direction: column;
}

#app.phone-layout #tourToolButtons button {
    display: grid;
    border-radius: 0;
}

#app.phone-layout #tourToolButtons button[hidden] {
    display: none;
}

#app.phone-layout #tourToolButtons > :nth-child(1 of :not([hidden])) {
    border-top-left-radius: var(--tour-radius);
    border-top-right-radius: var(--tour-radius);
}

#app.phone-layout #tourToolButtons > :nth-last-child(1 of :not([hidden])) {
    border-bottom-left-radius: var(--tour-radius);
    border-bottom-right-radius: var(--tour-radius);
}

#app.phone-layout .player-menu {
    left: calc(var(--tour-margin) + var(--tour-control-height) + 10px);
    bottom: var(--tour-margin);
}

/* EXIT TOUR is as high as the client logo of the design, with its words on two lines. */
#app.phone-layout .tour-end-button {
    height: 50px;
    padding: 0 10px;
    font-size: 15px;
    line-height: 1.15;
}

/* The top left reaches down to 10px above the three tool buttons, with their gaps of 2px. The client logo stays at
   the top, and the open list stands at the bottom, as wide and as large as on the desktop; it scrolls when it is
   higher than the space below the logo. */
#app.phone-layout .tour-top-left {
    --tour-poi-factor: 1;
    bottom: calc(var(--tour-margin) + 3 * var(--tour-control-height) + 4px + 10px);
    max-height: none;
}

#app.phone-layout .tour-client-logo {
    --tour-logo-factor: 0.83;
}

#app.phone-layout .tour-poi-list {
    margin-top: auto;
}

#app.phone-layout .tour-poi-button {
    padding: 11px 15px;
    font-size: 16px;
}

#app.phone-layout:not(.tour-menu-open) .tour-poi-list {
    display: none;
}

/* Landscape: the open list hides the client logo, the other tool buttons and the stick (viewerApp.js), and ends 10px
   above the menu button. */
#app.phone-layout.phone-landscape.tour-menu-open #tourToolButtons > button:not(.tour-menu-button) {
    display: none;
}

#app.phone-layout.phone-landscape.tour-menu-open #tourToolButtons > .tour-menu-button {
    border-radius: var(--tour-radius);
}

#app.phone-layout.phone-landscape.tour-menu-open .tour-top-left {
    bottom: calc(var(--tour-margin) + var(--tour-control-height) + 10px);
}

#app.phone-layout.phone-landscape.tour-menu-open .tour-client-logo {
    display: none;
}

/* The stick of a phone stands at the bottom, between 20px beside the menu, help and settings buttons and 20px beside
   the realitour logo: by default at the center in portrait and at the right in landscape. */
#app.phone-layout .touch-joystick {
    --tour-stick-left: calc((var(--tour-margin) + var(--tour-control-height) + 20px) * var(--tour-ui-scale));
    bottom: calc(var(--tour-margin) * var(--tour-ui-scale));
}

/* The help of phones lies between the client logo and the tool buttons in portrait, and between the tool buttons and
   the realitour logo in landscape. It has no X: the help button and a tap beside the panel close it. */
#app.phone-layout .tour-help {
    padding: calc(var(--tour-margin) + 60px) calc(2 * var(--tour-margin))
        calc(var(--tour-margin) + 3 * var(--tour-control-height) + 4px + 10px);
}

#app.phone-layout.phone-landscape .tour-help {
    padding: calc(var(--tour-margin) + 60px) calc(var(--tour-margin) + var(--tour-control-height) + 20px)
        var(--tour-margin);
}

#app.phone-layout .tour-help-close {
    display: none;
}

#app.phone-layout .tour-help-panel {
    width: 100%;
    padding: 28px 16px 40px;
}

#app.phone-layout.phone-landscape .tour-help-panel {
    max-width: 640px;
    padding: 24px;
}

/* The help of Fly and Walk mode on touch screens: in one column, each icon with its text beside it; on phones in
   landscape in two columns, the look around at the left with its text below its icon, and the icons at the right on
   one center line. */
.tour-help-section[data-help-section="touchFlight"] {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: center;
    gap: 34px;
}

.tour-help-section[data-help-section^="touchFlight"] .tour-help-item {
    width: auto;
    max-width: 100%;
    justify-content: center;
    gap: 22px;
    font-size: 15px;
    text-align: left;
    white-space: pre-line;
}

.tour-help-section[data-help-section^="touchFlight"] .tour-help-icon,
.tour-help-section[data-help-section^="touchFlight"] .tour-help-text {
    min-width: 0;
}

.tour-help-section[data-help-section="touchFlightLandscape"] {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    align-items: center;
    gap: 34px 36px;
}

.tour-help-section[data-help-section="touchFlightLandscape"] .tour-help-item.stacked {
    grid-row: 1 / span 3;
    flex-direction: column;
    align-items: center;
    gap: 22px;
}

.tour-help-section[data-help-section="touchFlightLandscape"] .tour-help-item:not(.stacked) {
    grid-column: 2;
    justify-content: flex-start;
}

.tour-help-section[data-help-section="touchFlightLandscape"] .tour-help-item:not(.stacked) .tour-help-icon {
    margin-left: calc((100px - var(--icon-width)) / 2);
}

/* On phones, the load percentage shows below the client logo. */
#app.phone-layout .load-progress {
    top: calc(var(--tour-margin) + 96px);
    bottom: auto;
}

/* A low landscape window keeps the help on the screen. */
@media (max-height: 380px) {
    #app.phone-layout.phone-landscape .tour-help-panel {
        padding: 14px 24px;
    }

    .tour-help-section[data-help-section="touchFlightLandscape"] {
        row-gap: 12px;
    }
}

/* The hint that Fly mode needs landscape, above the move stick, on the two lines of its text in the help. */
.phone-rotate-hint {
    position: absolute;
    left: 50%;
    bottom: calc(var(--tour-margin) + var(--tour-stick-size) + 16px);
    z-index: 3;
    transform: translateX(-50%);
    padding: 8px 14px;
    border-radius: var(--tour-radius);
    background: var(--tour-surface);
    color: white;
    font: 600 14px/1.2 var(--tour-font);
    text-align: center;
    white-space: pre-line;
    pointer-events: none;
}

.phone-rotate-hint[hidden] {
    display: none;
}

.player-menu-edit {
    height: var(--tour-control-height);
    border: 0;
    border-radius: 6px;
    background: rgb(255 255 255 / 0.08);
    color: var(--tour-accent);
    font: 700 16px/1 var(--tour-font);
    text-transform: uppercase;
    cursor: pointer;
}

/* The Ortho button of the top-down view, at the bottom right beside the logo, and its Exit top down button at the
   bottom center, which shows while the edit panel is open. Pressed, the Ortho button makes the view orthographic. */
.top-down-projection-toggle,
.top-down-exit {
    position: absolute;
    right: calc(var(--tour-margin) + 56px);
    bottom: var(--tour-margin);
    z-index: 3;
}

.top-down-exit {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
}

.top-down-projection-toggle[hidden],
.top-down-exit[hidden] {
    display: none;
}

/* The circle of the top-down brush at the pointer; dashed while it erases. */
.top-down-brush-cursor {
    position: absolute;
    z-index: 3;
    border: 2px solid rgb(255 255 255 / 0.9);
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgb(0 0 0 / 0.5), inset 0 0 0 1px rgb(0 0 0 / 0.5);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.top-down-brush-cursor[hidden] {
    display: none;
}

.top-down-brush-cursor.erasing {
    border-style: dashed;
}

/* The load percentage at the bottom center while a scene loads. */
.load-progress {
    position: absolute;
    left: 50%;
    bottom: calc(var(--tour-margin) + var(--tour-control-height) + 12px);
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    transform: translateX(-50%);
    background: rgb(10 10 10 / 0.72);
    border: 1px solid rgb(255 255 255 / 0.18);
    border-radius: 999px;
    color: rgb(255 255 255 / 0.9);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    backdrop-filter: blur(12px);
    pointer-events: none;
    transition: opacity 0.4s ease 0.2s;
}

.load-progress.hidden {
    display: none;
}

.load-progress.done {
    opacity: 0;
}

.load-progress-track {
    position: relative;
    width: 120px;
    height: 4px;
    overflow: hidden;
    border-radius: 2px;
    background: rgb(255 255 255 / 0.18);
}

.load-progress-bar {
    position: absolute;
    inset: 0;
    background: rgb(255 255 255 / 0.9);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.25s ease-out;
}

.load-progress-text {
    min-width: 3.2em;
    text-align: right;
}

/* The menu of a point of a line in the view, which a right click on the point opens. */
.point-menu button {
    min-height: 26px;
    padding: 0 8px;
    border: 0;
    border-radius: 4px;
    background: none;
    color: #ff8a80;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.point-menu button:hover,
.point-menu button:focus-visible {
    background: rgb(255 255 255 / 0.12);
    outline: none;
}

/* The geofront interface (uiStyle.js), as the geofront viewer: dark buttons with white text in groups with a light
   border, the active one light grey, without capital letters, 12px from the edges. Under the mouse, a camera mode
   button shows the controls of its mode above the buttons. The geofront logo is at the bottom right. The tour parts
   that the geofront interface does not have, the help, Lageplan, the orientation aid and the hint about Escape, hide
   in tourUi.js; the colors and the UI scale of the branding do not apply. */
#app.ui-geofront {
    --tour-accent: #f4f4f4;
    --tour-accent-contrast: #111;
    --tour-surface: #111;
    --tour-surface-hover: #2c2c2c;
    --tour-panel: rgb(10 10 10 / 0.92);
    --tour-panel-text: rgb(255 255 255 / 0.9);
    --tour-radius: 5px;
    --tour-margin: 12px;
    --tour-control-height: 32px;
    --tour-font: "Ubuntu Sans", Arial, sans-serif;
    --tour-poi-width: 234px;
    --geofront-border: rgb(255 255 255 / 0.35);
    --geofront-group: rgb(10 10 10 / 0.78);
    --geofront-logo-width: 180px;
}

#app.ui-geofront .tour-client-logo,
#app.ui-geofront .player-menu-size {
    display: none;
}

#app.ui-geofront #bottomLeftStack,
#app.ui-geofront #bottomLeftControls {
    gap: 8px;
}

#app.ui-geofront #bottomLeftStack {
    max-width: calc(100% - 3 * var(--tour-margin) - var(--geofront-logo-width));
}

/* A group has no gaps between its buttons, and one border around them. */
#app.ui-geofront #cameraModeControls,
#app.ui-geofront .tour-button-group,
#app.ui-geofront #qualityControls,
#app.ui-geofront .tour-poi-list {
    gap: 0;
    border: 1px solid var(--geofront-border);
    border-radius: var(--tour-radius);
    background: var(--geofront-group);
    backdrop-filter: blur(12px);
}

#app.ui-geofront #cameraModeControls {
    position: relative;
}

#app.ui-geofront #cameraModeControls button,
#app.ui-geofront .tour-button-group button,
#app.ui-geofront #qualityControls button,
#app.ui-geofront #qualityControls .quality-label,
#app.ui-geofront #recordBtn,
#app.ui-geofront #cameraPathBtn,
#app.ui-geofront .tour-end-button,
#app.ui-geofront .top-down-projection-toggle,
#app.ui-geofront .top-down-exit {
    padding: 0 10px;
    font: 500 14px/1 var(--tour-font);
    text-transform: none;
}

#app.ui-geofront #cameraModeControls button {
    min-width: 0;
    height: calc(var(--tour-control-height) - 2px);
}

#app.ui-geofront #qualityControls button,
#app.ui-geofront #qualityControls .quality-label,
#app.ui-geofront .tour-button-group button {
    height: calc(var(--tour-control-height) - 2px);
}

#app.ui-geofront #qualityControls .quality-label {
    background: none;
    font-size: 13px;
}

#app.ui-geofront .tour-button-group button {
    width: calc(var(--tour-control-height) + 2px);
}

#app.ui-geofront .tour-button-group svg {
    width: 18px;
    height: 18px;
}

#app.ui-geofront #recordBtn,
#app.ui-geofront #cameraPathBtn,
#app.ui-geofront .tour-end-button,
#app.ui-geofront .top-down-projection-toggle,
#app.ui-geofront .top-down-exit {
    border: 1px solid var(--geofront-border);
}

#app.ui-geofront #cameraModeControls button:focus-visible,
#app.ui-geofront .tour-button-group button:focus-visible,
#app.ui-geofront #qualityControls button:focus-visible {
    outline-offset: -3px;
}

/* The help of a camera mode button, above the group at its left edge. */
.camera-mode-tooltip {
    display: none;
}

#app.ui-geofront #cameraModeControls .camera-mode-tooltip {
    position: absolute;
    left: 0;
    bottom: calc(100% + 10px);
    z-index: 4;
    display: grid;
    gap: 3px;
    width: max-content;
    max-width: min(340px, calc(100vw - 24px));
    padding: 9px 10px;
    border: 1px solid rgb(255 255 255 / 0.22);
    border-radius: var(--tour-radius);
    background: rgb(10 10 10 / 0.92);
    color: white;
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.32);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    opacity: 0;
    pointer-events: none;
    text-align: left;
    transform: translateY(4px);
    transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
    visibility: hidden;
    white-space: normal;
}

#app.ui-geofront #cameraModeControls .camera-mode-tooltip > span {
    display: block;
}

#app.ui-geofront #cameraModeControls .camera-mode-tooltip strong {
    font-weight: 700;
}

#app.ui-geofront #cameraModeControls button:hover .camera-mode-tooltip,
#app.ui-geofront #cameraModeControls button:focus-visible .camera-mode-tooltip {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

/* A locked pointer keeps the hover state of the button that it was locked over. */
#app.ui-geofront #cameraModeControls.pointer-locked .camera-mode-tooltip {
    display: none;
}

/* The white geofront logo at the bottom right opens geofront.eu in a new window. The Ortho button of the top-down
   view stands beside it. */
#app.ui-geofront .tour-brand-logo {
    color: white;
}

#app.ui-geofront .top-down-projection-toggle {
    right: calc(2 * var(--tour-margin) + var(--geofront-logo-width));
}

#app.ui-geofront .tour-brand-logo svg {
    width: var(--geofront-logo-width);
    height: auto;
}

/* The points of interest at the top left, in one group; the selected one is light grey and shows its text below. */
#app.ui-geofront .tour-top-left {
    gap: 8px;
}

#app.ui-geofront .tour-poi-button {
    min-height: calc(var(--tour-control-height) - 2px);
    padding: 8px 10px;
    border-radius: 0;
    font: 500 14px/1.25 var(--tour-font);
}

#app.ui-geofront .tour-poi-info-fold {
    margin-top: 0;
}

#app.ui-geofront .tour-poi-info-clip,
#app.ui-geofront .tour-poi-info {
    border-radius: 0;
}

#app.ui-geofront .tour-poi-info {
    padding: 10px;
    font-family: var(--tour-font);
}

#app.ui-geofront .tour-poi-info a {
    color: white;
}

/* The Gyro button stands above the geofront logo. */
#app.ui-geofront .touch-control-toggle {
    right: var(--tour-margin);
    bottom: calc(var(--tour-margin) + var(--geofront-logo-width) * 183.7 / 730.1 + 8px);
}

#app.ui-geofront .touch-joystick {
    --tour-stick-right: calc(2 * var(--tour-margin) + var(--geofront-logo-width));
}

@media (hover: none), (pointer: coarse) {
    #app.ui-geofront {
        --tour-control-height: 44px;
    }

    #app.ui-geofront #cameraModeControls button {
        min-width: 44px;
    }

    #app.ui-geofront #cameraModeControls .camera-mode-tooltip {
        display: none;
    }
}

/* Phones keep the stick, the gyro and their layout; the logo is smaller, so that the stick has room beside it. */
#app.ui-geofront.phone-layout {
    --tour-margin: 10px;
    --geofront-logo-width: 120px;
}

#app.ui-geofront.phone-layout #tourToolButtons button {
    width: calc(var(--tour-control-height) + 2px);
}

#app.ui-geofront.phone-layout .touch-joystick {
    --tour-stick-left: calc(var(--tour-margin) + var(--tour-control-height) + 20px);
}

#app.ui-geofront.phone-layout .tour-top-left {
    bottom: calc(var(--tour-margin) + 3 * var(--tour-control-height) + 10px);
}

/* ui=none: the scene alone, as a picture in a web page. Every element of the viewer but the canvas stays hidden, also
   the ones that the camera modes and the tour add later. */
#app.ui-hidden > :not(#webgpuCanvas) {
    display: none !important;
}
