:root {
  --ink: #f6f4ed;
  --muted: rgba(246, 244, 237, 0.72);
  --panel: rgba(9, 11, 15, 0.68);
  --panel-strong: rgba(9, 11, 15, 0.86);
  --line: rgba(255, 255, 255, 0.13);
  --accent: #8fd3ff;
  --gold: #ffd280;
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Hiragino Sans GB", sans-serif;
  background:
    radial-gradient(circle at 30% 20%, rgba(135, 175, 220, 0.2), transparent 34%),
    linear-gradient(145deg, #11151e 0%, #252938 48%, #11131a 100%);
}

button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  padding: 10px 15px;
  font: inherit;
  cursor: pointer;
  backdrop-filter: blur(12px);
}

a {
  color: inherit;
}

button:hover,
button.active,
.nav-button:hover,
.nav-button.active {
  background: rgba(143, 211, 255, 0.2);
  border-color: rgba(143, 211, 255, 0.55);
}

.nav-button {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--ink);
  padding: 10px 15px;
  text-decoration: none;
  backdrop-filter: blur(12px);
}

.stage,
.view,
#panorama {
  position: absolute;
  inset: 0;
}

.view {
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

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

.hud {
  position: fixed;
  z-index: 20;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.top-left {
  top: 22px;
  left: 24px;
  max-width: min(360px, calc(100vw - 560px));
  min-width: 280px;
  padding: 18px 20px;
  border-radius: 22px;
}

.top-left h1 {
  margin: 4px 0 8px;
  font-size: clamp(24px, 2.45vw, 30px);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.top-left p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 11px;
  color: var(--accent);
}

.top-right {
  top: 20px;
  right: 22px;
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 999px;
}

.side-panel {
  right: 22px;
  top: 96px;
  bottom: 78px;
  width: 300px;
  display: grid;
  grid-template-rows: auto auto auto 1fr;
  gap: 12px;
  padding: 16px;
  border-radius: 24px;
}

.scene-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

#scene-count {
  color: var(--gold);
  font-size: 28px;
  font-weight: 700;
}

#scene-title {
  font-size: 18px;
}

#scene-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.scene-actions {
  display: flex;
  gap: 8px;
}

.scene-actions button {
  flex: 1;
  padding: 9px 10px;
}

.scene-list {
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-right: 4px;
}

.scene-card {
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  padding: 10px 12px;
  text-align: left;
}

.scene-card.active {
  color: #071018;
  background: linear-gradient(135deg, #8fd3ff, #ffd280);
}

.bottom-left {
  left: 24px;
  bottom: 22px;
  max-width: min(560px, calc(100vw - 48px));
  padding: 12px 16px;
  border-radius: 999px;
  color: var(--muted);
}

.model-loading {
  position: fixed;
  inset: 0;
  z-index: 19;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 48%, rgba(143, 211, 255, 0.14), transparent 0 24%, rgba(8, 12, 18, 0.28) 58%, transparent 78%);
  opacity: 1;
  transition: opacity 220ms ease;
}

.model-loading[hidden] {
  display: none;
}

.model-loading-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  max-width: min(420px, calc(100vw - 48px));
  border: 1px solid rgba(143, 211, 255, 0.26);
  border-radius: 24px;
  padding: 16px 18px;
  background: rgba(8, 12, 18, 0.76);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}

.model-loading-card .eyebrow {
  margin: 0 0 5px;
}

.model-loading-card strong,
.model-loading-card span {
  display: block;
}

.model-loading-card strong {
  font-size: 17px;
}

.model-loading-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.model-loading-orbit {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(143, 211, 255, 0.34);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 210, 128, 0.9) 0 4px, transparent 5px),
    conic-gradient(from 0deg, transparent 0 36%, rgba(143, 211, 255, 0.96) 48%, transparent 62% 100%);
  box-shadow: 0 0 0 8px rgba(143, 211, 255, 0.08);
  animation: model-loading-spin 1.05s linear infinite;
}

@keyframes model-loading-spin {
  to { transform: rotate(360deg); }
}

#model-stage.local-model {
  background:
    radial-gradient(circle at 50% 44%, rgba(143, 211, 255, 0.20), transparent 30%),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(145deg, #11151e 0%, #252938 48%, #11131a 100%);
  background-size: auto, 44px 44px, 44px 44px, auto;
}

#model-stage.local-model::before {
  content: "本地模型平面图";
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: min(68vw, 720px);
  height: min(54vh, 520px);
  border: 1px solid rgba(143, 211, 255, 0.22);
  border-radius: 34px;
  background:
    linear-gradient(135deg, rgba(143, 211, 255, 0.13), rgba(255, 210, 128, 0.07)),
    rgba(255,255,255,0.035);
  color: rgba(246, 244, 237, 0.28);
  display: grid;
  place-items: center;
  font-size: clamp(18px, 3vw, 34px);
  font-weight: 800;
  letter-spacing: 0.2em;
  transform: translate(-50%, -44%) rotate(-2deg);
  pointer-events: none;
  box-shadow: inset 0 0 60px rgba(143,211,255,0.08), 0 24px 90px rgba(0,0,0,0.26);
}

#model-stage.local-model .model-overlay {
  pointer-events: none;
}

#model-stage canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
}

.model-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
}

