:root {
  --bg: #111111;
  --panel: #1a1a1a;
  --panel-soft: #232323;
  --line: #303030;
  --text: #f5f2ea;
  --muted: #b6b1a6;
  --accent: #d66f38;
  --accent-strong: #f08b4f;
  --danger: #ff7e7e;
  --success: #8fd9a8;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, sans-serif; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }

.public-shell, .auth-shell { min-height: 100vh; background: radial-gradient(circle at top, #243c4a, #111 45%); }
.hero { display: grid; place-items: center; min-height: 100vh; padding: 32px; }
.hero-card, .auth-card, .card, .table-card, .form-card {
  background: rgba(17, 17, 17, 0.88);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}
.hero-card, .auth-card { max-width: 680px; padding: 32px; }
.auth-wrapper { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
}
.auth-meta a,
.auth-help a {
  color: var(--text);
}
.auth-help {
  margin: 18px 0 0;
  color: var(--muted);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}
.button-secondary {
  background: transparent;
  border-color: var(--line);
}
.button-danger {
  background: rgba(255, 126, 126, 0.16);
  border-color: rgba(255, 126, 126, 0.36);
  color: #ffdede;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.card-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.card-actions form {
  margin: 0;
}
.progress-list { margin-top: 20px; display: grid; gap: 8px; color: var(--muted); }
.setup-card { max-width: 860px; }
.status-line { margin: 18px 0; padding: 14px; border-radius: 14px; border: 1px solid var(--line); display: grid; gap: 4px; }
.status-line.ok { color: var(--success); }
.status-line.error { color: var(--danger); }
.code-block { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: #0c0c0c; overflow: auto; }
.steps { color: var(--muted); }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
}
.badge-success { color: var(--success); }
.badge-danger { color: var(--danger); }
.badge-muted { color: var(--muted); }
.import-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.import-card {
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(17, 17, 17, 0.9);
}
.import-card img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  background: #0f0f0f;
}
.import-card-body {
  padding: 16px;
}
.tour-brand-preview {
  display: block;
  max-width: min(320px, 100%);
  max-height: 120px;
  object-fit: contain;
  padding: 12px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.stack { display: grid; gap: 16px; }
label span { display: block; margin-bottom: 6px; color: var(--muted); }
.studio-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
}
.studio-checkbox input {
  width: 18px;
  height: 18px;
  margin: 0;
}
.studio-checkbox span {
  margin: 0;
  color: var(--text);
}
input, select, textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
}

.app-shell {
  min-height: 100vh;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: #121212;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-brand {
  display: flex;
  align-items: stretch;
  gap: 14px;
  min-width: 0;
}
.topbar-logo {
  display: block;
  height: 100%;
  max-height: 56px;
  width: auto;
  object-fit: contain;
  align-self: stretch;
}
.topbar-brand-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.topbar-brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}
.topbar-user {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-user span,
.topbar-user strong {
  color: var(--text);
  font-weight: 600;
}
.topbar-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.topbar-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.02);
}
.topbar-nav a:hover {
  color: var(--text);
  border-color: var(--line);
}
.topbar-logout {
  flex-shrink: 0;
}
.main-content { padding: 28px; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}
.page-head--compact {
  margin-bottom: 18px;
}
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.card, .table-card, .form-card { padding: 20px; }
.tour-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}
.tour-edit-column {
  display: grid;
  gap: 16px;
}
.table-card--compact {
  padding: 14px 16px;
}
.table-card--compact h2 {
  margin-bottom: 12px;
  font-size: 17px;
}
.table-card--compact .stack {
  gap: 10px;
}
.table-card--compact label span {
  font-size: 13px;
}
.table-card--compact textarea {
  min-height: 88px;
}
.table-card--compact .button {
  align-self: flex-start;
  padding: 10px 14px;
}
.tour-inline-preview {
  display: grid;
  gap: 8px;
}
.tour-inline-preview .muted {
  margin: 0;
  font-size: 12px;
}
.table-card--compact .tour-brand-preview {
  max-width: 140px;
}
.tour-panorama-card {
  padding: 14px 16px;
  min-height: 0;
}
.tour-panorama-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.tour-panorama-card h2 {
  margin-bottom: 4px;
}
.tour-panorama-import {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.panorama-upload-button {
  cursor: pointer;
  white-space: nowrap;
}
.tour-panorama-status {
  min-height: 20px;
  margin-bottom: 10px;
  font-size: 13px;
}
.tour-panorama-status--success {
  color: var(--success);
}
.tour-panorama-status--error {
  color: var(--danger);
}
.tour-panorama-table-wrap {
  max-height: calc(100vh - 290px);
  min-height: 360px;
  overflow: auto;
}
.tour-panorama-card .table th,
.tour-panorama-card .table td {
  padding: 9px 10px;
}
.tour-panorama-card .table thead th {
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 1;
}
.tour-panorama-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}
.tour-panorama-thumb {
  width: 72px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
}
.tour-panorama-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}
.tour-panorama-card .table td:first-child strong {
  display: block;
  margin-bottom: 2px;
}
.tour-panorama-card .table td:first-child .muted {
  margin: 0;
  font-size: 12px;
  word-break: break-word;
}
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.table-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.table-actions form {
  margin: 0;
}
.muted { color: var(--muted); }

