/*
    Refactored CSS
    - единообразные отступы (4 пробела)
    - сохранил визуальную структуру оригинала
*/
:root {
    --bg: transparent;
    --ink: #111;
    --muted: #667;
    --border: rgba(17, 17, 17, 0.14);
    --borderStrong: rgba(17, 17, 17, 0.22);
    --accent: #0b57d0;
    /* `backdrop-filter` is expensive; keep blur modest. */
    --glassBlur: 10px;
    --surface: rgba(255, 255, 255, 0.72);
    --surfaceStrong: rgba(255, 255, 255, 0.86);
    --surfaceWeak: rgba(255, 255, 255, 0.52);
    --controlBg: rgba(255, 255, 255, 0.60);
    --controlBgHover: rgba(255, 255, 255, 0.78);
    --shadow: none;
    --shadowStrong: none;
    --inset: none;
    --appbarH: 48px;
    --camsBarH: 0px;
    --sideW: 460px;
    --footerH: 28px;
    --mobileViewportH: 100vh;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--ink);
    background: transparent;
}

body.mobile-immersive {
    min-height: calc(var(--mobileViewportH, 100vh) + 1px);
}

body.app-loading {
    background: #fff;
    overflow: hidden;
}

.boot-loader {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    opacity: 1;
    visibility: visible;
    transition: opacity 220ms ease, visibility 220ms ease;
}

.boot-loader.is-leaving {
    opacity: 0;
    visibility: hidden;
}

.boot-loader-card {
    width: min(440px, calc(100vw - 48px));
    display: grid;
    gap: 10px;
    justify-items: center;
    text-align: center;
}

.boot-loader-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: lowercase;
}

.boot-loader-text {
    font-size: 13px;
    color: #5f6470;
    max-width: 38rem;
}

.boot-loader-track {
    position: relative;
    height: 9px;
    border-radius: 999px;
    border: 1px solid #111;
    background: #fff;
    overflow: hidden;
    width: 100%;
}

.boot-loader-bar {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: #111;
    transition: width 180ms ease;
}

.boot-loader-pct {
    font-size: 12px;
    color: #364055;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

body.app-boot-error .boot-loader-title,
body.app-boot-error .boot-loader-text,
body.app-boot-error .boot-loader-pct {
    color: #111;
}

body.app-boot-error .boot-loader-track {
    border-color: #b42318;
}

body.app-boot-error .boot-loader-bar {
    background: #b42318;
}

/* Enforce native `hidden` attribute behavior across browsers. */
[hidden] { display: none !important; }

/* <!-- --------------------------- -->
<!--      DEBUG SHADDOW PANNEL      -->
<!-- --------------------------- --> */

/* Shadows debug panel */
    .debug-panel{
    position: fixed;
    top: calc(var(--appbarH) + var(--camsBarH) + 8px);
    left: 8px;
    z-index: 20;
	    width: 320px;
	    background: var(--surfaceStrong);
	    border: 1px solid var(--border);
	    border-radius: 10px;
	    box-shadow: var(--shadow);
	    padding: 10px;
	    -webkit-backdrop-filter: blur(var(--glassBlur));
	    backdrop-filter: blur(var(--glassBlur));
	    display: none;
	    }
    .debug-panel.show{ display:block; }
    .debug-panel h4{ margin:0; font-size:13px; font-weight:600; }
    .debug-panel .hdr{ display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
    .debug-panel .row{ display:flex; align-items:center; gap:8px; margin:6px 0; }
    .debug-panel label{ font-size:12px; display:flex; justify-content:space-between; width:100%; gap:8px; }
    .debug-panel input[type="number"]{ width:120px; }
    .debug-panel select{ width:120px; }


/* <!-- ------------------------------- -->
<!--    END OF DEBUG SHADDOW PANNEL     -->
<!-- ----------------------------------> */


/* GeoJSON tab inside the side panel */
.doc {
    margin-left: 8px;
    padding: 0;
    border: 0;
    /* background: transparent; */
    font: inherit;
    line-height: 1;
    cursor: pointer;
    user-select: none;
}
.doc:hover { opacity: .75; }


.collapsible {
    position: relative;
    margin: 8px 0;
}

.collapsible > details {
    margin: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px;
    background: var(--surfaceWeak);
}

.collapsible > details > summary {
    position: relative;
    display: flex;
    align-items: center;
    padding-right: 56px;
}

.collapsible > details > summary .sumline {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    overflow: hidden;
}

.collapsible > details > summary .sumline span:last-of-type {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collapsible-controls {
    position: absolute;
    top: 12px;
    right: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.collapsible-controls .eye,
.collapsible-controls .doc {
    margin: 0;
}

.glass-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    padding: 8px 0 4px;
}

.glass-group label {
    display: grid;
    grid-template-columns: max-content 1fr max-content;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.glass-group label span:first-child {
    font-weight: 600;
    min-width: 40px;
}

.glass-controls input[type="range"] {
    width: 100%;
}

.glass-group:not(.glass-source-wrap) .glass-value {
    justify-self: end;
}

.glass-value {
    min-width: 34px;
    text-align: right;
    font-size: 12px;
    color: var(--muted);
}

.glass-source {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.glass-source-wrap {
    display: flex;
    justify-content: flex-end;
}

.light-controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 8px 0;
}

.light-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.light-section-title {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.light-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.light-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--muted);
    padding: 4px 0;
}

.light-checkbox input {
    width: 16px;
    height: 16px;
}

.light-checkbox-toggle {
    width: 24px;
    padding: 0;
    justify-content: center;
    gap: 0;
}

.light-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.light-label {
    flex: 0 0 90px;
    font-size: 12px;
    color: var(--muted);
}

.light-row select,
.light-row input[type="range"] {
    flex: 1;
    min-width: 0;
}

.light-row input[type="color"] {
    width: 48px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: none;
}

.light-row .glass-value-input {
    flex: 0 0 64px;
    text-align: right;
}


.light-duo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.light-duo .light-label {
    flex: 0 0 auto;
}

.light-duo input[type="color"] {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: none;
}

.light-hemi {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.light-hemi .light-label {
    flex: 0 0 auto;
}

.light-hemi input[type="range"] {
    flex: 1;
}

.light-hemi .glass-value-input {
    flex: 0 0 64px;
}



.glass-global-controls {
    gap: 12px;
    padding-top: 8px;
}

.glass-global-controls .glass-group label {
    grid-template-columns: 110px 1fr 56px;
    font-size: 13px;
}

.glass-global-controls .glass-group label span:first-child {
    font-weight: 600;
    color: var(--muted);
}

.glass-global-controls .glass-group input[type="range"] {
    width: 85%;
    justify-self: start;
}

.glass-global-controls .glass-value {
    font-variant-numeric: tabular-nums;
}

.glass-value-input {
    width: 56px;
    padding: 2px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #fff;
    color: var(--ink);
}

.glass-value-input:focus {
    outline: none;
    border-color: var(--accent);
}

.glass-value-input[type="text"] {
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.glass-value-input[type="number"]::-webkit-outer-spin-button,
.glass-value-input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.glass-value-input[type="number"] {
    -moz-appearance: textfield;
}

.glass-global-controls input[type="color"] {
    width: 48px;
    height: 24px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: none;
}

.glass-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 6px;
}



	.appbar {
	    position: fixed;
	    inset: 0 0 auto 0; /* верхняя панель */
	    display: flex;
	    align-items: center;
	    gap: 10px;
	    flex-wrap: wrap;
	    padding: 0 10px;
	    background: var(--surfaceWeak);
	    -webkit-backdrop-filter: blur(var(--glassBlur));
	    backdrop-filter: blur(var(--glassBlur));
	    z-index: 5;
	    min-height: 48px;
	}

	.cams-bar {
	    position: fixed;
	    top: var(--appbarH);
	    left: 0;
	    right: 0;
	    z-index: 4;
	    padding: 6px 10px;
	    background: var(--surfaceStrong);
	    -webkit-backdrop-filter: blur(var(--glassBlur));
	    backdrop-filter: blur(var(--glassBlur));
	}

.cams-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

.btn.cam-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border-radius: 999px;
    padding: 6px 12px;
    max-width: 260px;
    cursor: grab;
    user-select: none;
}

.btn.cam-chip.dragging {
    opacity: 0.6;
}

.btn.cam-chip .cam-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn.cam-chip .cam-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-left: 1px solid var(--border);
    padding-left: 10px;
}

.btn.cam-chip .cam-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    line-height: 1;
    opacity: 0.7;
    font-weight: 700;
    cursor: pointer;
}

.btn.cam-chip .cam-icon.cam-props {
    width: 16px;
    height: 16px;
    font-size: 16px;
    transform: translateY(-5px);
}

.btn.cam-chip .cam-icon.cam-refresh {
    width: 20px;
    height: 20px;
    font-size: 20px;
    transform: translateY(-2px);
}

.btn.cam-chip:hover .cam-icon {
    opacity: 1;
}

.btn.cam-add {
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 700;
    line-height: 1;
}

.btn.cam-transition,
.btn.cam-play {
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-weight: 700;
}

.btn.cam-transition {
    font-size: 14px;
}

.btn.cam-play {
    font-size: 12px;
}

.btn.cam-play.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.cams-side-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 8px;
}