.model-room-range {
  position: absolute;
  left: 0;
  top: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  filter: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  cursor: pointer;
  pointer-events: none;
  touch-action: none;
  padding: 0;
  overflow: visible;
}

.model-room-range-shape {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.model-room-range-polygon {
  fill: transparent !important;
  stroke: rgba(255, 210, 128, 0.38);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  filter: none;
}

.model-room-range:active {
  cursor: pointer;
}

.model-room-range:focus,
.model-room-range:focus-visible {
  outline: none;
}

.model-room-range.selected .model-room-range-polygon {
  fill: transparent !important;
  stroke: rgba(143, 211, 255, 0.98);
  stroke-width: 2.5;
}

.model-room-range-move {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: transparent;
  pointer-events: none;
}

.model-room-range.selected .model-room-range-move {
  cursor: move;
  pointer-events: auto;
}

.model-room-range-name {
  position: absolute;
  z-index: 5;
  left: 10px;
  top: 8px;
  padding: 0;
  border-radius: 0;
  background: none;
  color: rgba(255, 228, 168, 0.72);
  font-size: 12px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.86), 0 0 2px rgba(0, 0, 0, 0.92);
  pointer-events: auto;
}

.model-room-range.selected .model-room-range-name {
  color: #ffe4a8;
}

.model-room-range-hint {
  position: absolute;
  z-index: 5;
  right: 10px;
  bottom: 8px;
  padding: 0;
  border-radius: 0;
  background: none;
  color: rgba(255, 244, 218, 0.82);
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.82);
}

.model-room-range-handle {
  position: absolute;
  z-index: 6;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(6, 9, 14, 0.82);
  border-radius: 999px;
  background: #ffd280;
  box-shadow: 0 0 0 3px rgba(255, 210, 128, 0.22);
  pointer-events: auto;
}

.model-room-range-handle.vertex-handle {
  transform: translate(-50%, -50%);
  cursor: grab;
}

.model-room-range-handle.vertex-handle:hover {
  background: #8fd3ff;
  box-shadow: 0 0 0 4px rgba(143, 211, 255, 0.26), 0 0 22px rgba(143, 211, 255, 0.45);
}

.model-room-range-edge {
  position: absolute;
  z-index: 2;
  pointer-events: auto;
  background: transparent;
}

.model-room-range-edge.polygon-edge {
  height: 18px;
  border-radius: 999px;
  transform-origin: 0 50%;
  cursor: grab;
  translate: 0 -9px;
}

.model-room-range-edge.polygon-edge:hover {
  background: rgba(143, 211, 255, 0.14);
}

.model-room-range:not(.selected) .model-room-range-handle,
.model-room-range:not(.selected) .model-room-range-edge,
.model-room-range:not(.selected) .model-room-range-hint {
  display: none;
}

.model-room-range-edge.edge-e {
  right: -8px;
  top: 0;
  bottom: 0;
  width: 16px;
  cursor: ew-resize;
}

.model-room-range-edge.edge-w {
  left: -8px;
  top: 0;
  bottom: 0;
  width: 16px;
  cursor: ew-resize;
}

.model-room-range-edge.edge-n {
  left: 0;
  right: 0;
  top: -8px;
  height: 16px;
  cursor: ns-resize;
}

.model-room-range-edge.edge-s {
  left: 0;
  right: 0;
  bottom: -8px;
  height: 16px;
  cursor: ns-resize;
}

body.editor-space-split-mode .space-label {
  display: none !important;
}

body.editor-space-split-mode .model-room-range-name,
body.editor-space-split-mode .model-room-range-hint {
  pointer-events: auto;
}

