:root {
  --glass: rgba(255, 255, 255, .86); --glass2: rgba(255, 255, 255, .95); --line: rgba(20, 28, 40, .1); --hov: rgba(20, 28, 40, .06);
  --tx: #1d2126; --mut: #6b7178; --acc: #1f4e8c;
  --ok: #1b7f4b; --ok-bg: #e3f4ea; --opt: #8a5a00; --opt-bg: #fdf1d6; --no: #b42318; --no-bg: #fde7e5;
  --sh: 0 1px 2px rgba(16, 24, 40, .06), 0 6px 18px rgba(16, 24, 40, .1);
  --r: 10px; --g: 10px; --pw: 268px;
  --f: -apple-system, "Segoe UI", Roboto, "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #e9edf1; color: var(--tx); font: 13px/1.4 var(--f); overflow: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
#view { position: fixed; inset: 0; touch-action: none; }
#view canvas { display: block; width: 100%; height: 100%; outline: none; }
.glass { background: var(--glass); -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh); }

/* название — только когда модель открыта отдельно (во встроенном окне заголовок уже на странице) */
/* левый верхний угол — одна колонка с ровным зазором (владелец 2026-11-10: «отступы исправь между контейнерами в левом верхнем углу») */
.tl { position: fixed; top: var(--g); left: var(--g); display: flex; flex-direction: column; align-items: flex-start; gap: 8px; max-width: calc(100% - 170px); z-index: 3; }
.brand { padding: 7px 11px; display: flex; flex-direction: column; max-width: 100%; }
.brand b { font-size: 14px; font-weight: 600; }
.brand span { font-size: 11.5px; color: var(--mut); }
body.embed .brand { display: none; }

