:root {
  color-scheme: dark;
  --bg: #07111f;
  --bg-accent: #12304b;
  --bg-glow-top: #2c5490;
  --bg-glow-bottom: #2c5490;
  --bg-solid: #07111f;
  --panel: rgba(8, 24, 39, 0.82);
  --panel-strong: rgba(11, 32, 51, 0.94);
  --border: rgba(169, 211, 255, 0.18);
  --text: #f5f7fa;
  --muted: #a7bdd3;
  --accent: #7fd1ff;
  --accent-strong: #35b7ff;
  --hotspot-bg: rgba(11, 37, 60, 0.85);
  --hotspot-bg-hover: rgba(11, 37, 60, 0.93);
  --hotspot-scale: 1;
  --button: rgba(25, 62, 96, 0.92);
  --button-hover: rgba(40, 91, 137, 0.96);
  --welcome-panel-top: rgba(9, 23, 37, 0.98);
  --welcome-panel-bottom: rgba(6, 16, 27, 0.94);
  --welcome-button: rgba(25, 62, 96, 0.96);
  --welcome-button-hover: rgba(25, 62, 96, 1);
  --viewer-card-radius: 28px;
  --viewer-frame-radius: 30px;
  --danger: rgba(117, 43, 52, 0.9);
  --danger-hover: rgba(152, 52, 65, 0.95);
  --shadow: 0 24px 80px rgba(1, 12, 24, 0.45);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, var(--bg-glow-top), transparent 32%),
    radial-gradient(circle at bottom right, var(--bg-glow-bottom), transparent 28%),
    linear-gradient(145deg, var(--bg), var(--bg-accent));
  color: var(--text);
}

body.flat-background {
  background: var(--bg-solid);
}

.app {
  min-height: 100vh;
  padding: 24px;
}

.shell {
  width: min(1440px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.sidebar,
.viewer-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--viewer-card-radius);
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.sidebar {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.admin-menu-logo {
  display: block;
  width: min(100%, 240px);
  max-height: 96px;
  margin: 0 auto 16px;
  object-fit: contain;
}

.eyebrow,
.panel-label,
.legend span,
#hint {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 16px;
  font-size: clamp(1.15rem, 2.2vw, 1.9rem);
  line-height: 0.92;
}

.panel {
  background: var(--panel-strong);
  border: 1px solid rgba(169, 211, 255, 0.08);
  border-radius: 20px;
  padding: 18px;
}

.secondary-admin-panel {
  background: rgba(4, 16, 27, 0.92);
  border-color: rgba(127, 209, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(127, 209, 255, 0.06);
}

.secondary-admin-panel .panel-summary {
  color: rgba(151, 181, 208, 0.82);
}

.panel + .panel {
  margin-top: 6px;
}

.collapsible-panel {
  padding: 0;
  overflow: hidden;
}

.panel-summary {
  display: block;
  padding: 16px 18px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  list-style: none;
}

.panel-summary::-webkit-details-marker {
  display: none;
}

.panel-summary::after {
  content: "+";
  float: right;
  color: var(--accent);
  font-size: 1rem;
}

.collapsible-panel[open] .panel-summary::after {
  content: "−";
}

.panel-content {
  padding: 0 18px 14px;
}

.viewer-only {
  display: none;
}

.sidebar-toggle-label {
  display: none;
  width: 100%;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-row,
.button-row,
.viewer-meta,
.legend,
.hotspot-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.button-row {
  margin-top: 10px;
  flex-wrap: wrap;
}

.control-button-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.control-button-row button {
  width: 100%;
}

.secondary-row {
  margin-top: 10px;
}

.editor-view-panel {
  margin-top: 10px;
  border-radius: 18px;
  border: 1px solid rgba(127, 209, 255, 0.12);
  background: rgba(7, 18, 29, 0.72);
  overflow: hidden;
}

.editor-view-panel summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  list-style: none;
}

.editor-view-panel summary::-webkit-details-marker {
  display: none;
}

.editor-view-panel-content {
  padding: 0 16px 16px;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 1px solid var(--border);
  background: var(--button);
  color: var(--text);
  border-radius: 999px;
  padding: 12px 16px;
  cursor: pointer;
  transition:
    background 140ms ease,
    transform 140ms ease,
    border-color 140ms ease;
}

button:hover,
button:focus-visible {
  background: var(--button-hover);
  border-color: rgba(127, 209, 255, 0.4);
  transform: translateY(-1px);
}

button.active {
  background: linear-gradient(135deg, rgba(61, 143, 194, 0.95), rgba(22, 85, 149, 0.95));
  border-color: rgba(180, 231, 255, 0.48);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.icon-button {
  width: 48px;
  min-width: 48px;
  padding: 12px;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
}

.danger-button {
  background: var(--danger);
}

.danger-button:hover,
.danger-button:focus-visible {
  background: var(--danger-hover);
}

#toggle-hotspot-mode,
#copy-target-room-view,
#clear-target-room-view,
#validate-hotspots,
#toggle-info-mode {
  background: rgba(233, 218, 151, 0.9);
  border-color: rgba(255, 245, 196, 0.62);
  color: #3a3111;
}

#toggle-hotspot-mode:hover,
#toggle-hotspot-mode:focus-visible,
#copy-target-room-view:hover,
#copy-target-room-view:focus-visible,
#clear-target-room-view:hover,
#clear-target-room-view:focus-visible,
#validate-hotspots:hover,
#validate-hotspots:focus-visible,
#toggle-info-mode:hover,
#toggle-info-mode:focus-visible {
  background: rgba(243, 228, 163, 0.96);
  border-color: rgba(255, 248, 210, 0.78);
}

#toggle-hotspot-mode.active,
#copy-target-room-view.active,
#clear-target-room-view.active,
#validate-hotspots.active,
#toggle-info-mode.active {
  background: rgba(227, 207, 120, 0.96);
  border-color: rgba(255, 244, 186, 0.82);
  color: #2f280d;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent-strong);
}

