html, body {
  height: 100%;
  margin: 0;
  background: #000;
}
.site-content { padding: 0 !important; } 

.canvas-wrap {
  position: relative;
  width: 100vw;
  height: 100svh;           
  overflow: hidden;
}

canvas.render {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: -webkit-optimize-contrast;
  position: relative;
  z-index: 1;               
}

.map-bg { pointer-events:none; z-index:0; }
canvas.render { z-index:1; }

.header-over {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  background: rgba(34, 42, 57);
}

.header-inner {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 25px;
  padding: 10px 15px;
}

.breadcrumbs {
  font-size: 18px;
  opacity: .9;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-center-controls {
  justify-self: center;
  display: flex;
  gap: 10px;
}

.header-right-controls {
  justify-self: end;
  display: flex;
  gap: 10px;
  margin-left: 0; 
}

@media (max-width: 720px) {
  .header-center-controls { display: none; }
}

.icon-btn {
  background: none;       
  border: none;           
  padding: 0;             
  margin: 0;              
  display: inline-flex;   
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease;
}
.icon-btn img {
  width: 40px;            
  height: 40px;
  display: block;
  object-fit: contain;
}
.icon-btn:hover {
  transform: scale(1.06); 
  opacity: 0.85;          
}

/* Оверлей 360 */
#tourOverlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.76);
  display: none;
  z-index: 1000;
}
#tourFrame {
  position: absolute;
  inset: 16px 16px 16px 16px;
  width: calc(100% - 32px);
  height: calc(100% - 32px);
  border: 0;
}
#tourClose {
  position: absolute;
  top: 26px;
  right: 26px;
  background: none;
  border: 0;
  font-size: 35px;
  line-height: 1;
  cursor: pointer;
  color: #777;
  padding: 2px 6px;
  z-index: 2001;
  transition: color .2s ease;
}
#tourClose:hover {
  color: #000;
}

/* ===== POPUP / TOOLTIP ===== */
.popup {
  position: absolute;
  z-index: 60;
  background: rgba(255,255,255,1);
  color: rgba(88,88,88,1);
  padding: 6px 6px;
  border-radius: 0;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  display: none;
  max-width: 420px;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid rgba(255,255,255,.06);
}
.popup .title  { font-weight: 400; margin-bottom: 0; font-size: 16px; }
.popup .type   { font-size: 12px; opacity: .75; margin-bottom: 0; }
.popup .media  { margin-top: 6px; }
.popup .media img { display: block; max-width: 100%; height: auto; border-radius: 0; }
.popup::after { content: none !important; }

/* ===== ACCESSIBILITY ===== */
canvas {
  user-select: none;
  -webkit-user-drag: none;
}