/* значки сверху справа и легенда зон под ними */
.tools { position: fixed; top: var(--g); right: var(--g); display: flex; gap: 6px; transition: right .25s; }
.ic { width: 32px; height: 32px; padding: 0; display: grid; place-items: center; cursor: pointer; }
.ic:hover { background: var(--glass2); }
.ic.on { background: var(--acc); border-color: var(--acc); color: #fff; }
.legend { position: fixed; top: calc(var(--g) + 40px); right: var(--g); padding: 5px 10px; display: flex; gap: 12px; font-size: 12px; white-space: nowrap; transition: right .25s; }
.legend[hidden] { display: none; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; }

/* ракурсы — одна строка снизу справа */
.views { position: fixed; right: var(--g); bottom: var(--g); display: flex; gap: 2px; padding: 3px; max-width: calc(100% - 2 * var(--g)); overflow-x: auto; scrollbar-width: none; transition: right .25s; }
.views::-webkit-scrollbar { display: none; }
.views button { border: 0; background: none; padding: 5px 10px; border-radius: 7px; cursor: pointer; white-space: nowrap; }
.views button:hover { background: var(--hov); }
.views button.on { background: var(--acc); color: #fff; }
.views button[data-k] { min-width: 30px; }
.views .zones { margin-left: 4px; position: relative; }
.views .zones::before { content: ""; position: absolute; left: -4px; top: 6px; bottom: 6px; border-left: 1px solid var(--line); }

/* подсказка по управлению — сверху слева (во встроенном окне названия нет), переключатель мышь / тачпад */
.hint { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 6px 11px; font-size: 12px; color: var(--mut); max-width: 100%; }
.hint span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.hint .mi { width: 11px; height: 16px; stroke-width: 1.3; }
.hint .mi .f { fill: var(--acc); stroke: none; }
.hint .pi { width: 18px; height: 14px; stroke-width: 1.4; }
.hint .dev { display: inline-flex; gap: 2px; padding-right: 10px; margin-right: 2px; border-right: 1px solid var(--line); }
.hint .dev button { display: grid; place-items: center; width: 26px; height: 22px; padding: 0; border: 0; border-radius: 5px; background: none; color: var(--mut); cursor: pointer; }
.hint .dev button:hover { background: var(--hov); color: var(--tx); }
.hint .dev button.on { background: var(--hov); color: var(--acc); }
.hint kbd { font: 600 10.5px/1 var(--f); color: var(--tx); padding: 3px 5px; border-radius: 4px; background: #fff; border: 1px solid var(--line); }

/* масштаб — справа над ракурсами */
.zoom { position: fixed; right: var(--g); bottom: calc(var(--g) + 46px); display: flex; flex-direction: column; padding: 3px; gap: 2px; transition: right .25s; }
.zoom button { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 7px; background: none; display: grid; place-items: center; cursor: pointer; }
.zoom button:hover { background: var(--hov); }

/* итог одной строкой снизу слева — по нажатию открывает панель */
.chip { position: fixed; left: var(--g); bottom: var(--g); display: flex; align-items: center; gap: 6px; padding: 7px 9px 7px 11px; cursor: pointer; white-space: nowrap; max-width: calc(100% - 2 * var(--g)); }
.chip span { color: var(--mut); }
.chip b { font-size: 14px; font-weight: 600; }
.chip svg { width: 16px; height: 16px; color: var(--mut); }
.chip:hover { background: var(--glass2); }

/* одна панель справа: сводка или выбранный фасад */
/* панель (сводка, паспорт, фасад) — карточка снизу слева на месте строки-итога (владелец 2026-11-10: «эта херня сбоку выезжающая абсолютно по
   идиотски сделана. сделай ее лучше снизу слева»); кадр не сдвигается, кнопки справа на месте */
.panel { position: fixed; left: var(--g); bottom: var(--g); width: min(380px, calc(100% - 2 * var(--g))); max-height: min(62%, calc(100% - 150px)); display: flex; flex-direction: column; overflow: hidden; background: var(--glass2);
  transform: translateY(calc(100% + 2 * var(--g))); visibility: hidden; transition: transform .25s ease, visibility 0s linear .25s; }
body.open .panel { transform: none; visibility: visible; transition: transform .25s ease; }
body.open .chip { display: none; }
.p-top { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 0 14px; min-height: 34px; }
.back { border: 0; background: none; padding: 4px 0; color: var(--acc); cursor: pointer; font-size: 12.5px; }
.back:hover { text-decoration: underline; }
.x { width: 28px; height: 28px; margin-left: auto; padding: 0; border: 0; background: none; border-radius: 7px; display: grid; place-items: center; color: var(--mut); cursor: pointer; }
.x:hover { background: var(--hov); color: var(--tx); }
.p-body { flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: 0 14px 14px; }
.p-body h3 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3; }
.sub { color: var(--mut); font-size: 12px; margin-top: 2px; }
.big { font-size: 24px; font-weight: 650; letter-spacing: -.3px; margin: 8px 0 0; }
.big small { font-size: 13px; color: var(--mut); font-weight: 500; }
.dims { color: var(--mut); font-size: 12px; }
.tag { display: inline-block; font-size: 11.5px; font-weight: 500; padding: 2px 8px; border-radius: 6px; margin: 6px 0 2px; }
.tag.yes { background: var(--ok-bg); color: var(--ok); }
.tag.opt { background: var(--opt-bg); color: var(--opt); }
.tag.add { background: rgba(180, 140, 255, .16); color: #8a5cf0; }
.tag.no { background: var(--no-bg); color: var(--no); }
.note { color: var(--mut); font-size: 11.5px; margin-top: 8px; }
.note b { color: var(--tx); font-weight: 600; }
.p-body h4 { margin: 14px 0 2px; font-size: 12px; color: var(--mut); font-weight: 500; }
.seg { display: flex; gap: 2px; padding: 2px; background: var(--hov); border-radius: 8px; margin: 10px 0 4px; }
.seg button { flex: auto; border: 0; background: none; border-radius: 6px; padding: 4px 6px; cursor: pointer; font-size: 12px; white-space: nowrap; }
.seg button.on { background: #fff; box-shadow: 0 1px 2px rgba(16, 24, 40, .14); font-weight: 600; }
.row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:hover span:first-child { color: var(--acc); }
/* строка паспорта: подпись сверху мелко, значение под ней с переносом — без горизонтальной прокрутки */
.kv { padding: 6px 0; border-bottom: 1px solid var(--line); }
.kv span { display: block; font-size: 11.5px; color: var(--mut); }
.kv b { display: block; font-weight: 500; overflow-wrap: anywhere; }
.row span:last-child { color: var(--mut); white-space: nowrap; font-variant-numeric: tabular-nums; }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 4px 0 4px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
th:first-child, td:first-child { text-align: left; padding-left: 0; white-space: normal; }
th { color: var(--mut); font-weight: 500; font-size: 11.5px; }
td small { display: block; color: var(--mut); font-size: 11px; }
tr:last-child td { border-bottom: 0; }

.tip { position: fixed; left: 0; top: 0; z-index: 5; pointer-events: none; max-width: 260px; padding: 7px 10px; display: flex; flex-direction: column; gap: 1px; font-size: 12px; background: var(--glass2); }
.tip[hidden] { display: none; }
.tip b { font-size: 12.5px; font-weight: 600; }
.tip span { color: var(--mut); }
.tip i { font-style: normal; font-weight: 500; }
.tip i.yes { color: var(--ok); } .tip i.opt { color: var(--opt); } .tip i.no { color: var(--no); }
.load { position: fixed; inset: 0; display: grid; place-items: center; color: var(--mut); background: #e9edf1; transition: opacity .5s; }
.load.done { opacity: 0; pointer-events: none; }

/* узкое окно (телефон, узкая страница): ракурсы во всю ширину снизу, итог над ними, панель выезжает снизу */
@media (max-width: 720px) {
  :root { --g: 8px; }
  .ic { width: 36px; height: 36px; }
  .legend { top: calc(var(--g) + 44px); }
  .views { left: var(--g); }
  .views button { flex: 1 0 auto; padding: 6px 8px; }
  .chip { bottom: calc(var(--g) + 44px); }
  .zoom { bottom: calc(var(--g) + 44px); }
  .zoom button { width: 34px; height: 34px; }
  .tl { max-width: calc(100% - 2 * var(--g) - 130px); }
  .hint { font-size: 11.5px; padding: 6px 9px; gap: 2px 10px; }
  .panel { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 58%; border-radius: 14px 14px 0 0; border-bottom: 0; transform: translateY(105%); }
  body.open .tools, body.open .legend { right: var(--g); }
  body.open .views, body.open .chip, body.open .zoom { display: none; }
}
@media (max-width: 420px) { .chip .from { display: none; } }
body.shot .brand, body.shot .hint, body.shot .zoom, body.shot .tools, body.shot .legend, body.shot .views, body.shot .chip, body.shot .panel, body.shot .tip { display: none !important; }
/* границы участков и подписи строений (2026-11-09, из просмотрщика «Жайлоо»): HTML поверх сцены, кадры для сверки — без них */
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 2; }
.lbl { position: absolute; left: 0; top: 0; padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .9); color: var(--tx);
  font: 600 12px/1.25 var(--f); white-space: nowrap; border: 1px solid rgba(20, 30, 45, .12); box-shadow: 0 2px 8px rgba(20, 30, 45, .18); }
.lbl::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 1px; height: 6px; background: rgba(20, 30, 45, .45); }
.lbl.plot { background: var(--pc, #e8590c); color: #fff; border-color: transparent; font-weight: 500; }
.lbl.plot::after { display: none; }
body.shot #labels { display: none; }
