.e57-body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: #071013;
}

.e57-toolbar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #0b171b;
}

.toolbar-left {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.studio-title {
  min-width: 230px;
  display: grid;
  line-height: 1.1;
}

.studio-title-main {
  font-size: 17px;
  font-weight: 850;
}

.studio-title-sub {
  color: var(--text-muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar-button,
.toolbar-link,
.toolbar-file,
.toolbar-select,
.viewer-controls button,
.right-tab,
.measure-actions button,
.segment {
  min-height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #14272d;
  color: var(--text);
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 760;
  font-size: 13px;
}

.toolbar-select {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 800;
}

.toolbar-select select,
.viewer-controls select {
  min-height: 26px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #09171b;
  color: var(--text);
  padding: 3px 6px;
}

.toolbar-link {
  text-decoration: none;
}

.toolbar-button.primary,
.toolbar-file {
  border-color: #148b7d;
  background: #159a8a;
}

.toolbar-button.active,
.viewer-controls button.active,
.segment.active,
.right-tab.active {
  border-color: #e7b84b;
  background: rgba(231, 184, 75, 0.16);
  color: #ffe4a3;
}

.toolbar-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.toolbar-file input {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.segmented {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  overflow: hidden;
}

.segmented .segment {
  border: 0;
  border-radius: 0;
  min-width: 40px;
  background: #0f1b20;
}

.studio-grid {
  height: calc(100vh - 56px);
  min-height: 0;
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr) 390px;
}

.side-panel {
  min-height: 0;
  overflow: auto;
  background: #0d1a1f;
}

.left-panel {
  border-right: 1px solid var(--line);
}

.right-panel {
  border-left: 1px solid var(--line);
}

.panel-block {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.status-block {
  display: grid;
  gap: 10px;
  background: #102126;
}

.eyebrow {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.status-block strong {
  display: block;
  margin-top: 3px;
}

.status-pill {
  width: max-content;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.status-pass,
.status-done,
.status-success,
.status-completed,
.status-processed {
  background: rgba(62, 207, 142, 0.16);
  color: #9cf1c5;
}

.status-running,
.status-queued,
.status-cancel_requested {
  background: rgba(124, 199, 255, 0.16);
  color: #aad9ff;
}

.status-warning,
.status-success_with_fallback,
.status-completed_with_warnings,
.status-interrupted,
.status-processed_with_warnings {
  background: rgba(217, 155, 36, 0.16);
  color: #ffd58a;
}

.status-fail,
.status-failed,
.status-cancelled {
  background: rgba(224, 82, 77, 0.17);
  color: #ffaaa7;
}

.status-not-run,
.status-pending,
.status-skipped,
.status-uploaded {
  background: rgba(159, 178, 180, 0.13);
  color: #c3d0d2;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #071115;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  background: #19b6a2;
}

.status-block small {
  color: var(--text-muted);
  line-height: 1.35;
}

.panel-heading {
  margin-bottom: 9px;
  color: var(--text);
  font-weight: 850;
}

.step-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.step-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: #0a1519;
}

.step-row strong {
  display: block;
  font-size: 13px;
}

.step-row small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  line-height: 1.32;
}

.step-index {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 850;
}

.check-list,
.mini-list,
.qa-list,
.measurement-list,
.warning-list {
  display: grid;
  gap: 7px;
}

.check-row,
.mini-row,
.qa-row,
.measurement-row,
.warning-row {
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: #0a1519;
  font-size: 13px;
}

.check-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.mini-row {
  cursor: pointer;
}

.mini-row.selected {
  border-color: #e7b84b;
  background: rgba(231, 184, 75, 0.11);
}

.mini-row small,
.qa-row small,
.measurement-row small,
.warning-row small {
  color: var(--text-muted);
  line-height: 1.35;
}

.split-list {
  display: grid;
  gap: 14px;
}

.viewer-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #05090f;
}

.renderer-mount {
  width: 100%;
  height: 100%;
}

.viewer-status {
  position: absolute;
  left: 14px;
  bottom: 14px;
  max-width: min(720px, calc(100% - 28px));
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(5, 9, 15, 0.82);
  color: #dfe9e6;
  font-size: 13px;
  pointer-events: none;
}

.viewer-controls {
  position: absolute;
  left: 14px;
  top: 14px;
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 28px);
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(7, 17, 21, 0.86);
}

.mesh-controls {
  right: 14px;
  max-height: 118px;
  overflow: auto;
}

.viewer-controls.active {
  display: flex;
}

.viewer-controls label {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 13px;
}

.viewer-controls input[type="range"] {
  width: 120px;
}

.right-tabs {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: #0d1a1f;
}

.right-tab {
  border-radius: 0;
  min-height: 38px;
  padding: 7px 5px;
}

.right-pane {
  display: none;
  padding: 12px;
}

.right-pane.active {
  display: block;
}

.qa-score {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #102126;
}

.qa-score span {
  color: var(--text-muted);
  font-weight: 800;
}

.qa-score strong {
  font-size: 24px;
}

.qa-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.json-report {
  min-height: 190px;
  max-height: 42vh;
  overflow: auto;
  margin: 0 0 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: #071115;
  color: #dfe9e6;
  font-size: 12px;
  white-space: pre-wrap;
}

.mesh-output-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.mesh-output-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.mesh-output-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0a1519;
}

.mesh-output-card strong,
.mesh-output-card small {
  min-width: 0;
}

.mesh-output-card small {
  color: var(--text-muted);
  line-height: 1.35;
}

.mesh-output-actions {
  display: flex;
  gap: 6px;
  grid-column: 1 / -1;
}

.mesh-output-actions button,
.mesh-output-actions a {
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #14272d;
  color: var(--text);
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.mesh-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
}

.mesh-action-grid button,
.gap-actions button {
  min-height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: #14272d;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.gap-list {
  display: grid;
  gap: 7px;
  max-height: 320px;
  overflow: auto;
  margin-bottom: 10px;
}

.gap-row {
  padding: 8px;
  border: 1px solid var(--line);
  border-left: 3px solid #dd4b4b;
  border-radius: 5px;
  background: #091519;
}

.gap-row.preserve { border-left-color: #3ecf8e; }
.gap-row.manual { border-left-color: #4aa8e8; }

.gap-row strong,
.gap-row small { display: block; }
.gap-row small { margin-top: 3px; color: var(--text-muted); line-height: 1.3; }
.gap-actions { display: flex; gap: 5px; margin-top: 7px; }
.gap-actions button { min-height: 25px; padding: 3px 7px; font-size: 11px; }

.thumbnail-frame {
  min-height: 180px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #071115;
  color: var(--text-muted);
}

.thumbnail-frame img {
  display: none;
  width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.thumbnail-frame.has-image img {
  display: block;
}

.thumbnail-frame.has-image span {
  display: none;
}

.measure-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.measure-actions span {
  color: var(--text-muted);
  font-size: 13px;
}

.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  background: #05090f;
}

.tour-overlay.active {
  display: block;
}

.tour-mount {
  width: 100%;
  height: 100%;
  opacity: 1;
  touch-action: none;
  transition: opacity 520ms ease;
}

.tour-mount canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.splat-mount {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: none;
  overflow: hidden;
  background: #050505;
  touch-action: none;
}

.splat-mount canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.splat-active .splat-mount {
  display: block;
}

.splat-active .tour-mount,
.splat-active .dollhouse-mount,
.splat-active .tour-ring-layer,
.splat-active .tour-pin-layer,
.splat-active .tour-ruler-layer,
.splat-active .tour-minimap,
.splat-active .tour-ruler-mode-toggle,
.splat-active .dollhouse-controls,
.splat-active #tourMapBtn,
.splat-active #dollhouseBtn,
.splat-active #surfacePickBtn {
  display: none;
}

.splat-feedback {
  position: absolute;
  z-index: 9;
  inset: 0;
  place-items: center;
  padding: 24px;
  background: rgba(2, 7, 10, 0.24);
  pointer-events: none;
}

.splat-feedback:not([hidden]) {
  display: grid;
}

.splat-feedback-card {
  display: flex;
  width: min(390px, calc(100vw - 48px));
  align-items: center;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  background: rgba(8, 14, 17, 0.9);
  color: #f8fafc;
  text-align: center;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(14px);
}

.splat-feedback-card > span:not(.tour-transition-spinner) {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.splat-feedback-card button {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  background: #f8fafc;
  color: #111827;
  font-weight: 750;
  cursor: pointer;
  pointer-events: auto;
}

.splat-progress {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.15);
}

.splat-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: #38bdf8;
  transition: width 120ms linear;
}

.tour-transition-layer {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(2, 7, 10, 0);
  -webkit-backdrop-filter: blur(0) brightness(1) saturate(1);
  backdrop-filter: blur(0) brightness(1) saturate(1);
  opacity: 0;
  pointer-events: none;
  transition: background 260ms ease, backdrop-filter 260ms ease, -webkit-backdrop-filter 260ms ease, opacity 180ms ease;
}

.tour-overlay.tour-transitioning .tour-transition-layer {
  background: rgba(2, 7, 10, 0.16);
  -webkit-backdrop-filter: blur(16px) brightness(0.62) saturate(0.78);
  backdrop-filter: blur(16px) brightness(0.62) saturate(0.78);
  opacity: 1;
  pointer-events: auto;
}

.tour-transition-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(8, 14, 17, 0.76);
  color: rgba(255, 255, 255, 0.92);
  font-size: 13px;
  font-weight: 720;
  letter-spacing: 0.01em;
  opacity: 0;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  transform: translateY(6px) scale(0.98);
  transition: opacity 180ms ease, transform 220ms ease;
}