.model-room-range-handle.handle-e {
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.model-room-range-handle.handle-w {
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.model-room-range-handle.handle-n {
  left: 50%;
  top: -8px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.model-room-range-handle.handle-s {
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.model-room-range-handle.handle-ne {
  right: -8px;
  top: -8px;
  cursor: nesw-resize;
}

.model-room-range-handle.handle-se {
  right: -8px;
  bottom: -8px;
  cursor: nwse-resize;
}

.model-room-range-handle.handle-sw {
  left: -8px;
  bottom: -8px;
  cursor: nesw-resize;
}

.model-room-range-handle.handle-nw {
  left: -8px;
  top: -8px;
  cursor: nwse-resize;
}

.model-label {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  text-wrap: nowrap;
  line-height: 1;
  min-height: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(12px);
  pointer-events: auto;
  user-select: none;
  will-change: transform, opacity;
}

.model-label:hover,
.model-label.selected {
  border-color: rgba(143, 211, 255, 0.85);
  box-shadow: 0 12px 34px rgba(143, 211, 255, 0.2);
}

.space-label {
  transform: translate(-50%, -50%);
  min-height: 36px;
  padding: 10px 15px 10px 11px;
  border-radius: 12px;
  border-color: rgba(255, 210, 128, 0.62);
  background:
    linear-gradient(135deg, rgba(255, 210, 128, 0.2), rgba(98, 67, 24, 0.72)),
    rgba(13, 12, 8, 0.74);
  color: #ffe4a8;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.space-label::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: #ffd280;
  box-shadow: 0 0 0 4px rgba(255, 210, 128, 0.16);
  transform: rotate(45deg);
}

.point-label {
  --hotspot-width: 104px;
  --hotspot-height: 118px;
  --hotspot-floor-height: 27px;
  --hotspot-floor-bottom: 5px;
  --hotspot-anchor-y: 99.5px;
  transform: translate(-50%, calc(-1 * var(--hotspot-anchor-y, 99.5px)));
  transform-origin: 50% var(--hotspot-anchor-y, 99.5px);
  width: var(--hotspot-width);
  height: var(--hotspot-height);
  min-width: 0;
  min-height: 0;
  justify-content: center;
  align-items: flex-end;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #d9f3ff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: none;
  filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.42));
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
  touch-action: manipulation;
}

.point-label::before {
  content: none;
}

.point-label:hover,
.point-label.selected,
.point-label.active-scene {
  border-color: transparent;
  box-shadow: none;
}

.model-hotspot-floor {
  position: absolute;
  left: 50%;
  bottom: var(--hotspot-floor-bottom);
  width: 46px;
  height: var(--hotspot-floor-height);
  border: 2px solid rgba(143, 211, 255, 0.88);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(143, 211, 255, 0.12), transparent 66%);
  transform: translateX(-50%) rotate(var(--hotspot-floor-rotate, 0deg)) scaleY(var(--hotspot-floor-scale-y, 1));
  transform-origin: 50% 50%;
  pointer-events: none;
}

.model-hotspot-floor::before,
.model-hotspot-floor::after {
  content: "";
  position: absolute;
  inset: -2px;
  border: 1px solid rgba(143, 211, 255, 0.38);
  border-radius: 50%;
  animation: model-floor-pulse 1.9s ease-out infinite;
}

.model-hotspot-floor::after {
  animation-delay: 0.72s;
}

.model-hotspot-stem {
  position: absolute;
  left: 50%;
  bottom: 30px;
  height: 54px;
  border-left: 1px solid rgba(255, 255, 255, 0.7);
  transform: translateX(-50%);
  pointer-events: none;
}

.model-hotspot-core {
  position: absolute;
  left: 50%;
  bottom: 80px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #8fd3ff;
  border: 2px solid rgba(255, 255, 255, 0.94);
  box-shadow:
    0 0 0 4px rgba(143, 211, 255, 0.18),
    0 0 18px rgba(143, 211, 255, 0.86);
  transform: translateX(-50%);
  pointer-events: none;
}

.model-hotspot-core::before {
  content: "";
  position: absolute;
  inset: -10px;
  border: 1px solid rgba(143, 211, 255, 0.42);
  border-radius: 999px;
  animation: model-core-breathe 1.55s ease-in-out infinite;
}

.model-hotspot-text {
  position: absolute;
  left: 50%;
  bottom: 98px;
  max-width: 96px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateX(-50%);
  pointer-events: none;
}

.point-label:hover .model-hotspot-floor,
.point-label.selected .model-hotspot-floor,
.point-label.active-scene .model-hotspot-floor {
  border-color: rgba(255, 255, 255, 0.96);
  background: radial-gradient(circle, rgba(143, 211, 255, 0.22), transparent 68%);
}

.point-label.selected .model-hotspot-floor {
  border-color: rgba(255, 210, 128, 0.98);
  box-shadow: 0 0 0 4px rgba(255, 210, 128, 0.2), 0 0 24px rgba(255, 210, 128, 0.42);
}

.point-label:hover .model-hotspot-core,
.point-label.selected .model-hotspot-core,
.point-label.active-scene .model-hotspot-core {
  background: #fff;
  box-shadow:
    0 0 0 5px rgba(143, 211, 255, 0.22),
    0 0 26px rgba(143, 211, 255, 0.98);
}

.point-label.selected .model-hotspot-core {
  background: #ffd280;
  box-shadow:
    0 0 0 5px rgba(255, 210, 128, 0.24),
    0 0 28px rgba(255, 210, 128, 0.96);
}

.point-label.selected .model-hotspot-text {
  color: #ffe4a8;
}

body.editor-space-split-mode .point-label {
  --hotspot-width: 72px;
  --hotspot-height: 78px;
  --hotspot-floor-height: 21px;
  --hotspot-floor-bottom: 4px;
  --hotspot-anchor-y: 63.5px;
  z-index: 7;
  color: rgba(217, 243, 255, 0.9);
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.36));
  pointer-events: none;
}

body.editor-space-split-mode .point-label .model-hotspot-floor {
  width: 34px;
  border-color: rgba(143, 211, 255, 0.82);
  background: radial-gradient(circle, rgba(143, 211, 255, 0.16), transparent 68%);
}

body.editor-space-split-mode .point-label .model-hotspot-stem {
  bottom: 24px;
  height: 32px;
  opacity: 0.72;
}

body.editor-space-split-mode .point-label .model-hotspot-core {
  bottom: 52px;
  width: 7px;
  height: 7px;
}

body.editor-space-split-mode .point-label .model-hotspot-text {
  bottom: 65px;
  max-width: 74px;
  font-size: 10px;
}

body.editor-space-split-mode .point-label.point-conflict {
  z-index: 9;
  color: #ffe4a8;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
}

body.editor-space-split-mode .point-label.point-conflict .model-hotspot-floor {
  border-color: rgba(255, 210, 128, 0.98);
  background: radial-gradient(circle, rgba(255, 210, 128, 0.24), transparent 70%);
  box-shadow: 0 0 0 4px rgba(255, 210, 128, 0.18), 0 0 24px rgba(255, 210, 128, 0.36);
}