.cams-side-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cams-side-item .btn.cam-chip {
    flex: 1 1 auto;
    min-width: 0;
}

details.cam-props-panel {
    position: fixed;
    top: calc(var(--appbarH) + var(--camsBarH) + 8px);
    left: 8px;
    z-index: 12;
    width: min(420px, calc(100vw - 16px));
	    max-height: calc(100vh - var(--appbarH) - var(--camsBarH) - 16px);
	    overflow: auto;
	    margin: 0;
	    background: var(--surfaceStrong);
	    border: 1px solid var(--border);
	    box-shadow: var(--shadow);
	    -webkit-backdrop-filter: blur(var(--glassBlur));
	    backdrop-filter: blur(var(--glassBlur));
	}

.cam-props {
    padding-top: 8px;
}

.cam-props-root {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cam-props-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.cam-props-group {
	    border: 1px dashed var(--border);
	    border-radius: 10px;
	    padding: 8px;
	    background: var(--surfaceWeak);
	}

.cam-props-head {
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 6px;
}

.cam-props-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.cam-props-grid.cam-props-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cam-props-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    font-size: 12px;
}

.cam-props-cap {
    color: var(--muted);
    font-size: 11px;
    line-height: 1;
}

.cam-props-field input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: var(--controlBg);
    color: var(--ink);
}

.cam-props-field select {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    background: var(--controlBg);
    color: var(--ink);
}

.cam-props-field input[type="color"] {
    padding: 0;
    height: 34px;
}

details.cam-props-panel .btn.active:not(.primary) {
    background: rgba(0, 0, 0, 0.08);
    border-color: var(--borderStrong);
}

body.bg-black details.cam-props-panel .btn.active:not(.primary) {
    background: rgba(255, 255, 255, 0.12);
}

.cam-props-text {
    min-width: 0;
}

.cam-props-hint {
    font-size: 12px;
    line-height: 1.3;
}

.appbar .row {
    background: transparent;
    display: flex;
    align-items: center;
    gap: 6px;
}

.appbar .row label {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.appbar select {
    border: 1px solid var(--border);
    color: var(--ink);
    background: var(--controlBg);
    padding: 6px 10px;
    border-radius: 8px;
    line-height: 1.3;
    height: 28px;
    font: inherit;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
}
.appbar select:hover {
    border-color: var(--borderStrong);
}

.btn {
    border: 1px solid var(--border);
    background: var(--controlBg);
    padding: 6px 6px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--ink);
    text-decoration: none;
    box-shadow: var(--inset);
}

.btn .icon,
.anno-toolbar .icon {
    width: 18px;
    height: 18px;
    display: block;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.btn .btn-label {
    pointer-events: none;
}

.icon.icon-line circle,
.icon.icon-pin circle {
    fill: currentColor;
    stroke: none;
}

.appbar #toggleSideBtn,
.appbar #fullscreenBtn,
.appbar #resetViewBtn,
.appbar #focusPickBtn,
.appbar #exportBtn,
.appbar #collabPanelBtn,
.appbar #annoToggleBtn,
.appbar #bgToggleBtn {
    width: 28px;
    height: 28px;
    padding: 0;
    font-size: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.btn:hover {
    border-color: var(--borderStrong);
    background: var(--controlBgHover);
}

.btn:active { transform: translateY(0.5px); }

.btn.primary {
    background: var(--accent);
    color: #fff;
    border-color: rgba(0, 0, 0, 0);
    box-shadow: none;
}

.btn.danger {
    background: rgba(198, 40, 40, 0.12);
    border-color: rgba(198, 40, 40, 0.35);
    color: #b71c1c;
}

.btn.danger:hover {
    background: rgba(198, 40, 40, 0.18);
    border-color: rgba(198, 40, 40, 0.5);
}

body.bg-black .btn.danger {
    background: rgba(239, 83, 80, 0.18);
    border-color: rgba(239, 83, 80, 0.5);
    color: #ffd3d3;
}

body.bg-black .btn.danger:hover {
    background: rgba(239, 83, 80, 0.26);
}

.appbar .btn.active:not(.bg-btn):not(.primary) {
    background: rgba(0, 0, 0, 0.08);
    border-color: var(--borderStrong);
}

body.bg-black .appbar .btn.active:not(.bg-btn):not(.primary) {
    background: rgba(255, 255, 255, 0.12);
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn:disabled:hover {
    border-color: var(--border);
    background: var(--controlBg);
}

.btn:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 2px solid rgba(11, 87, 208, 0.45);
    outline-offset: 2px;
}

.muted { color: var(--muted); }

#viewer {
    position: fixed;
    top: 0;
    right: var(--sideW);
    bottom: 0;
    left: 0;
    background: transparent;
}

.annotate-canvas {
    position: fixed;
    top: calc(var(--appbarH) + var(--camsBarH));
    left: 0;
    width: calc(100vw - var(--sideW));
    height: calc(100vh - var(--appbarH) - var(--camsBarH));
    pointer-events: none;
    touch-action: none;
    z-index: 3;
}

.annotate-canvas.active {
    pointer-events: auto;
    cursor: crosshair;
}

.anno-toolbar {
    position: fixed;
    top: calc(var(--appbarH) + var(--camsBarH) + 12px);
    left: calc((100vw - var(--sideW)) / 2);
    transform: translateX(-50%);
    z-index: 6;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--surfaceStrong);
    color: var(--ink);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(var(--glassBlur));
    backdrop-filter: blur(var(--glassBlur));
    max-width: calc(100vw - var(--sideW) - 32px);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

.anno-toolbar .anno-divider {
    width: 1px;
    height: 22px;
    background: var(--border);
    opacity: 0.85;
    flex: 0 0 auto;
}

.anno-toolbar .anno-btn,
.anno-toolbar .anno-tool {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    line-height: 1;
    user-select: none;
    flex: 0 0 auto;
}

.anno-toolbar .anno-tool {
    font-size: 14px;
}

.anno-toolbar .btn.active {
    background: rgba(0, 0, 0, 0.08);
    border-color: var(--borderStrong);
}

body.bg-black .anno-toolbar .btn.active {
    background: rgba(255, 255, 255, 0.12);
}

.anno-toolbar .anno-color input[type="color"] {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: none;
    cursor: pointer;
}

.anno-toolbar .anno-select {
    padding: 4px 8px;
    border-radius: 999px;
    height: 28px;
    font-size: 12px;
}

.anno-toolbar .anno-layer-select {
    min-width: 120px;
}

.anno-toolbar .anno-number {
    width: 56px;
    height: 28px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--controlBg);
    color: var(--ink);
    font: inherit;
    box-sizing: border-box;
}

button.status-overlay {
    position: fixed;
    left: 50%;
    bottom: calc(50% + 100px);
    transform: translate(-50%, 50%);
    background: rgba(255, 255, 255, 0.8);
    color: #000000;
    padding: 8px 18px;
	    border-radius: 999px;
	    font-size: 13px;
	    line-height: 1.2;
	    max-width: 80vw;
	    text-align: center;
	    pointer-events: auto;
	    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: opacity 0.2s ease;
    z-index: 6;
}
body.bg-black button.status-overlay {
    background: rgba(0, 0, 0, 0.82);
    color: #ffffff;
}
#emptyHint.status-overlay {
    transform: translate(-50%, 50%);
}

