/* Цифровой паспорт — в языке Multica Fleet Control: тёмная плотная панель данных.
   Inter 13 px, цифры — табличные, коды и единицы — JetBrains Mono; поверхности #111 со скруглением 14 px,
   цвет — только смысловой: зелёный «в норме», красный «нарушение», янтарный «внимание»,
   плюс четыре акцента флота для слоёв и категорий. Сайт однотемный (тёмный) намеренно, как референс. */
:root {
  --bg: #0a0a0a; --surface: #111111; --surface-2: #161616; --hover: #1b1b1b;
  --border: #232323; --line: #1f1f1f; --border-subtle: rgba(255, 255, 255, .06); --border-focus: #3a3a3a;
  --text: #ededed; --muted: #b5b5b5; --dim: #8a8a8a;
  --accent: #ffffff;   /* акцент интерфейса — белый (решение владельца 2026-10-15); жёлтый остаётся только цветом данных */
  --amber: #f59e0b; --cyan: #38bdf8; --purple: #c084fc; --mint: #10b981;
  --profit: #34d399; --profit-bg: rgba(16, 185, 129, .12); --loss: #f87171; --loss-bg: rgba(239, 68, 68, .12); --warning: #fbbf24; --warning-bg: rgba(245, 158, 11, .12);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  /* элементы интерфейса */
  --strong: #ffffff; --nav: #9a9a9a; --faint: #6b6b6b; --icon: #8a8a8a; --th: #8f8f8f;
  --active-bg: #1c1c1c; --active-ring: #2c2c2c; --edge: #222222; --edge-hover: #262626;
  --cell: #0d0d0d; --cell-hover: #131313; --sheet-dark: #1a1a1a;
  --btn-bg: #ededed; --btn-fg: #0a0a0a; --btn-hover: #ffffff;
  --seg-on: #232323; --seg-on-ring: #313131;
  --tip-bg: #1a1a1a; --tip-edge: #2e2e2e; --tip-shadow: rgba(0, 0, 0, .55);
  --scroll: #2a2a2a; --scroll-hover: #3a3a3a; --scroll-ff: #2e2e2e;
  --topbar-bg: rgba(10, 10, 10, .9); --lb-bg: rgba(5, 5, 5, .96); --scrim: rgba(0, 0, 0, .6);
  /* 3D-сцена и всё поверх неё */
  --st-bg: #161616; --st-glass: rgba(12, 12, 12, .84); --st-glass-2: rgba(12, 12, 12, .9); --st-glass-3: rgba(12, 12, 12, .72);
  --st-edge: rgba(255, 255, 255, .08); --st-text: #a3a3a3; --st-hover-text: #ededed; --st-hover: rgba(255, 255, 255, .07);
  --st-strong: #ffffff; --st-on: #262626; --st-on-ring: #363636; --st-icon: #8a8a8a; --st-shadow: rgba(0, 0, 0, .35);
  --st-kbd: #222222; --st-kbd-edge: #333333;
  --tag-bg: rgba(10, 10, 10, .78); --tag-fg: #f1f1f1; --tag-edge: rgba(255, 255, 255, .08);
  --ruler-bg: #ffffff; --ruler-fg: #0a0a0a;
  color-scheme: dark;
}
/* светлая тема — по кнопке в меню (выбор хранится в браузере) */
:root[data-theme="light"] {
  --bg: #f4f4f2; --surface: #ffffff; --surface-2: #f3f3f1; --hover: #ececea;
  --border: #e2e2df; --line: #e8e8e5; --border-subtle: rgba(0, 0, 0, .07); --border-focus: #c4c4c0;
  --text: #161616; --muted: #4b4b4b; --dim: #6f6f6f;
  --accent: #111111;
  --cyan: #0284c7; --purple: #9333ea; --mint: #059669;
  --profit: #047857; --profit-bg: rgba(16, 185, 129, .12); --loss: #dc2626; --loss-bg: rgba(239, 68, 68, .1); --warning: #b45309; --warning-bg: rgba(245, 158, 11, .14);
  --strong: #0a0a0a; --nav: #5c5c5c; --faint: #8a8a8a; --icon: #6b6b6b; --th: #6b6b6b;
  --active-bg: #ffffff; --active-ring: #dcdcd8; --edge: #e2e2df; --edge-hover: #d6d6d2;
  --cell: #ffffff; --cell-hover: #f7f7f5; --sheet-dark: #e9e9e6;
  --btn-bg: #161616; --btn-fg: #ffffff; --btn-hover: #000000;
  --seg-on: #ffffff; --seg-on-ring: #d6d6d2;
  --tip-bg: #ffffff; --tip-edge: #e2e2df; --tip-shadow: rgba(0, 0, 0, .12);
  --scroll: #cfcfcb; --scroll-hover: #b3b3ae; --scroll-ff: #cfcfcb;
  --topbar-bg: rgba(244, 244, 242, .9); --lb-bg: rgba(240, 240, 238, .97); --scrim: rgba(0, 0, 0, .3);
  --st-bg: #e9e9e6; --st-glass: rgba(255, 255, 255, .88); --st-glass-2: rgba(255, 255, 255, .94); --st-glass-3: rgba(255, 255, 255, .82);
  --st-edge: rgba(0, 0, 0, .08); --st-text: #4b4b4b; --st-hover-text: #0a0a0a; --st-hover: rgba(0, 0, 0, .05);
  --st-strong: #0a0a0a; --st-on: #ececea; --st-on-ring: #d6d6d2; --st-icon: #6b6b6b; --st-shadow: rgba(0, 0, 0, .1);
  --st-kbd: #f3f3f1; --st-kbd-edge: #d6d6d2;
  --tag-bg: rgba(255, 255, 255, .9); --tag-fg: #161616; --tag-edge: rgba(0, 0, 0, .1);
  --ruler-bg: #111111; --ruler-fg: #ffffff;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 400 13px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
a[data-go] { cursor: pointer; }   /* ссылки без href (адрес в data-go) — чтобы браузер не показывал адрес при наведении */
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--border-focus); outline-offset: 2px; }
[hidden] { display: none !important; }
svg { flex: none; }