.flash {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
}
.flash-error { color: var(--danger); }
.flash-success { color: var(--success); }

.viewer-shell {
  min-height: 100vh;
  background: #070707;
}
.viewer-shell--branded .viewer-stage {
  min-height: 100vh;
}
.viewer-shell--branded .viewer-layout {
  padding-top: 0;
}
.viewer-shell--branded.viewer-shell {
  background: #050505;
}
.viewer-brand {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 12;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  max-width: min(70vw, 420px);
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  text-decoration: none;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
}
.viewer-brand img {
  display: block;
  max-width: 100%;
  max-height: 48px;
  object-fit: contain;
}
.viewer-shell--branded .viewer-layout--public .viewer-scene-card,
.viewer-shell--branded .viewer-layout--preview .viewer-scene-card {
  min-height: 100vh;
}
.viewer-shell--branded .viewer-layout--public .viewer-canvas--interactive,
.viewer-shell--branded .viewer-layout--preview .viewer-canvas--interactive {
  min-height: 100vh;
}
.viewer-stage {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}
.viewer-topbar { padding: 18px 24px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.viewer-canvas { display: grid; place-items: center; padding: 24px; }
.viewer-placeholder { text-align: center; opacity: 0.9; }
.viewer-stage--interactive {
  grid-template-rows: auto 1fr;
}
.viewer-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  padding: 18px 24px 24px;
}
.viewer-layout--public {
  grid-template-columns: minmax(0, 1fr);
}
.viewer-layout--preview {
  grid-template-columns: minmax(120px, 10vw) minmax(0, 1fr);
  align-items: stretch;
}
.viewer-sidebar,
.viewer-main {
  min-width: 0;
}
.viewer-main--standalone {
  min-height: 100vh;
}
.viewer-sidebar {
  display: grid;
  gap: 18px;
  align-content: start;
}
.viewer-sidebar--preview .viewer-panel {
  padding: 12px;
  height: 100%;
}
.viewer-sidebar--preview .studio-list {
  grid-template-columns: 1fr;
}
.viewer-sidebar--preview .studio-list-item {
  padding: 10px 12px;
  font-size: 13px;
}
.viewer-panel,
.viewer-scene-card {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(17, 17, 17, 0.9);
}
.viewer-panel h2,
.viewer-scene-card h2 {
  margin-top: 0;
}
.viewer-scene-card {
  min-height: calc(100vh - 140px);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 16px;
}
.viewer-scene-card--bare {
  grid-template-rows: 1fr;
  gap: 0;
}
.viewer-scene-card--standalone {
  min-height: 100vh;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.viewer-scene-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.viewer-canvas--interactive {
  position: relative;
  min-height: 60vh;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
  padding: 0;
}
.viewer-canvas--standalone {
  min-height: 100vh;
  border-radius: 0;
  border: 0;
}
.viewer-canvas--interactive canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.viewer-flat-panorama {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #050505;
  cursor: grab;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  touch-action: none;
}
.viewer-flat-panorama:active {
  cursor: grabbing;
}
.viewer-area-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 3;
  pointer-events: none;
}
.viewer-area {
  fill: rgba(224, 104, 55, 0.12);
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  pointer-events: auto;
  transition: fill 0.18s ease, stroke 0.18s ease;
}
.viewer-area:hover,
.viewer-area:focus {
  fill: rgba(224, 104, 55, 0.34);
  stroke: #f07a3e;
  outline: none;
}
.viewer-area-label {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 4;
  max-width: min(280px, 70vw);
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(10, 10, 10, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  pointer-events: none;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  opacity: 0;
  transition: opacity 0.16s ease, transform 0.16s ease;
}
.viewer-area-label.is-visible {
  opacity: 1;
}
.viewer-area-label--below {
  transform-origin: center top;
}
.viewer-area--link {
  fill: rgba(255, 204, 79, 0.12);
}
.viewer-area--link:hover,
.viewer-area--link:focus {
  fill: rgba(255, 204, 79, 0.32);
  stroke: #ffcc4f;
}
.viewer-area--video {
  fill: rgba(95, 168, 255, 0.13);
}
.viewer-area--video:hover,
.viewer-area--video:focus {
  fill: rgba(95, 168, 255, 0.32);
  stroke: #5fa8ff;
}
.viewer-burger {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 6;
  display: grid;
  gap: 10px;
}
.viewer-burger[open] .viewer-burger-toggle {
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}
.viewer-burger-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 48px;
  height: 48px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: rgba(17, 17, 17, 0.78);
  backdrop-filter: blur(10px);
  cursor: pointer;
  list-style: none;
}
.viewer-burger-toggle::-webkit-details-marker {
  display: none;
}
.viewer-burger-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
}
.viewer-burger-panel {
  width: min(320px, calc(100vw - 36px));
  max-height: min(62vh, 520px);
  overflow: auto;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(17, 17, 17, 0.92);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(14px);
}
.viewer-burger-title {
  margin: 0 0 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}