.input-field,
.upload-field {
  display: grid;
  gap: 10px;
  color: var(--muted);
}

.checkbox-field {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.checkbox-field + .input-field,
.input-field + .checkbox-field,
.checkbox-field + .checkbox-field {
  margin-top: 8px;
}

.checkbox-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent-strong);
}

.range-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.input-field + .input-field,
.upload-field + .upload-status {
  margin-top: 8px;
}

.input-field input,
.input-field textarea,
.input-field select,
.upload-field input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.input-field input[type="color"] {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(169, 211, 255, 0.28);
  background: transparent;
  justify-self: start;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(6, 16, 27, 0.35);
}

.input-field:has(input[type="color"]) {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.input-field:has(input[type="color"]) > span {
  margin: 0;
}

.input-field input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 999px;
}

.input-field input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 999px;
}

.input-field input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 999px;
}

.input-field select option {
  color: #000;
  background: #fff;
}

.upload-field span,
.upload-status {
  font-size: 0.95rem;
  line-height: 1.5;
}

.subtle-room-id {
  margin: 0 0 8px;
  color: rgba(245, 247, 250, 0.42);
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}

.room-list,
.hotspot-list {
  display: grid;
  gap: 12px;
}

.analytics-summary {
  display: grid;
  gap: 12px;
}

.analytics-summary-compact {
  gap: 8px;
}

.analytics-panel-content {
  gap: 8px;
}

.analytics-actions {
  margin-top: 4px;
}

.analytics-summary .hotspot-item {
  align-items: flex-start;
}

.analytics-divider {
  height: 1px;
  margin: 6px 0 2px;
  background: linear-gradient(90deg, transparent, rgba(169, 211, 255, 0.32), transparent);
}

.analytics-muted {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.analytics-nowrap {
  white-space: nowrap;
}

.analytics-table {
  display: grid;
  gap: 4px;
}

.analytics-table-summary {
  margin-bottom: 2px;
}

.analytics-table-row {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(110px, 0.95fr) minmax(70px, 0.7fr) minmax(110px, 0.95fr);
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 12px;
  background: rgba(169, 211, 255, 0.05);
}

.analytics-table-summary .analytics-table-row {
  grid-template-columns:
    minmax(0, 1.6fr)
    minmax(108px, 0.9fr)
    minmax(70px, 0.65fr)
    minmax(108px, 0.9fr)
    minmax(118px, 0.95fr);
}

.analytics-table-devices .analytics-table-row {
  grid-template-columns:
    minmax(0, 1.7fr)
    minmax(72px, 0.5fr)
    minmax(44px, 0.32fr)
    minmax(118px, 0.85fr)
    minmax(84px, 0.58fr);
  gap: 6px;
}

.analytics-table-head {
  padding-top: 0;
  padding-bottom: 2px;
  background: transparent;
  color: var(--muted);
  font-size: 0.84rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.analytics-table-head > div,
.analytics-table-row > div {
  white-space: nowrap;
}

.analytics-sort-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  letter-spacing: inherit;
  text-align: left;
  cursor: pointer;
}

.analytics-sort-button:hover {
  color: var(--text);
}

.analytics-room-name {
  font-weight: 700;
  color: var(--text);
}

.hotspot-item-target {
  display: block;
  margin-top: 1px;
  font-size: 0.74rem;
  color: var(--muted);
}

.room-list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}

.room-button-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.room-button-main > span:last-child {
  min-width: 0;
  color: var(--text);
}

.room-button-main > span:last-child > span {
  color: var(--muted);
  font-size: 0.92rem;
}

.room-group-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  flex: 0 0 12px;
  background: var(--room-group-color, #7fd1ff);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow: 0 0 0 1px rgba(8, 24, 39, 0.3);
}

.room-order-controls {
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.room-order-controls .icon-button {
  width: 42px;
  min-width: 42px;
  padding: 0;
}

.missing-images {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.missing-image-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.missing-image-item.is-missing,
.room-button.is-missing {
  border-color: rgba(255, 168, 168, 0.32);
  background: rgba(117, 43, 52, 0.16);
}

.missing-image-item strong {
  display: block;
}

.missing-image-item span {
  color: var(--muted);
  font-size: 0.92rem;
}

.room-button,
.hotspot-item-button {
  width: 100%;
  text-align: left;
  border-radius: 18px;
  padding: 10px 16px;
}

.room-button strong,
.hotspot-item-button strong {
  display: block;
}

.room-button span,
.hotspot-item-button span {
  color: var(--muted);
  font-size: 0.92rem;
}

.viewer-card {
  min-height: calc(100vh - 48px);
}

.viewer-meta {
  margin-bottom: 18px;
}

.project-intro-display {
  color: var(--muted);
  line-height: 1.6;
  margin: 0 0 16px;
}

.viewer-frame {
  position: relative;
  min-height: 68vh;
  border: 1px solid var(--border);
  border-radius: var(--viewer-frame-radius);
  overflow: hidden;
  background: #0a1827;
}

.panorama {
  position: relative;
  height: 100%;
  min-height: 68vh;
  overflow: hidden;
  background-size: cover;
  background-position: 50% 50%;
  touch-action: none;
}

.panorama::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(6, 16, 27, 0.58), rgba(6, 16, 27, 0.72));
  opacity: 0;
  pointer-events: none;
  transition: opacity 1000ms ease;
}

.panorama.is-room-transitioning::after {
  opacity: 1;
}

.panorama.is-editing {
  outline: 2px dashed rgba(127, 209, 255, 0.55);
  outline-offset: -14px;
}

.viewer-canvas,
.panorama-overlay {
  position: absolute;
  inset: 0;
}

.viewer-canvas {
  transition:
    transform 1000ms ease,
    filter 1000ms ease,
    opacity 1000ms ease;
}


.transition-snapshot {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 1000ms ease,
    filter 1000ms ease,
    transform 1000ms ease;
}

.transition-snapshot.is-visible {
  opacity: 1;
}

