:root {
  --bg: #111;
  --fg: #fff;
  --glass: rgba(20, 20, 24, 0.55);
  --accent: #3b82f6;
  --panel: #fff;
  --ink: #1d1d1f;
  --muted: #6b7280;
  /* theme (Оформление → Стиль тура sets these on :root) */
  --accent-fg: #fff;
  --on-bg: rgba(255, 255, 255, 0.92);
  --on-fg: #111;
  --tag-bg: rgba(255, 255, 255, 0.95);
  --tag-fg: #111;
  --soft: var(--soft);
  --glass-strong: rgba(15, 15, 18, 0.78);
  --blur: 8px;
  --r-pill: 999px;
  --r-panel: 14px;
  --r-btn: 10px;
  --ui-scale: 1;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-title: var(--font);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.35 var(--font);
}
#stage { position: fixed; inset: 0; overflow: hidden; -webkit-user-select: none; user-select: none; }
#c {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#c.dragging { cursor: grabbing; }
#c.picking { cursor: crosshair; }

/* ---------- top bar ---------- */
.bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: linear-gradient(rgba(0, 0, 0, 0.45), transparent);
  pointer-events: none;
  z-index: 5;
}
.bar > * { pointer-events: auto; }
.title {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.modes, .planStyle {
  display: flex;
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  border-radius: var(--r-pill);
  padding: 3px;
}
.modes button, .planStyle button {
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  cursor: pointer;
  opacity: 0.8;
}
.modes button.on, .planStyle button.on { background: var(--on-bg); color: var(--on-fg); opacity: 1; }
.tools { display: flex; gap: 8px; }
.icon {
  border: 0;
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  color: var(--fg);
  width: calc(36px * var(--ui-scale));
  height: calc(36px * var(--ui-scale));
  border-radius: var(--r-icon, 50%);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.icon.on { background: var(--on-bg); color: var(--on-fg); }
.planStyle {
  position: absolute;
  top: calc(64px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
}
@media (max-width: 600px) {
  .bar { flex-wrap: wrap; }
  .title { flex-basis: calc(100% - 140px); }
  .modes { order: 3; margin: 0 auto; }
  .planStyle { top: calc(108px + env(safe-area-inset-top)); }
}

.floors {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  border-radius: var(--r-panel);
  padding: 4px;
  z-index: 5;
}
.floors button {
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  font-size: 13px;
  padding: 7px 12px;
  border-radius: var(--r-btn);
  cursor: pointer;
  white-space: nowrap;
}
.floors button.on { background: var(--on-bg); color: var(--on-fg); }

/* ---------- overlay labels ---------- */
#overlay { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.lbl {
  position: absolute;
  left: 0;
  top: 0;
  will-change: transform;
  white-space: nowrap;
}
.tag {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 0;
  padding: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  cursor: pointer;
  transform: translate(calc(-14px * var(--ui-scale)), calc(-14px * var(--ui-scale)));
}
.tag .dot {
  width: calc(28px * var(--ui-scale));
  height: calc(28px * var(--ui-scale));
  border-radius: 50%;
  background: var(--tag-bg);
  color: var(--tag-fg);
  display: grid;
  place-items: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  font-size: calc(14px * var(--ui-scale));
}
.tag .txt {
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: 13px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.room {
  transform: translate(-50%, -50%);
  text-align: center;
  color: #1d1d1f;
  font-weight: 600;
  font-size: 13px;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff;
}
.room small { display: block; font-weight: 400; color: #4b5563; }
body.dark-labels .room { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8); }
body.dark-labels .room small { color: #e5e7eb; }
.ruler {
  transform: translate(-50%, -50%);
  background: #ffd400;
  color: #111;
  font-weight: 700;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

/* ---------- brand / contact ---------- */
.powered { position: absolute; left: 16px; bottom: calc(2px + env(safe-area-inset-bottom)); z-index: 4; display: flex; align-items: center; gap: 5px; font-size: 10px; color: rgba(255, 255, 255, 0.82); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55); pointer-events: none; letter-spacing: 0.02em; }
.powered img { width: 12px; height: 12px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }
.powered b { font-family: 'Unbounded', var(--font); font-weight: 500; letter-spacing: 0.01em; }
body.photo .powered, body.kiosk .powered { display: none; }
.brand {
  position: absolute;
  left: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  border-radius: var(--r-panel);
  padding: 8px 12px;
  z-index: 4;
}
.brand img { max-height: 32px; max-width: 120px; }
.brand img:not([src]) { display: none; }
.contact {
  border: 0;
  color: var(--accent-fg);
  background: var(--accent);
  padding: 7px 12px;
  border-radius: var(--r-btn);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- info panel ---------- */
.info {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 100%);
  background: var(--panel);
  color: var(--ink);
  z-index: 8;
  overflow-y: auto;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.25);
  -webkit-user-select: text;
  user-select: text;
}
.info h2 { margin: 0 32px 6px 0; font-size: 20px; }
.info .addr { color: var(--muted); margin-bottom: 14px; }
.info .desc { white-space: pre-wrap; margin: 0 0 16px; }
.info table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.info td { padding: 7px 0; border-bottom: 1px solid #eee; }
.info td:last-child { text-align: right; font-weight: 600; }
.info .linkBtn { display: inline-block; margin-bottom: 18px; color: var(--accent); }
.person { display: flex; gap: 12px; align-items: center; margin: 8px 0 12px; }
.person img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; background: #eee; }
.person b { display: block; font-size: 16px; }
.person span { color: var(--muted); }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions a {
  display: block;
  text-align: center;
  padding: 10px;
  border-radius: var(--r-btn);
  background: var(--soft);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
}
.actions a.primary { background: var(--accent); color: var(--accent-fg); }
.close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  color: #111;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}

/* ---------- tag card ---------- */
.card {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: grid;
  place-items: center;
  z-index: 9;
  padding: 16px;
}
.cardBox {
  position: relative;
  background: var(--panel);
  color: var(--ink);
  border-radius: var(--r-panel);
  width: min(560px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 20px;
  -webkit-user-select: text;
  user-select: text;
}
.cardBox h3 { margin: 0 36px 10px 0; font-size: 18px; }
.cardBox p { white-space: pre-wrap; margin: 0 0 12px; }
.cardBox img, .cardBox video { width: 100%; border-radius: var(--r-btn); display: block; margin-bottom: 12px; }
.cardBox .embed { position: relative; aspect-ratio: 16 / 9; margin-bottom: 12px; }
.cardBox .embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: var(--r-btn); }
.cardBox .go {
  display: inline-block;
  padding: 10px 16px;
  border-radius: var(--r-btn);
  background: var(--accent);
  color: var(--accent-fg);
  text-decoration: none;
  font-weight: 600;
}

/* ---------- misc ---------- */
.toast {
  position: absolute;
  left: 50%;
  top: calc(70px + env(safe-area-inset-top));
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.75);
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  z-index: 6;
  pointer-events: none;
  white-space: nowrap;
}
.hint {
  position: absolute;
  left: 50%;
  bottom: calc(84px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  white-space: nowrap;
  transition: opacity 0.6s;
  pointer-events: none;
  z-index: 3;
}
.hint.gone { opacity: 0; }
@media (max-width: 600px) { .hint { white-space: normal; text-align: center; width: calc(100% - 32px); } }

.lock {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: var(--bg);
  z-index: 20;
  margin: 0;
}
.lockBox { display: grid; gap: 10px; width: min(300px, calc(100% - 32px)); text-align: center; }
.lockTitle { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.lockBox input, .lockBox button { font: inherit; padding: 11px 12px; border-radius: var(--r-btn); border: 0; }
.lockBox button { background: var(--accent); color: var(--accent-fg); font-weight: 600; cursor: pointer; }
.lockErr { color: #f87171; min-height: 1.3em; font-size: 13px; }

.loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  background: var(--bg);
  transition: opacity 0.4s;
  z-index: 19;
}
.loading.done { opacity: 0; pointer-events: none; }
/* the plain spinner waits a moment, so a fast load shows nothing at all */
.loading:not(.ldr) > * { animation: ldrIn 0.3s 0.35s both; }
@keyframes ldrIn { from { opacity: 0; } }

/* ---------- loading screen (loader.js) ---------- */
@property --hole { syntax: '<length-percentage>'; inherits: false; initial-value: 0%; }
.loading.ldr { background: #101114; overflow: hidden; --hole: 0%; animation: ldrIn 0.25s both; }
.ldrBg { position: absolute; inset: -40px; background: center / cover no-repeat; filter: blur(22px) saturate(1.1) brightness(0.55); transform: scale(1.08); opacity: 0; transition: opacity 0.6s, transform 4s ease-out; }
.ldrBg.on { opacity: 1; transform: scale(1); }
.ldrMid { position: relative; display: grid; justify-items: center; gap: 14px; width: min(340px, 78vw); color: #fff; text-align: center; }
.ldrArt { width: min(240px, 60vw, 38vh); height: auto; overflow: visible; }
.ldrArt .walls { fill: none; stroke: #fff; stroke-width: 0.9; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5)); }
.ldrArt .rooms polygon { fill: var(--accent, #4b8cf5); fill-opacity: 0.18; stroke: none; }
.ldrArt .rooms { opacity: 0; transition: opacity 0.5s; }
.ldrArt .links line { stroke: rgba(255, 255, 255, 0.55); stroke-width: 0.5; stroke-dasharray: 1.5 1.5; opacity: 0; transition: opacity 0.4s; }
.ldrArt .dots circle { fill: #fff; opacity: 0.18; transform-box: fill-box; transform-origin: center; transition: opacity 0.3s, fill 0.3s, transform 0.3s; }
.ldrArt .links line.on { opacity: 1; }
.ldrArt .dots circle.on { opacity: 1; fill: var(--accent, #4b8cf5); animation: ldrPop 0.45s; }
@keyframes ldrPop { 50% { transform: scale(1.9); } }
.ldrLogo { max-width: 180px; max-height: 64px; object-fit: contain; }
.ldrRing { position: relative; width: 132px; height: 132px; display: grid; place-items: center; }
.ldrRing svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ldrRing .trk { fill: none; stroke: rgba(255, 255, 255, 0.16); stroke-width: 2; }
.ldrRing .bar { fill: none; stroke: var(--accent, #4b8cf5); stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.ldrRing img { max-width: 84px; max-height: 84px; object-fit: contain; }
.ldrTitle { font: 600 17px/1.3 var(--font-title, inherit); letter-spacing: 0.01em; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5); }
.ldrCap { font-size: 12px; letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.72); font-variant-numeric: tabular-nums; min-height: 1.2em; }
/* the lens: a hole opens from the centre and shows the panorama underneath */
.loading.reveal { pointer-events: none; -webkit-mask: radial-gradient(circle at 50% 50%, transparent var(--hole), #000 calc(var(--hole) + 1.5%)); mask: radial-gradient(circle at 50% 50%, transparent var(--hole), #000 calc(var(--hole) + 1.5%)); animation: ldrLens 0.85s cubic-bezier(0.7, 0, 0.2, 1) forwards; }
.loading.reveal .ldrMid { transition: transform 0.85s cubic-bezier(0.7, 0, 0.2, 1), opacity 0.4s; transform: scale(1.4); opacity: 0; }
@keyframes ldrLens { to { --hole: 105%; } }
@supports not (mask: radial-gradient(#000, #000)) { .loading.reveal { animation: none; opacity: 0; transition: opacity 0.6s; } }
@media (prefers-reduced-motion: reduce) { .ldrBg { transition: opacity 0.3s; transform: none; } .ldrArt .dots circle.on { animation: none; } }
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- bottom dock ---------- */
.dock {
  position: absolute;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  background: var(--glass);
  backdrop-filter: blur(var(--blur));
  border-radius: var(--r-panel);
  padding: 5px;
  z-index: 5;
  max-width: calc(100% - 24px);
  overflow-x: auto;
  scrollbar-width: none;
}
.dock:not(:has(button:not([hidden]))) { display: none; }
.dock button {
  border: 0;
  background: none;
  color: var(--fg);
  font: inherit;
  font-size: calc(11px * var(--ui-scale));
  display: grid;
  justify-items: center;
  gap: 3px;
  padding: 6px 10px;
  border-radius: var(--r-btn);
  cursor: pointer;
  min-width: 58px;
}
.dock button svg { width: calc(20px * var(--ui-scale)); height: calc(20px * var(--ui-scale)); }
.dock button:hover { background: rgba(255, 255, 255, 0.12); }
.dock button.on { background: var(--on-bg); color: var(--on-fg); }
@media (max-width: 600px) { .dock button { min-width: 48px; padding: 6px 6px; } .dock button span { font-size: 10px; } }

.routes {
  position: absolute;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: var(--panel);
  color: var(--ink);
  border-radius: var(--r-panel);
  padding: 6px;
  min-width: 240px;
  max-height: 50%;
  overflow-y: auto;
  z-index: 7;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}
.routes button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  padding: 10px 12px;
  border-radius: var(--r-btn);
  cursor: pointer;
  color: inherit;
  text-align: left;
}
.routes button:hover { background: var(--soft); }
.routes small { color: var(--muted); }

.guideBar {
  position: absolute;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(560px, calc(100% - 24px));
  background: var(--glass-strong);
  backdrop-filter: blur(var(--blur));
  border-radius: var(--r-panel);
  padding: 12px 14px;
  z-index: 6;
}
#guideText { font-size: 15px; line-height: 1.4; white-space: pre-wrap; min-height: 1.4em; }
.guideCtl { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; color: #cbd5e1; font-size: 12px; }
.guideCtl button { border: 0; background: rgba(255, 255, 255, 0.15); color: #fff; padding: 5px 12px; border-radius: var(--r-btn); font: inherit; cursor: pointer; }

.minimap {
  position: absolute;
  right: 16px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  width: 200px;
  height: 200px;
  box-sizing: content-box;
  border: 14px solid #fff;      /* the white card around the map; the map itself is drawn inside */
  border-radius: 24px;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  z-index: 4;
}
@media (max-width: 600px) { .minimap { width: 120px; height: 120px; border-width: 9px; border-radius: var(--r-panel); top: calc(110px + env(safe-area-inset-top)); bottom: auto; right: 12px; } }

.floatBtn {
  position: absolute;
  right: 16px;
  top: calc(70px + env(safe-area-inset-top));
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  z-index: 5;
  border-radius: var(--r-panel);
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}
.floatBtn img { display: block; width: 96px; height: 96px; object-fit: cover; }
.floatBtn span { display: block; background: var(--accent); color: var(--accent-fg); font-weight: 600; padding: 9px 14px; }

.popupBox { position: relative; max-width: min(420px, 100%); max-height: 100%; }
.popupBox img { display: block; max-width: 100%; max-height: calc(100vh - 40px); border-radius: var(--r-panel); cursor: pointer; }

#leadForm { display: grid; gap: 10px; }
#leadForm input, #leadForm textarea { font: inherit; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: var(--r-btn); color: var(--ink); background: #fff; }
#leadForm textarea { min-height: 80px; resize: vertical; }
#leadForm .go { border: 0; cursor: pointer; font: inherit; font-weight: 600; }
.formErr { color: #dc2626; font-size: 13px; min-height: 1em; }

.cover {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55) center / cover no-repeat;
}
.coverBox { display: grid; justify-items: center; gap: 16px; text-align: center; padding: 20px; }
.coverBox img { max-width: 220px; max-height: 90px; }
.coverTitle { font-family: var(--font-title); font-size: 26px; font-weight: 700; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); }
.coverBox button { border: 0; background: var(--on-bg); color: var(--on-fg); font: inherit; font-weight: 700; padding: 13px 26px; border-radius: var(--r-pill); cursor: pointer; }
@media (max-width: 600px) { .brand { bottom: calc(84px + env(safe-area-inset-bottom)); } }

/* ---------- floating tag cards ---------- */
#cards { position: absolute; inset: 0; pointer-events: none; z-index: 6; overflow: hidden; }
.tcard {
  position: absolute;
  left: 0;
  top: 0;
  width: 300px;
  max-height: calc(100% - 150px);
  overflow-y: auto;
  pointer-events: auto;
  background: var(--panel);
  color: var(--ink);
  border-radius: var(--r-panel);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.35);
  -webkit-user-select: text;
  user-select: text;
  animation: tcIn 0.18s ease-out;
}
.tcard.size-s { width: 230px; }
.tcard.size-l { width: 400px; }
@keyframes tcIn { from { opacity: 0; scale: 0.94; } to { opacity: 1; scale: 1; } }
.tcard::before {
  content: '';
  position: absolute;
  top: calc(var(--arrow-y, 50%) - 8px);
  width: 0;
  height: 0;
  border: 8px solid transparent;
}
.tcard[data-side='right']::before { left: -16px; border-right-color: var(--panel); }
.tcard[data-side='left']::before { right: -16px; border-left-color: var(--panel); }
.tcard { overflow: visible; }
.tcard > .tcBody, .tcard > .tcGallery, .tcard > .tcEmbed, .tcard > .tcVideo, .tcard > audio { display: block; }
.tcGallery { position: relative; background: #111; border-radius: 14px 14px 0 0; overflow: hidden; }
.tcGallery img { display: block; width: 100%; max-height: 240px; object-fit: cover; }
.tcNav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.tcNav.prev { left: 8px; }
.tcNav.next { right: 8px; }
.tcDots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 5px; }
.tcDots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, 0.5); }
.tcDots span.on { background: #fff; }
.tcEmbed { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: 14px 14px 0 0; overflow: hidden; }
.tcEmbed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.tcVideo { width: 100%; border-radius: 14px 14px 0 0; background: #000; }
.tcard > audio { width: calc(100% - 24px); margin: 12px 12px 0; }
.tcBody { padding: 12px 14px 14px; max-height: 260px; overflow-y: auto; }
.tcBody h3 { margin: 0 44px 6px 0; font-size: 16px; }
.tcard > .tcGallery ~ .tcBody h3, .tcard > .tcEmbed ~ .tcBody h3, .tcard > .tcVideo ~ .tcBody h3 { margin-right: 0; }
.tcBody p { margin: 0 0 10px; white-space: pre-wrap; font-size: 13.5px; line-height: 1.45; }
.tcBody .go { display: inline-block; padding: 8px 14px; border-radius: var(--r-btn); background: var(--accent); color: var(--accent-fg); text-decoration: none; font-weight: 600; font-size: 13px; }
.tcClose, .tcExpand {
  position: absolute;
  top: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #111;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.tcClose { right: 8px; }
.tcExpand { right: 42px; font-size: 14px; }
.tcard.sheet {
  left: 12px;
  right: 12px;
  top: auto;
  bottom: calc(84px + env(safe-area-inset-bottom));
  width: auto;
  max-height: 55%;
  overflow-y: auto;
}
.tcard.sheet::before { display: none; }

/* ---------- photo mode ---------- */
body.photo #overlay, body.photo #cards, body.photo .dock, body.photo .minimap, body.photo .floatBtn,
body.photo .brand, body.photo .hint, body.photo .bar, body.photo .floors, body.photo .planStyle,
body.photo .guideBar, body.photo .routes, body.photo .toast { display: none !important; }
.photoFrame {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  outline: 2px dashed rgba(255, 255, 255, 0.95);
  outline-offset: 0;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.5);
}
.photoFrame.full { box-shadow: none; outline-offset: -4px; }
.photoTint, .photoVignette { position: absolute; inset: 0; mix-blend-mode: soft-light; }
.photoVignette { mix-blend-mode: normal; }
.photoPanel {
  position: absolute;
  right: 20px;
  top: 20px;
  width: 270px;
  max-height: calc(100% - 40px);
  overflow-y: auto;
  z-index: 7;
  background: rgba(20, 20, 24, 0.85);
  backdrop-filter: blur(var(--blur));
  border-radius: var(--r-panel);
  padding: 14px;
  color: #fff;
  font-size: 13px;
}
.pTitle { font-size: 16px; font-weight: 700; }
.pHint { color: #9ca3af; font-size: 12px; margin: 2px 0 10px; }
.pLabel { color: #cbd5e1; font-size: 12px; margin: 10px 0 5px; }
.pChips { display: flex; flex-wrap: wrap; gap: 4px; }
.pChips button { border: 1px solid rgba(255, 255, 255, 0.2); background: none; color: #fff; padding: 5px 9px; border-radius: var(--r-btn); font: inherit; font-size: 12px; cursor: pointer; }
.pChips button.on { background: #fff; color: #111; border-color: #fff; }
.pRow { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; margin-top: 10px; }
.pRow b { font-weight: 600; color: #cbd5e1; font-variant-numeric: tabular-nums; }
.pRow input { grid-column: 1 / -1; width: 100%; accent-color: #fff; }
.pCheck { display: flex; gap: 8px; align-items: center; margin-top: 12px; cursor: pointer; }
.pBtns { display: flex; gap: 6px; margin-top: 14px; }
.pBtn { flex: 1; border: 0; background: rgba(255, 255, 255, 0.14); color: #fff; padding: 9px 6px; border-radius: var(--r-btn); font: inherit; font-weight: 600; cursor: pointer; }
.pBtn.primary { background: #fff; color: #111; flex: 1.6; }
@media (max-width: 700px) {
  .photoPanel { left: 10px; right: 10px; top: auto; bottom: calc(10px + env(safe-area-inset-bottom)); width: auto; max-height: 46%; }
}

/* ---------- packs: languages, variants, search, offers, audio, zoom, quest, accessibility, kiosk ---------- */
.langBtn { font-weight: 700; font-size: 12px; letter-spacing: 0.02em; }
.packMenu {
  position: absolute; top: calc(var(--barH, 54px) + 4px); right: 16px; z-index: 8;
  background: var(--panel); color: var(--ink); border-radius: var(--r-panel); padding: 6px; min-width: 170px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); display: grid; gap: 2px;
}
.packMenu button { border: 0; background: none; font: inherit; text-align: left; padding: 9px 12px; border-radius: var(--r-btn); cursor: pointer; color: inherit; }
.packMenu button:hover { background: var(--soft); }
.packMenu button.on { background: color-mix(in srgb, var(--accent) 14%, var(--panel)); color: var(--accent); font-weight: 600; }

.varBar {
  position: absolute; left: 50%; top: calc(var(--barH, 54px) + 8px); transform: translateX(-50%); z-index: 5;
  display: flex; gap: 2px; padding: 4px; border-radius: var(--r-pill); background: var(--glass); backdrop-filter: blur(var(--blur));
  max-width: calc(100% - 24px); overflow-x: auto;
}
.varBar button { border: 0; background: none; color: var(--fg); font: inherit; font-size: 13px; padding: 7px 14px; border-radius: var(--r-pill); cursor: pointer; white-space: nowrap; opacity: 0.85; }
.varBar button.on { background: var(--on-bg); color: var(--on-fg); opacity: 1; font-weight: 600; }

.packPanel {
  position: absolute; top: calc(var(--barH, 54px) + 4px); right: 16px; z-index: 8; width: min(360px, calc(100% - 32px));
  background: var(--panel); color: var(--ink); border-radius: var(--r-panel); padding: 10px; box-shadow: 0 12px 36px rgba(0, 0, 0, 0.32);
}
.searchPanel input { width: 100%; font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid #d6dbe4; border-radius: var(--r-btn); outline: none; }
.searchPanel input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18); }
.searchResults { max-height: min(50vh, 380px); overflow-y: auto; margin-top: 6px; display: grid; gap: 2px; }
.searchResults button { display: flex; align-items: baseline; gap: 10px; border: 0; background: none; font: inherit; text-align: left; padding: 9px 10px; border-radius: var(--r-btn); cursor: pointer; color: inherit; }
.searchResults button:hover { background: var(--soft); }
.srKind { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); min-width: 64px; }
.srLabel { font-weight: 500; }
.srNone { padding: 14px 10px; color: var(--muted); }

.tag[data-type="offer"] .dot { background: var(--accent); color: var(--accent-fg); }
.tcOffer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 4px; padding-top: 10px; border-top: 1px solid #eef0f4; }
.tcPrice { font-size: 17px; font-weight: 700; color: var(--ink); }
.tcCta, #cardBody .tcCta { border: 0; background: var(--accent); color: var(--accent-fg); font: inherit; font-weight: 600; font-size: 14px; padding: 10px 16px; border-radius: var(--r-btn); cursor: pointer; }
.tcCta:hover { filter: brightness(0.92); }
.tcListen { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #dfe3ea; background: #fff; color: var(--ink); font: inherit; font-size: 13px; padding: 7px 12px; border-radius: var(--r-pill); cursor: pointer; margin: 0 0 10px; }
.tcListen:hover { background: #f3f6fb; }

.zoomBox { position: fixed; inset: 0; z-index: 100; background: rgba(8, 8, 10, 0.94); overflow: hidden; display: grid; place-items: center; touch-action: none; cursor: grab; }
.zoomBox img { max-width: 94vw; max-height: 90vh; transform-origin: center; user-select: none; -webkit-user-drag: none; will-change: transform; }
.zoomClose { position: absolute; top: 16px; right: 16px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.92); font-size: 24px; cursor: pointer; }
.zoomHint { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: rgba(255, 255, 255, 0.6); font-size: 13px; pointer-events: none; }

.questBadge { position: absolute; left: 16px; top: calc(var(--barH, 54px) + 8px); z-index: 5; background: #f59e0b; color: #fff; font-weight: 700; padding: 7px 14px; border-radius: var(--r-pill); box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25); }
.tag.questTag .dot { background: #f59e0b; color: #fff; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.35), 0 2px 8px rgba(0, 0, 0, 0.35); animation: questPulse 1.6s infinite; }
.tag.questFound .dot { background: #16a34a; animation: none; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.3); }
@keyframes questPulse { 50% { box-shadow: 0 0 0 9px rgba(245, 158, 11, 0), 0 2px 8px rgba(0, 0, 0, 0.35); } }
.questBox { text-align: center; }
.questStar { font-size: 44px; margin: 4px 0 6px; }
.questBox .go { border: 0; cursor: pointer; font: inherit; }
#questBtn.on { background: #f59e0b; color: #fff; }

body.a11y { font-size: 17px; }
body.a11y .tag .dot { width: 38px; height: 38px; font-size: 18px; outline: 3px solid #000; }
body.a11y .tag .txt { font-size: 17px; background: #000; color: #fff; padding: 6px 12px; }
body.a11y .tcard { width: 380px; }
body.a11y .tcBody p, body.a11y #cardBody p { font-size: 18px; line-height: 1.55; color: #000; }
body.a11y .tcBody h3, body.a11y #cardBody h3 { font-size: 22px; }
body.a11y .dock button, body.a11y .modes button { font-size: 15px; }
body.a11y button:focus-visible, body.a11y a:focus-visible { outline: 4px solid #facc15; outline-offset: 2px; }
#a11yBtn.on { background: #facc15; color: #000; }

body.kiosk #shareBtn, body.kiosk #snapBtn, body.kiosk #fs { display: none !important; }
.kioskHint { position: absolute; left: 50%; bottom: calc(150px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 6; background: rgba(0, 0, 0, 0.6); color: #fff; padding: 12px 20px; border-radius: var(--r-pill); font-size: 16px; pointer-events: none; animation: kioskBlink 3s infinite; white-space: nowrap; }
@keyframes kioskBlink { 50% { opacity: 0.55; } }

@media (max-width: 600px) {
  .questBadge { top: auto; bottom: calc(150px + env(safe-area-inset-bottom)); }
  .toast { white-space: normal; max-width: calc(100% - 32px); text-align: center; border-radius: var(--r-panel); }
  .kioskHint { white-space: normal; max-width: calc(100% - 32px); text-align: center; }
}

/* ---------- tour style (theme.js) ---------- */
.thHide { display: none !important; }
.title, .info h2, .cardBox h3, .tcBody h3, .coverTitle, .questBox h3 { font-family: var(--font-title); }
body.bar-none .bar { background: none; }
body.bar-none .title { text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45); }
body.bar-solid .bar { background: var(--glass); backdrop-filter: blur(var(--blur)); padding-bottom: 10px; }
body.dockIcons .dock button span { display: none; }
body.dockIcons .dock button { min-width: 0; padding: 9px 11px; }
@media (min-width: 701px) {
  body.dock-left .dock, body.dock-right .dock { left: 16px; right: auto; top: 50%; bottom: auto; transform: translateY(-50%); flex-direction: column; max-height: calc(100% - 150px); max-width: none; overflow-y: auto; overflow-x: hidden; }
  body.dock-right .dock { left: auto; right: 16px; }
  body.dock-left .floors { left: calc(16px + 82px * var(--ui-scale)); }
  body.dock-left.dockIcons .floors { left: 74px; }
  body.dock-left .guideBar, body.dock-right .guideBar, body.dock-left .routes, body.dock-right .routes { bottom: calc(18px + env(safe-area-inset-bottom)); }
  body.dock-right .minimap { right: calc(16px + 82px * var(--ui-scale)); }
}
.tag.hasIcon .dot img { width: 72%; height: 72%; object-fit: contain; display: block; }
.tag.bareIcon .dot { background: none; box-shadow: none; width: calc(40px * var(--ui-scale)); height: calc(40px * var(--ui-scale)); }
.tag.bareIcon .dot img { width: 100%; height: 100%; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45)); }
.thMenuPanel { position: absolute; z-index: 9; }
.thMenuPanel button { display: flex; align-items: center; gap: 10px; }
.thMenuPanel svg, .dock .thMenu svg { width: calc(20px * var(--ui-scale)); height: calc(20px * var(--ui-scale)); flex: none; }

/* ---------- phones ---------- */
/* landscape phone: little height — compact minimap at the bottom right, float button under the bar */
@media (max-height: 500px) and (orientation: landscape) {
  .minimap { width: 104px; height: 104px; border-width: 7px; border-radius: 14px; top: auto; bottom: calc(12px + env(safe-area-inset-bottom)); right: calc(12px + env(safe-area-inset-right)); }
  .floatBtn { top: calc(var(--barH, 54px) + 6px); right: calc(12px + env(safe-area-inset-right)); }
  .floatBtn img { width: 64px; height: 64px; }
  .floatBtn span { padding: 7px 11px; font-size: 13px; }
  .brand { bottom: calc(12px + env(safe-area-inset-bottom)); left: calc(12px + env(safe-area-inset-left)); padding: 6px 10px; }
  .dock { bottom: calc(8px + env(safe-area-inset-bottom)); }
  .dock button { padding: 4px 8px; min-width: 50px; }
  .guideBar, .routes { bottom: calc(66px + env(safe-area-inset-bottom)); }
  .tcard.sheet { max-height: 72%; bottom: calc(66px + env(safe-area-inset-bottom)); }
  .hint { display: none; }
  .floors { top: calc(var(--barH, 54px) + 8px); transform: none; }
  .info { width: min(420px, 70%); }
}
/* touch screens: bigger targets, inputs at 16px so iOS doesn't zoom the page on focus */
@media (pointer: coarse) {
  .icon { width: calc(40px * var(--ui-scale)); height: calc(40px * var(--ui-scale)); }
  .close, .tcClose { width: 36px; height: 36px; }
  #leadForm input, #leadForm textarea, .searchPanel input, .lockBox input { font-size: 16px; }
  .tcNav { width: 36px; height: 36px; }
  .varBar button, .floors button { padding-top: 9px; padding-bottom: 9px; }
}
@media (max-width: 600px) {
  .minimap { top: calc(var(--barH, 104px) + 6px); }
  .floatBtn { top: auto; bottom: calc(84px + env(safe-area-inset-bottom)); right: 12px; }
  .floatBtn img { width: 72px; height: 72px; }
  .floatBtn span { padding: 8px 12px; font-size: 13px; max-width: 46vw; }
  .brand { max-width: calc(50vw - 20px); }
}
@media (max-width: 600px) {
  .title { flex: 1 1 0; flex-basis: 0; }
  .tools { flex-wrap: nowrap; gap: 6px; }
  .hint { bottom: calc(150px + env(safe-area-inset-bottom)); }
}

/* room volumes in «3D» */
.vol { transform: translate(-50%, -50%); pointer-events: auto; border: 0; cursor: pointer; font: inherit; font-size: calc(13px * var(--ui-scale)); font-weight: 600; color: #fff; padding: 5px 11px; border-radius: var(--r-btn); background: rgba(70, 70, 76, 0.55); backdrop-filter: blur(var(--blur)); box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25); white-space: nowrap; }
.vol:hover { background: var(--accent); color: var(--accent-fg); }

/* ---------- booking window ---------- */
.bookBox { z-index: 12; }
.bookIn { position: relative; width: min(980px, 100%); height: min(88vh, 860px); background: var(--panel); color: var(--ink); border-radius: var(--r-panel); overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4); }
.bookHead { display: flex; align-items: center; gap: 10px; padding: 10px 52px 10px 16px; border-bottom: 1px solid var(--soft); min-height: 52px; }
.bookHead b { flex: 1; font-family: var(--font-title); font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bookOut { text-decoration: none; color: var(--accent); font-size: 18px; padding: 4px 8px; }
.bookIn iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.bookHint { font-size: 12px; color: var(--muted); padding: 6px 16px; border-top: 1px solid var(--soft); }
.bookHead .close { top: 10px; right: 10px; }
@media (max-width: 600px) { .bookBox { padding: 0; } .bookIn { height: 100%; border-radius: 0; } }

/* ---------- calmer controls (ui-overflow.js) ---------- */
.tools.uiCollapsed > button:not(#fs):not(.uiMoreTools):not(.uiViewBtn) { display: none !important; }
.dock .uiTucked, .uiChipHidden { display: none !important; }

.uiPop { position: absolute; z-index: 30; width: 240px; background: var(--panel); color: var(--ink); border-radius: var(--r-panel); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); padding: 6px; display: grid; gap: 2px; }
.uiPopItem { display: flex; align-items: center; gap: 10px; border: 0; background: none; color: inherit; font: inherit; text-align: left; padding: 9px 10px; border-radius: calc(var(--r-panel) * 0.6); cursor: pointer; }
.uiPopItem:hover { background: var(--soft); }
.uiPopItem.on { color: var(--accent); font-weight: 600; }
.uiPopItem svg { flex: none; opacity: 0.8; }


/* «Прогулка» по модели из плана */
.walkBtn { position: absolute; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 6;
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border: 0; border-radius: 999px; cursor: pointer;
  background: #2563EB; color: #fff; font: 600 15px/1 Manrope, system-ui, sans-serif; box-shadow: 0 6px 22px rgba(37, 99, 235, .35); }
.walkBtn:hover { background: #1d4ed8; }
.walkBtnIco { font-size: 17px; }
.walkHud { position: absolute; inset: 0; pointer-events: none; z-index: 6; }
.walkExit { position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); pointer-events: auto;
  padding: 9px 16px; border: 0; border-radius: 999px; cursor: pointer; background: rgba(28, 31, 36, .78); color: #fff;
  font: 600 13.5px/1 Manrope, system-ui, sans-serif; backdrop-filter: blur(8px); }
.walkHelp { position: absolute; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: calc(100% - 32px);
  padding: 9px 16px; border-radius: 12px; background: rgba(28, 31, 36, .72); color: #fff; font: 500 13px/1.35 Manrope, system-ui, sans-serif;
  text-align: center; transition: opacity .6s; backdrop-filter: blur(8px); }
.walkHelp.gone { opacity: 0; }
.walkPad { display: none; position: absolute; left: calc(22px + env(safe-area-inset-left)); bottom: calc(110px + env(safe-area-inset-bottom));
  width: 120px; height: 120px; border-radius: 50%; background: rgba(255, 255, 255, .28); border: 2px solid rgba(255, 255, 255, .7);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .18); pointer-events: auto; touch-action: none; backdrop-filter: blur(6px); }
.walkKnob { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; background: #2563EB;
  box-shadow: 0 3px 10px rgba(37, 99, 235, .45); }
@media (pointer: coarse) { .walkPad { display: block; } .walkHelp { bottom: calc(240px + env(safe-area-inset-bottom)); } }
body.walking .hint, body.walking #minimap { display: none !important; }
@media (max-width: 600px) { .walkExit { top: calc(72px + env(safe-area-inset-top)); } }