#status.status-overlay {
    position: fixed;
    left: 50%;
    bottom: calc(50% + 100px);
    transform: translate(-50%, 50%);
    background: rgba(255, 255, 255, 0.8);
    color: #000000;
    padding: 8px 18px;
	    border-radius: 999px;
	    font-size: 13px;
	    line-height: 1.2;
	    max-width: 80vw;
	    text-align: center;
	    pointer-events: none;
	    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: opacity 0.2s ease;
    z-index: 6;
}
#status.status-overlay[hidden] {
    display: none;
}
#status.status-overlay.has-progress {
    display: grid;
    gap: 7px;
    justify-items: center;
    min-width: min(320px, 72vw);
    padding: 10px 16px 12px;
    border-radius: 12px;
}
.status-overlay-text {
    display: block;
}
.status-progress-track {
    position: relative;
    width: 100%;
    height: 7px;
    margin-top: 3mm;
    border-radius: 999px;
    border: 1px solid #111;
    background: #fff;
    overflow: hidden;
}
.status-progress-bar {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: #111;
    transition: width 180ms ease;
}
.status-progress-track.is-indeterminate .status-progress-bar {
    width: 38%;
    animation: status-progress-slide 1.1s ease-in-out infinite;
    transition: none;
}
body.bg-black .status-progress-track {
    border-color: #ffffff;
    background: #000000;
}
body.bg-black .status-progress-bar {
    background: #ffffff;
}
@keyframes status-progress-slide {
    0% { transform: translateX(-120%); }
    50% { transform: translateX(80%); }
    100% { transform: translateX(260%); }
}
body.bg-black #status.status-overlay {
    background: rgba(0, 0, 0, 0.82);
    color: #ffffff;
}

.side {
    position: fixed;
    top: calc(var(--appbarH) + var(--camsBarH));
    right: 0;
    bottom: 0;
    width: var(--sideW);
    background: var(--surface);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: 13px;
    scrollbar-gutter: stable;
}

.side::before {
    content: '';
    flex: 1 1 auto;
    min-height: 0;
}



/* строка внутри summary, чтобы не трогать сам summary и его маркер */
.sumline{ display:flex; align-items:center; gap:8px; }

/* бейдж протокола */
.badge{
display:inline-block;
padding:2px 10px;
border:1px solid var(--border);
border-radius:999px;
line-height:1.2;
font-size:12px;
font-weight:700;
	background: var(--controlBg);
/* важное: убираем любые тени/аутлайны */
box-shadow:none; outline:0;
}

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.list {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 0 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

#out {
    margin-top: 8px;
    max-height: calc(100vh - var(--appbarH) - var(--camsBarH) - 260px);
    min-height: 0;
    overflow: auto;
    flex: 0 0 auto;
}

details {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px;
    margin: 8px 0;
    background: var(--surfaceWeak);
}
summary { cursor: pointer; font-weight: 600; }

table { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 13px; }
td { padding: 4px 6px; border-top: 1px dashed var(--border); vertical-align: top; }
td.k { width: 140px; color: #334; }
td:not(.k) { overflow-wrap: anywhere; word-break: break-word; }

.chip { display: inline-block; border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; font-size: 11px; }
.tag  { display: inline-block; padding: 2px 6px; border: 1px solid var(--border); border-radius: 999px; margin: 2px 4px 0 0; font-size: 12px; max-width: 100%; overflow-wrap: anywhere; }

select {
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--controlBg);
    color: var(--ink);
    max-width: 100%;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: none;
}
#matSelect { flex: 1 1 auto; width: 100%; min-width: 0; }
input[type="range"] { width: 120px; }

.custom-select {
    position: relative;
    display: inline-block;
    min-width: 0;
}

.custom-select.custom-select-block {
    display: block;
    width: 100%;
}

.custom-select.custom-select-block .custom-select-trigger {
    width: 100%;
}

select.custom-select-native,
select.custom-select-native:disabled {
    opacity: 0;
    pointer-events: none;
    width: 100%;
    height: 100%;
}

.custom-select-trigger {
    position: absolute;
    inset: 0;
    border: 1px solid var(--border);
    background: var(--controlBg);
    color: var(--ink);
    padding: 6px 10px;
    border-radius: 8px;
    line-height: 1.3;
    min-height: 28px;
    font: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    box-sizing: border-box;
}

.custom-select-trigger::after { display: none; }

.custom-select-trigger:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.custom-select-label {
    flex: 1;
    min-width: 0;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-select-list {
    position: fixed;
    display: none;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    background: var(--surfaceStrong);
    color: var(--ink);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadowStrong);
    -webkit-backdrop-filter: blur(var(--glassBlur));
    backdrop-filter: blur(var(--glassBlur));
    z-index: 80;
    overflow: auto;
    overscroll-behavior: contain;
}

.custom-select-list.is-open { display: flex; }

.custom-select-option {
    border: 1px solid transparent;
    background: transparent;
    color: inherit;
    padding: 6px 8px;
    border-radius: 8px;
    text-align: left;
    font: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.custom-select-option-delete {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 4px;
    opacity: 0.7;
    cursor: pointer;
}

.custom-select-option-delete svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.custom-select-option-delete:hover {
    opacity: 1;
}

.custom-select-option:hover,
.custom-select-option:focus-visible {
    background: rgba(0, 0, 0, 0.06);
}

.custom-select-option.is-selected {
    background: rgba(0, 0, 0, 0.08);
    font-weight: 600;
}

.custom-select-option:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.custom-select-prompt .custom-select-trigger {
    padding: 10px 34px 10px 12px;
    border-radius: 10px;
}

.custom-select-anno .custom-select-trigger {
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
}

.collab-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 6px;
}

.collab-drawer {
    position: fixed;
    left: 50%;
    bottom: calc(50% - 320px);
    transform: translateX(-50%);
    width: min(360px, calc(100vw - 24px));
    z-index: 6;
}

.collab-drawer.empty-hint-overlay {
    bottom: calc(50% + 100px);
    transform: translate(-50%, 50%);
}

body.room-entry-landing #emptyHint.status-overlay {
    display: none !important;
}

body.room-entry-landing .collab-drawer.room-entry-overlay {
    left: 50%;
    right: auto;
    top: auto;
    bottom: calc(50% + 100px);
    transform: translate(-50%, 50%);
    width: min(360px, calc(100vw - 24px));
    padding: 0;
}

body.room-entry-landing .appbar {
    justify-content: flex-end;
}

body.room-entry-landing #toggleSideBtn,
body.room-entry-landing #fullscreenBtn,
body.room-entry-landing #resetViewerBtn,
body.room-entry-landing #resetViewBtn,
body.room-entry-landing #focusPickBtn,
body.room-entry-landing #exportBtn,
body.room-entry-landing .appbar-shading,
body.room-entry-landing #solidToggleBtn,
body.room-entry-landing #collToggleBtn,
body.room-entry-landing #vpmToggleBtn,
body.room-entry-landing #npmToggleBtn,
body.room-entry-landing #camsToggleBtn,
body.room-entry-landing #collabPanelBtn,
body.room-entry-landing #annoToggleBtn {
    display: none !important;
}

body.room-entry-landing .app-footer .footer-btn:not(#collabStatusBtn),
body.room-entry-landing #collabFooter,
body.room-entry-landing #collabChatToggleBtn {
    display: none !important;
}

body.room-entry-landing .app-footer .footer-left {
    width: 100%;
    justify-content: flex-end;
}

body.room-entry-landing .collab-status-btn {
    min-width: 82px;
}

.auth-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 6px 12px 12px;
    background: var(--surfaceStrong);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(var(--glassBlur));
    backdrop-filter: blur(var(--glassBlur));
}