.tour-overlay.tour-transition-waiting .tour-transition-card {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.tour-transition-spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.26);
  border-top-color: #fff;
  border-radius: 50%;
  animation: tour-transition-spin 720ms linear infinite;
}

@keyframes tour-transition-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .tour-transition-layer,
  .tour-transition-card {
    transition-duration: 0ms;
  }

  .tour-transition-spinner {
    animation: none;
  }
}

.dollhouse-mount {
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 520ms ease;
}

.dollhouse-mount canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.dollhouse-active .dollhouse-mount {
  opacity: 1;
  pointer-events: auto;
}

.dollhouse-active .tour-mount,
.dollhouse-active .tour-ring-layer,
.dollhouse-active .tour-pin-layer,
.dollhouse-active .tour-ruler-layer {
  opacity: 0;
  pointer-events: none;
}

.dollhouse-active .tour-minimap,
.dollhouse-active .tour-ruler-mode-toggle {
  opacity: 0;
  pointer-events: none;
}

.tour-ring-layer,
.tour-pin-layer,
.tour-ruler-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.tour-ring {
  position: absolute;
  width: var(--ring-size, 58px);
  height: calc(var(--ring-size, 58px) * 0.56);
  border: 3px solid rgba(255, 210, 40, 0.95);
  border-radius: 999px;
  background: rgba(255, 210, 40, 0.12);
  box-shadow: 0 0 16px rgba(255, 210, 40, 0.65);
  cursor: pointer;
  opacity: var(--ring-opacity, 0.9);
  pointer-events: auto;
  transform: translate(-50%, -50%) rotateX(62deg) scale(var(--ring-scale, 1));
  transform-origin: center;
  transition: opacity 120ms ease, transform 120ms ease, border-color 120ms ease;
}