.flat-image {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 0;
  width: var(--flat-width, 116%);
  height: var(--flat-height, 116%);
  object-fit: fill;
  transform: translate(
    calc(-50% + var(--flat-offset-x, 0%)),
    calc(-50% + var(--flat-offset-y, 0%))
  );
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  touch-action: none;
  transition:
    opacity 1000ms ease,
    transform 1000ms ease,
    filter 1000ms ease;
}

.panorama.is-dragging-flat .flat-image {
  transition: none;
}

.flat-image.is-editor-fit {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.viewer-title-overlay {
  position: absolute;
  top: 18px;
  left: 20px;
  z-index: 2;
  max-width: min(60%, 520px);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.34);
  border: 1px solid rgba(169, 211, 255, 0.18);
  color: rgba(245, 247, 250, 0.88);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms ease;
}

.viewer-menu-anchor {
  position: absolute;
  top: 18px;
  left: 20px;
  z-index: 7;
  width: auto;
  max-width: min(320px, calc(100% - 112px));
  display: none;
}

.viewer-menu-heading {
  margin-bottom: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.34);
  border: 1px solid rgba(169, 211, 255, 0.18);
  color: rgba(245, 247, 250, 0.88);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.viewer-room-menu {
  width: fit-content;
  min-width: 108px;
  max-width: min(320px, calc(100vw - 40px));
  border-radius: 20px;
  background: rgba(8, 24, 39, 0.58);
  border: 1px solid rgba(169, 211, 255, 0.18);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.viewer-room-menu[open] {
  width: min(320px, calc(100vw - 40px));
}

.viewer-room-menu summary {
  display: block;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--text);
  list-style: none;
  white-space: nowrap;
}

.viewer-room-menu summary::-webkit-details-marker {
  display: none;
}

.viewer-room-menu summary::after {
  content: "+";
  float: right;
  color: var(--accent);
}

.viewer-room-menu[open] summary::after {
  content: "−";
}

.viewer-room-list {
  padding: 0 12px 12px;
  display: grid;
  gap: 6px;
  max-height: min(52vh, 420px);
  overflow: auto;
}

.viewer-room-list-item {
  grid-template-columns: 1fr;
}

.viewer-room-list .room-button {
  width: 100%;
}

.room-filter-layout {
  display: grid;
  gap: 12px;
}

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

.room-filter-action,
.room-filter-group-button {
  min-height: 0;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.92rem;
}

.room-filter-section {
  display: grid;
  gap: 8px;
}

.room-filter-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.room-filter-group-list,
.room-filter-room-list {
  display: grid;
  gap: 6px;
}

.room-filter-group-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
}

.room-filter-group-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.room-filter-item {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(169, 211, 255, 0.14);
  border-radius: 14px;
  background: rgba(8, 24, 39, 0.36);
}

.room-filter-item input {
  margin: 0;
}

.room-filter-item-text {
  min-width: 0;
}

.room-filter-item-text strong,
.room-filter-item-text span {
  display: block;
}

.room-filter-item-text span {
  color: var(--muted);
  font-size: 0.9rem;
}

.viewer-menu-admin {
  margin: 0 12px 12px;
  width: calc(100% - 24px);
}

.viewer-credit {
  position: absolute;
  right: 16px;
  bottom: 14px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.28);
  border: 1px solid rgba(169, 211, 255, 0.14);
  color: rgba(245, 247, 250, 0.72);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  text-decoration: none;
  pointer-events: auto;
}

.viewer-credit:hover,
.viewer-credit:focus-visible {
  color: rgba(245, 247, 250, 0.92);
  border-color: rgba(169, 211, 255, 0.22);
}

.viewer-share-button {
  position: absolute;
  right: 16px;
  bottom: 46px;
  z-index: 4;
  min-width: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.42);
  border: 1px solid rgba(169, 211, 255, 0.18);
  color: rgba(245, 247, 250, 0.82);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
}

.viewer-share-button:hover,
.viewer-share-button:focus-visible {
  background: rgba(18, 42, 67, 0.64);
  border-color: rgba(169, 211, 255, 0.26);
  color: rgba(245, 247, 250, 0.96);
  transform: none;
}

.viewer-progress {
  position: absolute;
  left: 118px;
  bottom: 12px;
  z-index: 4;
  display: block;
  color: rgba(245, 247, 250, 0.72);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 10px rgba(3, 9, 18, 0.45);
  pointer-events: none;
  line-height: 1.15;
}

.viewer-progress strong,
.viewer-progress span {
  display: block;
}

.viewer-progress strong {
  color: rgba(245, 247, 250, 0.88);
  font-weight: 600;
}

.hotspot-style-toggle {
  position: absolute;
  left: 16px;
  bottom: 14px;
  z-index: 4;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.36);
  border: 1px solid rgba(169, 211, 255, 0.16);
  color: rgba(245, 247, 250, 0.78);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
}

.autorotate-toggle {
  left: 76px;
}

.viewer-back-button {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 12;
  min-width: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(7, 17, 31, 0.42);
  border: 1px solid rgba(169, 211, 255, 0.18);
  color: rgba(245, 247, 250, 0.82);
  font-size: 0.74rem;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  transform: translateX(-50%);
}

.viewer-back-button:hover,
.viewer-back-button:focus-visible {
  transform: translateX(-50%);
}

body.welcome-open .viewer-back-button {
  display: none !important;
}

.viewer-canvas {
  z-index: 0;
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    filter 180ms ease;
}

.viewer-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
}

.viewer-canvas canvas:active {
  cursor: grabbing;
}

.panorama-overlay {
  background:
    linear-gradient(to top, rgba(4, 12, 21, 0.72), transparent 28%),
    linear-gradient(to bottom, rgba(6, 18, 30, 0.25), transparent 20%);
  pointer-events: none;
  z-index: 1;
}

.panorama.has-image .panorama-overlay {
  background: none;
}

body:not(.viewer-mode) .panorama::before,
body:not(.viewer-mode) .panorama::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: 2;
  opacity: 0.42;
}