.viewer-burger-panel .studio-list {
  grid-template-columns: 1fr;
}
.viewer-burger-panel .studio-list-item {
  padding: 10px 12px;
  font-size: 13px;
}
.viewer-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.viewer-overlay::before,
.viewer-overlay::after {
  opacity: 0;
  transition: opacity 0.22s ease;
}
.viewer-overlay--loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(6, 6, 6, 0.46);
  backdrop-filter: blur(8px);
  opacity: 1;
}
.viewer-overlay--loading::after {
  content: attr(data-loading-label);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(17, 17, 17, 0.8);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
  opacity: 1;
}
.viewer-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}
.viewer-marker {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  will-change: transform, opacity;
  transition: opacity 0.18s ease;
}
.viewer-overlay--loading .viewer-marker {
  opacity: 0;
}
.viewer-marker.is-hidden {
  display: none;
}
.viewer-marker--link {
  width: 46px;
  height: 46px;
}
.viewer-marker__ring,
.viewer-marker__core {
  position: absolute;
  inset: 50% auto auto 50%;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}
.viewer-marker__ring {
  width: 46px;
  height: 46px;
  border: 2px solid rgba(255, 204, 79, 0.85);
  background: rgba(255, 204, 79, 0.12);
  animation: studioPulse 1.8s ease-out infinite;
}
.viewer-marker__ring--inner {
  width: 30px;
  height: 30px;
  border-color: rgba(255, 204, 79, 0.95);
  background: rgba(255, 204, 79, 0.32);
  animation-delay: 0.15s;
}
.viewer-marker__core {
  width: 16px;
  height: 16px;
  background: #ffcc4f;
  box-shadow: 0 0 0 4px rgba(255, 204, 79, 0.18);
}
.viewer-marker--info {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.96);
  color: #1f1f1f;
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  font-weight: 800;
  font-size: 24px;
  line-height: 1;
}
.viewer-marker--video,
.studio-marker--video {
  width: 164px;
  color: #fff;
  text-align: center;
}
.viewer-marker__video-title,
.studio-marker__video-title {
  display: block;
  margin-bottom: 8px;
  font-weight: 800;
  font-size: 12px;
  line-height: 1.2;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
}
.viewer-marker__video-card,
.studio-marker__video-card {
  position: relative;
  display: block;
  width: 104px;
  height: 58px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 2px;
  border: 4px solid rgba(255, 255, 255, 0.92);
  background: linear-gradient(135deg, rgba(24, 24, 24, 0.88), rgba(88, 88, 88, 0.68));
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.34);
}
.viewer-marker__video-thumb,
.studio-marker__video-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.viewer-marker__video-fallback,
.studio-marker__video-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.9);
}
.viewer-marker__video-shade,
.studio-marker__video-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.28));
}
.viewer-marker__play,
.studio-marker__play {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 0;
  height: 0;
  border-top: 11px solid transparent;
  border-bottom: 11px solid transparent;
  border-left: 18px solid #ffffff;
  margin-left: 4px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45));
}
.viewer-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 30;
}
.viewer-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
}
.viewer-modal__panel {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 22px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(17, 17, 17, 0.98);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}
.viewer-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.viewer-modal__header h2 {
  margin: 0;
}
.viewer-modal__close {
  display: flex;
  flex-shrink: 0;
}
.viewer-modal__panel--video {
  width: min(980px, 100%);
}
.viewer-video-frame {
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
}
.viewer-video-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.viewer-info-content img {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
}
.viewer-info-content img.infospot-panorama {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
}
.viewer-info-content iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 12px;
}
.viewer-info-content {
  color: var(--text);
  line-height: 1.7;
}
.viewer-info-content a {
  color: var(--accent-strong);
}
.viewer-info-content h1,
.viewer-info-content h2,
.viewer-info-content h3,
.viewer-info-content h4,
.viewer-info-content h5 {
  margin: 0 0 0.75rem;
  line-height: 1.15;
  color: var(--text);
}
.viewer-info-content h1 {
  font-size: clamp(2rem, 3vw, 2.6rem);
  font-weight: 800;
}
.viewer-info-content h2 {
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  font-weight: 800;
}
.viewer-info-content h3 {
  font-size: clamp(1.3rem, 1.9vw, 1.55rem);
  font-weight: 700;
}
.viewer-info-content h4 {
  font-size: clamp(1.1rem, 1.5vw, 1.25rem);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.viewer-info-content h5 {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.viewer-info-content p,
.viewer-info-content ul,
.viewer-info-content ol,
.viewer-info-content blockquote,
.viewer-info-content figure {
  margin: 0 0 1rem;
}
.viewer-info-content ul,
.viewer-info-content ol {
  padding-left: 1.25rem;
}
.viewer-info-content blockquote {
  padding-left: 1rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
}
.viewer-info-panorama {
  margin: 0 0 1rem;
}
.viewer-info-panorama__canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 1;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: #000;
}
.viewer-info-panorama__canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
  filter: brightness(1.12) saturate(1.04);
}
.viewer-info-panorama__hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.viewer-info-content .is-align-left {
  text-align: left;
}
.viewer-info-content .is-align-center {
  text-align: center;
}
.viewer-info-content .is-align-right {
  text-align: right;
}