.tour-ring::after {
  content: "";
  position: absolute;
  inset: 28%;
  border-radius: 999px;
  border: 2px solid rgba(255, 244, 170, 0.82);
}

.tour-ring:hover,
.tour-ring:focus-visible {
  border-color: rgba(255, 238, 120, 1);
  opacity: 1;
  transform: translate(-50%, -50%) rotateX(62deg) scale(calc(var(--ring-scale, 1) * 1.12));
}

.tour-pin {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.9);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.tour-ruler-layer {
  display: none;
  z-index: 4;
}

.tour-ruler-layer.active {
  display: block;
}

.tour-ruler-tether {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.tour-ruler-tether line {
  stroke: rgba(250, 204, 21, 0.72);
  stroke-width: 1.5;
  stroke-dasharray: 5 5;
  vector-effect: non-scaling-stroke;
}

.tour-ruler-aim,
.tour-ruler-snap {
  position: absolute;
  display: none;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.tour-ruler-aim {
  width: 34px;
  height: 34px;
  border: 2px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(7, 17, 21, 0.42), 0 0 14px rgba(56, 189, 248, 0.65);
}

.tour-ruler-aim::before,
.tour-ruler-aim::after {
  content: "";
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(7, 17, 21, 0.28);
}

.tour-ruler-aim::before {
  left: 50%;
  top: -7px;
  width: 2px;
  height: 46px;
  transform: translateX(-50%);
}

.tour-ruler-aim::after {
  left: -7px;
  top: 50%;
  width: 46px;
  height: 2px;
  transform: translateY(-50%);
}

.tour-ruler-aim.is-off-surface {
  border-color: rgba(148, 163, 184, 0.9);
  box-shadow: 0 0 0 2px rgba(7, 17, 21, 0.36);
  opacity: 0.62;
}

.tour-ruler-snap {
  width: 12px;
  height: 12px;
  border: 2px solid rgba(7, 17, 21, 0.78);
  border-radius: 999px;
  background: #facc15;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.28), 0 0 16px rgba(250, 204, 21, 0.8);
}

.tour-ruler-add,
.tour-ruler-close {
  position: absolute;
  bottom: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #ffffff;
  font-weight: 850;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.36);
}

.tour-ruler-add {
  left: 50%;
  width: 58px;
  height: 58px;
  background: rgba(250, 204, 21, 0.92);
  color: #071013;
  font-size: 34px;
  line-height: 1;
  transform: translateX(-50%);
}

.tour-ruler-close {
  left: calc(50% + 58px);
  width: 44px;
  height: 44px;
  background: rgba(7, 17, 21, 0.88);
  font-size: 20px;
}

.tour-ruler-add.is-hidden {
  display: none;
}

.tour-ruler-hint,
.tour-ruler-label {
  position: absolute;
  left: 50%;
  max-width: min(460px, calc(100vw - 28px));
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(7, 17, 21, 0.86);
  color: #dfe9e6;
  pointer-events: none;
  transform: translateX(-50%);
}

.tour-ruler-hint {
  bottom: 98px;
  padding: 8px 10px;
  font-size: 13px;
  text-align: center;
}

.tour-ruler-label {
  display: none;
  padding: 6px 9px;
  color: #fff3a4;
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.32);
  transform: translate(-50%, -50%);
}