body.editor-space-split-mode .point-label.point-conflict .model-hotspot-core {
  background: #ffd280;
  box-shadow:
    0 0 0 5px rgba(255, 210, 128, 0.24),
    0 0 28px rgba(255, 210, 128, 0.96);
}

body.editor-space-split-mode .point-label.point-unassigned {
  color: #ffb4b4;
}

body.editor-space-split-mode .point-label.point-unassigned .model-hotspot-floor {
  border-color: rgba(255, 134, 134, 0.92);
  background: radial-gradient(circle, rgba(255, 134, 134, 0.18), transparent 70%);
}

body.editor-space-split-mode .point-label.point-unassigned .model-hotspot-core {
  background: #ff8686;
  box-shadow:
    0 0 0 5px rgba(255, 134, 134, 0.18),
    0 0 22px rgba(255, 134, 134, 0.78);
}

.model-hotspot-burst {
  position: absolute;
  z-index: 10;
  left: 0;
  top: 0;
  width: 112px;
  height: 112px;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.model-hotspot-burst span {
  position: absolute;
  inset: 42px;
  border: 2px solid rgba(143, 211, 255, 0.86);
  border-radius: 999px;
  opacity: 0;
  animation: model-hotspot-burst 780ms cubic-bezier(0.12, 0.76, 0.22, 1) both;
}

.model-hotspot-burst span:nth-child(2) {
  border-color: rgba(255, 255, 255, 0.82);
  animation-delay: 80ms;
}

.model-hotspot-burst span:nth-child(3) {
  border-color: rgba(255, 210, 128, 0.76);
  animation-delay: 150ms;
}

@keyframes model-floor-pulse {
  0% {
    opacity: 0.7;
    transform: scale(0.86);
  }
  100% {
    opacity: 0;
    transform: scale(1.65);
  }
}

@keyframes model-core-breathe {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.72);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes model-hotspot-burst {
  0% {
    opacity: 0;
    transform: scale(0.2);
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(2.8);
  }
}

body.editing #edit-link {
  display: none;
}

body.editing .side-panel {
  display: none;
}

.editor-panel {
  right: 22px;
  top: 96px;
  bottom: 22px;
  width: min(430px, calc(100vw - 44px));
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 16px;
  border-radius: 24px;
  min-height: 0;
  overflow: hidden;
}

.editor-panel[hidden] {
  display: none;
}

.editor-panel [hidden] {
  display: none !important;
}

.mobile-editor-shell {
  display: none;
}

.editor-sheet-toggle {
  width: 100%;
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 8px 12px 10px;
  border-radius: 18px;
}

.editor-sheet-handle {
  width: 48px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.26);
}

.mobile-editor-summary {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.mobile-editor-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mobile-editor-nav button.active {
  border-color: rgba(143, 211, 255, 0.7);
  background: rgba(143, 211, 255, 0.14);
}

.editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.editor-head h2 {
  margin: 4px 0 0;
  font-size: 24px;
}

.close-editor {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.08);
}

.editor-help {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.editor-switches,
.editor-mode-switch,
.editor-tabs,
.editor-tools,
.editor-history-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-start;
  flex: 0 0 auto;
}

.editor-mode-switch button.active {
  border-color: rgba(143, 211, 255, 0.7);
  background: rgba(143, 211, 255, 0.14);
}

body.editor-points-mode .editor-help {
  display: none;
}

body.editor-space-split-mode .editor-tools,
body.editor-space-split-mode #label-json {
  display: none !important;
}

.editor-history-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.editor-switches label {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  flex: 0 0 auto;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 11px;
  min-height: 34px;
  max-height: 34px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.06);
}

.editor-tabs button,
.editor-tools button {
  padding: 8px 12px;
}

.config-env-panel {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(143, 211, 255, 0.18);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.045);
  flex: 0 0 auto;
}

.config-env-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.config-env-head strong {
  color: var(--accent);
  font-size: 13px;
}

.config-env-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.config-env-diff {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.config-env-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.05);
}

.config-env-pill.same {
  color: rgba(190, 255, 210, 0.92);
  border-color: rgba(118, 216, 150, 0.38);
}

.config-env-pill.diff {
  color: rgba(255, 210, 128, 0.95);
  border-color: rgba(255, 210, 128, 0.42);
}

.config-env-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.config-env-actions button {
  padding: 7px 10px;
  font-size: 12px;
}

.config-env-actions button[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.add-room-button {
  margin-left: auto;
  border-color: rgba(255, 210, 128, 0.42);
  background: rgba(255, 210, 128, 0.13);
}

.editor-list {
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 10px;
  padding-right: 4px;
  min-height: 0;
  flex: 1 1 auto;
}

body.editor-space-split-mode .editor-panel {
  width: min(360px, calc(100vw - 44px));
}

body.editor-space-split-mode .editor-help {
  font-size: 12px;
  line-height: 1.4;
}

body.editor-space-split-mode .editor-switches {
  display: none;
}

body.editor-space-split-mode .editor-list {
  gap: 8px;
}

.editor-overview {
  display: grid;
  gap: 10px;
}

.editor-overview-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.editor-overview-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.editor-overview-head strong {
  font-size: 13px;
}

.editor-overview-head span {
  color: var(--muted);
  font-size: 11px;
}

.space-graph,
.scene-pool {
  display: grid;
  gap: 8px;
}

.space-graph-room,
.scene-pool-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(8, 12, 18, 0.45);
}