.studio-workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100vh - 56px);
}
.studio-column {
  min-width: 0;
}
.studio-column--left {
  display: grid;
  gap: 18px;
  align-content: start;
}
.studio-column--main {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.studio-top-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 580px;
  gap: 18px;
  align-items: start;
}
.studio-hotspot-editor,
.studio-hotspots-panel {
  min-width: 0;
}
.studio-stack-actions {
  display: grid;
  gap: 10px;
}
.studio-action-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.studio-upload-status {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 13px;
}
.studio-upload-status.is-error {
  color: #ffdede;
  border-color: rgba(255, 126, 126, 0.36);
  background: rgba(255, 126, 126, 0.12);
}
.studio-upload-status.is-success {
  color: #dff5e6;
  border-color: rgba(143, 217, 168, 0.34);
  background: rgba(143, 217, 168, 0.12);
}
.studio-hotspot-editor textarea {
  min-height: 150px;
  resize: vertical;
}
.studio-panel {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(17, 17, 17, 0.9);
}
.studio-panel h2 {
  margin-top: 0;
}
.studio-panel--grow {
  min-height: 0;
}
.studio-stage {
  min-height: 58vh;
}
.studio-viewer {
  position: relative;
  min-height: 58vh;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #000;
}
.studio-viewer canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.studio-flat-panorama {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #050505;
  cursor: grab;
  transform-origin: center center;
  will-change: transform;
  user-select: none;
  touch-action: none;
}
.studio-flat-panorama:active {
  cursor: grabbing;
}
.studio-viewer--flat .studio-crosshair {
  display: none;
}
.studio-viewer--drawing .studio-flat-panorama {
  cursor: crosshair;
}
.studio-area-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}
.studio-area {
  fill: rgba(224, 104, 55, 0.22);
  stroke: #f07a3e;
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}
.studio-area--draft {
  fill: rgba(255, 255, 255, 0.14);
  stroke: #ffffff;
  stroke-dasharray: 8 6;
}
.studio-area-point {
  fill: #ffffff;
  stroke: #e06837;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  cursor: grab;
  pointer-events: auto;
}
.studio-area-point:hover {
  fill: #ffe8dd;
  stroke-width: 3;
}
.studio-area-point:active {
  cursor: grabbing;
}
.studio-area--link {
  fill: rgba(255, 204, 79, 0.2);
  stroke: #ffcc4f;
}
.studio-area--video {
  fill: rgba(95, 168, 255, 0.2);
  stroke: #5fa8ff;
}
.studio-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.studio-marker {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  pointer-events: none;
  will-change: transform, opacity;
}
.studio-marker.is-hidden {
  display: none;
}
.studio-marker--link {
  width: 46px;
  height: 46px;
}
.studio-marker__ring,
.studio-marker__core {
  position: absolute;
  inset: 50% auto auto 50%;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}
