#pano-root {
  position: relative;
  /* не #0a0a0a: чёрный под status (#e7eae9) даёт тёмные дуги на border-radius */
  background: var(--color-bg, #e7eae9);
  touch-action: none;
  overflow: hidden;
}

#pano-root .pano-canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#pano-root .pano-canvas:active {
  cursor: grabbing;
}

/* 3D floor decals live inside the panorama sphere — no HTML overlay styles. */

.pano-minimap {
  position: absolute;
  left: 24px;
  bottom: 24px;
  z-index: 3;
  width: var(--minimap-size, 140px);
  height: var(--minimap-size, 140px);
  border-radius: 24px;
  background: #d1d5db;
  box-shadow: var(--shadow-soft, 0 4px 24px rgba(28, 43, 57, 0.12));
  overflow: hidden;
  pointer-events: auto;
  touch-action: manipulation;
  user-select: none;
}

.pano-minimap__canvas {
  /* Offscreen WebGL → blit в overlay (stacking под absolute overlay ломался). */
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.pano-minimap__overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  touch-action: manipulation;
  background: transparent;
}

@media (max-width: 768px) {
  .pano-minimap {
    left: 12px;
    bottom: calc(var(--toggle-bottom, 12px) + 64px);
    width: var(--minimap-size, 120px);
    height: var(--minimap-size, 120px);
    border-radius: 16px;
  }

  /* Буфер карты остаётся 140² (inline из рендера). Вписываем картинку в коробку,
     не пересчитывая кадр — иначе зум/обрез схемы меняется. */
  .pano-minimap__canvas,
  .pano-minimap__overlay {
    width: 100% !important;
    height: 100% !important;
  }
}

.pano-minimap--fill {
  position: absolute;
  inset: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  box-shadow: none;
}

/* Full-bleed map over pano panel (same engine as mode=map) */
.pano-map-modal {
  position: absolute;
  inset: 0;
  z-index: 30;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s linear;
  pointer-events: none;
  border-radius: inherit;
  overflow: hidden;
}

.pano-map-modal.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.pano-map-modal__map {
  position: absolute;
  inset: 0;
  background: var(--map-floor, #d1d5db);
  touch-action: none;
}

.pano-map-modal__map .map-canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  cursor: grab;
  touch-action: none;
}

.pano-map-modal__map .map-canvas:active {
  cursor: grabbing;
}

.pano-map-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  width: 40px;
  height: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: var(--color-surface, #fff);
  color: var(--color-ink, #353735);
  display: grid;
  place-items: center;
  box-shadow: 0 1px 4px rgba(28, 43, 57, 0.12);
  cursor: pointer;
  pointer-events: auto;
}

.pano-map-modal__close:hover {
  background: var(--color-surface-muted, #f2f3f3);
}

.pano-map-modal__close img {
  width: var(--icon-sm, 16px);
  height: var(--icon-sm, 16px);
}

@media (max-width: 768px) {
  .pano-map-modal__close {
    top: 8px;
    right: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pano-map-modal {
    transition: none;
  }
}