.space-graph-room.selected {
  border-color: rgba(143, 211, 255, 0.7);
  box-shadow: 0 0 0 1px rgba(143, 211, 255, 0.18) inset;
}

.space-graph-room.is-hidden {
  opacity: 0.55;
}

.space-graph-room-head,
.scene-pool-group-head,
.scene-chip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.space-graph-room-meta,
.scene-pool-empty,
.scene-chip-meta {
  color: var(--muted);
  font-size: 11px;
}

.scene-chip-list {
  display: grid;
  gap: 6px;
}

.room-scene-sort-list {
  margin-top: 2px;
}

.scene-chip-row {
  padding: 7px 8px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
}

.scene-chip-row.is-hidden {
  opacity: 0.58;
}

.scene-chip-main {
  all: unset;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
}

.scene-chip-main:hover {
  color: #8fd3ff;
}

.scene-chip-actions {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sortable-chip {
  cursor: grab;
}

.sortable-chip.dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.sortable-chip.drag-over {
  border-color: rgba(255, 210, 128, 0.7);
  box-shadow: inset 0 0 0 1px rgba(255, 210, 128, 0.2);
}

.scene-chip-actions button,
.space-graph-room button {
  padding: 5px 8px;
  font-size: 11px;
}

.edit-card.room-card .assignment-summary::before {
  content: '空间分割';
  display: inline-flex;
  width: fit-content;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(143, 211, 255, 0.24);
  color: #8fd3ff;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.edit-card {
  display: grid;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.07);
  min-width: 0;
}

.edit-card.selected {
  border-color: rgba(143, 211, 255, 0.7);
  background: rgba(143, 211, 255, 0.12);
}

.assignment-summary {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.assignment-summary strong {
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.assignment-summary span {
  font-size: 13px;
  line-height: 1.45;
}

.assignment-summary.is-assigned {
  border-color: rgba(143, 211, 255, 0.32);
  background: rgba(143, 211, 255, 0.09);
}

.assignment-summary.is-conflict {
  border-color: rgba(255, 210, 128, 0.4);
  background: rgba(255, 210, 128, 0.10);
}

.assignment-summary.is-unassigned {
  border-color: rgba(255, 134, 134, 0.38);
  background: rgba(255, 134, 134, 0.10);
}

.assignment-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.assignment-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(6, 9, 14, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.84);
  font-size: 12px;
}

.sortable-card {
  cursor: grab;
}

.sortable-card.dragging {
  opacity: 0.55;
  cursor: grabbing;
}

.sortable-card.drag-over {
  border-color: rgba(255, 210, 128, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255, 210, 128, 0.25);
}

.space-sort-card {
  cursor: grab;
}

.sortable-card input,
.sortable-card button {
  cursor: auto;
}

.edit-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  min-width: 0;
}

.edit-card-title > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.edit-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.edit-card input[type="text"],
.edit-card input[type="number"],
#label-json {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.09);
  color: var(--ink);
  padding: 9px 10px;
  font: inherit;
  outline: none;
}

.edit-card input:focus,
#label-json:focus {
  border-color: rgba(143, 211, 255, 0.65);
}

.edit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  min-width: 0;
}

.shape-summary {
  display: grid;
  grid-column: 1 / -1;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 12px;
}

.shape-summary strong {
  color: var(--ink);
  font-size: 12px;
}

.shape-summary span {
  line-height: 1.45;
}

body.editor-space-split-mode .edit-card {
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
}

body.editor-space-split-mode .edit-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.editor-space-split-mode .edit-card label {
  min-width: 0;
}

body.editor-space-split-mode .edit-card input[type="text"],
body.editor-space-split-mode .edit-card input[type="number"] {
  min-width: 0;
  padding: 7px 8px;
  border-radius: 10px;
}

body.editor-space-split-mode .assignment-summary {
  padding: 8px;
}

.edit-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.edit-actions button {
  padding: 7px 10px;
  font-size: 12px;
}

.edit-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.danger-button {
  border-color: rgba(255, 130, 130, 0.32);
  color: #ffd1d1;
  background: rgba(255, 80, 80, 0.1);
}

#label-json {
  resize: none;
  min-height: 100px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.pnlm-hotspot-base.route-hotspot {
  width: 0;
  height: 0;
  background: none !important;
  background-image: none !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
}

.pnlm-hotspot.route-hotspot,
.pnlm-hotspot.route-hotspot::before,
.pnlm-hotspot.route-hotspot::after {
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

.pnlm-load-box {
  display: none !important;
}

.route-hotspot-target {
  position: absolute;
  left: 0;
  top: 0;
  width: 176px;
  height: 136px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: #fff;
  transform: translate(-50%, -96%);
  transform-origin: 50% 96%;
  filter: none;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  cursor: pointer;
  pointer-events: auto;
}

.route-hotspot-target:focus-visible .route-hotspot-anchor::before,
.route-hotspot-target:hover .route-hotspot-anchor::before,
.route-hotspot-anchor:hover::before,
.route-hotspot-anchor:focus-visible::before,
.route-hotspot-anchor:active::before {
  border-color: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.14);
}