.tour-topbar {
  position: absolute;
  z-index: 7;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}

.tour-topbar button,
.tour-topbar span,
.tour-status,
.tour-minimap {
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: rgba(7, 17, 21, 0.84);
  color: var(--text);
}

.tour-topbar button {
  min-height: 34px;
  padding: 7px 11px;
  cursor: pointer;
}

.tour-topbar button.active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.18);
  color: #d7f4ff;
}

.tour-topbar span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
}

.tour-minimap {
  position: absolute;
  right: 16px;
  bottom: 16px;
  padding: 8px;
}

.tour-status {
  position: absolute;
  left: 16px;
  bottom: 16px;
  max-width: 520px;
  padding: 8px 10px;
  color: #dfe9e6;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .studio-grid {
    grid-template-columns: 310px minmax(0, 1fr);
  }

  .right-panel {
    display: none;
  }

  .studio-title {
    min-width: 180px;
  }
}

/* Public virtual-tour viewer */
.tour-topbar {
  top: 18px;
  left: 18px;
  right: auto;
  gap: 12px;
}

.tour-action-cluster {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(12, 16, 18, 0.82);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
  pointer-events: auto;
}

.tour-mode-toggle {
  position: fixed;
  top: 76px;
  left: 18px;
  display: flex;
  gap: 3px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 11px;
  background: rgba(12, 16, 18, 0.82);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
  pointer-events: auto;
}

.tour-quality-control {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  background: rgba(5, 14, 18, 0.82);
}

.tour-quality-control span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.tour-quality-control select {
  border: 0;
  background: transparent;
  color: #fff;
  font: inherit;
  font-weight: 760;
}

.tour-topbar .tour-mode-toggle button {
  min-height: 34px;
  padding: 0 11px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 720;
  white-space: nowrap;
}

.tour-topbar .tour-mode-toggle button.active {
  background: rgba(56, 189, 248, 0.2);
  color: #e0f7ff;
}

.tour-topbar .tour-mode-toggle button:disabled {
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
}

.tour-topbar .tour-mode-toggle .reset-splat-view {
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0 8px 8px 0;
}

.tour-topbar .tour-icon-button {
  display: grid;
  width: 40px;
  min-height: 40px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #f8fafc;
  touch-action: manipulation;
}

.tour-icon-button:hover,
.tour-icon-button.active {
  background: rgba(255, 255, 255, 0.12);
}

.tour-icon-button svg,
.tour-share-button svg,
.tour-ruler-mode-toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tour-location-chip {
  display: flex;
  min-height: 50px;
  flex-direction: column;
  justify-content: center;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: rgba(12, 16, 18, 0.78);
  color: #fff;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(16px);
  pointer-events: auto;
}

.tour-location-chip strong {
  max-width: min(36vw, 360px);
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tour-location-chip span,
.tour-topbar .tour-location-chip span {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
}

.tour-location-chip #tourUnitLabel {
  display: none;
}

