/* Карта «Ростов Арены». Мобильная вёрстка в первую очередь: системный шрифт, 14 px текста,
   крупные зоны нажатия при компактной типографике. Раскладка: карта во весь экран + шторка снизу;
   от 900 px шторка становится боковой панелью. */
/* Фирменный шрифт ТТК — PT Sans (ParaType, свободная лицензия: assets/fonts/PT-Free-Font-License-*.txt) */
@font-face { font-family: "PT Sans"; src: url("../assets/fonts/PTS55F.ttf") format("truetype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "PT Sans"; src: url("../assets/fonts/PTS56F.ttf") format("truetype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "PT Sans"; src: url("../assets/fonts/PTS75F.ttf") format("truetype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "PT Sans"; src: url("../assets/fonts/PTS76F.ttf") format("truetype"); font-weight: 700; font-style: italic; font-display: swap; }

/* Цвета ТТК: красный, белый, серый. Тема выбирается кнопкой и хранится в браузере (data-theme на <html>). */
:root {
  --bg: #f3f3f3; --surface: #ffffff; --surface-2: #f2f2f2; --ink: #1e1e1e; --ink-2: #5c5c5c; --ink-3: #8c8c8c;
  --line: #e1e1e1; --line-strong: #9b9b9b; --accent: #e30613; --accent-ink: #ffffff; --neon: #39ff14; --pano: #c4121c; --ok: #2e9b4f; --warn: #c97f00;
  --plaza: #e7e7e7; --room: #fbfbfb; --wall-line: #3a3a3a; --grid: #e0e0e0; --podium: #ebebeb; --bowl: #d2d2d2;
  --shadow: 0 1px 2px rgba(20, 20, 20, .08), 0 6px 20px rgba(20, 20, 20, .10);
  --font: "PT Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "PT Sans", ui-monospace, Consolas, monospace;
  --r: 12px; --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212; --surface: #1d1d1d; --surface-2: #262626; --ink: #f1f1f1; --ink-2: #ababab; --ink-3: #7d7d7d;
    --line: #2e2e2e; --line-strong: #6b6b6b; --accent: #ff1f2d; --pano: #ff4d55;
    --plaza: #262626; --room: #2c2c2c; --wall-line: #d4d4d4; --grid: #222222; --podium: #303030; --bowl: #3b3b3b;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121212; --surface: #1d1d1d; --surface-2: #262626; --ink: #f1f1f1; --ink-2: #ababab; --ink-3: #7d7d7d;
  --line: #2e2e2e; --line-strong: #6b6b6b; --accent: #ff1f2d; --pano: #ff4d55;
  --plaza: #262626; --room: #2c2c2c; --wall-line: #d4d4d4; --grid: #222222; --podium: #303030; --bowl: #3b3b3b;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .4); color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14px/1.4 var(--font); overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--pano); outline-offset: 2px; }
[hidden] { display: none !important; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
#app { height: 100%; }
.boot { display: grid; place-items: center; }
.boot-mark { width: 56px; height: 56px; border-radius: 16px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; letter-spacing: -.02em; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.fatal { display: grid; place-content: center; gap: 12px; padding: 24px; text-align: center; }

/* ---------- общие элементы ---------- */
.btn { min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.btn:hover { border-color: var(--line-strong); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.btn.blue { background: var(--pano); border-color: var(--pano); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn.full { width: 100%; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row.nowrap { flex-wrap: nowrap; }
.iconbtn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow); display: grid; place-items: center; color: var(--ink); text-decoration: none; }
.iconbtn.flat { box-shadow: none; background: transparent; border-radius: 10px; }
.iconbtn.flat:hover { background: var(--surface-2); }
.iconbtn:disabled { opacity: .35; }
.txt-btn { border: 0; background: none; color: var(--pano); font-weight: 600; padding: 4px 0; }
.toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); background: var(--ink); color: var(--surface); padding: 10px 14px; border-radius: 10px; font-size: 13.5px; font-weight: 500; z-index: 100; max-width: min(92vw, 420px); text-align: center; box-shadow: var(--shadow); transition: opacity .2s; }
.toast.out { opacity: 0; }
.lbl { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.cap { font-size: 12px; color: var(--ink-3); }
.inp { width: 100%; min-height: 40px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; padding: 8px 11px; outline: none; font-size: 14px; }
.inp:focus { border-color: var(--pano); background: var(--surface); }
textarea.inp { min-height: 76px; resize: vertical; line-height: 1.4; }
.field { display: flex; flex-direction: column; gap: 5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
h1, h2, h3 { margin: 0; letter-spacing: -.01em; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.glyph { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 700; flex: none; }
.glyph.sm { width: 22px; height: 22px; font-size: 10px; }
.glyph.ico { background: #fff; box-shadow: inset 0 0 0 1.5px var(--accent); padding: 4px; }
.glyph.ico img { width: 100%; height: 100%; object-fit: contain; display: block; }
.glyph.sm.ico { padding: 3px; }
/* подсказка с названием точки при наведении на карте */
.map-tip { position: fixed; z-index: 120; pointer-events: none; background: var(--ink); color: var(--surface); font-size: 13px; font-weight: 700; padding: 5px 9px; border-radius: 8px; box-shadow: var(--shadow); white-space: nowrap; max-width: 70vw; overflow: hidden; text-overflow: ellipsis; }
/* кнопка темы: в светлой показываем луну, в тёмной — солнце */
.theme-btn .th-sun { display: none; }
:root[data-theme="dark"] .theme-btn .th-sun { display: block; }
:root[data-theme="dark"] .theme-btn .th-moon { display: none; }
.tool-img { width: 22px; height: 22px; object-fit: contain; }
.glyph.xs { width: 18px; height: 18px; font-size: 9px; padding: 2px; }
.guide-field .lbl { display: inline-flex; align-items: center; gap: 5px; }
.guide-field .lbl .ic { width: 15px; height: 15px; color: var(--accent); }
.guide-field .row { justify-content: space-between; }

/* ---------- шторка ---------- */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-radius: 16px 16px 0 0; box-shadow: 0 -2px 18px rgba(0, 0, 0, .12); display: flex; flex-direction: column; height: 46%; transition: height .28s cubic-bezier(.2, .8, .2, 1); padding-bottom: var(--safe-b); }
.sheet-grip { flex: none; height: 30px; width: 64px; margin: 0 auto; display: grid; place-items: center; cursor: pointer; border: 0; background: none; padding: 0; color: var(--ink-2); -webkit-tap-highlight-color: transparent; }
.sheet-grip i { width: 12px; height: 12px; border: solid currentColor; border-width: 0 3px 3px 0; border-radius: 2px; display: block; transform: translateY(3px) rotate(-135deg); transition: transform .28s cubic-bezier(.2, .8, .2, 1); }
.sheet[data-state="full"] .sheet-grip i { transform: translateY(-3px) rotate(45deg); }
.sheet-grip:hover, .sheet-grip:focus-visible { color: var(--accent); }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 20px; display: flex; flex-direction: column; gap: 16px; -webkit-overflow-scrolling: touch; }
@media (min-width: 900px) {
  .sheet { top: 0; right: auto; width: 380px; height: auto !important; border-radius: 0; box-shadow: 1px 0 0 var(--line); padding-top: 72px; }
  .sheet-grip { display: none; }
  .sheet-body { padding-top: 4px; }
}
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; width: 100%; min-height: 52px; }
.item:last-child { border-bottom: 0; }
.item:hover { background: var(--surface-2); }
.item .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.item .t b { font-weight: 600; font-size: 14px; }
.item .t span { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .ic.chev { color: var(--ink-3); width: 16px; height: 16px; }
.item .side { font-size: 12px; color: var(--ink-3); font-family: var(--mono); }
.h-sec { font-size: 13px; font-weight: 700; color: var(--ink-2); text-transform: none; margin: 4px 0 -6px; }

/* ---------- экран посетителя ---------- */
.vis { position: relative; height: 100%; overflow: hidden; }
.stage { position: absolute; inset: 0; background: var(--bg); }
.stage .three, .stage .plan { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage .three canvas { display: block; touch-action: none; }
.plan { touch-action: none; user-select: none; -webkit-user-select: none; }
@media (min-width: 900px) { .vis .stage { left: 380px; } }
.topbar { position: absolute; z-index: 25; top: calc(10px + var(--safe-t)); left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); display: flex; gap: 8px; align-items: center; }
@media (min-width: 900px) { .vis .topbar { left: 14px; width: 352px; right: auto; } }
.search { flex: 1; min-width: 0; height: 44px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); display: flex; align-items: center; gap: 8px; padding: 0 6px 0 12px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 15px; height: 100%; }
.search .ic { color: var(--ink-3); }
.results { position: absolute; z-index: 26; top: calc(60px + var(--safe-t)); left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 4px 12px; max-height: 60vh; overflow: auto; }
@media (min-width: 900px) { .vis .results { left: 14px; width: 352px; right: auto; } }
.fabs { position: absolute; z-index: 15; right: calc(10px + var(--safe-r)); top: calc(66px + var(--safe-t)); display: flex; flex-direction: column; gap: 8px; }
.fab-txt { font-size: 12.5px; font-weight: 700; letter-spacing: .02em; }
.pop { position: absolute; z-index: 30; right: calc(58px + var(--safe-r)); top: calc(66px + var(--safe-t)); background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; min-width: 220px; }
.pop label { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 8px; font-size: 14px; border-radius: 8px; }
.pop label:hover { background: var(--surface-2); }
.pop-h { font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 6px 8px 2px; }
.pop { max-height: calc(100% - 80px); overflow-y: auto; }
.switch { appearance: none; width: 36px; height: 22px; border-radius: 11px; background: var(--line); position: relative; transition: background .2s; flex: none; cursor: pointer; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch:checked { background: var(--ok); }
.switch:checked::after { transform: translateX(14px); }
.home-head { display: flex; flex-direction: column; gap: 2px; }
.home-head h1 { font-size: 19px; font-weight: 700; }
.home-head p { margin: 0; color: var(--ink-2); font-size: 13px; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.quick button { border: 0; background: var(--surface-2); border-radius: 12px; padding: 10px 4px 8px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ink); min-height: 66px; }
.quick button:hover { background: var(--line); }
.photos { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 0 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.photos figure { margin: 0; flex: none; width: 232px; scroll-snap-align: start; }
.photos img { width: 100%; height: 132px; object-fit: cover; border-radius: 12px; display: block; background: var(--surface-2); }
.photos figcaption { font-size: 12px; color: var(--ink-2); margin-top: 5px; }
.stand-row .bar { width: 4px; align-self: stretch; border-radius: 2px; }
.place { display: flex; flex-direction: column; gap: 12px; }
.place-photo { width: calc(100% + 32px); margin: 0 -16px; height: 168px; object-fit: cover; display: block; }
@media (min-width: 900px) { .place-photo { border-radius: 12px; width: 100%; margin: 0; } }
.place-head { display: flex; gap: 10px; align-items: flex-start; }
.place-head .t { flex: 1; min-width: 0; }
.place-head h2 { font-size: 18px; font-weight: 700; line-height: 1.25; }
.place-head p { margin: 2px 0 0; color: var(--ink-2); font-size: 13px; }
.place .txt { margin: 0; font-size: 14px; }
.actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.actions .btn { flex-direction: column; gap: 3px; min-height: 58px; font-size: 12.5px; padding: 6px 4px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; font-weight: 500; }
.route-box { display: flex; flex-direction: column; gap: 10px; }
.route-pts { display: grid; grid-template-columns: 18px 1fr; gap: 8px 10px; align-items: center; }
.route-pts .a, .route-pts .b { width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--pano); justify-self: center; }
.route-pts .b { border-color: var(--accent); }
.route-sum { display: flex; align-items: baseline; gap: 10px; }
.route-sum b { font-size: 22px; font-weight: 700; font-family: var(--mono); letter-spacing: -.02em; }
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.steps li { display: flex; gap: 10px; align-items: center; padding: 7px 0; font-size: 13.5px; border-bottom: 1px solid var(--line); }
.steps li:last-child { border: 0; }
.steps li i { width: 8px; height: 8px; border-radius: 50%; background: var(--pano); flex: none; }

/* ---------- режим панорамы / вида с места ---------- */
.look-ui { position: absolute; inset: 0; z-index: 40; pointer-events: none; }
.look-ui > * { pointer-events: auto; }
.look-top { position: absolute; top: calc(10px + var(--safe-t)); left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); display: flex; gap: 8px; align-items: center; }
.look-title { background: rgba(18, 19, 22, .74); color: #fff; border-radius: 12px; padding: 7px 12px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); min-width: 0; }
.look-title b { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.look-title span { font-size: 11.5px; opacity: .78; }
.look-bottom { position: absolute; left: calc(10px + var(--safe-l)); right: calc(126px + var(--safe-r)); bottom: calc(12px + var(--safe-b)); display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chip { flex: none; height: 36px; padding: 0 12px; border-radius: 18px; border: 0; background: rgba(255, 255, 255, .95); color: #17181a; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.chip.next { background: var(--accent); color: #fff; }
.mini { position: absolute; right: calc(10px + var(--safe-r)); bottom: calc(12px + var(--safe-b)); width: 108px; height: 108px; border-radius: 14px; overflow: hidden; background: rgba(18, 19, 22, .74); border: 1px solid rgba(255, 255, 255, .18); }
.mini svg { width: 100%; height: 100%; display: block; }
.look-hint { position: absolute; left: 50%; bottom: calc(60px + var(--safe-b)); transform: translateX(-50%); background: rgba(18, 19, 22, .7); color: #fff; font-size: 12px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; transition: opacity .4s; }
.pano-embed { position: absolute; inset: 0; z-index: 35; background: #121316; }
.pano-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
/* ---------- маскот ТТК ---------- */
/* --m — размер, который задаёт админ. Картинки «выглядывает» 1254×1254, видимая часть маскота — x 684…1198, y 176…1068:
   показываем только её и прижимаем к правому краю окна, будто он прячется за ним. */
.mascot { position: fixed; right: 0; bottom: 0; z-index: 95; pointer-events: none; --m: 1; }
.mascot > * { pointer-events: auto; }
.mascot-peek { position: absolute; right: 0; bottom: calc(10px + var(--safe-b)); width: calc(96px * var(--m)); aspect-ratio: 514 / 892; border: 0; padding: 0; cursor: pointer;
  background: url("../assets/mascot/peek-1.png") 92.4% 48.6% / 244% auto no-repeat; image-rendering: pixelated; transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .25s; transform-origin: right bottom; }
.mascot-peek:hover, .mascot-peek:focus-visible { background-image: url("../assets/mascot/peek-2.png"); transform: translateX(-4px) scale(1.04); }
.mascot.out .mascot-peek { transform: translateX(110%); opacity: 0; pointer-events: none; }
.mascot-body { position: absolute; right: calc(6px + var(--safe-r)); bottom: calc(4px + var(--safe-b)); height: calc(250px * var(--m)); width: auto; image-rendering: pixelated;
  transform: translateX(120%); transition: transform .45s cubic-bezier(.2, .8, .2, 1); filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .25)); pointer-events: none; }
.mascot-body.pose { height: calc(270px * var(--m)); }
.mascot.out .mascot-body { transform: translateX(0); }
/* облако реплики: размер фиксирован, длинный текст прокручивается ползунком справа */
.mascot-cloud { position: absolute; right: calc(150px * var(--m) + 8px); bottom: calc(150px * var(--m)); width: min(340px, calc(100vw - 150px * var(--m) - 28px)); height: 148px;
  background: var(--surface); color: var(--ink); border: 2px solid var(--accent); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 34px 12px 14px;
  display: flex; flex-direction: column; opacity: 0; transform: translateY(10px) scale(.96); transform-origin: right bottom; visibility: hidden;
  transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s; }
.mascot-cloud.on { opacity: 1; transform: none; visibility: visible; transition: opacity .3s ease, transform .3s ease; }
.mascot-cloud::after { content: ""; position: absolute; right: -10px; bottom: 22px; border: 9px solid transparent; border-left-color: var(--accent); border-right: 0; }
.mascot-text { flex: 1; overflow-y: auto; font-size: 15px; line-height: 1.45; padding-right: 6px; scrollbar-width: thin; scrollbar-color: var(--accent) var(--surface-2); }
.mascot-text::-webkit-scrollbar { width: 6px; }
.mascot-text::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 3px; }
.mascot-text::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }
.mascot-text p { margin: 0 0 6px; }
.mascot-x { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border: 0; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); font-size: 18px; line-height: 1; display: grid; place-items: center; }
.mascot-x:hover { background: var(--accent); color: #fff; }
@media (max-width: 600px) {
  .mascot-peek { width: calc(72px * var(--m)); }
  .mascot-body { height: calc(190px * var(--m)); } .mascot-body.pose { height: calc(205px * var(--m)); }
  .mascot-cloud { right: calc(110px * var(--m) + 6px); bottom: calc(110px * var(--m)); height: 132px; font-size: 14px; }
}
/* в режиме панорамы мини-карта уходит наверх, чтобы не спорить с маскотом в правом нижнем углу */
.look-ui .mini { bottom: auto; top: calc(64px + var(--safe-t)); }
/* цилиндрическая панорама своей точки */
.cyl { position: fixed; inset: 0; z-index: 90; background: #0d0e10; }
.cyl canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.cyl canvas:active { cursor: grabbing; }
.cyl-top { position: absolute; top: calc(10px + var(--safe-t)); left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); display: flex; gap: 8px; align-items: center; }
.cyl-msg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #fff; font-size: 14px; opacity: .8; }
.cyl-zoom { position: absolute; right: calc(10px + var(--safe-r)); bottom: calc(14px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; }
.cyl-zoom .iconbtn { font-size: 20px; font-weight: 600; }
/* ---------- вход и панель сотрудников ---------- */
.login { height: 100%; display: grid; place-items: center; padding: 20px; overflow: auto; }
.login form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; background: var(--surface); padding: 22px; border-radius: 16px; box-shadow: var(--shadow); }
.login h1 { font-size: 20px; }
.login .hero { width: calc(100% + 44px); margin: -22px -22px 4px; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px 16px 0 0; display: block; }
.demo-note { font-size: 12.5px; color: var(--ink-2); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; line-height: 1.5; }
.demo-note b { color: var(--ink); font-weight: 600; }
.err { color: var(--accent); font-size: 13px; margin: 0; }

.adm { height: 100%; display: grid; grid-template-rows: auto auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); max-width: 100vw; overflow: hidden; }
.appbar { display: flex; align-items: center; gap: 2px; padding: calc(6px + var(--safe-t)) calc(6px + var(--safe-r)) 6px calc(6px + var(--safe-l)); background: var(--surface); border-bottom: 1px solid var(--line); min-height: 52px; }
.appbar .title { flex: 1; min-width: 0; padding: 0 4px; }
.appbar .title b { display: block; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .title span { font-size: 12px; color: var(--ink-2); display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; }
.appbar .title span i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; }
.appbar .title span.dirty i { background: var(--warn); }
.appbar .btn.sm { margin-left: 4px; }
.modes { display: flex; gap: 4px; padding: 6px 10px; background: var(--surface); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; align-items: center; }
.modes button { flex: none; border: 0; background: none; height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.modes button[aria-selected="true"] { background: var(--ink); color: var(--surface); }
.modes .role-tag { margin-left: auto; }
.role-tag { flex: none; font-size: 11.5px; font-weight: 600; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.workspace { position: relative; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; grid-template-areas: "canvas" "tools"; }
.canvas { grid-area: canvas; position: relative; overflow: hidden; background: var(--bg); }
.canvas .plan, .canvas .three { position: absolute; inset: 0; width: 100%; height: 100%; }
.canvas .three canvas { display: block; touch-action: none; }
.toolbar { grid-area: tools; display: flex; gap: 2px; padding: 5px 6px calc(5px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; z-index: 22; }
.tool { flex: none; width: 58px; height: 50px; border: 0; background: none; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; font-weight: 500; color: var(--ink-2); }
.tool:hover { background: var(--surface-2); }
.tool[aria-pressed="true"] { background: var(--ink); color: var(--surface); }
.tool.pano[aria-pressed="true"] { background: var(--pano); color: #fff; }
.tool-sep { width: 1px; background: var(--line); margin: 8px 3px; flex: none; }
.adm .sheet { position: absolute; bottom: calc(61px + var(--safe-b)); z-index: 21; }
.optbar { position: absolute; left: 8px; right: 8px; top: 8px; z-index: 12; display: flex; gap: 6px; align-items: center; background: var(--surface); border-radius: 12px; padding: 5px; box-shadow: var(--shadow); overflow-x: auto; scrollbar-width: none; }
.optbar .cap { padding: 0 6px; white-space: nowrap; color: var(--ink-2); font-size: 12.5px; }
.optbar .seg { display: flex; background: var(--surface-2); border-radius: 8px; padding: 2px; flex: none; }
.optbar .seg button { border: 0; background: none; height: 28px; padding: 0 9px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.optbar .seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.zoombox { position: absolute; right: 8px; top: 64px; z-index: 11; display: flex; flex-direction: column; gap: 6px; }
.zoombox .iconbtn { width: 36px; height: 36px; font-size: 18px; font-weight: 600; }
.coords { position: absolute; left: 8px; bottom: 8px; z-index: 11; font: 11.5px var(--mono); color: var(--ink-2); background: var(--surface); padding: 4px 8px; border-radius: 7px; box-shadow: var(--shadow); display: none; }
.readonly-banner { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 11; background: var(--ink); color: var(--surface); font-size: 12.5px; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.look-exit { position: absolute; left: 8px; top: 8px; z-index: 40; }
.lock-banner { display: flex; gap: 8px; align-items: center; white-space: normal; max-width: min(92%, 640px); background: var(--warn); color: #fff; line-height: 1.35; }
.lock-banner .ic { width: 16px; height: 16px; }
.appbar .iconbtn.on { color: var(--pano); background: var(--surface-2); }
.layers-pop { top: 64px; right: 52px; }
.clip-row { padding-top: 4px; border-top: 1px solid var(--line); }
/* этажи в конструкторе */
.floor-bar { display: flex; align-items: center; gap: 3px; margin-left: 12px; padding-left: 12px; border-left: 1px solid var(--line); flex: none; }
.floor-bar .cap { margin-right: 4px; }
.floor-bar button { border: 1px solid var(--line); background: var(--surface); min-width: 30px; height: 30px; padding: 0 8px; border-radius: 8px; font: 600 13px var(--mono); color: var(--ink-2); }
.floor-bar button[aria-pressed="true"] { background: var(--pano); border-color: var(--pano); color: #fff; }
.floor-bar .fl-more { font-family: var(--font); font-weight: 500; }
.floor-row { display: grid; grid-template-columns: auto 1fr 96px auto auto; gap: 8px; align-items: end; padding: 8px 0; border-bottom: 1px solid var(--line); }
.floor-row .cap { align-self: center; white-space: nowrap; }
.fl-elev .lbl { font-size: 11px; }
.vl-row select { max-width: 200px; }
/* этажи у посетителя */
.floor-pick { position: absolute; z-index: 15; left: calc(10px + var(--safe-l)); top: calc(66px + var(--safe-t)); display: flex; flex-direction: column; gap: 4px; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); padding: 4px; }
@media (min-width: 900px) { .floor-pick { left: auto; right: calc(60px + var(--safe-r)); } }
.floor-pick button { width: 40px; height: 36px; border: 0; border-radius: 8px; background: none; font: 700 14px var(--mono); color: var(--ink-2); }
.floor-pick button[aria-pressed="true"] { background: var(--pano); color: #fff; }
.clip-card { gap: 6px; padding: 10px 12px; }
@media (min-width: 900px) {
  .workspace { grid-template-columns: 74px minmax(0, 1fr) 340px; grid-template-rows: minmax(0, 1fr); grid-template-areas: "tools canvas sheet"; }
  .toolbar { flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding: 8px; overflow-y: auto; align-items: center; }
  .tool-sep { width: auto; height: 1px; margin: 4px 6px; align-self: stretch; }
  .adm .sheet { grid-area: sheet; position: relative; inset: auto; width: auto; height: auto !important; padding-top: 12px; box-shadow: -1px 0 0 var(--line); border-radius: 0; }
  .coords { display: block; }
}
.insp { display: flex; flex-direction: column; gap: 14px; }
.insp-head { display: flex; align-items: center; gap: 10px; }
.insp-head h2 { flex: 1; font-size: 17px; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { border: 1px solid var(--line); background: var(--surface); border-radius: 18px; height: 32px; padding: 0 11px; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px; }
.opt[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--surface); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sw { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); padding: 0; }
.sw[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
input[type="color"] { width: 36px; height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--surface); }
.thumb { width: 100%; height: 140px; object-fit: cover; border-radius: 10px; display: block; }
.thumb.wide { height: auto; aspect-ratio: 2 / 1; }
.card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 13px; margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 500; }
.status-pill { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 6px; display: inline-flex; gap: 5px; align-items: center; }
.status-pill.ok { background: rgba(31, 157, 85, .12); color: var(--ok); }
.status-pill.warn { background: rgba(201, 127, 0, .14); color: var(--warn); }
.menu-list .item { min-height: 48px; }
.user-row select { width: auto; min-height: 32px; padding: 4px 8px; font-size: 13px; }
.t-sec { font-family: var(--mono); font-weight: 700; fill: #fff; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.t-stand { font-weight: 700; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.t-shape { font-weight: 500; fill: var(--ink); text-anchor: middle; dominant-baseline: central; pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: .25em; stroke-opacity: .65; }
.t-shape.b { font-weight: 700; }
.t-pano { fill: var(--pano); font-weight: 600; text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: .3em; }
.t-poi { fill: var(--ink); font-weight: 600; dominant-baseline: central; pointer-events: none; paint-order: stroke; stroke: var(--surface); stroke-width: .3em; }
.t-glyph { fill: #fff; font-weight: 700; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.plan [data-kind] { cursor: pointer; }
.plan.tool-draw { cursor: crosshair; }
/* ---------- вход в админ-панель с карты ---------- */
.admin-link { width: auto; border-radius: 12px; padding: 0 12px; gap: 6px; display: inline-flex; align-items: center; font-weight: 600; font-size: 13.5px; height: 44px; }
@media (max-width: 520px) { .admin-link span { display: none; } .admin-link { width: 44px; padding: 0; justify-content: center; } }
.staff-link { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); color: var(--ink); text-decoration: none; }
.staff-link:hover { background: var(--line); }
.staff-link > span { flex: 1; display: flex; flex-direction: column; }
.staff-link > span span { font-size: 12.5px; color: var(--ink-2); }
.staff-link .chev { color: var(--ink-3); width: 16px; height: 16px; }

/* ---------- админ-панель: кабинет ---------- */
.cab { height: 100%; display: grid; grid-template-columns: 248px minmax(0, 1fr); }
.cab-side { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; padding: calc(14px + var(--safe-t)) 12px 12px; min-height: 0; }
.cab-brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; color: var(--ink); text-decoration: none; }
.cab-brand .mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.cab-brand > span:last-child { display: flex; flex-direction: column; }
.cab-brand b { font-size: 15px; }
.cab-brand span span { font-size: 12px; color: var(--ink-3); }
.cab-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.cab-nav a { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 10px; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-weight: 600; }
.cab-nav a:hover { background: var(--surface-2); color: var(--ink); }
.cab-nav a[aria-current="page"] { background: var(--ink); color: var(--surface); }
.cab-me { display: flex; align-items: center; gap: 10px; padding: 10px 6px 4px; border-top: 1px solid var(--line); }
.cab-me .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cab-me .t b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cab-me .t span { font-size: 12px; color: var(--ink-3); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink-2); color: var(--surface); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.avatar.lg { width: 52px; height: 52px; font-size: 20px; background: var(--accent); color: #fff; }
.cab-main { overflow-y: auto; min-height: 0; padding: calc(22px + var(--safe-t)) 28px 40px; }
.cab-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; max-width: 1180px; }
.cab-head h1 { font-size: 24px; font-weight: 700; }
.cab-head p { margin: 4px 0 0; color: var(--ink-2); max-width: 640px; }
.cab-body { display: flex; flex-direction: column; gap: 16px; max-width: 1180px; }
.cab-body .card { background: var(--surface); padding: 16px; gap: 12px; }
.cab-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.cab-cols .wide { grid-column: 1 / -1; }
.stack { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.stack .field, .stack .inp { width: 100%; }
.stack.danger { border-top: 1px solid var(--line); padding-top: 10px; }
.sep { height: 1px; background: var(--line); margin: 4px 0; }
.obj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.obj { background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 60%, var(--line)); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, box-shadow .15s; }
.obj:hover, .obj:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.obj-top { display: flex; gap: 10px; align-items: flex-start; }
.obj-top .t { flex: 1; min-width: 0; }
.obj-top h2 { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.obj-top .mono { font-size: 12px; color: var(--ink-3); }
.obj-ic { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); display: grid; place-items: center; font-weight: 700; color: var(--ink-2); flex: none; }
.obj-desc { margin: 0; color: var(--ink-2); font-size: 13.5px; }
.obj .btn { text-decoration: none; }
.picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; }
.pick { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; }
.pick:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.pick input { margin-top: 3px; accent-color: var(--accent); }
.pick > span { display: flex; flex-direction: column; gap: 2px; }
.pick > span span { font-size: 12.5px; color: var(--ink-2); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: none; height: 30px; padding: 0 11px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-3); padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.bad td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tbl .muted { color: var(--ink-2); }
.tbl .nowrap, .nowrap { white-space: nowrap; }
.tbl .t2 { display: flex; flex-direction: column; min-width: 0; }
.tbl .t2 span { font-size: 12.5px; color: var(--ink-2); }
.inp.sm { min-height: 32px; padding: 4px 8px; font-size: 13px; width: auto; }
.status-pill.bad { background: rgba(227, 36, 43, .12); color: var(--accent); }
.checks, .bullets { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks li > div { display: flex; flex-direction: column; gap: 2px; }
.checks li > div span { font-size: 13px; color: var(--ink-2); }
.checks .ck { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 800; }
.checks .ck .ic { width: 15px; height: 15px; stroke-width: 2.6; }
.checks .ok .ck { background: rgba(31, 157, 85, .14); color: var(--ok); }
.checks .warn .ck { background: rgba(201, 127, 0, .16); color: var(--warn); }
.bullets li { padding-left: 16px; position: relative; font-size: 13.5px; color: var(--ink-2); }
.bullets li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.cab .btn { text-decoration: none; }
/* личная ссылка автора: выбор карты */
.author { height: 100%; overflow-y: auto; padding: calc(28px + var(--safe-t)) 16px 40px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.author > header { display: flex; align-items: center; gap: 14px; width: min(560px, 100%); }
.author h1 { font-size: 22px; }
.author header p { margin: 2px 0 0; color: var(--ink-2); }
.author-list { width: min(560px, 100%); display: flex; flex-direction: column; gap: 10px; }
.author-card { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; color: var(--ink); text-decoration: none; }
.author-card:hover { border-color: var(--line-strong); }
.author-card .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.author-card .t span { font-size: 13px; color: var(--ink-2); }
.author-card .chev { color: var(--ink-3); }
@media (max-width: 760px) {
  .cab { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .cab-side { flex-direction: row; align-items: center; padding: calc(8px + var(--safe-t)) 10px 8px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; gap: 4px; }
  .cab-brand { padding: 0 6px 0 0; }
  .cab-brand > span:last-child { display: none; }
  .cab-nav { flex-direction: row; flex: none; }
  .cab-nav a { height: 36px; padding: 0 10px; white-space: nowrap; font-size: 13px; }
  .cab-nav a .ic { display: none; }
  .cab-me { border-top: 0; padding: 0; margin-left: auto; }
  .cab-me .t { display: none; }
  .cab-main { padding: 16px 16px 32px; }
  .cab-head h1 { font-size: 20px; }
  .cab-cols { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
@media (max-width: 600px) { .hide-s { display: none; } }
.appbar .iconbtn.flat { width: 36px; height: 36px; }
@media (max-width: 600px) {
  .appbar .btn.sm { width: 36px; padding: 0; margin-left: 0; }
  .appbar .title b { font-size: 14px; }
}

/* ---- вход / регистрация / приглашения ---- */
.auth-tabs { display: flex; }
.auth-tabs a { flex: 1; text-align: center; height: 30px; line-height: 30px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--ink-2); text-decoration: none; }
.auth-tabs a[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .12); }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 22px; }
.ok-note { color: #1a7f37; font-size: 13px; margin: 0; font-weight: 600; }
/* опасные действия — красная обводка, чтобы не путать с обычными */
.btn.danger { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.btn.danger:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.btn.ghost.danger { border-color: transparent; }

/* ---- конструктор: подтверждение, значки, проверка карты ---- */
.confirm-back { position: fixed; inset: 0; background: rgba(0, 0, 0, .38); display: grid; place-items: center; z-index: 200; padding: 16px; }
.confirm { background: var(--surface); color: var(--ink); border-radius: 14px; padding: 18px; width: min(380px, 100%); box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }
.confirm p { margin: 0; font-size: 14.5px; line-height: 1.45; }
.opt-num { display: inline-flex; align-items: center; gap: 6px; }
.opt-num .inp { width: 72px; min-height: 30px; }
.icon-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.ipk { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; padding: 0; }
.ipk img { width: 26px; height: 26px; object-fit: contain; }
.ipk[aria-pressed="true"] { border: 2px solid var(--accent); }
.pano-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 4px 14px; align-items: start; margin-top: 8px; }
.pano-col .h-sec { margin: 4px 0; }
.item.issue { text-align: left; }
.item.issue .ck { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--warn, #d08a00); color: #fff; flex: none; font-size: 13px; }
.item.issue.bad .ck { background: var(--accent); }

/* ---- настройка панорамы и предпросмотр 360° ---- */
.pano-tune { position: absolute; left: 12px; bottom: 12px; width: min(420px, calc(100% - 24px)); max-height: 55%; overflow: auto; background: var(--surface); color: var(--ink); border-radius: 14px; box-shadow: var(--shadow); padding: 12px; display: flex; flex-direction: column; gap: 10px; z-index: 6; font-size: 13px; }
.pano-tune .tune-row { display: flex; flex-direction: column; gap: 6px; }
.pano-tune .tune-arrows { display: flex; flex-direction: column; gap: 6px; }
.pano-tune .tune-arrows .t2 { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pano-tune .tune-arrows .t2 span { font-size: 11.5px; color: var(--ink-2); }
.pano-tune .row.nowrap { flex-wrap: wrap; }
.pano-tune .tune-head { flex-wrap: nowrap; }
.pano-tune .tune-min { display: none; flex: none; }
.pano-tune .tune-min svg { transform: rotate(90deg); transition: transform .2s; }
.pano-tune.min .tune-min svg { transform: rotate(-90deg); }
.pp-acts { position: absolute; left: 50%; bottom: calc(18px + var(--safe-b)); transform: translateX(-50%); display: flex; gap: 8px; }

/* ---- посетитель: загрузка панорамы, кнопки просмотра, черновик, охота ---- */
.look-acts { margin-left: auto; display: flex; gap: 6px; }
.look-acts .iconbtn, .look-top .iconbtn { flex: none; }
.vis:fullscreen { background: var(--bg); }
[data-act="fullscreen"][aria-pressed="true"], [data-act="sound"][aria-pressed="true"] { color: var(--accent); }
.pano-loader { position: absolute; inset: 0; z-index: 45; display: grid; place-items: center; background: rgba(13, 14, 16, .55); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.ld-card { background: var(--surface); color: var(--ink); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: min(320px, calc(100% - 32px)); text-align: center; box-shadow: var(--shadow); font-size: 14px; }
.ld-card img { width: 96px; height: 96px; object-fit: contain; }
.preview-bar { position: absolute; z-index: 30; left: 50%; transform: translateX(-50%); top: calc(62px + var(--safe-t)); display: flex; align-items: center; gap: 10px; background: #fff4d6; color: #5b4200; border: 1px solid #f0c85a; border-radius: 12px; padding: 6px 8px 6px 12px; font-size: 13px; box-shadow: var(--shadow); max-width: calc(100% - 24px); }
.preview-bar .ic { width: 18px; height: 18px; flex: none; }
.quest-card { display: flex; gap: 12px; align-items: center; background: var(--surface-2); border-radius: 14px; padding: 10px 12px; margin: 4px 0 8px; }
.quest-card > img { width: 36px; height: 36px; image-rendering: pixelated; flex: none; }
.quest-card .t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; font-size: 13px; }
.quest-card .t span { color: var(--ink-2); font-size: 12.5px; }
.qbar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.qbar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s; }
.leaders { margin: 8px 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.leaders li b { display: block; }
.leaders li span { font-size: 12.5px; color: var(--ink-2); }
.item.resume { background: var(--surface-2); border-radius: 12px; }
@media (max-width: 520px) { .look-acts [data-act="shot"] { display: none; } }
@media (min-width: 900px) { .vis.looking .stage { left: 0; } }

/* ---- свёрнутая панель инструментов: только значки ---- */
.tool-fold { color: var(--ink-3); }
.tool-fold .ic { transform: rotate(0deg); transition: transform .2s; }
.tool-fold .ic.flip { transform: rotate(180deg); }
.tools-mini .tool { width: 44px; height: 42px; }
.tools-mini .tool .tl { display: none; }
@media (min-width: 900px) {
  .workspace.tools-mini { grid-template-columns: 58px minmax(0, 1fr) 340px; }
  .tool-fold .ic { transform: rotate(0deg); }
}
@media (max-width: 899px) { .tool-fold .ic { transform: rotate(90deg); } .tool-fold .ic.flip { transform: rotate(-90deg); } }
@media (max-width: 899px) { .adm .pano-tune { bottom: 100px; } }   /* над опущенной шторкой конструктора */

/* ---- видео перехода между точками ---- */
.trans-video { position: absolute; inset: 0; z-index: 60; background: #000; opacity: 0; transition: opacity .25s; }
body > .trans-video { position: fixed; z-index: 120; }
.trans-video.on { opacity: 1; }
.trans-video video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tv-top { position: absolute; top: calc(10px + var(--safe-t)); left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.tv-title { background: rgba(18, 19, 22, .74); color: #fff; border-radius: 10px; padding: 6px 10px; font-size: 13px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .2); }
.tv-bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.trans-row .btn.sm { padding: 0 8px; }

/* ---- телефон: всё помещается в 360–420 px ---- */
@media (max-width: 600px) {
  .fabs { gap: 6px; top: calc(60px + var(--safe-t)); }
  .fabs .iconbtn, .look-acts .iconbtn, .topbar .iconbtn { width: 38px; height: 38px; }
  .topbar { gap: 6px; }
  .search input { font-size: 16px; }              /* без автоприближения iOS при вводе */
  .look-top { gap: 6px; }
  .look-title { padding: 6px 10px; }
  .look-title b { font-size: 13px; }
  .look-acts { gap: 4px; }
  .look-bottom { right: calc(66px + var(--safe-r)); bottom: calc(12px + var(--safe-b)); }
  .mini { width: 88px; height: 88px; }
  .mascot-peek { width: calc(56px * var(--m)); }
  .mascot-body { height: calc(160px * var(--m)); } .mascot-body.pose { height: calc(172px * var(--m)); }
  /* облако — по ширине экрана, а не узкого блока маскота (иначе уезжало за правый край) */
  .mascot-cloud { position: fixed; right: 8px; left: 8px; width: auto; bottom: calc(172px * var(--m) + 4px + var(--safe-b)); }
  .mascot-cloud::after { right: 34px; bottom: -10px; border: 9px solid transparent; border-top-color: var(--accent); border-bottom: 0; }
  .preview-bar { top: calc(56px + var(--safe-t)); font-size: 12px; }
  /* на телефоне настройка панорамы — компактная полоса внизу, сворачивается до заголовка и кнопок сохранения */
  .pano-tune { left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 34%; padding: 8px 10px; gap: 6px; font-size: 12px; border-radius: 12px; }
  .pano-tune .tune-help, .pano-tune .tune-row > .cap:not(:first-child) { display: none; }
  .pano-tune .tune-min { display: grid; width: 32px; height: 32px; }
  .pano-tune .btn.sm { padding: 5px 9px; font-size: 12px; min-height: 30px; }
  .pano-tune.min > :not(.tune-head):not(.tune-save) { display: none; }
  .pano-tune .tune-arrows .t2 span { display: none; }
  .quick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .confirm { padding: 16px; }
  .tv-title { font-size: 12px; }
  .ld-card img { width: 72px; height: 72px; }
}
@media (max-width: 380px) { .look-acts [data-act="share"] { display: none; } }
/* сенсорные экраны: зона нажатия у кнопок не меньше 40 px */
@media (pointer: coarse) { .btn.sm { min-height: 38px; } .pano-tune .btn.sm { min-height: 34px; } .tool { min-height: 46px; } }

/* ---- «Спроси маскота» ---- */
.ask-card { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 12px; margin: 4px 0; color: var(--ink); }
.ask-card > .ic { width: 28px; height: 28px; color: var(--accent); flex: none; }
.ask-card span { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.ask-card span span { color: var(--ink-2); font-size: 12.5px; }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; padding: 4px 0; }
.msg { max-width: 88%; padding: 8px 12px; border-radius: 14px; font-size: 14px; line-height: 1.4; }
.msg p { margin: 0; }
.msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; display: flex; flex-direction: column; gap: 8px; }
.msg-item { display: flex; flex-direction: column; gap: 6px; background: var(--surface); border-radius: 10px; padding: 8px; }
.msg-item .t { display: flex; flex-direction: column; font-size: 13px; }
.msg-item .t span { color: var(--ink-2); font-size: 12px; }
.msg-item .row { gap: 6px; flex-wrap: wrap; }
.ask-sug { margin: 6px 0; }
.ask-form { display: flex; gap: 8px; position: sticky; bottom: 0; background: var(--surface); padding: 6px 0 calc(6px + var(--safe-b)); }
.ask-form .inp { flex: 1; font-size: 16px; }
@media (max-width: 600px) { .ask-btn { display: none; } }

/* ---- конструктор на телефоне: шапка без переполнения ---- */
@media (max-width: 600px) {
  .appbar { gap: 2px; padding-left: 4px; padding-right: 4px; }
  .appbar .title { min-width: 0; flex: 1; overflow: hidden; }
  .appbar .title b, .appbar .title span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .appbar .theme-btn, .appbar [data-act="preview"] { display: none; }   /* тема и «как посетитель» — в меню */
  .appbar .iconbtn { width: 36px; height: 36px; }
  .modes .role-tag { display: none; }
  .modes { overflow-x: auto; scrollbar-width: none; }
}

/* ---- переход «ладошкой» между панорамами ---- */
.palm-wipe { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; z-index: 58; pointer-events: none; }

/* ---- съёмка панорамы камерой ---- */
html.cap-open, html.cap-open body { overflow: hidden; overscroll-behavior: none; }
.cam360 { position: fixed; inset: 0; z-index: 150; background: #000; color: #fff; touch-action: none; -webkit-user-select: none; user-select: none; }
.cap-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam360.flash::after { content: ''; position: absolute; inset: 0; background: #fff; opacity: .55; pointer-events: none; }
.cap-aim { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.cap-cross { fill: none; stroke: rgba(255, 255, 255, .9); stroke-width: 2; }
.cap-ring { fill: rgba(227, 6, 19, .25); stroke: #e30613; stroke-width: 3; }
.cap-fill { fill: none; stroke: #fff; stroke-width: 4; stroke-dasharray: 138; stroke-dashoffset: 138; transform: rotate(-90deg); }
.cap-target.near .cap-ring { fill: rgba(46, 158, 79, .45); stroke: #2e9e4f; }
.cap-num { fill: #fff; font: 700 14px var(--font, sans-serif); text-anchor: middle; }
.cap-arrow { fill: #e30613; stroke: #fff; stroke-width: 2; }
.cap-top { position: absolute; top: calc(10px + var(--safe-t)); left: calc(10px + var(--safe-l)); right: calc(10px + var(--safe-r)); display: flex; gap: 8px; align-items: center; }
.cap-top .look-title { flex: 1; }
.cap-hint { position: absolute; left: 50%; transform: translateX(-50%); top: calc(66px + var(--safe-t)); background: rgba(18, 19, 22, .74); border-radius: 12px; padding: 8px 12px; font-size: 14px; max-width: calc(100% - 24px); text-align: center; }
.cap-hint:empty { display: none; }
.cap-set { position: absolute; right: calc(10px + var(--safe-r)); top: calc(60px + var(--safe-t)); width: min(300px, calc(100% - 20px)); color: var(--ink); display: flex; flex-direction: column; gap: 10px; }
.cap-start, .cap-busy { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .55); }
.cap-start .card, .cap-busy .card { background: var(--surface); color: var(--ink); width: min(420px, 100%); display: flex; flex-direction: column; gap: 12px; }
.cap-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 8px calc(10px + var(--safe-r)) calc(12px + var(--safe-b)) calc(10px + var(--safe-l)); background: linear-gradient(transparent, rgba(0, 0, 0, .6)); display: flex; flex-direction: column; gap: 10px; }
.cam360:not(.live) .cap-bottom, .cam360:not(.live) .cap-hint { display: none; }
.cap-thumbs { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: 3px; }
.cap-th { aspect-ratio: 3 / 4; border: 1px solid rgba(255, 255, 255, .5); border-radius: 4px; background: rgba(0, 0, 0, .35); color: #fff; font-size: 10px; padding: 0; overflow: hidden; }
.cap-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cap-th.done { border-color: #2e9e4f; }
.cap-th.on { outline: 2px solid #e30613; outline-offset: 1px; }
.cap-actions { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.cap-actions .btn { justify-self: start; }
.cap-count { justify-self: end; font: 700 15px var(--mono, monospace); }
.cap-right { justify-self: end; display: flex; align-items: center; gap: 10px; }
.cap-clear { background: rgba(0, 0, 0, .45); color: #fff; border-color: rgba(255, 255, 255, .35); }
.cap-clear.confirm { background: #e30613; border-color: #e30613; }
@media (max-width: 420px) { .cap-clear:not(.confirm) span { display: none; } }
.cap-shutter { width: 70px; height: 70px; border-radius: 50%; border: 4px solid #fff; background: #e30613; box-shadow: 0 0 0 3px rgba(0, 0, 0, .3); }
.cap-shutter:active { transform: scale(.94); }
@media (max-width: 520px) { .cap-thumbs { grid-template-columns: repeat(8, minmax(0, 1fr)); } }

/* ---- iOS и Android: без автоувеличения шрифта и приближения при вводе, жесты только наши ---- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.plan, .three canvas, .cyl canvas { touch-action: none; }
@media (pointer: coarse) {
  .inp, select.inp, textarea.inp { font-size: 16px; }   /* iOS приближает страницу при фокусе на поле мельче 16 px */
  .iconbtn.flat { min-width: 40px; min-height: 40px; }
}

/* ---- план: касания всегда приходят на сам <svg> (его содержимое перерисовывается) ---- */
.plan > * { pointer-events: none; }
.plan.hit > * { pointer-events: auto; }
