/* Copyright (c) 2026 geofront.eu. All rights reserved. */

html,
body,
#app {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
}

#app {
    position: relative;
}

.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;
}

#webgpuCanvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    outline: none;
    touch-action: none;
}

#cornerLogo {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    width: 180px;
}

#cornerLogo img {
    display: block;
    width: 100%;
    height: auto;
}

#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 #cameraModeControls,
#app.comparison-mode #stats {
    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 {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: calc(100% - 24px);
    padding: 8px;
    background: rgb(10 10 10 / 0.78);
    border: 1px solid rgb(255 255 255 / 0.22);
    border-radius: 6px;
    backdrop-filter: blur(12px);
}

#toolbar label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

#toolbar select,
#toolbar button,
#cameraModeControls button {
    height: 32px;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 5px;
    background: #111;
    color: white;
    padding: 0 10px;
}

#toolbar button,
#cameraModeControls button {
    cursor: pointer;
}

#toolbar button:hover,
#cameraModeControls button:hover {
    background: #2c2c2c;
}

#toolbar > button.active,
#cameraModeControls button.active {
    background: #f4f4f4;
    color: #111;
}

#cameraModeControls {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 2;
    display: inline-flex;
    overflow: visible;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 5px;
    background: rgb(10 10 10 / 0.78);
    backdrop-filter: blur(12px);
}

#cameraModeControls button {
    border: 0;
    border-radius: 0;
    overflow: visible;
}

#cameraModeControls button:first-child {
    border-top-left-radius: 4px;
    border-bottom-left-radius: 4px;
}

#cameraModeControls button:last-child {
    border-top-right-radius: 4px;
    border-bottom-right-radius: 4px;
}

#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: 5px;
    background: rgb(10 10 10 / 0.92);
    color: white;
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.32);
    font-size: 13px;
    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;
}

#cameraModeControls .camera-mode-tooltip span {
    display: block;
}

#cameraModeControls .camera-mode-tooltip strong {
    font-weight: 700;
}

#cameraModeControls button:hover .camera-mode-tooltip,
#cameraModeControls button:focus-visible .camera-mode-tooltip,
#cameraModeControls.help-visible button.active .camera-mode-tooltip {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

@media (hover: none), (pointer: coarse) {
    #cameraModeControls:not(.help-visible) .camera-mode-tooltip {
        display: none;
    }

    #cameraModeControls button {
        min-width: 44px;
        height: 44px;
    }
}

#toolbar 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"] {
    width: 108px;
}

#colorEditPanel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    display: grid;
    gap: 8px;
    width: 288px;
    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);
}

#colorEditPanel label {
    display: grid;
    grid-template-columns: 88px minmax(96px, 1fr) 42px;
    align-items: center;
    gap: 8px;
}

#colorEditPanel input[type="range"] {
    width: 100%;
}

#colorEditPanel output {
    color: rgb(255 255 255 / 0.78);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.color-edit-actions {
    display: flex;
    justify-content: flex-end;
}

.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;
}

.point-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;
}

.point-camera-target {
    width: 54px;
    height: 54px;
}

.top-down-camera-cursor {
    width: 34px;
    height: 34px;
}

.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: 70px;
    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) {
    #cornerLogo {
        width: 100px;
    }

    #toolbar {
        right: 12px;
        flex-wrap: wrap;
    }

    #cameraModeControls {
        left: 50%;
        max-width: calc(100% - 24px);
        transform: translateX(-50%);
    }

    #cameraModeControls .camera-mode-tooltip {
        left: 50%;
        transform: translate(-50%, 4px);
    }

    #cameraModeControls button:hover .camera-mode-tooltip,
    #cameraModeControls button:focus-visible .camera-mode-tooltip,
    #cameraModeControls.help-visible button.active .camera-mode-tooltip {
        transform: translate(-50%, 0);
    }

    #toolbar select:first-child {
        flex: 1 1 160px;
    }

    #stats {
        left: 12px;
        right: auto;
        bottom: 56px;
    }
}

.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;
}

@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;
    }
}