/* прокрутка как в Fleet Control (.ft-scroll): тонкая тёмная полоса, бегунок с «рамкой» под цвет фона, без дорожки */
* { scrollbar-width: thin; scrollbar-color: var(--scroll-ff) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track, ::-webkit-scrollbar-corner { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll); border-radius: 10px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-hover); }
.tw::-webkit-scrollbar-thumb, .panel::-webkit-scrollbar-thumb, .md ::-webkit-scrollbar-thumb { border-color: var(--surface); }
*:hover { scrollbar-color: var(--scroll-hover) transparent; }

/* ---------------------------------------------------------------- каркас: боковое меню + страница */
html, body { height: 100%; }
body { overflow: hidden; }
.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); height: 100%; }
/* шапка и квартиры стоят на месте, прокручивается только список разделов; полоса прокрутки — в правом поле меню */
.side { --sp: 12px; height: 100%; overflow: hidden; display: grid; grid-template-rows: auto auto minmax(0, 1fr); gap: 16px; padding: 18px var(--sp) 16px; background: var(--bg); border-right: 1px solid var(--border-subtle); }
.side-head { position: relative; display: flex; justify-content: center; min-width: 0; }
.side-head .brand { flex: 1; }
.side-head .brand b { padding-right: 66px; }
/* кнопка темы: солнце в тёмной теме, луна в светлой */
.theme-tog { position: absolute; top: -5px; right: 32px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--icon); cursor: pointer; }
.theme-tog:hover { color: var(--text); background: var(--hover); border-color: var(--edge-hover); }
.theme-tog svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-tog .moon, :root[data-theme="light"] .theme-tog .sun { display: none; }
:root[data-theme="light"] .theme-tog .moon { display: block; }
.topbar .theme-tog { position: static; margin-left: auto; width: 36px; height: 36px; border-radius: 10px; background: var(--surface); border: 1px solid var(--edge); color: var(--text); }
.side-tog { position: absolute; top: -5px; right: 0; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--icon); cursor: pointer; }
.side-tog:hover { color: var(--text); background: var(--hover); border-color: var(--edge-hover); }
.side-tog svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.brand { display: grid; gap: 2px; padding: 0 8px; min-width: 0; color: var(--text); text-decoration: none !important; }
/* «Объекты» — первая строка блока квартир: ведёт на список; на списке она активна */
.obj-all { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--nav); text-decoration: none !important; }
.obj-all svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.obj-all:hover { color: var(--text); background: var(--hover); }
.obj-all.on { color: var(--strong); background: var(--active-bg); box-shadow: inset 0 0 0 1px var(--active-ring); }
.obj .code { display: none; }
.brand b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.brand span { font: 500 11px/1.3 var(--mono); color: var(--dim); }
.sync { display: flex; align-items: center; gap: 8px; padding: 0 8px; color: var(--dim); font-size: 12px; font-weight: 500; }
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(16, 185, 129, .15); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(16, 185, 129, 0); } }
.nav { display: grid; gap: 2px; align-content: start; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin-inline: -4px calc(-1 * var(--sp)); padding: 2px calc(var(--sp) - 10px) 2px 4px; scrollbar-gutter: stable; }   /* место под полосу (10 px) зарезервировано — пункты не сдвигаются */
/* переключатель квартир */
.objs { display: grid; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--edge); border-radius: 12px; }
.obj { display: grid; gap: 1px; padding: 8px 10px; border-radius: 8px; color: var(--nav); text-decoration: none !important; }
.obj b { font: 600 12.5px/1.3 var(--mono); color: inherit; }
.obj span { font-size: 11.5px; color: var(--faint); }
.obj:hover { background: var(--hover); color: var(--text); }
.obj.on { background: var(--active-bg); color: var(--strong); box-shadow: inset 0 0 0 1px var(--active-ring); }
.obj.on b { color: var(--accent); }
.obj.on span { color: var(--muted); }
.objlist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.objlist .thumb { aspect-ratio: 16 / 9; }
.objlist .cbody p { line-height: 1.7; }
.nav hr { border: 0; border-top: 1px solid var(--border-subtle); margin: 8px 10px; }
.nav .grp { font: 600 10.5px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 14px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: 8px; color: var(--nav); font-weight: 600; text-decoration: none !important; }
.nav-item svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item small { font: 500 11px/1 var(--mono); color: var(--faint); white-space: nowrap; }
.nav-item:hover { color: var(--text); background: var(--hover); }
.nav-item.on { background: var(--active-bg); color: var(--strong); box-shadow: inset 0 0 0 1px var(--active-ring); }
.nav-item.on svg { color: var(--accent); }
.nav-item.on small { color: var(--muted); }
.tbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--edge); color: var(--text); font-weight: 600; white-space: nowrap; text-decoration: none !important; }
.tbtn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tbtn:hover { background: var(--hover); border-color: var(--border-focus); }
.side .foot { padding: 0 8px; color: var(--faint); font-size: 11.5px; line-height: 1.5; }
.topbar { display: none; }
@media (min-width: 981px) {
  .app { transition: grid-template-columns .2s ease; }
  body.side-min .app { grid-template-columns: 64px minmax(0, 1fr); }
  body.side-min .side { --sp: 10px; }
  body.side-min .brand { display: none; }
  body.side-min .side-head { flex-direction: column; align-items: center; gap: 6px; }
  body.side-min .side-tog, body.side-min .side .theme-tog { position: static; }
  body.side-min .side-tog svg { transform: scaleX(-1); }
  body.side-min .objs { padding: 3px; }
  body.side-min .obj { padding: 8px 0; justify-items: center; }
  body.side-min .obj b, body.side-min .obj span { display: none; }
  body.side-min .obj .code { display: block; font: 600 12px/1.2 var(--mono); font-style: normal; }
  body.side-min .obj.on .code { color: var(--accent); }
  body.side-min .obj-all { justify-content: center; padding: 8px 0; gap: 0; font-size: 0; }
  body.side-min .nav-item { justify-content: center; padding: 0; }
  body.side-min .nav-item span { display: none; }
  body.side-min .nav hr { margin: 8px 4px; }
}