body:not(.viewer-mode) .panorama::before {
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  transform: translateY(-0.5px);
  background: #000;
}

body:not(.viewer-mode) .panorama::after {
  top: 0;
  left: 50%;
  height: 100%;
  width: 1px;
  transform: translateX(-0.5px);
  background: #000;
}

body.editor-guides-hidden:not(.viewer-mode) .panorama::before,
body.editor-guides-hidden:not(.viewer-mode) .panorama::after {
  display: none;
}

.hotspots {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  transition:
    opacity 1000ms ease,
    transform 1000ms ease,
    filter 1000ms ease;
}

.panorama.is-room-transitioning .transition-snapshot {
  filter: blur(4.2px);
  transform: scale(1.14);
}

.panorama.is-room-transitioning .viewer-canvas,
.panorama.is-room-transitioning .flat-image,
.panorama.is-room-transitioning .hotspots {
  opacity: 1;
  filter: blur(3.1px);
  transform: scale(1.12);
}

.hotspot {
  position: absolute;
  transform: translate(-50%, -50%) scale(var(--hotspot-scale));
  transform-origin: center;
  pointer-events: auto;
  min-width: 0;
  max-width: min(240px, 42vw);
  width: max-content;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--hotspot-bg);
  color: var(--text);
  text-align: left;
  box-shadow: 0 12px 32px rgba(2, 10, 19, 0.25);
}

.hotspot.active {
  outline: 2px solid rgba(180, 231, 255, 0.56);
}

.hotspot.is-guided {
  overflow: visible;
  border-color: rgba(255, 228, 130, 0.85);
  box-shadow:
    0 0 0 2px rgba(255, 228, 130, 0.2),
    0 12px 32px rgba(2, 10, 19, 0.25);
}

.hotspot.is-guided::before {
  content: "";
  position: absolute;
  inset: -10px;
  border: 2px solid rgba(255, 226, 118, 0.92);
  border-radius: 26px;
  animation: hotspot-guidance-pulse 1.8s ease-out infinite;
  pointer-events: none;
}

.hotspot.is-guided::after {
  content: attr(data-guidance-text);
  position: absolute;
  left: 50%;
  top: calc(100% + 12px);
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 226, 118, 0.96);
  color: #2f280d;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1;
  box-shadow: 0 10px 24px rgba(1, 8, 15, 0.26);
  pointer-events: none;
}

.hotspot.is-guided:not([data-guidance-text])::after,
.hotspot.is-guided[data-guidance-text=""]::after {
  content: none;
  display: none;
}

@keyframes hotspot-guidance-pulse {
  0% {
    opacity: 0.95;
    transform: scale(0.98);
  }

  70% {
    opacity: 0;
    transform: scale(1.18);
  }

  100% {
    opacity: 0;
    transform: scale(1.18);
  }
}

.hotspot strong,
#room-title {
  display: block;
  margin-bottom: 2px;
  font-size: 1.05rem;
  line-height: 1.15;
  white-space: normal;
  word-break: break-word;
}

.hotspot span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
}

.hotspot::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -18px;
  width: 2px;
  height: 18px;
  background: linear-gradient(to bottom, rgba(127, 209, 255, 0.95), transparent);
}

.hotspot:hover,
.hotspot:focus-visible {
  border-color: rgba(127, 209, 255, 0.5);
  background: var(--hotspot-bg-hover);
  transform: translate(-50%, -50%) scale(var(--hotspot-scale));
}

.hotspot.is-compact {
  width: 42px;
  height: 42px;
  max-width: none;
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--hotspot-bg-hover);
  border-width: 3px;
}

.hotspot.is-compact strong,
.hotspot.is-compact span {
  display: none;
}

.hotspot.is-compact::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  border-top: 4px solid currentColor;
  border-left: 4px solid currentColor;
  border-top-left-radius: 4px;
  transform: translate(-50%, -28%) rotate(45deg);
  transform-origin: center;
}

.hotspot.is-compact::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 16px);
  transform: translateX(-50%);
  min-width: max-content;
  max-width: 180px;
  padding: 7px 10px;
  border: 1px solid rgba(169, 211, 255, 0.22);
  border-radius: 12px;
  background: rgba(8, 24, 39, 0.96);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
  white-space: normal;
  box-shadow: 0 12px 32px rgba(2, 10, 19, 0.25);
  opacity: 0;
  pointer-events: none;
}

.hotspot.is-compact:hover::after,
.hotspot.is-compact:focus-visible::after {
  content: attr(data-label);
  opacity: 1;
}

.info-point {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  width: calc(42px * var(--info-point-scale, 1));
  height: calc(42px * var(--info-point-scale, 1));
  min-width: calc(42px * var(--info-point-scale, 1));
  padding: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--info-point-bg, rgba(245, 247, 250, 0.92));
  color: #07111f;
  font-size: calc(1.1rem * var(--info-point-scale, 1));
  font-weight: 700;
  box-shadow: 0 12px 32px rgba(2, 10, 19, 0.25);
}

.info-point:hover,
.info-point:focus-visible {
  transform: translate(-50%, -50%);
  background: var(--info-point-bg, rgba(245, 247, 250, 0.92));
}

.info-point.active {
  background: var(--info-point-bg, rgba(245, 247, 250, 0.92));
  outline: 2px solid rgba(180, 231, 255, 0.72);
}


.info-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 12, 21, 0.26);
}

.welcome-overlay {
  --welcome-logo-width: 50%;
  position: absolute;
  inset: 0;
  z-index: 7;
  border-radius: inherit;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(4, 12, 21, 0.16), rgba(4, 12, 21, 0.52)),
    radial-gradient(circle at 50% 22%, rgba(255, 255, 255, 0.16), transparent 34%);
  backdrop-filter: blur(10px);
  opacity: 1;
  transition:
    opacity 1200ms ease,
    backdrop-filter 1200ms ease,
    background 1200ms ease;
}