.tour-share-button {
  position: absolute;
  z-index: 7;
  top: 18px;
  right: 18px;
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 11px;
  background: rgba(12, 16, 18, 0.82);
  color: #fff;
  font-weight: 750;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
  cursor: pointer;
  touch-action: manipulation;
}

.tour-share-button:hover {
  background: rgba(30, 36, 38, 0.92);
}

.tour-ruler-mode-toggle {
  position: absolute;
  z-index: 7;
  left: 50%;
  bottom: 28px;
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(12, 16, 18, 0.86);
  color: #fff;
  font-weight: 760;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(16px);
  cursor: pointer;
  transform: translateX(-50%);
  touch-action: manipulation;
  transition: bottom 160ms ease, background 160ms ease;
}

.tour-ruler-mode-toggle.active {
  bottom: 100px;
  border-color: rgba(250, 204, 21, 0.68);
  background: rgba(250, 204, 21, 0.92);
  color: #111827;
}

.tour-minimap {
  right: auto;
  left: 18px;
  bottom: 18px;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.32);
  transition: opacity 160ms ease, transform 160ms ease;
}

.tour-minimap.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

.tour-status {
  bottom: 210px;
}

.venue-logo {
  position: absolute;
  z-index: 6;
  right: 20px;
  bottom: 18px;
  display: flex;
  align-items: baseline;
  color: #fff;
  font-size: 22px;
  font-weight: 830;
  letter-spacing: -0.045em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.dollhouse-controls {
  position: absolute;
  z-index: 8;
  left: 18px;
  bottom: 18px;
  display: none;
  width: min(360px, calc(100vw - 36px));
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  background: rgba(12, 16, 18, 0.86);
  color: #fff;
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(16px);
}

.dollhouse-active .dollhouse-controls {
  display: grid;
  gap: 11px;
}

.dollhouse-intro .dollhouse-controls {
  display: none;
}

.dollhouse-control-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dollhouse-control-heading strong,
.dollhouse-control-heading span {
  display: block;
}

.dollhouse-control-heading strong {
  font-size: 14px;
}

.dollhouse-control-heading span {
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 11px;
}

.dollhouse-control-heading button {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.dollhouse-range {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 700;
}

.dollhouse-range input {
  width: 100%;
  accent-color: #facc15;
}

.dollhouse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
}

.dollhouse-toggle input {
  accent-color: #facc15;
}

.venue-logo b,
.access-brand b {
  color: #facc15;
}

.public-access-gate {
  position: absolute;
  z-index: 20;
  inset: 0;
  display: none;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 30%, rgba(59, 130, 246, 0.13), transparent 36%),
    #080b0d;
}

.public-access-gate.active {
  display: grid;
}

.access-card {
  width: min(440px, 100%);
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(19, 24, 27, 0.92);
  color: #f8fafc;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}

.access-brand {
  margin-bottom: 28px;
  font-size: 24px;
  font-weight: 830;
  letter-spacing: -0.045em;
}

.access-card h1 {
  margin: 0 0 8px;
  font-size: 26px;
}

.access-card p {
  margin: 0;
  color: #aab4b1;
  line-height: 1.55;
}

.tour-password-form {
  margin-top: 24px;
}

.tour-password-form[hidden],
.share-password-field[hidden] {
  display: none !important;
}

.tour-password-form label {
  display: block;
  margin-bottom: 7px;
  color: #dbe4e1;
  font-size: 13px;
  font-weight: 700;
}

.access-input-row {
  display: flex;
  gap: 8px;
}

.access-input-row input {
  min-width: 0;
  flex: 1;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9px;
  background: #0b1012;
  color: #fff;
}

.access-input-row button,
.share-save-row button {
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: #facc15;
  color: #111827;
  font-weight: 800;
  cursor: pointer;
}

#accessError {
  display: block;
  min-height: 18px;
  margin-top: 7px;
  color: #fda4af;
}

.public-viewer-mode .e57-toolbar,
.public-viewer-mode .studio-grid,
.public-viewer-mode .owner-only,
.viewer-share-dialog .owner-only-share {
  display: none !important;
}

.public-viewer-mode .tour-overlay {
  z-index: 100;
}

.public-viewer-mode .tour-status {
  display: none;
}

.embed-viewer-mode .tour-share-button,
.embed-viewer-mode .tour-location-chip {
  display: none;
}

/* Sharing dialog */
.share-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(880px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid #dce3e1;
  border-radius: 18px;
  background: #f7f9f8;
  color: #15201d;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.38);
}