.studio-marker__ring {
  width: 46px;
  height: 46px;
  border: 2px solid rgba(255, 204, 79, 0.85);
  background: rgba(255, 204, 79, 0.12);
  animation: studioPulse 1.8s ease-out infinite;
}
.studio-marker__ring--inner {
  width: 30px;
  height: 30px;
  border-color: rgba(255, 204, 79, 0.95);
  background: rgba(255, 204, 79, 0.32);
  animation-delay: 0.15s;
}
.studio-marker__core {
  width: 16px;
  height: 16px;
  background: #ffcc4f;
  box-shadow: 0 0 0 4px rgba(255, 204, 79, 0.18);
}
.studio-marker--info {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.96);
  color: #1f1f1f;
  border: 1px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  font-weight: 800;
  font-size: 24px;
  line-height: 1;
}
.studio-marker--pending {
  opacity: 0.92;
  filter: drop-shadow(0 0 16px rgba(255, 255, 255, 0.15));
}
@keyframes studioPulse {
  0% {
    transform: translate(-50%, -50%) scale(0.82);
    opacity: 0.95;
  }
  70% {
    transform: translate(-50%, -50%) scale(1.04);
    opacity: 0.55;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.16);
    opacity: 0.18;
  }
}
.studio-crosshair {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 26px;
  height: 26px;
  border: 2px solid rgba(255,255,255,0.88);
  border-radius: 999px;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 9999px rgba(255,255,255,0.0);
  pointer-events: none;
}
.studio-list {
  display: grid;
  gap: 10px;
}
.studio-list-item {
  width: 100%;
  text-align: left;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  padding: 12px 14px;
  cursor: pointer;
  display: grid;
  gap: 4px;
}
.studio-panel--grow .studio-list,
.studio-hotspots-panel .studio-list {
  max-height: 48vh;
  overflow: auto;
  padding-right: 6px;
}
.studio-list-item.is-active {
  border-color: var(--accent);
}
.studio-hotspot-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.studio-hotspot-item:last-child {
  border-bottom: 0;
}
.studio-item-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.studio-hotspot-item p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.studio-hotspot-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.studio-hotspot-badge {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 14px;
  font-weight: 800;
  flex-shrink: 0;
}
.studio-hotspot-badge--link {
  background: rgba(255, 204, 79, 0.18);
  color: #ffcc4f;
}
.studio-hotspot-badge--info {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}
.studio-hotspot-badge--video {
  background: rgba(214, 111, 56, 0.2);
  color: var(--accent-strong);
}
.is-hidden {
  display: none;
}

@media (max-width: 900px) {
  .topbar {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .topbar-nav {
    justify-content: flex-start;
  }
  .tour-edit-grid {
    grid-template-columns: 1fr;
  }
  .tour-panorama-head {
    flex-direction: column;
  }
  .page-head { flex-direction: column; }
  .viewer-layout,
  .viewer-layout--preview { grid-template-columns: 1fr; }
  .viewer-scene-head { flex-direction: column; }
  .studio-workspace { grid-template-columns: 1fr; }
  .studio-top-panels { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .main-content {
    padding: 20px;
  }
  .topbar {
    padding: 12px 14px;
  }
  .topbar-brand h1 {
    font-size: 16px;
  }
  .topbar-logo {
    max-height: 46px;
  }
  .topbar-user {
    white-space: normal;
  }
  .topbar-nav {
    width: 100%;
  }
  .topbar-nav a,
  .topbar-logout .button {
    width: 100%;
  }
  .viewer-burger {
    top: 12px;
    left: 12px;
  }
  .viewer-burger-panel {
    width: min(300px, calc(100vw - 24px));
  }
  .page-head {
    align-items: stretch;
  }
}