.welcome-dialog {
  width: min(100%, 540px);
  padding: 28px 28px 24px;
  border: 1px solid rgba(169, 211, 255, 0.18);
  border-radius: 28px;
  background: linear-gradient(180deg, var(--welcome-panel-top), var(--welcome-panel-bottom));
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.34);
  text-align: center;
  transition:
    opacity 1200ms ease,
    transform 1200ms ease,
    filter 1200ms ease;
}

.welcome-overlay.is-dismissing {
  opacity: 0;
  backdrop-filter: blur(4px);
}

.welcome-overlay.is-dismissing .welcome-dialog {
  opacity: 0;
  transform: translateY(12px) scale(0.985);
  filter: blur(1.2px);
}

.welcome-logo {
  width: min(350px, var(--welcome-logo-width));
  min-height: 1px;
  margin: 0 auto 16px;
  display: block;
}

.welcome-logo img {
  display: block;
  width: 100%;
  max-height: 120px;
  margin: 0 auto;
  object-fit: contain;
}

.welcome-eyebrow {
  margin: 0 0 10px;
  color: rgba(151, 181, 208, 0.84);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.welcome-dialog h2 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.1;
}

.welcome-text {
  margin: 0 0 22px;
  color: rgba(226, 236, 245, 0.9);
  font-size: 1rem;
  line-height: 1.6;
  white-space: pre-line;
}

.welcome-dialog #welcome-start-button {
  min-width: 420px;
  min-height: 96px;
  padding: 24px 40px;
  font-size: 1.62rem;
  font-weight: 700;
  border-radius: 999px;
  background: var(--welcome-button);
}

.welcome-dialog #welcome-start-button:hover,
.welcome-dialog #welcome-start-button:focus-visible {
  background: var(--welcome-button-hover);
}

.welcome-footer-logo {
  display: block;
  width: 150px;
  max-width: 100%;
  margin: 18px auto 0;
  object-fit: contain;
}

.rotate-hint {
  position: fixed;
  left: 50%;
  bottom: 92px;
  z-index: 9;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: min(92vw, 780px);
  max-width: min(780px, calc(100% - 24px));
  padding: 10px 14px;
  border: 1px solid rgba(169, 211, 255, 0.18);
  border-radius: 18px;
  background: rgba(8, 24, 39, 0.9);
  color: rgba(245, 247, 250, 0.92);
  box-shadow: 0 18px 42px rgba(1, 12, 24, 0.3);
  backdrop-filter: blur(12px);
  transform: translate(-50%, 10px);
  opacity: 0;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
  cursor: pointer;
}

.rotate-hint[hidden] {
  display: none !important;
}

.rotate-hint.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.rotate-hint-icon {
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
}

.rotate-hint-text {
  flex: 1 1 auto;
  font-size: 0.82rem;
  line-height: 1.35;
}

.rotate-hint-text strong {
  color: var(--text);
  font-weight: 700;
}

.rotate-hint-text br {
  display: block;
}

.rotate-hint-close {
  width: 30px;
  min-width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  font-size: 0.82rem;
  line-height: 1;
  pointer-events: none;
}

.info-dialog {
  width: min(760px, 100%);
  max-height: min(80vh, 720px);
  padding: 18px;
  border: 1px solid rgba(169, 211, 255, 0.18);
  border-radius: 22px;
  background: rgba(8, 24, 39, 0.94);
  box-shadow: 0 24px 80px rgba(1, 12, 24, 0.45);
  overflow: auto;
}

.info-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.info-dialog-header strong {
  font-size: 1.1rem;
}

.info-dialog-image {
  display: block;
  width: 100%;
  max-height: 320px;
  margin-bottom: 14px;
  border-radius: 16px;
  object-fit: contain;
  background: rgba(2, 10, 18, 0.42);
}

.info-dialog-body {
  color: var(--muted);
  line-height: 1.6;
  white-space: pre-wrap;
}

.info-dialog-body.is-html {
  white-space: normal;
}

.info-dialog-body p {
  margin: 0;
}

.info-dialog-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--info-action-border, var(--border));
  border-radius: 999px;
  background: var(--info-action-bg, var(--button));
  color: var(--info-action-text, var(--text));
  box-shadow: var(--button-shadow);
  text-decoration: none;
}

.info-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.cta-panel {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.cta-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cta-list {
  display: grid;
  gap: 10px;
}

.cta-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px 34px;
  grid-template-areas:
    "label reset remove"
    "type buttoncolor textcolor"
    "value . .";
  gap: 10px;
  align-items: start;
}

.cta-item input,
.cta-item select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  min-width: 0;
}

.cta-item input:nth-of-type(1) {
  grid-area: label;
}

.cta-item select {
  grid-area: type;
}

.cta-item input:nth-of-type(2) {
  grid-area: value;
}

.cta-item input[type="color"] {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 999px;
  justify-self: center;
  align-self: center;
  cursor: pointer;
  background: transparent;
  border: 1px solid rgba(169, 211, 255, 0.28);
  box-shadow: inset 0 0 0 1px rgba(6, 16, 27, 0.35);
}

.cta-item input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 999px;
}

.cta-item input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 999px;
}

.cta-item input[type="color"]::-moz-color-swatch {
  border: none;
  border-radius: 999px;
}

.cta-item .icon-button {
  grid-area: reset;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  align-self: center;
  justify-self: center;
}

.cta-item .danger-button {
  grid-area: remove;
  width: 34px;
  min-width: 34px;
  height: 34px;
  padding: 0;
  align-self: center;
  justify-self: center;
}

.cta-item select option {
  color: #000;
  background: #fff;
}

.cta-item > input[type="color"]:nth-of-type(3) {
  grid-area: buttoncolor;
}

.cta-item > input[type="color"]:nth-of-type(4) {
  grid-area: textcolor;
}

.info-dialog-link[hidden] {
  display: none;
}

.info-dialog-link:hover,
.info-dialog-link:focus-visible {
  border-color: var(--info-action-border, rgba(169, 211, 255, 0.3));
  background: var(--info-action-hover, var(--button-hover));
}

.info-dialog-body .analytics-summary {
  gap: 10px;
}

