:root {
  color-scheme: dark;
  --ink: #07131b;
  --panel: rgba(8, 23, 31, 0.82);
  --panel-strong: rgba(7, 19, 27, 0.94);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f5fbfc;
  --muted: #b8c8cd;
  --cyan: #43d6c5;
  --amber: #ffbd59;
  --danger: #ff7f73;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--ink); }
button, input, select { font: inherit; }

.tour-shell, #panorama { position: fixed; inset: 0; }
#panorama { background: radial-gradient(circle at 50% 45%, #19313a, var(--ink) 65%); }
.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
}

.brand-panel {
  position: fixed;
  z-index: 12;
  top: max(20px, env(safe-area-inset-top));
  left: max(20px, env(safe-area-inset-left));
  min-width: 230px;
  max-width: min(380px, calc(100vw - 40px));
  padding: 16px 18px 15px;
  border-radius: 16px;
}
.brand-kicker { color: var(--cyan); font-size: 0.75rem; font-weight: 800; letter-spacing: 0.2em; }
.brand-panel h1 { margin: 4px 0 1px; font-size: clamp(1.15rem, 2.2vw, 1.55rem); line-height: 1.1; }
.brand-panel p { margin: 5px 0 0; color: var(--muted); font-size: 0.9rem; }

.scene-dock {
  position: fixed;
  z-index: 12;
  left: max(20px, env(safe-area-inset-left));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: min(350px, calc(100vw - 40px));
  padding: 8px;
  border-radius: 18px;
}
.dock-heading {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px 10px; border: 0; color: var(--text); background: transparent;
  font-weight: 720; text-align: left; cursor: pointer;
}
.count { min-width: 26px; padding: 3px 8px; border-radius: 999px; color: var(--ink); background: var(--cyan); text-align: center; font-size: 0.78rem; }
.scene-list { display: grid; gap: 6px; max-height: min(34vh, 260px); overflow: auto; }
.scene-list[hidden] { display: none; }
.scene-button {
  display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 10px;
  width: 100%; padding: 8px; border-radius: 12px; border: 1px solid transparent;
  background: rgba(255,255,255,0.055); color: var(--text); text-align: left; cursor: pointer;
  transition: 160ms ease;
}
.scene-button:hover { background: rgba(255,255,255,0.10); transform: translateY(-1px); }
.scene-button.active { border-color: rgba(67,214,197,.75); background: rgba(67,214,197,.12); }
.scene-index { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: #16323a; color: var(--cyan); font-weight: 800; }
.scene-name { font-size: .9rem; font-weight: 660; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hint {
  position: fixed; z-index: 12; right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px;
  color: var(--muted); font-size: .82rem;
}
.hint button { border: 0; color: var(--muted); background: transparent; cursor: pointer; font-size: 1.2rem; line-height: 1; }
.mouse-icon { width: 17px; height: 24px; border: 2px solid var(--cyan); border-radius: 9px; position: relative; }
.mouse-icon::after { content: ""; position: absolute; width: 2px; height: 5px; top: 4px; left: 5.5px; border-radius: 2px; background: var(--cyan); }

.loading-panel, .error-panel {
  position: fixed; z-index: 30; left: 50%; top: 50%; transform: translate(-50%, -50%);
}
.loading-panel { display: grid; justify-items: center; gap: 9px; color: var(--text); text-align: center; }
.loading-panel[hidden], .error-panel[hidden] { display: none; }
.loading-panel span { color: var(--muted); font-size: .9rem; }
.loader-ring { width: 44px; height: 44px; border: 3px solid rgba(255,255,255,.16); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.error-panel { width: min(440px, calc(100vw - 40px)); padding: 22px; border-radius: 16px; }
.error-panel strong { color: var(--danger); }
.error-panel p { color: var(--muted); line-height: 1.5; }

.tour-hotspot { width: 42px; height: 42px; border-radius: 50%; background: var(--amber); border: 3px solid white; box-shadow: 0 8px 22px rgba(0,0,0,.42); }
.tour-hotspot::before { content: ""; position: absolute; inset: 10px 12px 10px 8px; border-top: 3px solid var(--ink); border-right: 3px solid var(--ink); transform: rotate(45deg); }
.tour-tooltip { position: absolute; left: 50px; top: 2px; min-width: max-content; max-width: 220px; padding: 8px 11px; border-radius: 9px; color: var(--text); background: var(--panel-strong); border: 1px solid var(--line); font-size: .82rem; font-weight: 700; pointer-events: none; }

.flat-public-stage { position: absolute; overflow: hidden; border: 1px solid rgba(255,255,255,.14); background: #020709; box-shadow: 0 22px 70px rgba(0,0,0,.42); }
.flat-public-stage > img { display: block; width: 100%; height: 100%; object-fit: fill; }
.flat-public-hotspot { position: absolute; z-index: 4; width: 42px; height: 42px; transform: translate(-50%,-50%); border: 3px solid white; border-radius: 50%; color: var(--ink); background: var(--amber); font-size: 1.25rem; font-weight: 900; cursor: pointer; box-shadow: 0 8px 22px rgba(0,0,0,.5); }
.flat-public-hotspot::after { content: attr(data-label); position: absolute; left: 50px; top: 2px; width: max-content; max-width: 220px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--panel-strong); font-size: .82rem; font-weight: 700; }
.compat-badge { position: fixed; z-index: 12; right: 20px; top: 20px; max-width: min(360px, calc(100vw - 40px)); padding: 9px 12px; border: 1px solid rgba(255,189,89,.42); border-radius: 11px; color: #fff2d9; background: rgba(45,31,8,.9); font-size: .78rem; text-align: center; }

.pnlm-load-box, .pnlm-about-msg { display: none !important; }
.pnlm-controls-container { right: 20px !important; left: auto !important; top: 20px !important; }

@media (max-width: 700px) {
  .brand-panel { top: max(12px, env(safe-area-inset-top)); left: 12px; max-width: calc(100vw - 76px); padding: 12px 14px; }
  .brand-panel h1 { font-size: 1.05rem; }
  .brand-panel p { font-size: .8rem; }
  .scene-dock { left: 10px; right: 10px; bottom: max(10px, env(safe-area-inset-bottom)); width: auto; }
  .scene-list { display: flex; overflow-x: auto; overflow-y: hidden; max-height: none; padding-bottom: 2px; }
  .scene-button { min-width: 190px; }
  .hint { display: none; }
  .pnlm-controls-container { right: 12px !important; top: 12px !important; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