main { min-width: 0; height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; padding-inline: 28px; padding-block: 26px 48px; scroll-padding-top: 20px; }
.page { max-width: 1320px; margin-inline: auto; display: grid; gap: 22px; }
.page > header { display: grid; gap: 8px; }
.page { scroll-margin-top: 20px; }
.page > header h2 { font-size: clamp(20px, 2.2vw, 26px); font-weight: 700; letter-spacing: -.02em; }

/* ---------------------------------------------------------------- типографика */
.eyebrow { font: 600 11px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
h1, h2, h3 { margin: 0; text-wrap: balance; letter-spacing: -.015em; }
h1 { font-size: clamp(24px, 3vw, 34px); line-height: 1.15; font-weight: 700; }
h2 { font-size: 17px; line-height: 1.3; font-weight: 650; }
h3 { font-size: 13px; line-height: 1.4; font-weight: 600; }
p { margin: 0; max-width: 78ch; }
.lead { font-size: 15px; line-height: 1.6; color: var(--muted); max-width: 86ch; }
.muted { color: var(--dim); }
.hint { color: var(--dim); font-size: 12px; line-height: 1.5; }
.note { font-size: 12.5px; color: var(--dim); padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; max-width: none; }
.nw { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }   /* заголовок для экранных дикторов и названия вкладки */
.block { display: grid; gap: 12px; align-content: start; min-width: 0; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.two:has(table) { grid-template-columns: minmax(0, 1fr); gap: 22px; }   /* таблицы — друг под другом, не в две колонки */
.ok { color: var(--profit); } .bad { color: var(--loss); } .warn { color: var(--warning); }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 10px; background: var(--btn-bg); color: var(--btn-fg); font-weight: 600; border: 0; cursor: pointer; font-family: inherit; font-size: 13px; justify-self: start; text-decoration: none !important; }
.btn:hover { background: var(--btn-hover); }
.points { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.points li { padding-left: 16px; position: relative; color: var(--muted); max-width: 86ch; }
.points li b { color: var(--text); }
.points li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--dim); }
.pill { display: inline-block; font: 600 12px/1 var(--font); padding: 5px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--profit-bg); color: var(--profit); }
.pill.bad { background: var(--loss-bg); color: var(--loss); }
.pill.warn { background: var(--warning-bg); color: var(--warning); }