.info-dialog-body .analytics-table {
  margin-top: 0;
}

.info-dialog-body .analytics-table-row {
  gap: 8px;
  padding: 5px 8px;
}

.info-dialog-body .analytics-table-summary .analytics-room-name {
  display: grid;
  gap: 2px;
}

.creator-auth-change-log {
  margin: 6px 0 0;
  font-size: 0.72rem;
  line-height: 1.2;
  color: rgba(151, 181, 208, 0.62);
  text-align: right;
}

.analytics-hour-charts {
  display: grid;
  gap: 14px;
}

.analytics-hour-chart {
  display: grid;
  gap: 8px;
}

.analytics-hour-bars {
  display: grid;
  grid-template-columns: repeat(24, minmax(0, 1fr));
  gap: 4px;
  align-items: end;
  min-height: 118px;
  padding: 8px 6px 4px;
  border-radius: 12px;
  background: rgba(169, 211, 255, 0.05);
}

.analytics-hour-slot {
  display: grid;
  gap: 4px;
  justify-items: center;
  align-items: end;
}

.analytics-hour-bar {
  width: 100%;
  min-height: 6px;
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, rgba(127, 209, 255, 0.92), rgba(127, 209, 255, 0.58));
}

.analytics-hour-label {
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1;
}

.analytics-insights {
  display: grid;
  gap: 8px;
}

.analytics-insight-list {
  display: grid;
  gap: 6px;
}

.analytics-insight-item {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(169, 211, 255, 0.05);
  color: var(--text);
  line-height: 1.4;
}

.analytics-comparison {
  display: grid;
  gap: 8px;
}

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

.analytics-comparison-item {
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(169, 211, 255, 0.05);
  display: grid;
  gap: 4px;
}

.analytics-trend {
  display: grid;
  gap: 10px;
}

.analytics-trend-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}

.analytics-trend-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.analytics-trend-tab {
  min-height: 0;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(169, 211, 255, 0.18);
  background: rgba(169, 211, 255, 0.05);
  color: var(--muted);
  font-size: 0.9rem;
}

.analytics-trend-tab.is-active {
  background: rgba(127, 209, 255, 0.18);
  color: var(--text);
  border-color: rgba(127, 209, 255, 0.42);
}

.analytics-trend-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
  gap: 6px;
  align-items: end;
  min-height: 164px;
  padding: 10px 8px 6px;
  border-radius: 12px;
  background: rgba(169, 211, 255, 0.05);
}

.analytics-trend-slot {
  display: grid;
  gap: 4px;
  align-items: end;
  justify-items: center;
}

.analytics-trend-slot-button {
  display: grid;
  gap: 4px;
  align-items: end;
  justify-items: center;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  min-height: 0;
}

.analytics-trend-slot-button.is-active .analytics-trend-bar {
  background: linear-gradient(180deg, rgba(255, 228, 128, 0.98), rgba(217, 184, 74, 0.84));
  box-shadow: 0 0 0 1px rgba(255, 228, 128, 0.22);
}

.analytics-trend-value {
  font-size: 0.74rem;
  color: var(--muted);
}

.analytics-trend-bar {
  width: 100%;
  min-height: 6px;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, rgba(127, 209, 255, 0.95), rgba(66, 154, 227, 0.72));
}

.analytics-trend-label {
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.15;
}

.analytics-trend-link {
  padding: 0;
  border: 0;
  background: transparent;
  min-height: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(169, 211, 255, 0.28);
  text-underline-offset: 0.14em;
}

.analytics-trend-link.is-active {
  color: var(--text);
  font-weight: 700;
  text-decoration-color: rgba(255, 228, 128, 0.75);
}

.analytics-trend-detail {
  display: grid;
  gap: 10px;
}

.analytics-trend-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.analytics-trend-chart-days {
  grid-template-columns: repeat(auto-fit, minmax(24px, 1fr));
}

.analytics-report {
  display: grid;
  gap: 12px;
}

.analytics-report-actions {
  display: flex;
  justify-content: flex-end;
}

.analytics-report-header {
  display: grid;
  gap: 4px;
}

.analytics-report-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.analytics-report-header h3 {
  margin: 0;
  font-size: 1.4rem;
}

.analytics-report-intro {
  margin: 0;
  line-height: 1.5;
  color: var(--muted);
}

.analytics-report-section {
  display: grid;
  gap: 10px;
}

.analytics-report-section h4 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

@media print {
  .analytics-report-actions,
  .info-dialog-header button {
    display: none !important;
  }

  .info-overlay,
  .info-dialog,
  .info-dialog-body {
    position: static !important;
    inset: auto !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    overflow: visible !important;
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
  }

  .analytics-table-row,
  .analytics-hour-bars,
  .analytics-insight-item,
  .analytics-comparison-item {
    break-inside: avoid;
  }
}

.import-export-table-head {
  grid-template-columns: minmax(0, 1.8fr) 110px 150px;
}

.import-export-table-row {
  grid-template-columns: minmax(0, 1.8fr) 110px 150px;
}

.import-export-action {
  width: 100%;
  min-height: 0;
  padding: 8px 10px;
  border-radius: 12px;
  font-size: 0.92rem;
}

.panorama.has-image {
  background: #06101b;
}

.legend {
  margin-top: 18px;
  flex-wrap: wrap;
}

.legend span {
  margin: 0;
}

.editor-view-tools {
  margin-top: 12px;
}

.viewer-info {
  display: none;
  margin-top: 14px;
  width: 100%;
  border: 1px solid rgba(169, 211, 255, 0.18);
  border-radius: 18px;
  background: rgba(11, 32, 51, 0.5);
  overflow: hidden;
}

.viewer-info summary {
  padding: 12px 16px;
  cursor: pointer;
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  list-style: none;
}

.viewer-info summary::-webkit-details-marker {
  display: none;
}

.viewer-info summary::after {
  content: "+";
  float: right;
  color: var(--accent);
}

.viewer-info[open] summary::after {
  content: "−";
}