.share-dialog::backdrop {
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(5px);
}

.share-dialog-shell {
  max-height: inherit;
  overflow: auto;
}

.share-dialog-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px 22px;
  border-bottom: 1px solid #e1e7e5;
  background: rgba(247, 249, 248, 0.96);
  backdrop-filter: blur(14px);
}

.share-dialog-header h2 {
  margin: 4px 0 5px;
  font-size: 25px;
  letter-spacing: -0.025em;
}

.share-dialog-header p,
.share-section-heading p {
  margin: 0;
  color: #68736f;
  font-size: 13px;
  line-height: 1.5;
}

.dialog-close-button {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid #d7dfdc;
  border-radius: 999px;
  background: #fff;
  color: #35413d;
  font-size: 24px;
  cursor: pointer;
}

.share-dialog-body {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.share-section {
  padding: 20px;
  border: 1px solid #dfe6e3;
  border-radius: 13px;
  background: #fff;
}

.share-section-heading {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.share-section-heading h3 {
  margin: 0 0 2px;
  font-size: 15px;
}

.share-section-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: #eef2f1;
  color: #33413c;
  font-size: 12px;
  font-weight: 800;
}

.copy-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid #ccd5d2;
  border-radius: 9px;
  background: #f7f9f8;
}

.copy-field input,
.copy-field textarea {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #33413c;
  font: 13px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
  resize: none;
}

.copy-field button {
  min-width: 92px;
  border: 0;
  border-left: 1px solid #ccd5d2;
  background: #15201d;
  color: #fff;
  font-weight: 760;
  cursor: pointer;
}

.code-field textarea {
  height: 86px;
}

.embed-options {
  display: flex;
  gap: 12px;
  margin-bottom: 10px;
}

.embed-options label,
.share-password-field {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #5c6965;
  font-size: 12px;
  font-weight: 700;
}

.embed-options input,
.share-password-field input {
  width: 92px;
  padding: 7px 9px;
  border: 1px solid #ccd5d2;
  border-radius: 7px;
  background: #fff;
}

.visibility-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.visibility-options label {
  display: flex;
  gap: 9px;
  padding: 12px;
  border: 1px solid #dce3e1;
  border-radius: 9px;
  cursor: pointer;
}

.visibility-options label:has(input:checked) {
  border-color: #4f6b62;
  background: #f0f5f3;
  box-shadow: inset 0 0 0 1px #4f6b62;
}

.visibility-options input {
  margin-top: 3px;
  accent-color: #1e5c49;
}

.visibility-options b,
.visibility-options small {
  display: block;
}

.visibility-options b {
  margin-bottom: 2px;
  font-size: 13px;
}

.visibility-options small {
  color: #71807b;
  font-size: 11px;
  line-height: 1.35;
}

.share-password-field {
  margin-top: 12px;
}

.share-password-field input {
  width: min(320px, 70%);
}

.share-save-row {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}

.share-save-row span {
  margin-right: auto;
  color: #64726d;
  font-size: 12px;
}

.share-save-row button {
  min-height: 40px;
}

@media (max-width: 720px) {
  .tour-topbar {
    top: 12px;
    left: 12px;
  }

  .tour-location-chip {
    display: none;
  }

  .tour-mode-toggle {
    top: 66px;
    left: 12px;
    max-width: calc(100vw - 24px);
  }

  .tour-topbar .tour-mode-toggle button {
    padding: 0 9px;
    font-size: 11px;
  }

  .tour-share-button {
    top: 12px;
    right: 12px;
    width: 44px;
    padding: 0;
    justify-content: center;
    font-size: 0;
  }

  .tour-minimap {
    left: 12px;
    bottom: 12px;
    transform: scale(0.82);
    transform-origin: left bottom;
  }

  .venue-logo {
    right: 14px;
    bottom: 12px;
    font-size: 19px;
  }

  .dollhouse-controls {
    left: 12px;
    bottom: 12px;
    width: min(320px, calc(100vw - 24px));
  }

  .visibility-options {
    grid-template-columns: 1fr;
  }

  .share-dialog-header,
  .share-section {
    padding: 18px;
  }

  .share-dialog-body {
    padding: 12px;
  }

  .copy-field {
    grid-template-columns: minmax(0, 1fr);
  }

  .copy-field button {
    min-height: 40px;
    border-top: 1px solid #ccd5d2;
    border-left: 0;
  }
}