@font-face {
  font-family: 'MyFont';
  src: url('../fonts/Belleza.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
body { font-family: 'MyFont', sans-serif; }

.header-over .breadcrumbs a { color: #ffffff !important; text-decoration: none; }
.header-over .breadcrumbs .sep { color: #ffffff !important; margin: 0 10px; }
.header-over .breadcrumbs .current { color: #48b9eb !important; }

.logo img { display: block; height: 28px; width: auto; }

.icon-btn,
.icon-btn:hover,
.icon-btn:focus,
.icon-btn:active {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  outline: none;                 
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.icon-btn::-moz-focus-inner { border: 0; padding: 0; }
.icon-btn:focus-visible {
  outline: 2px solid rgba(255,255,255,.35);
  outline-offset: 2px;
}

.header-inner:not(:has(.header-center-controls)) {
  grid-template-columns: auto 1fr auto; 
}
@media (max-width: 720px) {
  .header-inner { grid-template-columns: auto 1fr auto; }
}

/* ===== LOADER ===== */
.viewer-loader {
  position: fixed;
  inset: 0;
  background: #ede7e3;
  z-index: 500;             
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity .25s ease;
  pointer-events: auto;
}
.viewer-loader.is-hidden { opacity: 0; pointer-events: none; }
.loader-logo { width: clamp(120px, 16vw, 380px); height: auto; margin-bottom: 18px; }
.loader-bar { width: min(420px, 72vw); height: 6px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.loader-bar__fill { display: block; width: 0%; height: 100%; background: var(--accent); transition: width .15s ease; }
.loader-percent { margin-top: 8px; font-size: 14px; color: #303b4f; }
@media (prefers-reduced-motion: reduce) {
  .viewer-loader, .loader-bar__fill { transition: none !important; }
}

/* ===== MAP POPUP LEGACY ===== */
.map-popup{
  position: fixed !important;   
  left: 0; top: 0;               
  transform: translate3d(0,0,0);
  z-index: 1000;                 
  background: #fff;
  color: #222;
  padding: 12px 14px;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  display: none;
  max-width: 280px;
  font-size: 14px;
  pointer-events: auto;
}
.map-popup .title{ font-weight:600; margin-bottom:6px; }
.map-popup .image{ margin-bottom:8px; }
.map-popup .image img{ display:block; width:100%; height:auto; border-radius:6px; }

#viewer { touch-action: none; }

/* ===== LEFT INFO PANEL ===== */
.panel-overlay{
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 250;
  display: none;
}
.panel-overlay.is-open{ display:block; }

.panel-area{
  position: fixed;
  top: 0; bottom: 0; left: 0;
  width: min(550px, 92vw);
  background: #fff;
  color: #222;
  z-index: 251;
  transform: translateX(-100%);
  transition: transform .25s ease;
  box-shadow: 0 0 28px rgba(0,0,0,.25);
  display: flex; flex-direction: column;
}
.panel-area.is-open{ transform: translateX(0); }

.panel-area__header{
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider);
}
.panel-area__title{ font-size: 23px; font-weight: 400; margin: 0; }
.panel-area__close{
  background: none; border: 0; font-size: 28px; line-height: 1;
  cursor: pointer; color: #777; padding: 2px 6px;
}
.panel-area__close:hover{ color: #000; }

.panel-area__body{ padding: 14px 16px; overflow: auto; }
.panel-area .subtitle{ font-size: 14px; opacity: .8; margin: 6px 0 10px; }
.panel-area p{ margin: 0 0 10px; line-height: 1.55; }
.panel-area .small{ font-size: 12px; opacity:.8; }
.panel-area ul.small{ padding-left: 18px; }
.panel-area .media{ margin: 10px 0; }
.panel-area .media img{ width:100%; height:auto; display:block; border-radius:8px; }
.panel-area .media-grid{ display:grid; gap:8px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px){
  .panel-area{ width: 100vw; }
  .panel-area .media-grid{ grid-template-columns: 1fr; }
}
.panel-area .media-grid { display: block; }
.panel-area .media-grid img { width: 100%; height: auto; display: block; margin: 0 0 12px 0; border-radius: 8px; }
.panel-area .media-grid img:last-child { margin-bottom: 0; }

/* ===== THEME TOKENS ===== */
:root {
  --accent: #48b9eb;
  --text:   #ede7e3;
  --muted:  rgba(237,231,227,.72);
  --subtle: rgba(237,231,227,.55);

  --bg:     #000;
  --panel-bg:#fff;
  --panel-text:#222;
  --divider:rgba(227,227,227,1);

  --fs-12: 12px; --fs-13: 13px; --fs-14: 14px; --fs-16: 16px;
  --fs-18: 18px; --fs-20: 20px; --fs-24: 24px; --fs-28: 28px;

  --fw-400: 400; --fw-500: 500; --fw-600: 600; --fw-700: 700;

  --r-8: 8px; --r-10: 10px; --r-12: 12px;
  --gap-8: 8px; --gap-10: 10px; --gap-12: 12px;

  /* Єдині відступи для “лінії контролів” */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);

  --controls-bottom: calc(16px + var(--safe-bottom));
  --controls-left:   calc(16px + var(--safe-left));
  --controls-right:  calc(16px + var(--safe-right));
}

/* Типографіка зверху */
body { color: var(--text); line-height: 1.5; }
.header-over .breadcrumbs { color: var(--muted); }
.header-over .breadcrumbs a { color: var(--text) !important; }
.header-over .breadcrumbs .sep { color: var(--subtle) !important; }
.header-over .breadcrumbs .current { color: --accent; }

/* Утиліти */
.text-accent { color: var(--accent) !important; }
.text-muted  { color: var(--muted)  !important; }
.text-subtle { color: var(--subtle) !important; }
.text-invert { color: var(--text)   !important; }
.text-dark   { color: var(--panel-text) !important; }
.fw-400{font-weight:400}.fw-500{font-weight:500}.fw-600{font-weight:600}.fw-700{font-weight:700}
.fs-12{font-size:12px}.fs-13{font-size:13px}.fs-14{font-size:14px}.fs-16{font-size:16px}
.fs-18{font-size:18px}.fs-20{font-size:20px}.fs-24{font-size:24px}.fs-28{font-size:28px}
.tt-upper { text-transform: uppercase; letter-spacing: .06em; }

/* ===== PANEL: Tour button ===== */
:root { --panel-button-font: 'MyFont', sans-serif; }
.panel-tour-btn {
  background: #303b4f;
  color: #ffffff;
  border: 0;
  padding: 9px 35px;
  border-radius: 0;
  font-size: 16px;
  font-weight: 400;
  font-family: var(--panel-button-font);
  cursor: pointer;
  transition: none;
  margin-left: auto;
  margin-right: 12px;
}

/* ===== PANEL Blocks ===== */
.pa-block { display: block; padding: 10px 0 14px; }
.pa-block + .pa-block { border-top: 1px solid var(--divider); margin-top: 10px; }
.pa-block__line { font-size: 14px; line-height: 1.55; color: rgba(88,88,88,1); margin-bottom: 10px; }
.pa-block__media img { width: 100%; height: auto; display: block; border-radius: 0; }

/* Інфо-ряд */
.pa-info{
  display: grid;
  grid-template-columns: minmax(0,1fr) /* left */
                         1px           /* divider track */
                         minmax(0,1.1fr); /* right */
  column-gap: 5px; /* заміна gap для точнішого керування між колонами */
  align-items: start;
}
.pa-info__left { min-width: 0; }
.pa-heading {
  font-family: var(--panel-heading-font, 'MyFont', sans-serif);
  font-size: var(--panel-heading-size, 25px);
  font-weight: var(--panel-heading-weight, 400);
  color: rgba(88,88,88,1);
  line-height: 1.25;
}
.pa-info__divider { width: 1px; background: var(--divider); min-height: 100%; margin: 0 4px; }
.pa-info__right { min-width: 0; text-align: right; }
.pa-info__right strong,
.pa-info__right b,
.pa-info__right .fw-600 {
  font-weight: 600;
}
.pa-facts { list-style: none; margin: 0; padding: 0; color: rgba(88,88,88,0.8); font-size: 14px; line-height: 1.5; }
.pa-facts li { margin: 2px 0; }

/* Галерея креслень */
.pa-gallery { position: relative; margin: 8px 0 6px; user-select: none; z-index: 1; }
.pa-gallery.is-single .pa-g-prev,
.pa-gallery.is-single .pa-g-next,
.pa-gallery.is-single .pa-dots { display: none !important; }
.pa-gallery__stage { position: relative; overflow: hidden; border-radius: 0; background: #f6f8fb; z-index: 1; }
.pa-gallery__stage img { display: block; width: 100%; height: auto; position: relative; z-index: 1; transition: opacity 0.25s ease; }

/* Стрілки SVG */
.pa-g-prev, .pa-g-next {
  all: unset;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 52px; height: 52px;
  display: grid; place-items: center;
  cursor: pointer; opacity: 1;
  background: transparent;
  transition: transform .2s ease, opacity .2s ease;
}
.pa-g-prev img, .pa-g-next img {
  width: 36px; height: 36px; display: block; pointer-events: none;
  filter: brightness(0) saturate(100%) invert(65%) sepia(3%) saturate(205%) hue-rotate(175deg) brightness(95%) contrast(88%);
  transition: filter .2s ease;
}
.pa-g-prev:hover, .pa-g-next:hover { transform: translateY(-50%) scale(1.1); opacity: 1; }
.pa-g-prev:hover img, .pa-g-next:hover img {
  filter: brightness(0) saturate(100%) invert(38%) sepia(5%) saturate(283%) hue-rotate(177deg) brightness(95%) contrast(88%);
}
.pa-g-prev[disabled], .pa-g-next[disabled] { opacity: .35; cursor: default; pointer-events: none; }
.pa-g-prev { left: 8px; } .pa-g-next { right: 8px; }

/* Крапки */
.pa-dots { display: flex; justify-content: center; gap: 11px; padding: 8px 0 2px; }
.pa-dot {
  all: unset; width: 9px; height: 9px; border-radius: 50%;
  background: rgba(0,0,0,0.22); cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.pa-dot:hover { transform: scale(1.00); }
.pa-dot.is-active { background: #303b4f; transform: scale(1.55); }

/* ===== MINI MENU (desktop) ===== */
.mini-menu {
  position: fixed;
  left: 0px; bottom: 0px;
  width: 180px; min-height: 250px;
  background: #303b4f; color: #ede7e3;
  z-index: 203;
  border-radius: 0px;
  box-shadow: 0 10px 20px rgba(0,0,0,.35);
  padding: 10px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 2px; user-select: none;
}

.mini-menu__toggle {
  all: unset;
  width: 100%;
  display: flex;
  justify-content: center;
  cursor: pointer;
  padding-bottom: 6px;
}

.mini-menu__handle {
  display: block;
  width: 38px;
  height: 5px;
  border-radius: 4px;
  background: rgba(255,255,255,0.55);
  transition: background .2s ease;
}
.mini-menu__toggle:hover .mini-menu__handle {
  background: rgba(255,255,255,0.85);
}

.mini-menu__logo img { display: block; width: 170px; height: auto; filter: brightness(0) invert(1); margin: 0 auto; }
.mini-menu__title { font-size: 15px; letter-spacing: 0.4px; text-transform: uppercase; color: #ede7e3; opacity: .95; margin: 2px 0 4px; }
.mini-menu__btn {
  all: unset; display: block; width: 100%; text-align: center;
  padding: 0; font-size: 16px; color: #ede7e3;
  border: 1.5px solid #ede7e3; border-radius: 0;
  cursor: pointer; transition: transform .15s, background-color .15s, opacity .15s, border-color .15s;
}
.mini-menu__btn + .mini-menu__btn { margin-top: 2px; }
.mini-menu__btn:hover { transform: translateY(0); background: rgba(237,231,227,.4); border-color: #fff; }
.mini-menu__btn:active { transform: translateY(0); opacity: .95; }

.mini-menu__list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: max-height .28s ease, opacity .28s ease;
  overflow: hidden;
}

/* In collapsed state menu shows only logo + title */
.mini-menu.is-collapsed .mini-menu__list {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.mini-menu {
  transition: padding .28s ease, min-height .28s ease;
}

.mini-menu.is-collapsed {
  padding-bottom: 10px; /* трохи менше низу */
  min-height: 140px;    /* висота, коли список сховано */
}

/* ===== FLUID TOKENS (mobile) ===== */
:root{
  --icon-40: clamp(28px, 7vw, 40px);
  --icon-72: clamp(54px, 12vw, 72px);

  --fs-12: clamp(11px, 2.8vw, 12px);
  --fs-13: clamp(12px, 3vw, 13px);
  --fs-14: clamp(12px, 3.2vw, 14px);
  --fs-16: clamp(14px, 3.6vw, 16px);
  --fs-18: clamp(16px, 4.2vw, 18px);
  --fs-20: clamp(17px, 4.6vw, 20px);
  --fs-24: clamp(18px, 5.4vw, 24px);
  --fs-28: clamp(20px, 6.2vw, 28px);
}

/* Header tweaks mobile */
.header-over { padding-top: var(--safe-top); }
.header-inner{ gap: clamp(12px, 3.5vw, 25px); padding: 8px 12px; }
.breadcrumbs{ font-size: var(--fs-14); }
@media (max-width: 720px){
  .header-inner { grid-template-columns: auto 1fr auto; }
  .logo img { height: clamp(20px, 4.8vw, 28px); }
}

/* Icon buttons fluid */
.icon-btn img{ width: var(--icon-40); height: var(--icon-40); }

/* Popup tweaks */
.popup{ max-width: min(420px, 90vw); font-size: var(--fs-14); padding: 5px 5px; }

/* Panel mobile */
@media (max-width: 720px){

  .pa-info{
    display: block;
    padding: 6px 0;
  }

  .pa-info__left {
    margin-bottom: 4px;
    max-width: 100%;
  }

  .pa-heading {
    font-size: 25px;
    line-height: 1.3;
    font-weight: 500;
    display: block;
    max-width: 80%;

    white-space: normal !important;   /* перебиваємо можливий nowrap */
    word-wrap: break-word;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .pa-info__divider{
    display: none;
  }

  .pa-info__right{
    text-align: left;
    margin-top: 25px;
  }

  .pa-info__right ul.pa-facts {
    padding: 0;
    margin: 0;
    list-style: none;
  }

  .pa-info__right li{
    margin: 2px 0;
    font-size: 15px;
    line-height: 1.3;
  }
  
  .pa-info__right {
    max-width: 100%;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    word-wrap: break-word;
  }

  .pa-info__right li {
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: break-word;
    word-wrap: break-word;
    max-width: 100%;
  }

  .pa-info__right strong,
  .pa-info__right b,
  .pa-info__right .fw-600 {
    font-weight: 600;
  }
}

.panel-area__body{ padding-bottom: calc(16px + var(--safe-bottom)); -webkit-overflow-scrolling: touch; }

/* Mini-menu mobile size */
@media (max-width: 520px){
  .mini-menu{ left: 12px; bottom: calc(12px + var(--safe-bottom)); width: min(82vw, 260px); padding: 10px 12px; border-radius: 8px; }
  .mini-menu__logo img{ width: clamp(88px, 32vw, 120px); }
  .mini-menu__btn{ font-size: var(--fs-16); padding: 6px 0; }
}

/* Canvas height backups */
.canvas-wrap{ height: 100dvh; height: 100svh; }

/* Readability tweaks */
@media (max-width: 520px){
  .panel-area p, .pa-block__line { font-size: var(--fs-14); line-height: 1.55; }
}

/* ===== Desktop mini-menu only on ≥720px ===== */
@media (max-width: 719.98px){
  .mini-menu { display: none !important; }
}

/* =========================================================
   === UI BAR (єдиний контейнер для FAB • Arrows • Zoom) ===
   ========================================================= */
.ui-bar{
  position: fixed;
  left: 0; right: 0;
  bottom: var(--controls-bottom);
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* left | center | right */
  align-items: center;
  z-index: 200;
  padding-left:  var(--controls-left);
  padding-right: var(--controls-right);
  pointer-events: none; /* контейнер не ловить кліки */
}
.ui-bar__left,
.ui-bar__center,
.ui-bar__right{
  display: flex;
  align-items: center;
  gap: 18px;
  pointer-events: auto; /* але внутрішні елементи ловлять */
}
.ui-bar__left  { justify-content: flex-start; }
.ui-bar__center{ justify-content: center; gap: 42px; }
.ui-bar__right { justify-content: flex-end; }

/* === CTRL BUTTONS (спільний стиль для prev/next, FAB, zoom) === */
.ctrl-btn{
  all: unset;
  cursor: pointer;
  display: grid;
  place-items: center;
  width: var(--icon-72);
  height: var(--icon-72);
  border-radius: 999px;          /* потрібна кругла тапа-зона */
  background: transparent;       /* без чорної плашки */
  transition: transform .2s ease, opacity .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.ctrl-btn img{
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}
.ctrl-btn:hover   { transform: scale(1.06); opacity: .98; }
.ctrl-btn:active  { transform: scale(1.06); opacity: 1; }
.ctrl-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* Ховаємо FAB на десктопі, показуємо на мобі — через existing .only-mobile */
.only-mobile{ display:none; }
@media (max-width:720px){
  .only-mobile{ display:flex; }
}

/* ===== ZOOM Overlay ===== */
.zoom-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.97);
  z-index: 1000;
  display: none;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.zoom-overlay.is-open { display: block; }
.zoom-overlay:active { cursor: grabbing; }
.zoom-overlay img {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center center;
  max-width: none;
  will-change: transform;
  z-index: 1001;
}
/* Кнопка закриття зуму — там само, де й zoom */
.zoom-close{
  all: unset;
  position: fixed;
  right: var(--controls-right);
  bottom: var(--controls-bottom);
  z-index: 1002;
  display: flex; align-items: center; justify-content: center;
  width: var(--icon-72); height: var(--icon-72);
  cursor: pointer; opacity: .9;
  transition: transform .2s ease, opacity .2s ease;
  background: transparent;
}
.zoom-close img{ width: 100%; height: 100%; display:block; pointer-events:none; }
.zoom-close:hover { transform: scale(1.1); opacity: 1; }
.zoom-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* Ховаємо інтерфейс під час зуму */
body.zoom-mode .ui-bar,
body.zoom-mode #popup,
body.zoom-mode .panel-area,
body.zoom-mode .panel-overlay {
  display: none !important;
}

/* ===== Mobile Drawer (висувне меню) ===== */
.mini-drawer{
  position: fixed;
  left: calc(0px + var(--safe-left));
  bottom: 0;
  width: min(100vw, 200px);
  background: #303b4f;
  color: #ede7e3;
  z-index: 204;
  border-radius: 0px 0px 0 0;
  box-shadow: 0 -8px 30px rgba(0,0,0,.45);
  transform: translateY(calc(100% + 12px));
  transition: transform .28s ease;
  padding: 12px 12px calc(14px + var(--safe-bottom));
  will-change: transform;
}
.mini-drawer[aria-hidden="false"]{ transform: translateY(0); }
@media (min-width: 720px){
  .mini-drawer, .mini-backdrop { display: none !important; }
}
.mini-drawer__header{
  display: grid; grid-template-columns: 1fr auto;
  align-items: center; gap: 10px; margin-bottom: 6px;
}
.mini-drawer__title{
  font-size: var(--fs-16);
  text-transform: uppercase;
  letter-spacing: .4px;
  text-align: center;
  margin-top: 3px;
  margin-bottom: 3px;
}
.mini-drawer__close {
  all: unset;
  position: absolute;
  top: 5px;                           /* відступ зверху */
  right: 5px;                         /* відступ справа */
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #ede7e3;
  border-radius: 8px;
  background: rgba(255,255,255,.0);
  font-size: 22px;
  line-height: 1;
  transition: background .2s ease;
}
.mini-drawer__close:hover{ background: rgba(255,255,255,.12); }
.mini-drawer__logo{ display: grid; place-items: center; padding: 6px 0 6px; margin-top: 22px; }
.mini-drawer__logo img{ width: clamp(96px, 62vw, 170px); height: auto; filter: brightness(0) invert(1); }
.mini-drawer__list{ display: grid; gap: 10px; }
.mini-drawer__btn{
  all: unset; text-align: center; padding: 5px 0; font-size: var(--fs-56);
  color: #ede7e3; border: 1px solid #ede7e3; border-radius: 0px;
  cursor: pointer; transition: transform .15s ease, background-color .15s ease, border-color .15s ease, opacity .15s ease;
}
.mini-drawer__btn:hover{
  transform: translateY(0px);
  background: rgba(237,231,227,.4);
  border-color: #fff;
}
.mini-backdrop{
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 110;
}
.mini-backdrop[hidden]{ display: none; }

/* Галерея: стрілки компактніші на малих */
@media (max-width: 520px){
  .pa-g-prev, .pa-g-next{ width: 44px; height: 44px; }
  .pa-g-prev img, .pa-g-next img{ width: 28px; height: 28px; }
}

/* робимо FAB 100% “тапабельною” на iOS */
.mini-fab{
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* забираємо системний tap-highlight на мобільних */
*,
*::before,
*::after {
  -webkit-tap-highlight-color: transparent;
}

/* для наших іконок-кнопок */
.ctrl-btn,
.mini-fab,
.zoom-close,
#zoomBtn,
#prevBtn,
#nextBtn {
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

/* не даємо браузеру заливати активний стан */
.ctrl-btn:active,
.mini-fab:active,
.zoom-close:active {
  background: transparent !important;
  box-shadow: none !important;
}

/* ---- Телефони/планшети (hover емітується) ---- */
@media (hover: none), (pointer: coarse) {
  .ctrl-btn:hover { transform: none; opacity: .95; }
  .ctrl-btn:active{ transform: scale(1.06); opacity: 1; }
}

/* Вимикаємо виділення тексту на всій сторінці */
html, body, #viewer, canvas, .ui-bar, .map-bg, .mini-menu, .mini-drawer {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
/* дозволяємо виділення лише в боковій панелі */
.panel-area, 
.panel-area * {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

/* MOBILE/TABLET: карта по висоті екрана + горизонтальний скрол */
@media (max-width: 820px){
  .canvas-wrap{
    height: 100dvh;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    background: #000;
  }
  canvas.render{
    height: 100dvh;
    width: auto;
    aspect-ratio: 16 / 9;
    max-width: none;
    display: block;
  }
  #viewer{ touch-action: pan-x; }
}

/* Кнопка Zoom (увімкнення) — завжди тут */
#zoomBtn{
  position: fixed;
  right: var(--controls-right);
  bottom: var(--controls-bottom);
  z-index: 201;
}

/* Кнопка закриття зуму — рівно в тому ж місці */
.zoom-close{
  all: unset;
  position: fixed;
  right: var(--controls-right);
  bottom: var(--controls-bottom);
  z-index: 1002;
  display: flex; align-items: center; justify-content: center;
  width: var(--icon-72); height: var(--icon-72);
  cursor: pointer; opacity: .9;
  transition: transform .2s ease, opacity .2s ease;
  background: transparent;
}
.zoom-close img{ width: 100%; height: 100%; display:block; pointer-events:none; }

.popup { will-change: left, top, transform; }

/* глобально: вимикаємо rubber-band */
html, body {
  overscroll-behavior: none;
}

/* мобільно-планшетний режим */
@media (max-width: 820px){
  html, body { overscroll-behavior: none; height: 100%; overflow: hidden; background: #fff; }
  .canvas-wrap{
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: none;
    touch-action: pan-x; /* тільки горизонтальний жест */
  }
}

@media (max-width: 720px) {
  #tourFrame {
    inset: 0;
    width: 100%;
    height: 100%;
  }
#tourClose {
  position: absolute;
  top: 16px;
  right: 16px;
  background: none;
  border: 0;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  color: #777;
  padding: 2px 6px;
  z-index: 2001;
  transition: color .2s ease;}
}

/* Overlay-підказка про орієнтацію */
.rotate-overlay {
  position: fixed;
  inset: 0;
  background: #fff;
  color: #222;
  z-index: 3000;                 /* вище за все: loader(500), panel(251), zoom(1000) */
  display: none;                 /* керуємо через JS */
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px calc(16px + env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  font-family: '', sans-serif;
}
.rotate-overlay__inner {
  max-width: 560px;
}
.rotate-overlay__title {
  font-size: 25px;
  font-weight: 600;
  margin: 0 0 10px;
}
.rotate-overlay__text {
  font-size: 20px;
  opacity: .85;
  margin: 0;
}

/* коли показано — блокуємо скрол */
html.rotate-lock,
body.rotate-lock { overflow: hidden; }

/* Ручка-шторка зверху міні-меню (desktop) */
.mini-menu__toggle{
  all: unset;
  width: 64px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,.55);
  margin: 2px 0 6px;
  cursor: pointer;
  display: block;
}

/* Обгортка для кнопок (будемо її згортати) */
.mini-menu__list{
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: max-height .25s ease, opacity .25s ease, transform .25s ease;
  max-height: 400px;    /* достатньо для всіх кнопок */
}

/* Можна трохи піджати меню у згорнутому стані */
.mini-menu.mini-menu--collapsed{
  padding-bottom: -80px;
}

.mini-menu {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 180px;
  min-height: 250px;
  background: #303b4f;
  color: #ede7e3;
  z-index: 203;
  border-radius: 0;
  box-shadow: 0 10px 20px rgba(0,0,0,.35);
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  user-select: none;
  transition: transform .25s ease; /* анімація для всього меню */
}

/* Згорнутий стан: все меню їде вниз, лишається зверху «шапка» */
.mini-menu.mini-menu--collapsed {
  transform: translateY(calc(100% - 110px)); 
  /* 60px — скільки хочеш залишити видимим:
     ручка + лого + заголовок */
}

/* Вимикаємо pinch / "розтягування" в сервісних блоках */
.mini-menu,
.mini-drawer,
.ui-bar,
.panel-overlay,
.panel-area {
  touch-action: none;       /* жести тут не перетворюються на системний зум */
  -webkit-user-select: none;
}

.pa-block {
  touch-action: pan-y;      /* дозволяємо тільки вертикальний скрол */
}

#tourOverlay,
#tourFrame,
#tourClose {
  touch-action: none;
}

.pa-gallery {
  display: grid;
  grid-template-columns: 1fr auto;         /* сцена + кнопка next праворуч */
  grid-template-rows: auto auto auto;      /* stage, caption, dots */
  align-items: start;
  gap: 8px 8px;
}
.pa-g-prev { grid-column: 1 / 2; grid-row: 1; justify-self: start; align-self: center; }
.pa-gallery__stage { grid-column: 1 / 3; grid-row: 1; }
.pa-g-next { grid-column: 2 / 3; grid-row: 1; justify-self: end; align-self: center; }

/* ----- Caption under gallery image ----- */
.pa-caption {
  text-align: center;
  font-size: 1.2rem;
  line-height: 1.4;
  opacity: 0.85;
  color: rgba(88,88,88,0.8);
  padding: 0px 10px 10px 10px;
  grid-column: 1 / 3;
  grid-row: 2;
  justify-self: center;
}
.pa-dots    { grid-column: 1 / 3; grid-row: 3; }