.viewer-info-content {
  display: grid;
  gap: 14px;
  padding: 0 16px 16px;
}

.viewer-info-room {
  display: grid;
  gap: 6px;
}

.viewer-info-room strong {
  font-size: 1rem;
}

.viewer-info-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.viewer-info-format {
  margin: 2px 0 0;
  color: rgba(245, 247, 250, 0.46);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.viewer-image-format {
  margin-bottom: 14px;
}

.editor-image-format {
  margin-top: 10px;
  margin-bottom: 0;
}

.image-load-timing {
  margin-top: 4px;
  font-size: 0.72rem;
  opacity: 0.7;
}

.audio-controls {
  display: none;
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 3;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 0;
  padding: 6px;
  border: 1px solid rgba(169, 211, 255, 0.18);
  border-radius: 999px;
  background: rgba(8, 24, 39, 0.6);
  backdrop-filter: blur(10px);
  width: fit-content;
}

.audio-status {
  color: var(--muted);
  font-size: 0.95rem;
}

.fullscreen-hint {
  position: absolute;
  top: calc(100% + 12px);
  right: 42px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(320px, calc(100vw - 48px));
  padding: 10px 12px;
  border: 1px solid rgba(169, 211, 255, 0.2);
  border-radius: 16px;
  background: rgba(8, 24, 39, 0.92);
  color: rgba(245, 247, 250, 0.92);
  font-size: 0.8rem;
  line-height: 1.35;
  box-shadow: 0 14px 34px rgba(1, 12, 24, 0.32);
  backdrop-filter: blur(12px);
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.fullscreen-hint::after {
  content: "";
  position: absolute;
  top: -7px;
  right: 18px;
  width: 12px;
  height: 12px;
  border-top: 1px solid rgba(169, 211, 255, 0.2);
  border-left: 1px solid rgba(169, 211, 255, 0.2);
  background: rgba(8, 24, 39, 0.92);
  transform: rotate(45deg);
}

.fullscreen-hint.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.fullscreen-hint-icon {
  flex: 0 0 auto;
  font-size: 1rem;
  line-height: 1;
}

.fullscreen-hint-text {
  display: block;
}

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 12, 21, 0.54);
  backdrop-filter: blur(10px);
}

.confirm-overlay[hidden],
.info-overlay[hidden],
.welcome-overlay[hidden] {
  display: none !important;
}

.confirm-dialog {
  width: min(480px, 100%);
  padding: 22px;
  border: 1px solid rgba(169, 211, 255, 0.18);
  border-radius: 24px;
  background: rgba(8, 24, 39, 0.96);
  box-shadow: 0 24px 80px rgba(1, 12, 24, 0.45);
}

.confirm-dialog h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}

.confirm-dialog .button-row {
  margin-top: 18px;
  justify-content: flex-end;
}

#legend-secondary:empty {
  display: none;
}

.creator-signature {
  margin: 12px 4px 0;
  text-align: right;
  font-size: 0.82rem;
  color: rgba(167, 189, 211, 0.72);
}

.creator-signature a {
  color: inherit;
  text-decoration: none;
}

.creator-signature a:hover,
.creator-signature a:focus-visible {
  color: rgba(201, 223, 242, 0.92);
  text-decoration: underline;
}

.creator-change-log {
  margin-top: 10px;
  padding-top: 8px;
}

.hotspot-target-preview {
  margin-top: 10px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(127, 209, 255, 0.16);
  background: rgba(7, 19, 31, 0.82);
}

.hotspot-target-preview-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.hotspot-target-preview-header .upload-status {
  margin: 4px 0 0;
}

.hotspot-target-preview-content {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 10px;
}

.hotspot-target-preview-stage {
  position: relative;
  margin-top: 0;
  height: 270px;
  flex: 0 1 50%;
  max-width: 50%;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(127, 209, 255, 0.14);
  background:
    radial-gradient(circle at 18% 18%, rgba(127, 209, 255, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(12, 29, 46, 0.92), rgba(5, 13, 22, 0.96));
  touch-action: none;
}

.hotspot-target-preview-panorama,
.hotspot-target-preview-flat-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hotspot-target-preview-panorama canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.hotspot-target-preview-flat-image {
  object-fit: cover;
  transform: translate(var(--preview-flat-offset-x, 0%), var(--preview-flat-offset-y, 0%)) scale(1.02);
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}

.hotspot-target-preview-content > button {
  flex: 0 0 190px;
  align-self: flex-start;
}

.hotspot-target-preview-hint {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

body.viewer-mode .creator-only {
  display: none;
}

body:not(.admin-enabled) #toggle-mode {
  display: none;
}

body.viewer-mode .viewer-only {
  display: inline-flex;
}

body.viewer-mode .viewer-progress.viewer-only {
  display: block;
}

body.viewer-mode .shell {
  grid-template-columns: 1fr;
}

body.viewer-mode .viewer-card {
  position: relative;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  overflow: visible;
}

body.viewer-mode.welcome-open .viewer-card {
  border-radius: var(--viewer-frame-radius);
  overflow: hidden;
}

body.viewer-mode .sidebar {
  display: none;
}

body.viewer-mode #project-heading {
  margin-bottom: 12px;
}

body:not(.viewer-mode) #project-heading {
  display: none;
}

body.viewer-mode .viewer-meta,
body.viewer-mode .project-intro-display {
  display: none;
}

body.viewer-mode .legend {
  display: none;
}

body:not(.viewer-mode) .legend {
  display: none;
}

body.viewer-mode .viewer-info {
  display: block;
}

body.viewer-mode .mode-panel .panel-row {
  display: none;
}

body.viewer-mode .audio-controls {
  display: flex;
}

body.viewer-mode .audio-status {
  display: none;
}

body.viewer-mode .audio-controls .icon-button {
  width: 38px;
  min-width: 38px;
  padding: 8px;
  font-size: 1rem;
  background: transparent;
  border-color: transparent;
}