.route-hotspot-target:active .route-hotspot-anchor,
.route-hotspot-anchor:active {
  transform: translateX(-50%) scale(0.92);
}

.route-hotspot-ground-line {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 46px;
  height: 26px;
  border: 2px solid rgba(143, 211, 255, 0.88);
  border-radius: 50%;
  background: transparent;
  transform: translateX(-50%);
  transform-origin: 50% 100%;
  pointer-events: none;
}

.route-hotspot-near-room .route-hotspot-ground-line {
  border-style: dashed;
  border-color: rgba(255, 210, 128, 0.88);
  background: transparent;
}

.route-hotspot-anchor {
  all: unset;
  position: absolute;
  left: 50%;
  bottom: 77px;
  width: 20px;
  height: 20px;
  min-width: 20px;
  min-height: 20px;
  max-width: 20px;
  max-height: 20px;
  box-sizing: border-box;
  display: block;
  cursor: pointer;
  transform: translateX(-50%);
  pointer-events: auto;
  appearance: none;
  -webkit-appearance: none;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none;
}

.route-hotspot-anchor::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-radius: 999px;
  background: rgba(143, 211, 255, 0.94);
  box-shadow: 0 0 0 2px rgba(143, 211, 255, 0.12);
}

.route-hotspot-near-room .route-hotspot-anchor::before {
  background: rgba(255, 210, 128, 0.92);
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 2px rgba(255, 210, 128, 0.16);
}

.route-hotspot-stem {
  position: absolute;
  left: 50%;
  bottom: 22px;
  height: 54px;
  border-left: 1px solid rgba(255, 255, 255, 0.7);
  transform: translateX(-50%);
  pointer-events: none;
}

.route-hotspot-label {
  position: absolute;
  left: 50%;
  bottom: 104px;
  min-width: 0;
  max-width: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  color: #fff;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.75);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.15;
  overflow: visible;
  text-align: center;
  text-overflow: clip;
  white-space: nowrap;
  transform: translateX(-50%);
  backdrop-filter: none;
  pointer-events: none;
}

.route-hotspot-current-room .route-hotspot-label {
  border-color: rgba(143, 211, 255, 0.42);
}

.route-hotspot-near-room .route-hotspot-label {
  border-color: rgba(255, 210, 128, 0.42);
  color: #ffe4a8;
}

#app::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 18;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at var(--travel-origin-x, 50%) var(--travel-origin-y, 54%), rgba(255, 255, 255, 0.3), transparent 0 7%, rgba(143, 211, 255, 0.2) 8%, transparent 28%),
    radial-gradient(circle at 50% 50%, transparent 0 46%, rgba(4, 8, 14, 0.54) 100%);
  transform: translate3d(0, 0, 0) scale(1);
}

#app.travel-forward::after {
  animation: travel-forward 720ms cubic-bezier(0.18, 0.82, 0.24, 1) both;
}

#app.travel-forward .view.active {
  animation: view-forward 560ms cubic-bezier(0.18, 0.82, 0.24, 1) both;
}

#panorama-stage.pano-arriving {
  animation: pano-arrive 620ms cubic-bezier(0.16, 0.84, 0.22, 1) both;
}

#model-stage.model-arriving {
  animation: model-arrive 620ms cubic-bezier(0.16, 0.84, 0.22, 1) both;
}

@keyframes travel-forward {
  0% {
    opacity: 0;
    transform: translate3d(0, 0, 0) scale(1);
  }
  35% {
    opacity: 1;
    transform: translate3d(var(--travel-x, 0), var(--travel-y, -18px), 0) scale(1.1);
  }
  100% {
    opacity: 0;
    transform: translate3d(calc(var(--travel-x, 0) * 1.9), calc(var(--travel-y, -18px) * 1.9), 0) scale(1.24);
  }
}

@keyframes view-forward {
  0% {
    filter: none;
    transform: translate3d(0, 0, 0) scale(1);
  }
  55% {
    filter: blur(4px) saturate(1.16) brightness(1.08);
    opacity: 0.74;
    transform: translate3d(calc(var(--travel-x, 0) * -0.24), calc(var(--travel-y, -18px) * -0.2), 0) scale(1.09);
  }
  100% {
    filter: blur(9px) saturate(1.04) brightness(0.98);
    opacity: 0.18;
    transform: translate3d(calc(var(--travel-x, 0) * -0.42), calc(var(--travel-y, -18px) * -0.34), 0) scale(1.16);
  }
}