.auth-head {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-title {
    font-size: 12px;
    font-weight: 600;
}

.auth-room-entry {
    display: none;
    gap: 12px;
    padding: 0;
}

.auth-room-entry-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.auth-room-entry-field {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.auth-room-entry-field-label {
    margin-bottom: 2px;
}

.auth-room-entry-display {
    box-sizing: border-box;
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--controlBg);
    color: var(--ink);
    font-size: 13px;
    line-height: 1.3;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.auth-close {
    margin-left: auto;
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.auth-close .icon {
    width: 16px;
    height: 16px;
}

.auth-body {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.auth-fields {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.auth-field,
.auth-actions,
.auth-back {
    max-height: 0;
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    overflow: hidden;
    transition: max-height 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.auth-panel[data-mode="login"] .auth-email,
.auth-panel[data-mode="register"] .auth-email,
.auth-panel[data-mode="register"] .auth-name,
.auth-panel[data-mode="roomEntry"] .auth-name,
.auth-panel[data-mode="login"] .auth-password,
.auth-panel[data-mode="register"] .auth-password,
.auth-panel[data-mode="register"] .auth-password-confirm {
    overflow: visible;
}

.auth-panel[data-mode="login"] .auth-email,
.auth-panel[data-mode="register"] .auth-email {
    max-height: 80px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.auth-panel[data-mode="register"] .auth-name,
.auth-panel[data-mode="roomEntry"] .auth-name {
    max-height: 80px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.auth-panel[data-mode="login"] .auth-password,
.auth-panel[data-mode="register"] .auth-password {
    max-height: 80px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.auth-panel[data-mode="register"] .auth-password-confirm {
    max-height: 80px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.auth-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.auth-actions-login,
.auth-actions-register {
    flex-wrap: nowrap;
}

.auth-actions-login .btn,
.auth-actions-register .btn {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
}

.auth-panel[data-mode="initial"] .auth-actions-initial,
.auth-panel[data-mode="login"] .auth-actions-login,
.auth-panel[data-mode="register"] .auth-actions-register,
.auth-panel[data-mode="roomEntry"] .auth-actions-room {
    margin-top: 6px;
}

.auth-panel[data-mode="initial"],
.auth-panel[data-mode="roomEntry"] {
    gap: 16px;
}

.auth-panel[data-mode="roomEntry"] .auth-room-entry {
    display: grid;
}

.auth-panel[data-mode="initial"] .auth-fields,
.auth-panel[data-mode="initial"] .auth-error {
    display: none;
}

.auth-panel[data-mode="initial"] .auth-actions-initial,
.auth-panel[data-mode="roomEntry"] .auth-actions-room {
    margin-top: 0;
}

.auth-panel[data-mode="roomEntry"] .auth-head {
    position: absolute;
    top: 12px;
    right: 12px;
    min-height: 0;
    z-index: 1;
}

.auth-panel[data-mode="roomEntry"] .auth-title,
.auth-panel[data-mode="roomEntry"] .chip {
    display: none;
}

.auth-panel[data-mode="roomEntry"] {
    position: relative;
    padding-top: 18px;
}

.auth-panel[data-mode="roomEntry"] .auth-room-entry-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 10px 22px;
    padding-right: 54px;
}

.auth-panel[data-mode="roomEntry"] .auth-room-entry-field {
    gap: 6px;
}

.auth-panel[data-mode="roomEntry"] .auth-room-entry-field-label {
    margin-bottom: 0;
}

.auth-panel[data-mode="roomEntry"] .auth-room-entry-display {
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    font-size: 18px;
    line-height: 1.1;
    font-weight: 700;
}

.auth-panel[data-mode="initial"] .auth-actions-initial,
.auth-panel[data-mode="login"] .auth-actions-login,
.auth-panel[data-mode="register"] .auth-actions-register,
.auth-panel[data-mode="roomEntry"] .auth-actions-room {
    max-height: 40px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.auth-actions .btn {
    flex: 1 1 auto;
}

.confirm-panel {
    width: min(360px, calc(100vw - 24px));
}

.confirm-panel .auth-body {
    gap: 10px;
}

.confirm-panel .auth-actions {
    max-height: none;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    margin-top: 6px;
}

.auth-link {
    border: none;
    background: transparent;
    padding: 0;
    font-size: 11px;
    color: var(--muted);
    text-decoration: underline;
    cursor: pointer;
}

.auth-foot {
    display: flex;
    justify-content: flex-start;
}

.auth-panel[data-mode="initial"] .auth-foot,
.auth-panel[data-mode="roomEntry"] .auth-foot {
    display: none;
}

.auth-panel[data-mode="login"] .auth-back,
.auth-panel[data-mode="register"] .auth-back {
    max-height: 36px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.field-error {
    font-size: 11px;
    color: #b00020;
    min-height: 12px;
}

.auth-error {
    font-size: 11px;
    color: #b00020;
    min-height: 12px;
}

.collab-row {
    align-items: flex-end;
}

.collab-actions {
    gap: 6px;
}

.collab-actions .btn {
    flex: 1 1 auto;
}

.collab-admin .btn {
    flex: 1 1 auto;
}

.collab-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
    min-width: 0;
}

.collab-field-wide {
    flex: 1 1 auto;
}

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

.collab-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--controlBg);
    color: var(--ink);
    font: inherit;
}

.collab-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.collab-disabled {
    opacity: 0.55;
    pointer-events: none;
}

.collab-owner {
    font-size: 12px;
    color: var(--muted);
}

.collab-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.collab-title {
    font-size: 12px;
    font-weight: 600;
}

.collab-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 120px;
    overflow: auto;
}

.collab-member {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--controlBg);
}

.collab-member small {
    font-size: 10px;
    color: var(--muted);
}

.collab-chat-log {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    background: var(--controlBg);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.collab-chat-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: calc(var(--footerH) + 8px);
    padding: 8px;
    height: min(260px, 40vh);
    background: var(--surfaceStrong);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    -webkit-backdrop-filter: blur(var(--glassBlur));
    backdrop-filter: blur(var(--glassBlur));
    z-index: 6;
    box-sizing: border-box;
    overflow: hidden;
}

.collab-chat-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 8px;
    height: 100%;
    min-height: 0;
}

.collab-chat-main {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    min-height: 0;
}

.collab-chat-side {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    min-height: 0;
}

.collab-chat-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.collab-chat-participants {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 6px;
    background: var(--controlBg);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.collab-chat-user {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.collab-chat-user .eye {
    font-size: 12px;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    background: transparent;
}

.collab-chat-user .eye-pin {
    font-size: 12px;
}

.collab-chat-user.offline {
    color: #ff4e4e;
}

.collab-chat-user.online {
    color: #1aa34a;
}

.collab-chat-user-name {
    color: inherit;
}

.collab-chat-user-voice {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(127, 140, 155, 0.55);
    flex: 0 0 auto;
}

.collab-chat-user-voice.is-online {
    background: #0b57d0;
}

.collab-chat-user-voice.is-speaking {
    background: #1aa34a;
    box-shadow: 0 0 0 2px rgba(26, 163, 74, 0.18);
}

.collab-chat-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.collab-chat-msg {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.collab-chat-meta {
    font-size: 10px;
    color: var(--muted);
}

.collab-chat-text {
    font-size: 12px;
}

.collab-chat-input {
    flex: 1 1 auto;
    min-width: 0;
}

.collab-status-btn {
    font-family: "SFMono-Regular", Consolas, Monaco, "Liberation Mono", monospace;
    font-weight: 600;
    letter-spacing: 0.2px;
    background: transparent;
    border: 1px solid var(--border);
}

.collab-status-btn.is-offline {
    color: #ff4e4e;
    border-color: rgba(255, 78, 78, 0.35);
}

.collab-status-btn.is-online {
    color: #1aa34a;
    border-color: rgba(26, 163, 74, 0.35);
}

.collab-status-btn.is-entry {
    color: #0b57d0;
    border-color: rgba(11, 87, 208, 0.35);
}

.voice-btn,
.voice-mute-btn {
    font-family: "SFMono-Regular", Consolas, Monaco, "Liberation Mono", monospace;
    font-weight: 600;
    letter-spacing: 0.2px;
    background: transparent;
    border: 1px solid var(--border);
}

.voice-btn.is-offline {
    color: var(--muted);
    border-color: rgba(127, 140, 155, 0.28);
}

.voice-btn.is-online {
    color: #0b57d0;
    border-color: rgba(11, 87, 208, 0.35);
}

.voice-btn.is-speaking {
    color: #1aa34a;
    border-color: rgba(26, 163, 74, 0.35);
}

.voice-mute-btn.is-muted {
    color: #ff4e4e;
    border-color: rgba(255, 78, 78, 0.35);
}

.voice-mute-btn.is-unmuted {
    color: #1aa34a;
    border-color: rgba(26, 163, 74, 0.35);
}

.vr-btn {
    font-family: "SFMono-Regular", Consolas, Monaco, "Liberation Mono", monospace;
    font-weight: 600;
    letter-spacing: 0.2px;
    background: transparent;
    border: 1px solid var(--border);
}

.vr-btn.is-active {
    color: #0b57d0;
    border-color: rgba(11, 87, 208, 0.45);
    background: rgba(11, 87, 208, 0.08);
}

.vr-btn.is-supported:not(.is-active) {
    color: #7a4a00;
    border-color: rgba(122, 74, 0, 0.36);
}

.vr-btn.is-unsupported {
    opacity: 0.55;
    border-style: dashed;
}

body.bg-black .collab-chat-panel {
    background: rgba(0, 0, 0, 0.86);
}

@media (max-width: 980px) {
    :root {
        --sideW: 0px;
        --footerH: calc(34px + env(safe-area-inset-bottom, 0px));
    }

    .appbar {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        padding: calc(4px + env(safe-area-inset-top, 0px)) calc(6px + env(safe-area-inset-right, 0px)) 4px calc(6px + env(safe-area-inset-left, 0px));
        min-height: 64px;
        align-items: center;
        justify-content: flex-start;
    }

    .appbar .btn,
    .appbar .row {
        width: auto;
        min-width: 0;
        margin: 0;
        flex: 0 0 auto;
    }

    .appbar #resetViewerBtn,
    .appbar #exportBtn,
    .appbar #collabPanelBtn,
    .appbar #camsToggleBtn {
        display: none !important;
    }

    .appbar #toggleSideBtn { order: 1; }
    .appbar #fullscreenBtn { order: 2; }
    .appbar #resetViewBtn { order: 3; }
    .appbar #focusPickBtn { order: 4; }
    .appbar #annoToggleBtn { order: 5; }
    .appbar #bgToggleBtn {
        order: 6;
        margin-left: auto;
    }

    .appbar #orderBtn {
        order: 7;
        height: 28px;
        padding: 0 8px;
        font-size: 11px;
        white-space: nowrap;
        text-align: center;
        max-width: 124px;
        overflow: hidden;
        text-overflow: ellipsis;
        flex: 0 1 124px;
    }

    .appbar .appbar-shading {
        order: 20;
        flex: 1 1 auto;
        min-width: 0;
    }

    .appbar .appbar-shading label {
        width: 100%;
    }

    .appbar .appbar-shading #shadingMode {
        width: 100%;
        min-width: 0;
        height: 26px;
        font-size: 12px;
        padding: 3px 6px;
    }

    .appbar #solidToggleBtn { order: 21; }
    .appbar #collToggleBtn { order: 22; }
    .appbar #npmToggleBtn { order: 23; }
    .appbar #vpmToggleBtn { order: 24; }

    .appbar #toggleSideBtn,
    .appbar #resetViewBtn,
    .appbar #focusPickBtn,
    .appbar #annoToggleBtn,
    .appbar #bgToggleBtn {
        width: 28px;
        min-width: 28px;
        height: 28px;
        padding: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .appbar #solidToggleBtn,
    .appbar #collToggleBtn,
    .appbar #npmToggleBtn,
    .appbar #vpmToggleBtn {
        width: 40px;
        min-width: 40px;
        max-width: 40px;
        height: 26px;
        padding: 0;
        font-size: 12px;
        flex: 0 0 40px;
        justify-content: center;
    }

    .annotate-canvas {
        width: 100vw;
    }

    .side {
        left: 0;
        right: 0;
        width: 100vw;
        max-width: 100vw;
        transform: translateX(100%);
        transition: transform 0.22s ease;
        box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18);
        z-index: 6;
    }

    body:not(.side-hidden) .side {
        transform: translateX(0);
    }

    body.side-hidden .side {
        pointer-events: none;
    }

    .list {
        padding: 12px;
    }

    #out,
    #gallery {
        max-height: calc(100vh - var(--appbarH) - var(--camsBarH) - 220px);
    }

    #annoLayerSelect,
    #annoLayerAddBtn {
        display: none;
    }

    .anno-toolbar .custom-select .anno-layer-select {
        display: none !important;
    }

    .anno-tool[data-tool="eraser"] + .anno-divider,
    #annoLayerAddBtn + .anno-divider {
        display: none;
    }

    .collab-drawer {
        top: calc(var(--appbarH) + var(--camsBarH));
        left: 0;
        right: 0;
        bottom: var(--footerH);
        width: auto;
        transform: none;
        padding: 8px;
        box-sizing: border-box;
    }

    .auth-panel {
        width: 100%;
        max-width: 520px;
        max-height: calc(100dvh - var(--appbarH) - var(--camsBarH) - var(--footerH) - 12px);
        overflow: auto;
    }

    .auth-room-entry-meta {
        grid-template-columns: 1fr;
    }

    .app-footer {
        padding: 6px calc(8px + env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) calc(8px + env(safe-area-inset-left, 0px));
        min-height: var(--footerH);
        gap: 8px;
    }

    .app-footer .footer-left {
        gap: 6px;
    }

    .stats-overlay {
        min-width: max-content;
    }

    .collab-footer {
        margin-left: 6px;
        gap: 6px;
    }

    .collab-footer-label .collab-label-full {
        display: none;
    }

    .collab-footer-label .collab-label-short {
        display: inline;
    }

    body.room-entry-landing #collabStatusBtn {
        margin-left: auto;
    }

}