/* ---------------------------------------------------------------- таблицы (как .ft в Fleet Control) */
.tw { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font: 600 11px/1.3 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--th); padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 11px 16px; border-bottom: 1px solid var(--line); vertical-align: top; background: var(--cell); }
tbody tr:hover td { background: var(--cell-hover); }
tr:last-child td { border-bottom: 0; }
table.num td:not(:first-child), table.num th:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
td b { font-weight: 700; }

/* ---------------------------------------------------------------- плитки KPI (bento) */
.figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
/* шесть плиток обзора — ровными рядами 6 / 3 / 2, без одинокой плитки в последнем ряду */
main { container-type: inline-size; }
.figs.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@container (max-width: 520px) { .figs.three { grid-template-columns: 1fr; } }
.fig { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 6px; align-content: start; }
.fig b { order: 2; font: 700 22px/1.1 var(--font); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fig span { order: 1; font: 600 11px/1.3 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.fig small { order: 3; font-size: 12px; color: var(--dim); }

/* ---------------------------------------------------------------- обзор */
.heroimg { position: relative; display: block; border-radius: 14px; overflow: hidden; background: var(--st-bg); border: 1px solid var(--line); aspect-ratio: 21 / 9; max-width: 100%; }
.heroimg img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s; }
.heroimg:hover img { transform: scale(1.012); }
.heroimg .btn { position: absolute; left: 18px; bottom: 18px; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.card { display: grid; grid-template-rows: auto 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; color: var(--text); text-decoration: none !important; transition: border-color .15s, background .15s; }
.card:hover { border-color: var(--border-focus); background: var(--surface-2); }
.thumb { aspect-ratio: 16 / 9; background: var(--st-bg); overflow: hidden; border-bottom: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .shot-l, :root[data-theme="light"] .thumb .shot-d { display: none; }   /* обложка 3D — под тему */
:root[data-theme="light"] .thumb .shot-l { display: block; }
.thumb.paper { background: #fff; padding: 10px; }
.thumb.paper img { object-fit: contain; }
.cbody { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "no t m" "no p p"; gap: 4px 10px; padding: 12px 14px 14px; align-items: baseline; }
.cbody .no { grid-area: no; font: 500 11px/1.5 var(--mono); color: var(--dim); }
.cbody b { grid-area: t; font-size: 14px; font-weight: 650; }
.cbody em { grid-area: m; font: 600 12px/1 var(--font); font-style: normal; color: var(--muted); white-space: nowrap; }
.cbody p { grid-area: p; font-size: 12.5px; color: var(--dim); }
.bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.bar i { display: block; min-width: 3px; }
.crows { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.crow { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto 54px; gap: 12px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none !important; }
.crow:last-child { border-bottom: 0; }
.crow:hover { background: var(--surface-2); }
.crow i { width: 10px; height: 10px; border-radius: 3px; }
.crow b { font-weight: 700; font-variant-numeric: tabular-nums; }
.crow em { font: 500 11.5px/1 var(--mono); font-style: normal; color: var(--dim); text-align: right; }
table.kv2 { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; border-collapse: separate; border-spacing: 0; overflow: hidden; }
table.kv2 td { background: transparent; }
table.kv2 td:first-child { color: var(--dim); width: 110px; white-space: nowrap; font-weight: 500; }

/* ---------------------------------------------------------------- чертежи и галереи */
figure { margin: 0; display: grid; gap: 8px; min-width: 0; }
.sheet { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; overflow: hidden; }
.sheet img { display: block; width: 100%; height: auto; cursor: zoom-in; }
figcaption { font-size: 12px; color: var(--dim); display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
figcaption a { white-space: nowrap; font-weight: 600; }
.gal { display: grid; gap: 18px; }
details.more { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
details.more > summary { cursor: pointer; list-style: none; padding: 12px 16px; font-weight: 600; color: var(--muted); display: flex; align-items: center; gap: 8px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: ""; width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
details.more[open] > summary::before { transform: rotate(45deg); }
details.more > summary:hover { color: var(--text); }
details.more > :not(summary) { padding: 4px 16px 16px; }
.elev { display: grid; gap: 8px; }
.elev h3 .muted { font-weight: 400; }
.elev-scroll { overflow-x: auto; padding-bottom: 4px; }
.elev-row { display: grid; gap: 6px; }
.elev-row figure { min-width: 0; gap: 5px; }
.elev-row .sheet { padding: 3px; border-radius: 8px; background: var(--sheet-dark); }
.elev-row .sheet img { border-radius: 5px; }
.elev-row figcaption { font: 500 11px/1.3 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.ceil { max-width: 640px; }

/* ---------------------------------------------------------------- документы */
.docs { display: grid; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.doc { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--cell); }
.doc:last-child { border-bottom: 0; }
.doc:hover { background: var(--cell-hover); }
.doc .ext { font: 600 10.5px/1 var(--mono); text-transform: uppercase; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 7px 0; text-align: center; }
.doc b { font-weight: 600; }
.doc p { font-size: 12px; color: var(--dim); }
.doc .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.doc .acts a { font-size: 12.5px; font-weight: 600; padding: 6px 11px; border: 1px solid var(--border); border-radius: 8px; color: var(--text); white-space: nowrap; background: var(--surface); text-decoration: none; }
.doc .acts a:hover { border-color: var(--border-focus); background: var(--hover); }
.md { display: grid; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; font-size: 13.5px; color: var(--muted); }
.md h1 { font-size: 22px; color: var(--text); } .md h2 { font-size: 16px; margin-top: 8px; color: var(--text); } .md h3 { color: var(--text); }
.md strong, .md b { color: var(--text); }
.md code { font: 12px var(--mono); background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }

/* ---------------------------------------------------------------- 3D */
/* модель занимает окно целиком: сверху отступ и заголовок (~82 px), снизу 20 px — подсказка и низ панели не уходят за край */
main:has(> #model:not([hidden])) { padding-bottom: 20px; }
#model-box { display: grid; grid-template-columns: minmax(0, 1fr) 300px; height: calc(100vh - 102px); height: calc(100dvh - 102px); min-height: 340px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--st-bg); }
#model-box:fullscreen { height: 100vh; border-radius: 0; }
#stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
#stage canvas { display: block; position: absolute; top: 0; left: 0; }   /* холст не задаёт размер области: после полного экрана она не остаётся растянутой */
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.tag { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font: 600 11px/1.2 var(--font); padding: 3px 7px; border-radius: 6px; background: var(--tag-bg); color: var(--tag-fg); border: 1px solid var(--tag-edge); }
.tag.room { font-size: 11.5px; }
.tag.fix { color: var(--muted); }
.tag.ruler { background: var(--ruler-bg); color: var(--ruler-fg); border: 0; }
#v-loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--dim); font-size: 13px; }
.panel { background: var(--surface); border-left: 1px solid var(--line); padding: 14px; overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: 18px; }
.panel .block { gap: 9px; }
.panel h3 { font: 600 11px/1 var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
.vcut .row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 6px; align-items: center; color: var(--muted); }
.vcut .row b { font: 500 12px/1 var(--mono); color: var(--text); }
.vcut input[type=range] { width: 100%; margin: 0; accent-color: var(--accent); grid-column: 1 / -1; }
.panel label, .vcut label { display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--muted); }
.panel label:hover, .vcut label:hover { color: var(--text); }
.panel input[type=checkbox], .vcut input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }
/* кнопки на экране модели */
.vbar { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 3; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.vseg { pointer-events: auto; display: flex; gap: 2px; padding: 3px; background: var(--st-glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--st-edge); border-radius: 10px; box-shadow: 0 6px 20px var(--st-shadow); }
.vseg button { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 11px; border: 0; border-radius: 7px; background: transparent; color: var(--st-text); font: 600 12.5px var(--font); cursor: pointer; }
.vseg button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vseg button:hover { color: var(--st-hover-text); background: var(--st-hover); }
.vseg button.on { color: var(--st-strong); background: var(--st-on); box-shadow: inset 0 0 0 1px var(--st-on-ring); }
.vseg button.on svg, .vseg button.act svg { color: var(--st-strong); }
#v-fullseg { margin-left: auto; }
#v-fullseg button { padding: 0 9px; }
.vcut { position: absolute; top: 58px; left: 12px; z-index: 3; width: min(280px, calc(100% - 24px)); display: grid; gap: 12px; padding: 12px 14px 14px; background: var(--st-glass-2); color: var(--st-text); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border: 1px solid var(--st-edge); border-radius: 12px; box-shadow: 0 10px 28px var(--st-shadow); font-size: 12.5px; }
.vhint { position: absolute; left: 12px; bottom: 12px; z-index: 2; max-width: calc(100% - 76px); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 7px 11px; background: var(--st-glass-3); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid var(--st-edge); border-radius: 9px; color: var(--st-text); font: 500 12px/1.3 var(--font); pointer-events: none; }
.vhint span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.vhint .mi { width: 11px; height: 16px; fill: none; stroke: var(--st-icon); stroke-width: 1.3; }
.vhint .mi .f { fill: var(--st-strong); stroke: none; }
.vhint .pi { width: 18px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.vhint .dev { display: inline-flex; gap: 2px; padding-right: 10px; margin-right: 2px; border-right: 1px solid var(--st-edge); pointer-events: auto; }
.vhint .dev button { display: grid; place-items: center; width: 26px; height: 22px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: var(--st-icon); cursor: pointer; }
.vhint .dev button .mi { stroke: currentColor; }
.vhint .dev button:hover { color: var(--st-hover-text); }
.vhint .dev button.on { background: var(--st-on); color: var(--st-strong); }
.vzoom { position: absolute; right: 12px; bottom: 12px; z-index: 3; flex-direction: column; }
.vzoom button { padding: 0; width: 32px; justify-content: center; }
.vhint kbd { font: 600 10.5px/1 var(--mono); color: var(--st-hover-text); padding: 3px 5px; border-radius: 4px; background: var(--st-kbd); border: 1px solid var(--st-kbd-edge); }
.tag.hot { border-color: var(--st-strong); box-shadow: 0 0 0 1px var(--st-strong); z-index: 1; }
/* всплывающая расшифровка */
.tipbox { position: fixed; z-index: 70; max-width: 300px; display: grid; gap: 2px; padding: 8px 11px; border-radius: 9px; background: var(--tip-bg); border: 1px solid var(--tip-edge); color: var(--muted); font: 500 12px/1.45 var(--font); box-shadow: 0 10px 28px var(--tip-shadow); pointer-events: none; }
.tipbox b { color: var(--strong); font-weight: 650; font-size: 12.5px; }
.tipbox span { display: block; }
.seg { display: flex; gap: 2px; flex-wrap: wrap; padding: 3px; background: var(--bg); border: 1px solid var(--edge); border-radius: 10px; }
.seg button { background: transparent; color: var(--nav); border: 0; border-radius: 7px; height: 30px; padding: 0 11px; cursor: pointer; font: 600 12.5px var(--font); }
.seg button:hover { color: var(--text); background: var(--hover); }
.seg button.on { background: var(--seg-on); color: var(--strong); box-shadow: inset 0 0 0 1px var(--seg-on-ring); }
.panel table.kv td, .panel table.kv th { padding: 6px 0; border-bottom: 1px solid var(--line); background: none; color: var(--muted); letter-spacing: 0; text-transform: none; font-size: 12.5px; }
.panel table.kv th { color: var(--dim); font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; }
.panel table.kv td:last-child { text-align: right; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; padding-left: 10px; }
.panel table.cmp td, .panel table.cmp th { text-align: right; }
.panel table.cmp td:first-child, .panel table.cmp th:first-child { text-align: left; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--muted); }
.legend.col { flex-direction: column; gap: 6px; }
.legend span { display: flex; align-items: baseline; gap: 7px; }
.legend i { flex: none; display: inline-block; width: 14px; height: 4px; border-radius: 2px; transform: translateY(-2px); }
.legend i.dash { background: repeating-linear-gradient(90deg, #94a3b8 0 4px, transparent 4px 7px); }
.legend b { font: 600 11.5px var(--mono); color: var(--text); }
.finds, .rlist { display: grid; gap: 4px; }
.finds button, .rlist button { text-align: left; background: var(--bg); color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 12px; line-height: 1.45; cursor: pointer; }
.finds button:hover:not(:disabled), .rlist button:hover { border-color: var(--border-focus); color: var(--text); }
.finds button.on { border-color: var(--accent); color: var(--text); }
.finds .find { background: var(--bg); color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.45; }
.finds b { font: 600 10px/1 var(--font); text-transform: uppercase; letter-spacing: .06em; margin-right: 5px; padding: 3px 6px; border-radius: 999px; }
.finds .lv0 b { color: var(--loss); background: var(--loss-bg); } .finds .lv1 b { color: var(--warning); background: var(--warning-bg); }
.finds .lv2 b { color: var(--cyan); background: rgba(56, 189, 248, .12); } .finds .lv3 b { color: var(--profit); background: var(--profit-bg); }
.rlist button { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 9px; align-items: center; color: var(--text); }
.rlist i { width: 10px; height: 10px; border-radius: 3px; }
.rlist span { color: var(--dim); font-weight: 600; font-variant-numeric: tabular-nums; }
/* группы щита — кнопки как у помещений: щелчок скрывает группу на модели */
.glist button { align-items: start; }
.glist button i { margin-top: 4px; }
.glist em { font-style: normal; min-width: 0; }
.glist em b { font-weight: 700; margin-right: 4px; }
.glist em small { display: block; color: var(--dim); font-size: 11.5px; }
.rlist button.off { opacity: .45; }
.rlist button.off i { background: transparent !important; box-shadow: inset 0 0 0 1.5px var(--dim); }

/* ---------------------------------------------------------------- просмотр чертежей */
.lb { position: fixed; inset: 0; z-index: 50; background: var(--lb-bg); display: grid; grid-template-rows: auto minmax(0, 1fr); }
.lb-bar { display: flex; align-items: center; gap: 6px; padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px; color: var(--text); border-bottom: 1px solid var(--border-subtle); }
.lb-cap { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-bar button, .lb-bar a { height: 32px; display: inline-flex; align-items: center; background: var(--surface); color: var(--text); border: 1px solid var(--edge); border-radius: 8px; padding: 0 12px; font: 600 13px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.lb-bar button:hover, .lb-bar a:hover { background: var(--hover); border-color: var(--border-focus); }
.lb-view { position: relative; overflow: hidden; touch-action: none; cursor: grab; }
.lb-view:active { cursor: grabbing; }
.lb-view img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; background: #fff; user-select: none; -webkit-user-drag: none; border-radius: 4px; }

/* ---------------------------------------------------------------- служебный режим съёмки (?shot=…) */
body.shot .side, body.shot .topbar, body.shot #model > header, body.shot .panel, body.shot .vbar, body.shot .vcut, body.shot .vhint, body.shot .vzoom, body.shot .tipbox { display: none !important; }
body.shot .app { display: block; }
body.shot:not(.ready) #labels, body.shot:not(.ready) #v-loading { display: none; }   /* съёмка: до загрузки модели кадр пустой — скрипт подождёт */
body.shot main { overflow: visible; }
body.shot main { padding: 0; container-type: normal; }   /* иначе main станет опорным блоком для position: fixed */
body.shot #model-box { position: fixed; inset: 0; height: 100vh; border: 0; border-radius: 0; grid-template-columns: 1fr; }

/* ---------------------------------------------------------------- адаптив */
@media (max-width: 1180px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 980px) {
  .side-tog { display: none; }
  html, body { height: auto; }
  body { overflow: auto; }
  .app { grid-template-columns: 1fr; height: auto; }
  main { height: auto; overflow: visible; scrollbar-gutter: auto; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); z-index: 30; transform: translateX(-102%); transition: transform .2s; border-right: 1px solid var(--border); }
  body.menu-open .side { transform: none; box-shadow: 0 0 0 100vmax var(--scrim); }
  .topbar { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 20; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; background: var(--topbar-bg); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border-subtle); }
  .topbar button { display: grid; place-items: center; width: 36px; height: 36px; background: var(--surface); border: 1px solid var(--edge); border-radius: 10px; color: var(--text); cursor: pointer; }
  .topbar svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
  .topbar b { font-size: 14px; font-weight: 700; }
  .topbar span { font: 500 11px var(--mono); color: var(--dim); }
  main { padding-inline: 20px; padding-block: 18px 40px; }
  #model-box { height: calc(100vh - 150px); height: calc(100dvh - 150px); }   /* + верхняя полоса с кнопкой меню */
}
@media (max-width: 860px) {
  .two { grid-template-columns: 1fr; }
  .cards, .objlist { grid-template-columns: 1fr; }
  #model-box { grid-template-columns: 1fr; grid-template-rows: 58vh auto; height: auto; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 600px) {
  main { padding-inline: 16px; padding-block: 16px 32px; }
  .heroimg { aspect-ratio: 4 / 3; }
  .heroimg .btn { left: 12px; bottom: 12px; }
  .doc { grid-template-columns: 44px minmax(0, 1fr); }
  .doc .acts { grid-column: 1 / -1; justify-content: flex-start; }
  .lb-bar a, .lb-bar [data-z="fit"] { display: none; }
  .vseg button span { display: none; }
  .vseg button { padding: 0 9px; }
  .vcut { top: 54px; }
  .vhint { font-size: 11.5px; gap: 3px 10px; }
  .fig b { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) { .sync-dot { animation: none; } .heroimg img, .card, .side { transition: none; } }