@keyframes pano-arrive {
  0% {
    filter: blur(10px) saturate(1.04) brightness(1.08);
    opacity: 0.24;
    transform: translate3d(calc(var(--travel-x, 0) * 0.32), calc(var(--travel-y, -18px) * 0.28), 0) scale(1.12);
  }
  58% {
    filter: blur(2px) saturate(1.08) brightness(1.04);
    opacity: 1;
    transform: translate3d(calc(var(--travel-x, 0) * 0.08), calc(var(--travel-y, -18px) * 0.06), 0) scale(1.035);
  }
  100% {
    filter: none;
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes model-arrive {
  0% {
    filter: blur(8px) saturate(1.04) brightness(1.06);
    opacity: 0.28;
    transform: translate3d(calc(var(--travel-x, 0) * 0.24), calc(var(--travel-y, -18px) * 0.2), 0) scale(1.1);
  }
  58% {
    filter: blur(1.5px) saturate(1.06) brightness(1.03);
    opacity: 1;
    transform: translate3d(calc(var(--travel-x, 0) * 0.06), calc(var(--travel-y, -18px) * 0.05), 0) scale(1.025);
  }
  100% {
    filter: none;
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .model-hotspot-floor::before,
  .model-hotspot-floor::after,
  .model-hotspot-core::before,
  .model-hotspot-burst span,
  #app.travel-forward::after,
  #app.travel-forward .view.active,
  #panorama-stage.pano-arriving,
  #model-stage.model-arriving {
    animation: none;
  }
}


@media (max-width: 1120px) and (min-width: 901px) {
  button,
  .nav-button {
    padding: 8px 11px;
    min-height: 38px;
    font-size: 13px;
  }

  .top-left {
    max-width: 304px;
    min-width: 0;
    padding: 14px 16px;
  }

  .top-left h1 {
    font-size: 24px;
  }

  .top-right {
    gap: 7px;
    padding: 8px;
  }
}

@media (max-width: 900px) {
  button,
  .nav-button {
    padding: 9px 12px;
    min-height: 40px;
    font-size: 13px;
  }

  .top-left {
    top: max(12px, env(safe-area-inset-top));
    left: 88px;
    right: 12px;
    max-width: none;
    min-width: 0;
    padding: 10px 14px;
    border-radius: 18px;
  }

  .top-left h1 {
    margin: 2px 0 4px;
    font-size: 20px;
    white-space: normal;
    line-height: 1.12;
  }

  .top-left .eyebrow,
  #project-meta {
    font-size: 10px;
  }

  .top-right {
    top: auto;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 10px;
    right: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    gap: 6px;
    padding: 7px;
    border-radius: 22px;
  }

  .top-right button,
  .top-right .nav-button {
    justify-content: center;
    padding-left: 6px;
    padding-right: 6px;
    white-space: nowrap;
  }

  .side-panel {
    display: grid;
    left: 10px;
    right: 10px;
    top: auto;
    bottom: calc(80px + env(safe-area-inset-bottom));
    width: auto;
    max-height: min(22vh, 168px);
    padding: 9px 10px;
    border-radius: 20px;
    grid-template-rows: auto 1fr;
    gap: 8px;
  }

  .scene-identity {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 10px;
    align-items: center;
  }

  #scene-meta,
  .scene-actions {
    display: none;
  }

  .scene-list {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(116px, 42vw);
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
  }

  .scene-card {
    min-height: 58px;
    padding: 9px 10px;
    scroll-snap-align: start;
  }

  .model-loading {
    align-items: start;
    padding-top: calc(104px + env(safe-area-inset-top));
    padding-bottom: calc(176px + env(safe-area-inset-bottom));
  }

  .model-loading-card {
    justify-self: center;
    width: min(100%, calc(100vw - 28px), 360px);
    max-width: calc(100vw - 28px);
    padding: 13px 14px;
    border-radius: 20px;
  }

  .model-loading-orbit {
    width: 34px;
    height: 34px;
  }

  .bottom-left {
    display: none;
  }

  .space-label {
    padding: 7px 10px 7px 8px;
    font-size: 12px;
  }

  .point-label {
    min-width: 28px;
    padding: 6px 7px;
    font-size: 9px;
  }


  .route-hotspot-target {
    width: 124px;
    height: 112px;
    transform: translate(-50%, -92%);
    transform-origin: 50% 92%;
  }

  .route-hotspot-ground-line {
    width: 34px;
    height: 18px;
  }

  .route-hotspot-anchor {
    bottom: 61px;
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    max-width: 16px;
    max-height: 16px;
  }

  .route-hotspot-anchor::before {
    inset: 3px;
  }

  .route-hotspot-stem {
    bottom: 18px;
    height: 42px;
  }

  .route-hotspot-label {
    bottom: 82px;
    min-width: 0;
    max-width: none;
    padding: 0;
    font-size: 10px;
    line-height: 1.1;
    letter-spacing: 0;
  }

  #model-stage.local-model::before {
    width: calc(100vw - 42px);
    height: min(54vh, 430px);
    top: 50%;
    border-radius: 26px;
    transform: translate(-50%, -46%) rotate(-2deg);
  }

  body.mobile-editor-layout .editor-panel {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: calc(8px + env(safe-area-inset-bottom));
    width: auto;
    max-height: min(72vh, 620px);
    min-height: 0;
    grid-template-rows: auto auto auto auto minmax(0, 1fr) auto 96px;
    gap: 8px;
    padding: 10px;
    border-radius: 20px;
    transform: translateY(calc(100% - 108px));
    transition: transform 180ms ease, box-shadow 180ms ease;
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.22);
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  body.mobile-editor-layout.mobile-editor-sheet-open .editor-panel {
    transform: translateY(0);
  }

  .mobile-editor-shell {
    display: grid;
    gap: 6px;
    position: sticky;
    top: 0;
    z-index: 3;
    padding-bottom: 4px;
    background: linear-gradient(180deg, rgba(9, 11, 15, 0.96), rgba(9, 11, 15, 0.78) 72%, transparent);
  }

  body.mobile-editor-layout .editor-sheet-toggle {
    display: grid;
    width: 100%;
  }

  body.mobile-editor-layout .editor-head {
    display: none;
  }

  body.mobile-editor-layout:not(.mobile-editor-sheet-open) .editor-panel {
    overflow: hidden;
  }

  body.mobile-editor-layout:not(.mobile-editor-sheet-open) .editor-panel > :not(.mobile-editor-shell) {
    display: none !important;
  }

  body.mobile-editor-layout:not(.mobile-editor-sheet-open) .mobile-editor-nav {
    display: none;
  }

  body.mobile-editor-layout .editor-help {
    font-size: 11px;
    line-height: 1.45;
  }

  body.editing.mobile-editor-layout .top-left {
    left: 12px;
    right: 88px;
    top: 12px;
    max-width: none;
    padding: 8px 12px;
    border-radius: 16px;
  }

  body.editing.mobile-editor-layout .top-left h1 {
    font-size: 16px;
    line-height: 1.1;
  }

  body.editing.mobile-editor-layout #project-meta {
    display: none;
  }

  body.mobile-editor-layout .editor-switches,
  body.mobile-editor-layout .editor-mode-switch,
  body.mobile-editor-layout .editor-tabs,
  body.mobile-editor-layout .editor-history-actions {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }

  body.mobile-editor-layout .editor-overview,
  body.mobile-editor-layout .editor-list,
  body.mobile-editor-layout .editor-tools,
  body.mobile-editor-layout #label-json {
    min-height: 0;
  }

  body.mobile-editor-layout .editor-overview,
  body.mobile-editor-layout .editor-list,
  body.mobile-editor-layout .scene-pool,
  body.mobile-editor-layout .space-graph {
    overflow: visible;
  }

  body.mobile-editor-layout .editor-list {
    align-content: start;
    gap: 10px;
  }

  body.mobile-editor-layout .edit-card {
    border-radius: 16px;
    padding: 10px;
  }

  body.mobile-editor-layout .edit-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body.mobile-editor-layout .edit-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  body.mobile-editor-layout .edit-actions button,
  body.mobile-editor-layout .mobile-editor-nav button,
  body.mobile-editor-layout .editor-mode-switch button,
  body.mobile-editor-layout .editor-tabs button,
  body.mobile-editor-layout .editor-switches label,
  body.mobile-editor-layout .editor-tools button,
  body.mobile-editor-layout .editor-history-actions button,
  body.mobile-editor-layout .editor-sheet-toggle {
    min-height: 34px;
    padding: 7px 10px;
    font-size: 12px;
  }

  body.mobile-editor-layout .editor-tools {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  body.mobile-editor-layout.editor-points-mode .editor-panel {
    max-height: min(46vh, 360px);
  }

  body.mobile-editor-layout.editor-points-mode .editor-overview,
  body.mobile-editor-layout.editor-points-mode .editor-tabs,
  body.mobile-editor-layout.editor-points-mode .editor-switches,
  body.mobile-editor-layout.editor-points-mode .editor-tools,
  body.mobile-editor-layout.editor-points-mode #label-json {
    display: none !important;
  }

  body.mobile-editor-layout.editor-points-mode .editor-list {
    gap: 10px;
  }

  body.mobile-editor-layout.editor-points-mode .editor-list .edit-card:not(.selected) {
    display: none !important;
  }

  body.mobile-editor-layout.editor-space-split-mode .editor-panel {
    max-height: 220px;
    transform: translateY(calc(100% - 88px));
  }

  body.mobile-editor-layout.editor-space-split-mode .mobile-editor-nav,
  body.mobile-editor-layout.editor-space-split-mode .editor-list,
  body.mobile-editor-layout.editor-space-split-mode .editor-overview,
  body.mobile-editor-layout.editor-space-split-mode .editor-tools,
  body.mobile-editor-layout.editor-space-split-mode #label-json,
  body.mobile-editor-layout.editor-space-split-mode .editor-tabs {
    display: none !important;
  }

  body.mobile-editor-layout .scene-chip-row,
  body.mobile-editor-layout .space-graph-room-head,
  body.mobile-editor-layout .scene-pool-group-head {
    align-items: start;
    flex-direction: column;
    gap: 6px;
  }

  body.mobile-editor-layout .scene-chip-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
  }

  body.mobile-editor-layout .stage,
  body.mobile-editor-layout #model-stage,
  body.mobile-editor-layout #panorama-stage {
    padding-bottom: 116px;
  }

  .edit-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .top-left {
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    left: 82px;
    right: 12px;
    gap: 4px;
    padding: 8px 12px;
  }

  .top-left .eyebrow {
    grid-column: 1 / -1;
    font-size: 9px;
  }

  .top-left h1 {
    margin: 0;
    font-size: 18px;
    white-space: normal;
    line-height: 1.1;
  }

  #project-meta {
    display: none;
  }

  .top-right {
    grid-template-columns: repeat(auto-fit, minmax(58px, 1fr));
  }

  .top-right button,
  .top-right .nav-button {
    min-height: 42px;
    font-size: 12px;
  }

  .side-panel {
    max-height: 144px;
  }

  #scene-count {
    font-size: 22px;
  }

  #scene-title {
    font-size: 15px;
  }
}