@media (max-width: 760px) {
    .collab-chat-panel {
        left: 6px;
        right: 6px;
        bottom: calc(var(--footerH) + 6px);
        height: min(320px, 46vh);
        padding: 6px;
    }

    .collab-chat-layout {
        grid-template-columns: 1fr;
    }

    .collab-chat-side {
        min-height: 82px;
        max-height: 36%;
    }

    .auth-panel {
        padding: 8px 10px 10px;
    }

    .app-footer .footer-btn {
        height: 24px;
        padding: 2px 6px;
    }
}

#gallery{
    display:grid;
    grid-template-columns:repeat(auto-fill, minmax(96px, 1fr));
    gap:8px;
    padding:8px;

    /* прокрутка */
    overflow:auto;
    max-height:calc(100vh - var(--appbarH) - var(--camsBarH) - 260px); /* при желании подстройте 260px */
    scrollbar-gutter:stable both-edges;
    overscroll-behavior:contain;
    -webkit-overflow-scrolling:touch;
}
.thumb { border: 1px solid var(--border); border-radius: 10px; padding: 6px; background: var(--surfaceWeak); display:flex; flex-direction:column; gap:4px; cursor:pointer; overflow:hidden; }
.thumb img, .thumb .ph { width:100%; aspect-ratio:1/1; object-fit:cover; border-radius:6px; display:block }
.thumb .ph { display:grid; place-items:center; font-size:11px; color:#666; background:#f4f4f5 }
.thumb.broken { border-color:#f5c2c7; background:#fff5f6 }
.thumb .nm { display:block; max-width:100%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.pill { align-self:flex-start; font-size:10px; padding:1px 6px; border:1px solid var(--border); border-radius:999px }

.gallery-spacer { grid-column: 1 / -1; height: 1px; }

.drop { position: fixed; inset: calc(var(--appbarH) + var(--camsBarH)) 0 0 0; display:none; place-items:center; background:rgba(0,0,0,.04); border:3px dashed rgba(0,0,0,.2); font-size:18px; z-index:4; pointer-events:none }
.drop.show { display: grid; }

.modal { position: fixed; inset:0; display:none; place-items:center; background:rgba(0,0,0,.45); z-index:50 }
.modal.show { display:grid }
#promptModal, #confirmModal { z-index:60; }
.sheet { background:var(--surfaceStrong); width:min(900px, calc(100vw - 40px)); border-radius:12px; border:1px solid var(--border); overflow:hidden; box-shadow:var(--shadowStrong); -webkit-backdrop-filter: blur(var(--glassBlur)); backdrop-filter: blur(var(--glassBlur)); }
.sheet.sheet-sm { width:min(420px, calc(100vw - 40px)); }
.sheet .head { display:flex; align-items:center; justify-content:space-between; padding:10px 12px; border-bottom:1px solid var(--border) }
.sheet .body { display:grid; grid-template-columns: 1fr 320px; gap:0 }
.sheet .imgwrap { background:#111; display:grid; place-items:center; min-height:320px }
.sheet .imgwrap img { max-width:100%; max-height:70vh }
.sheet .tex-side { padding:10px; display:flex; flex-direction:column; gap:8px }
.sheet .row { display:flex; gap:8px; align-items:center; flex-wrap:wrap }
.sheet .btn.primary { background: var(--accent); color:#fff; border-color:rgba(0,0,0,0) }

.prompt-body { padding:12px; display:flex; flex-direction:column; gap:10px }
.prompt-input { width:100%; box-sizing:border-box; padding:10px 12px; border:1px solid var(--border); border-radius:10px; font:inherit; background: var(--controlBg); color: var(--ink); }
.prompt-message { font-size: 13px; line-height: 1.4; color: var(--ink); white-space: pre-wrap; }
.prompt-actions { justify-content:flex-end }
.room-content-panel { box-sizing:border-box; width:min(920px, calc(100vw - 40px)); max-height:calc(100vh - 48px); }
.room-content-body { gap:10px; max-height:calc(100vh - 112px); overflow:auto; }
.room-content-head { align-items:center; gap:10px; }
.room-content-head .auth-close { flex:0 0 auto; margin-left:0; }
.room-content-toolbar { display:flex; align-items:center; justify-content:space-between; gap:10px; flex:1 1 auto; min-width:0; }
.room-content-field { display:flex; flex:0 1 300px; flex-direction:column; gap:5px; min-width:180px; }
.room-content-room-select { min-height:30px; }
.room-content-toolbar-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; min-width:0; }
.room-content-user-email { color:var(--muted); font-size:12px; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.room-content-summary { display:flex; gap:12px; flex-wrap:wrap; color:var(--muted); font-size:12px; line-height:1.35; }
.room-content-tabs { display:flex; gap:6px; flex-wrap:wrap; border-bottom:1px solid var(--border); padding-bottom:8px; }
.room-content-tab.active { color:var(--accent); border-color:rgba(11, 87, 208, 0.35); background:rgba(11, 87, 208, 0.08); }
.room-content-status { min-height:18px; color:var(--muted); font-size:12px; }
.room-content-status:empty { display:none; }
.room-content-list { display:flex; flex-direction:column; gap:8px; }
.room-content-tab[hidden], .room-content-field[hidden] { display:none; }
.user-directory-search { display:flex; gap:8px; margin:0 0 8px; }
.user-directory-search input { flex:1; min-width:0; }
.user-directory-table { width:100%; border-collapse:collapse; table-layout:fixed; font-size:12px; }
.user-directory-table th, .user-directory-table td { text-align:left; padding:10px 8px; border-bottom:1px solid var(--border); vertical-align:top; overflow-wrap:anywhere; }
.user-directory-table th { color:var(--muted); font-weight:500; }
.user-directory-table th:first-child { width:38%; }
.user-directory-email { font-weight:600; }
.user-directory-name { color:var(--muted); margin-top:4px; }
.user-directory-pagination { display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:12px; color:var(--muted); padding-top:8px; }
@media (max-width: 540px) {
    .user-directory-table, .user-directory-table tbody { display:block; }
    .user-directory-table thead { display:none; }
    .user-directory-table tr { display:block; padding:10px 0; border-bottom:1px solid var(--border); }
    .user-directory-table td { display:block; padding:4px 0; border:0; }
    .user-directory-table td[data-label]::before { content:attr(data-label) ': '; color:var(--muted); }
}
.project-admin-bar, .project-admin-actions { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.project-admin-bar { justify-content:space-between; padding-bottom:8px; }
.project-admin-role, .project-admin-owner, .project-admin-count { color:var(--muted); font-size:12px; }
.project-admin-tree { border-top:1px solid var(--border); }
.project-admin-tree .project-admin-project { margin:0; padding:12px 0; border:0; border-bottom:1px solid var(--border); border-radius:0; background:transparent; }
.project-admin-summary { display:flex; align-items:center; gap:12px; list-style:none; padding:0; }
.project-admin-summary::-webkit-details-marker { display:none; }
.project-admin-summary::before { content:'\203A'; display:block; width:16px; flex:0 0 16px; font-size:20px; text-align:center; }
.project-admin-project[open] > .project-admin-summary::before { transform:rotate(90deg); }
.project-admin-heading { display:flex; flex-direction:column; gap:4px; flex:1; min-width:0; }
.project-admin-name, .project-admin-owner { min-width:0; overflow-wrap:anywhere; }
.project-admin-count { white-space:nowrap; }
.project-admin-project > .project-admin-actions { padding:12px 0 8px 28px; }
.project-admin-room { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-left:28px; padding:10px 0; border-top:1px solid var(--border); font-size:13px; }
.project-admin-actions .btn { font-size:12px; }
.project-admin-actions .danger { color:#b42318; }
@media (max-width: 540px) {
    .project-admin-room { align-items:flex-start; flex-direction:column; }
    .project-admin-actions { gap:6px; }
}
.room-content-empty { color:var(--muted); font-size:13px; padding:12px 0; }
.room-content-tree { display:flex; flex-direction:column; gap:8px; }
.room-content-tree details { margin:0; border-radius:8px; }
.room-content-project { background:var(--surfaceWeak); }
.room-content-room { background:var(--surface); margin-top:8px !important; }
.room-content-tree summary { display:flex; align-items:center; gap:8px; list-style:none; min-width:0; }
.room-content-tree summary::-webkit-details-marker { display:none; }
.room-content-tree summary::before {
    content:"";
    width:0;
    height:0;
    border-top:5px solid transparent;
    border-bottom:5px solid transparent;
    border-left:7px solid var(--ink);
    flex:0 0 auto;
    transform-origin:50% 50%;
    transition:transform .12s ease;
}
.room-content-tree details[open] > summary::before { transform:rotate(90deg); }
.room-content-tree-line { display:flex; align-items:center; gap:8px; min-width:0; flex:1 1 auto; }
.room-content-tree-name { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.room-content-tree-meta { color:var(--muted); border:1px solid var(--border); border-radius:999px; padding:1px 7px; font-size:11px; font-weight:600; white-space:nowrap; }
.room-content-tree-action { flex:0 0 auto; }
.room-content-tree-action .btn { padding:4px 8px; font-size:12px; }
.room-content-tree-action .btn.danger { color:#b42318; border-color:rgba(180, 35, 24, 0.35); background:rgba(180, 35, 24, 0.06); }
.room-content-tree-action .btn.danger:disabled { color:var(--muted); border-color:var(--border); background:transparent; opacity:.55; }
.room-content-items { display:flex; flex-direction:column; gap:0; margin-top:8px; }
.room-content-room-empty { padding:8px 0 2px 20px; }
.room-content-row { display:grid; grid-template-columns:minmax(180px, 1fr) 110px 145px 115px 86px; gap:10px; align-items:center; border-bottom:1px solid var(--border); padding:8px 0; font-size:12px; }
.room-content-row.room-content-head { color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.04em; padding-top:0; }
.room-content-item-row:last-child { border-bottom:0; }
.room-content-main { min-width:0; }
.room-content-name { color:var(--ink); font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.room-content-sub { color:var(--muted); margin-top:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.room-content-action { justify-self:end; }
.room-content-action .btn { padding:5px 8px; font-size:12px; }
.room-content-action .btn.danger { color:#b42318; border-color:rgba(180, 35, 24, 0.35); background:rgba(180, 35, 24, 0.06); }
.room-content-action .btn.danger:disabled { color:var(--muted); border-color:var(--border); background:transparent; opacity:.55; }

@media (max-width: 760px) {
    .room-content-panel { width:calc(100vw - 16px); }
    .room-content-head { align-items:flex-start; }
    .room-content-toolbar { align-items:stretch; flex-direction:column; }
    .room-content-toolbar-actions { justify-content:space-between; }
    .room-content-field { flex-basis:auto; min-width:0; }
    .room-content-tree-line { flex-wrap:wrap; }
    .room-content-tree-name { flex:1 1 100%; }
    .room-content-tree-action { margin-left:20px; }
    .room-content-row { grid-template-columns:minmax(0, 1fr) auto; gap:4px 8px; }
    .room-content-row.room-content-head { display:none; }
    .room-content-row > div:nth-child(2),
    .room-content-row > div:nth-child(3),
    .room-content-row > div:nth-child(4) { color:var(--muted); font-size:11px; }
    .room-content-action { grid-column:2; grid-row:1 / span 4; align-self:start; }
}
.order-body { align-items:center; text-align:center; gap:14px; font-size: 18px; padding: 16px; }
.order-title { font-size: 24px; font-weight: 700; color: var(--ink); letter-spacing: 0.2px; }
.order-actions { display:flex; align-items:center; justify-content:center; gap:12px; flex-wrap:wrap; }
.order-action { display:inline-flex; align-items:center; justify-content:center; width: 42px; height: 42px; border-radius: 50%; border:1px solid var(--border); background: var(--controlBg); color: var(--ink); text-decoration:none; box-shadow: var(--inset); }
.order-action:hover { border-color: var(--borderStrong); background: var(--controlBgHover); }
.order-action-icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.order-action-telegram .order-action-icon { fill: currentColor; stroke: none; }
.order-action-telegram { color: #229ed9; border-color: rgba(34, 158, 217, 0.35); background: rgba(34, 158, 217, 0.12); }
.order-action-telegram:hover { background: rgba(34, 158, 217, 0.2); }
.order-contacts { display:grid; gap:8px; }
.order-line { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:0px; color: var(--ink); }
.order-phone { color: var(--ink); text-decoration: none; font-weight: 600; }
.order-phone:hover { text-decoration: underline; }
.order-name { color: var(--muted); font-size: 14px; }
.order-samples { display:flex; align-items:center; justify-content:center; width:100%; }
.order-sample-select {
    text-align: center;
    font: inherit;
    font-weight: 600;
    padding: 8px 8px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--controlBg);
    color: var(--ink);
    box-shadow: var(--inset);
    cursor: pointer;
}
.order-sample-btn {
    width: 158px;
    min-width: 158px;
    font-size: 14px;
}
.order-samples .custom-select {
    width: 160px;
    min-width: 160px;
    max-width: 160px;
    height: 36px;
}
.order-samples .custom-select-trigger {
    min-height: 36px;
    justify-content: center;
}
.order-samples .custom-select-label {
    text-align: center;
    white-space: pre-line;
    overflow: visible;
    text-overflow: unset;
    line-height: 1.1;
}
.order-sample-select:hover {
    border-color: var(--borderStrong);
    background: var(--controlBgHover);
}
.order-sample-select:active { transform: translateY(0.5px); }

#orderModal .sheet {
    background: var(--surfaceStrong);
    border: 1px solid var(--border);
    box-shadow: var(--shadowStrong);
    -webkit-backdrop-filter: blur(var(--glassBlur));
    backdrop-filter: blur(var(--glassBlur));
    position: fixed;
    left: 50%;
    bottom: calc(50% + 100px);
    transform: translate(-50%, 50%);
    width: fit-content;
    max-width: calc(100vw - 40px);
    min-width: 0;
}

.rect-annot-body { gap: 12px; }
.rect-annot-field { display:flex; flex-direction:column; gap:6px; }
.rect-annot-color {
    width: 100%;
    height: 40px;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--controlBg);
}
.rect-annot-select { height: auto; }
.rect-annot-info { font-size: 12px; }
.eye {
    font-size: 14px;
    user-select: none;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    color: inherit;
}
.eye:hover { opacity: .75; }

body.side-hidden { --sideW: 0px; }

.stats-overlay {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    line-height: 1;
    color: var(--muted);
    white-space: nowrap;
    min-width: 0;
    pointer-events: none;
    font-family: "SFMono-Regular", Consolas, Monaco, "Liberation Mono", monospace;
}

.stats-overlay .stats-mode { color: #ff4e4e; font-weight: 600; }
.stats-overlay .stats-item { color: var(--muted); }
.stats-overlay .stats-sep { color: var(--borderStrong); }

.light-sun .light-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.light-sun input[type="number"] {
    width: 56px;
}


.light-row-sun {
    display: flex;
    align-items: center;
    gap: 12px;
}

.light-sun-hour {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.light-sun-hour input[type="range"] {
    flex: 1;
}

.light-sun-hour input[type="text"] {
    width: 56px;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
}

.light-sun-hour input[type="text"],
.light-sun-int-input {
    width: 56px;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    text-align: right;
}

.light-sun-date {
    display: flex;
    align-items: center;
    gap: 8px;
}

.light-date-field {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--muted);
}

.light-date-field input[type="number"] {
    width: 32px;
    padding: 4px 6px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
}

.light-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.light-actions .btn {
    padding: 4px 10px;
    font-size: 13px;
}

.future-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.future-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.appbar .bg-btn { margin-left: auto; }
.appbar .bg-btn.white-mode { background: #fff; color: #000; border-color: #ddd; }
.appbar .bg-btn.black-mode { background: #000; color: #fff; border-color: #333; }
.appbar .grid-btn { margin-left: 4px; }
.appbar .order-btn { margin-left: 4px;}

#bgToggleBtn .icon-sun { display: none; }
body.bg-black #bgToggleBtn .icon-sun { display: block; }
body.bg-black #bgToggleBtn .icon-moon { display: none; }

body.bg-black {
    background-color: #000;
    color: #fff;
    --ink: rgba(255, 255, 255, 0.94);
    --muted: rgba(255, 255, 255, 0.65);
    --border: rgba(255, 255, 255, 0.18);
    --borderStrong: rgba(255, 255, 255, 0.28);
    --surface: rgba(0, 0, 0, 0.55);
    --surfaceStrong: rgba(0, 0, 0, 0.76);
    --surfaceWeak: rgba(0, 0, 0, 0.42);
    --controlBg: rgba(0, 0, 0, 0.50);
    --controlBgHover: rgba(255, 255, 255, 0.12);
    --shadow: none;
    --shadowStrong: none;
    --inset: none;
}

body.bg-black .side input[type="number"],
body.bg-black .side input[type="text"] {
    background: #000;
    color: var(--ink);
}

body.bg-black .custom-select-option:hover,
body.bg-black .custom-select-option:focus-visible {
    background: var(--controlBgHover);
}

body.bg-black .custom-select-option.is-selected {
    background: rgba(255, 255, 255, 0.16);
}

.bind-log {
    background: var(--surfaceWeak);
    border: 1px solid var(--border);
    border-radius: 6px;
}

.app-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: space-between;
    padding: 4px 10px;
    min-height: 24px;
    font-size: 12px;
    z-index: 5;
    pointer-events: none;
    background: var(--surfaceWeak);
    border-top: 1px solid var(--border);
    -webkit-backdrop-filter: blur(var(--glassBlur));
    backdrop-filter: blur(var(--glassBlur));
}
.app-footer .footer-left,
.app-footer .footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: nowrap;
    min-width: 0;
    pointer-events: auto;
}

.app-footer .footer-right { margin-left: auto; }
.app-footer .viewer-version { flex:0 0 auto; color:var(--muted); font-size:11px; white-space:nowrap; }

.app-footer .footer-left {
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
}

.app-footer .footer-left > * {
    flex: 0 0 auto;
}

.app-footer .footer-btn {
    padding: 2px 8px;
    height: 22px;
    font-size: 11px;
    line-height: 1;
    border-radius: 6px;
}

.app-footer .btn.active {
    background: rgba(0, 0, 0, 0.08);
    border-color: var(--borderStrong);
}

.collab-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
    flex-wrap: nowrap;
    font-size: 12px;
    line-height: 1;
    color: var(--muted);
    font-family: "SFMono-Regular", Consolas, Monaco, "Liberation Mono", monospace;
    white-space: nowrap;
    min-width: max-content;
    flex: 0 0 auto;
}

.collab-footer-guest,
.collab-footer-registered {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.collab-footer-registered {
    flex-direction: row;
    align-items: center;
}

.collab-footer-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.collab-footer-label {
    color: var(--muted);
}

.collab-label-short {
    display: none;
}

.collab-footer-value {
    color: var(--ink);
    font-weight: 600;
}

.collab-footer .collab-input {
    padding: 0 2px;
    margin: 0;
    font-size: 12px;
    height: 16px;
    line-height: 16px;
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none;
    font-family: inherit;
}

.collab-footer-select {
    min-width: 160px;
    appearance: none;
    padding-right: 2px;
    top: -6px;
}

.collab-footer-create {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
}

.collab-footer-admin {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
}

.collab-copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.collab-link-input {
    display: none;
}

.collab-reserve-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.collab-footer .btn {
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none;
    padding: 0 2px;
    font-size: 12px;
    line-height: 1;
    color: var(--muted);
    font-family: inherit;
}

.collab-footer .btn:hover {
    border-color: var(--borderStrong);
    background: transparent;
}

.collab-footer .btn.primary,
.collab-footer .btn.danger {
    background: transparent;
    color: var(--muted);
    border-color: var(--borderStrong);
}

.collab-footer .collab-copy-btn {
    min-width: 0;
    gap: 6px;
}

.collab-footer .collab-copy-btn {
    height: 22px;
    padding: 2px 8px;
    border-radius: 6px;
    color: var(--ink);
    border: 1px solid var(--border);
    background: var(--controlBg);
    box-shadow: var(--inset);
    font-size: 11px;
    line-height: 1;
    font-family: inherit;
    font-weight: 400;
}

.collab-footer .collab-copy-btn:hover {
    border-color: var(--borderStrong);
    background: var(--controlBgHover);
}

.collab-footer .collab-copy-btn .icon,
.collab-footer .collab-reserve-btn .icon {
    width: 14px;
    height: 14px;
}

.collab-footer .collab-copy-btn .btn-label {
    display: inline-block;
}

.collab-footer .collab-room-manage-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
    height: 22px;
    padding: 2px 8px;
    border-radius: 6px;
    color: #0b57d0;
    border: 1px solid rgba(11, 87, 208, 0.35);
    background: transparent;
    box-shadow: var(--inset);
    font-size: 11px;
    line-height: 1;
    font-family: "SFMono-Regular", Consolas, Monaco, "Liberation Mono", monospace;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.collab-footer .collab-room-manage-btn:hover {
    border-color: rgba(11, 87, 208, 0.35);
    background: var(--controlBgHover);
}

.collab-footer .collab-reserve-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
}

.collab-footer .collab-reserve-btn:hover {
    border-color: var(--borderStrong);
}

.collab-footer .collab-reserve-btn.active {
    color: var(--accent);
    border-color: rgba(11, 87, 208, 0.3);
    background: rgba(11, 87, 208, 0.06);
}

body.bg-black .app-footer .btn.active {
    background: rgba(255, 255, 255, 0.12);
}

body.bg-black .collab-footer .collab-copy-btn {
    color: var(--ink);
    border-color: var(--border);
    background: var(--controlBg);
}

body.bg-black .collab-footer .collab-copy-btn:hover {
    border-color: var(--borderStrong);
    background: var(--controlBgHover);
}

body.bg-black .collab-footer .collab-reserve-btn.active {
    color: #7fb3ff;
    border-color: rgba(127, 179, 255, 0.34);
    background: rgba(127, 179, 255, 0.14);
}

.app-footer a {
    pointer-events: auto;
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    color: var(--muted);
    border: 1px solid var(--border);
    background: var(--controlBg);
    box-shadow: var(--inset);
    text-decoration: none;
    font-size: 11px;
    line-height: 1;
    max-width: 48vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.app-footer a:hover {
    background: var(--controlBgHover);
    color: var(--ink);
    border-color: var(--borderStrong);
}

/* VR DOM overlay layout */
body.vr-ui-active {
    --sideW: 0px;
    --appbarH: 66px;
    --footerH: 52px;
}

body.vr-ui-active #viewer {
    right: 0;
}

body.vr-ui-active .side,
body.vr-ui-active #shadowDbg {
    display: none !important;
}

body.vr-ui-active .appbar {
    inset: auto;
    top: calc(8px + env(safe-area-inset-top, 0px));
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translateX(-50%);
    width: min(98vw, 1240px);
    min-height: 56px;
    max-height: 42vh;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surfaceStrong);
    z-index: 40;
}

body.vr-ui-active .appbar .btn,
body.vr-ui-active .appbar select {
    height: 38px;
    min-height: 38px;
    font-size: 15px;
}

body.vr-ui-active .appbar #toggleSideBtn,
body.vr-ui-active .appbar #fullscreenBtn,
body.vr-ui-active .appbar #resetViewBtn,
body.vr-ui-active .appbar #focusPickBtn,
body.vr-ui-active .appbar #exportBtn,
body.vr-ui-active .appbar #collabPanelBtn,
body.vr-ui-active .appbar #annoToggleBtn,
body.vr-ui-active .appbar #bgToggleBtn {
    width: 38px;
    min-width: 38px;
    height: 38px;
}

body.vr-ui-active .appbar #solidToggleBtn,
body.vr-ui-active .appbar #collToggleBtn,
body.vr-ui-active .appbar #npmToggleBtn,
body.vr-ui-active .appbar #vpmToggleBtn {
    width: 56px;
    min-width: 56px;
    max-width: 56px;
    font-size: 14px;
}

body.vr-ui-active .cams-bar {
    top: calc(74px + env(safe-area-inset-top, 0px));
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(96vw, 1200px);
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surfaceStrong);
    z-index: 39;
}

body.vr-ui-active .anno-toolbar {
    top: calc(126px + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    max-width: min(96vw, 1120px);
    z-index: 41;
    padding: 8px 10px;
}

body.vr-ui-active .anno-toolbar .anno-btn,
body.vr-ui-active .anno-toolbar .anno-tool {
    width: 34px;
    height: 34px;
}

body.vr-ui-active .app-footer {
    left: 50%;
    right: auto;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    width: min(96vw, 1100px);
    min-height: 48px;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surfaceStrong);
    z-index: 40;
}

body.vr-ui-active .app-footer .footer-left {
    gap: 8px;
}

body.vr-ui-active .app-footer .footer-btn {
    height: 34px;
    padding: 6px 10px;
    font-size: 14px;
}

body.vr-ui-active .collab-footer .collab-input,
body.vr-ui-active .collab-footer .btn {
    font-size: 13px;
}

body.bg-black .thumb { background: #000; border-color: rgba(255,255,255,0.25); }
body.bg-black .thumb .ph { background: rgba(255,255,255,0.08); color: #ccc; }
body.bg-black .thumb.broken { border-color: rgba(255,0,0,0.35); background: rgba(255,0,0,0.1); }

body.bg-black input[type="range"] {
    background: transparent;
}
body.bg-black input[type="range"]::-webkit-slider-runnable-track {
    background: rgba(255,255,255,0.35);
    height: 2px;
    border-radius: 2px;
}
body.bg-black input[type="range"]::-webkit-slider-thumb {
    background: #fff;
    border: 2px solid #000;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    margin-top: -6px;
    -webkit-appearance: none;
}
body.bg-black input[type="range"]::-moz-range-track,
body.bg-black input[type="range"]::-ms-track {
    background: rgba(255,255,255,0.35);
    height: 2px;
}

#geoModal .sheet {
    background: rgba(0, 0, 0, 0.88);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
#geoModal .sheet .head {
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
#geoModal .sheet-geo {
    width: min(900px, calc(100vw - 40px));
}
#geoModal .head-line {
    gap: 8px;
    align-items: center;
}
#geoModal .head-line .muted {
    font-size: 12px;
}
#geoModal .sheet-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 70vh;
    overflow-y: auto;
}
#geoModal pre {
    margin: 0;
    white-space: pre;
    font-size: 12px;
    line-height: 1.35;
    tab-size: 2;
    max-height: 55vh;
    overflow: auto;
    flex: 1 1 auto;
}
#geoModal .geo-actions {
    justify-content: flex-end;
    gap: 8px;
}
#geoModal .sheet .head .muted {
    color: #fff;
}
#geoModal .sheet .btn {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.35);
    color: #fff;
}
#geoModal .sheet .btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.6);
}
#geoModal pre {
    background: rgba(0,0,0,0.55);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.15);
}
#geoModal .muted { color: #ddd; }