body.viewer-mode .audio-controls .icon-button:hover,
body.viewer-mode .audio-controls .icon-button:focus-visible {
  background: rgba(127, 209, 255, 0.16);
  border-color: rgba(127, 209, 255, 0.28);
  transform: none;
}

body:not(.viewer-mode) .viewer-meta,
body:not(.viewer-mode) .project-intro-display {
  display: none;
}

body:not(.viewer-mode) .button-row {
  margin-top: 5px;
  gap: 6px;
}

body.viewer-mode .viewer-title-overlay {
  display: none;
}

body.viewer-mode .viewer-menu-anchor {
  display: block;
}

body.viewer-mode.embedded-view .app {
  padding: 0;
}

body.viewer-mode.embedded-view .shell {
  width: 100%;
  max-width: none;
  display: block;
}

body.viewer-mode.embedded-view .viewer-card {
  position: relative;
  min-height: 100vh;
  padding: 0;
  border: none;
  border-radius: 0;
  background: #07111f;
  box-shadow: none;
  backdrop-filter: none;
}

body.viewer-mode.embedded-view .viewer-frame,
body.viewer-mode.embedded-view .panorama {
  min-height: 100vh;
  border: none;
  border-radius: 0;
}

body.viewer-mode.embedded-view .legend {
  display: none;
}

body.viewer-mode.embedded-view .viewer-info {
  position: absolute;
  right: 12px;
  bottom: 64px;
  left: auto;
  z-index: 6;
  margin-top: 0;
  width: min(420px, calc(100% - 24px));
  max-height: min(34vh, 280px);
  overflow: auto;
}

body.viewer-mode.window-maximized .app {
  padding: 0;
}

body.viewer-mode.window-maximized .shell {
  width: 100%;
  max-width: none;
  grid-template-columns: 1fr;
  gap: 0;
}

body.viewer-mode.window-maximized .sidebar {
  display: none;
}

body.viewer-mode.window-maximized .viewer-card {
  min-height: 100vh;
  padding: 0;
  border: none;
  border-radius: 0;
  background: #07111f;
  box-shadow: none;
  backdrop-filter: none;
}

body.viewer-mode.window-maximized .viewer-frame,
body.viewer-mode.window-maximized .panorama {
  min-height: 100vh;
  border: none;
  border-radius: 0;
}

body.viewer-mode.window-maximized .legend {
  display: none;
}

body.viewer-mode.window-maximized .viewer-info {
  position: absolute;
  right: 12px;
  bottom: 64px;
  left: auto;
  z-index: 6;
  margin-top: 0;
  width: min(420px, calc(100% - 24px));
  max-height: min(34vh, 280px);
  overflow: auto;
}

@media (max-width: 980px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    max-height: none;
  }

  .viewer-card {
    min-height: auto;
  }

  body.viewer-mode .app {
    padding: 0;
  }

  body.viewer-mode .shell {
    width: 100%;
    display: block;
  }

  body.viewer-mode .viewer-card {
    position: relative;
    min-height: 100vh;
    padding: 0;
    border: none;
    border-radius: 0;
    background: #07111f;
    box-shadow: none;
    backdrop-filter: none;
  }

  body.viewer-mode .viewer-frame,
  body.viewer-mode .panorama {
    min-height: 100vh;
    border: none;
    border-radius: 0;
  }

  body.viewer-mode .legend {
    display: none;
  }

  body.viewer-mode .viewer-info {
    position: absolute;
    right: 12px;
    bottom: 74px;
    left: auto;
    z-index: 6;
    margin-top: 0;
    width: 104px;
    max-width: calc(100% - 24px);
    max-height: none;
    overflow: hidden;
  }

  body.viewer-mode .viewer-info summary {
    padding: 10px 14px;
    text-align: center;
  }

  body.viewer-mode .viewer-info[open] {
    width: calc(100% - 24px);
    max-height: min(34vh, 280px);
    overflow: auto;
  }

  body.viewer-mode .audio-controls {
    top: 12px;
    right: 12px;
    z-index: 8;
  }

  .fullscreen-hint {
    right: 18px;
    max-width: min(260px, calc(100vw - 32px));
    font-size: 0.74rem;
  }

  body.viewer-mode #window-toggle {
    display: none;
  }

  body.viewer-mode .viewer-menu-anchor {
    top: 12px;
    left: 12px;
    max-width: min(280px, calc(100% - 96px));
  }

  .viewer-credit {
    right: 12px;
    bottom: 12px;
    font-size: 0.68rem;
  }

  .viewer-share-button {
    right: 12px;
    bottom: 42px;
    font-size: 0.68rem;
  }

  .viewer-progress {
    left: 108px;
    bottom: 10px;
    font-size: 0.62rem;
  }

  .hotspot-style-toggle {
    left: 12px;
    bottom: 12px;
    font-size: 0.68rem;
  }

  .autorotate-toggle {
    left: 70px;
  }

  .viewer-back-button {
    bottom: 12px;
    z-index: 12;
    font-size: 0.68rem;
  }
}

@media (max-width: 680px) {
  .app,
  .sidebar,
  .viewer-card {
    padding: 18px;
  }

  .viewer-frame,
  .panorama {
    min-height: 52vh;
  }

  .panel-row,
  .button-row,
  .viewer-meta,
  .legend,
  .hotspot-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .button-row button {
    width: 100%;
  }

  .control-button-row {
    grid-template-columns: 1fr;
  }

  body.viewer-mode .app,
  body.viewer-mode .sidebar,
  body.viewer-mode .viewer-card {
    padding: 0;
  }

  .welcome-overlay {
    padding: 12px;
  }

  .welcome-dialog {
    width: min(100%, 420px);
    padding: 22px 18px 20px;
    border-radius: 22px;
  }

  .welcome-dialog h2 {
    font-size: clamp(1.45rem, 8vw, 2rem);
  }

  .welcome-dialog #welcome-start-button {
    width: 100%;
    min-width: 0;
    min-height: 82px;
    padding: 18px 20px;
    font-size: 1.3rem;
  }

  .welcome-footer-logo {
    width: 120px;
  }
}
