/* AI-смета — компоненты. Цвета и радиусы только из tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--tx); font: 14.5px/1.5 var(--sans); -webkit-font-smoothing: antialiased;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-c) 1px, transparent 1px), linear-gradient(90deg, var(--grid-c) 1px, transparent 1px),
    linear-gradient(var(--grid-c2) 1px, transparent 1px), linear-gradient(90deg, var(--grid-c2) 1px, transparent 1px);
  background-size: var(--grid) var(--grid), var(--grid) var(--grid), var(--grid2) var(--grid2), var(--grid2) var(--grid2);
  background-attachment: fixed;
  min-height: 100vh;
  transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
}
a { color: var(--ac); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--head); letter-spacing: var(--head-ls); margin: 0; line-height: 1.2; }
h1 { font-size: clamp(24px, 3.2vw, 34px); font-weight: 650; }
h2 { font-size: 19px; font-weight: 620; }
h3 { font-size: 15.5px; font-weight: 620; }
p { margin: 0; }
code, .mono-n { font-family: var(--mono); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--tx2); }
.amber { color: var(--am); }
.bad { color: var(--er); }
.dim { color: var(--mu); }
.eyebrow { font-family: var(--mono); font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--mu); }
.wrap { width: min(1440px, 100% - 48px); margin: 0 auto; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; border-radius: var(--r-s); }   /* заметная рамка Tab (аудит 8.4) */
[hidden] { display: none !important; }

/* ── шапка ── */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--bd); }
.top .wrap { display: flex; align-items: center; gap: 14px; height: 58px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--tx); font-family: var(--mono); font-size: 13px;
  letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand .mk { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--ac); position: relative; flex: none;
  box-shadow: 0 0 0 4px var(--ac-s); }
.brand .mk::before { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--am); opacity: .85; }
.crumb { color: var(--tx2); font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumb b { color: var(--tx); font-weight: 600; }
.top .sp { flex: 1; }
.gnav { display: flex; gap: 2px; flex: none; }
.gnav .tab { padding: 6px 12px; font-size: 13.5px; }
#objSearch { width: 100%; }
.news { position: relative; margin: -4px 0 18px; padding-right: 44px; line-height: 1.5; }
.news ul { margin: 4px 0 0 18px; padding: 0; }
.news [data-x] { position: absolute; top: 6px; right: 6px; }

/* ── закреплённая панель объекта (часть C): одна строка ≈ 48 px, всегда видна при прокрутке; шапка программы на
      страницах объекта уезжает вверх — закреплена одна строка, не две ── */
body.obj-page .top { position: static; }
.tabs { position: sticky; top: 0; z-index: 21; margin-bottom: 12px; background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 0 100vmax color-mix(in srgb, var(--bg) 90%, transparent), 0 1px 0 100vmax var(--bd); clip-path: inset(0 -100vmax -1px); }
.ob-row { display: flex; align-items: center; gap: 10px; height: 48px; }
.ob-name { font-weight: 700; font-size: 14px; color: var(--tx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22ch; flex: none; }
.ob-name:hover { text-decoration: none; color: var(--ac); }
.ob-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.ob-tabs::-webkit-scrollbar { display: none; }
.ob-tabs .tab { padding: 6px 11px; font-size: 13.5px; }
.ob-act { display: flex; gap: 6px; align-items: center; flex: none; }
.ob-more { width: 32px; height: 32px; }
.ob-next { font-size: 12.5px; padding: 0 0 7px; color: var(--tx2); }
.ob-next a { font-weight: 600; }
/* на листе — тонкая полоса 8 px; содержимое выезжает поверх листа при наведении или касании (раскладка не прыгает) */
.tabs.thin { height: 8px; cursor: pointer; clip-path: none; box-shadow: none; background: transparent; }   /* clip-path обрезал бы выезд */
.tabs.thin .ob-in { position: absolute; left: 0; right: 0; top: 0; background: var(--bg); border-bottom: 1px solid var(--bd);
  box-shadow: var(--sh2); transform: translateY(-10px); opacity: 0; visibility: hidden; pointer-events: none;
  transition: transform var(--t), opacity var(--t), visibility 0s var(--t); }      /* свёрнуто — не видно и не ловит мышь */
.tabs.thin::after { content: ""; position: absolute; left: 50%; top: 2px; width: 44px; height: 4px; margin-left: -22px; border-radius: 4px; background: var(--bd2); }
.tabs.thin:hover .ob-in, .tabs.thin.open .ob-in, .tabs.thin:focus-within .ob-in { transform: none; opacity: 1; visibility: visible; pointer-events: auto;
  transition: transform var(--t), opacity var(--t), visibility 0s; }
/* «Excel ▾»: ссылки и номер в СИС в меню */
.ctx .ctx-a { display: block; padding: 7px 12px; border-radius: 6px; color: var(--tx); font-size: 13.5px; text-decoration: none; }
.ctx .ctx-a:hover, .ctx .ctx-a:focus { background: var(--ac-s); color: var(--ac); outline: none; }
.ctx .ctx-f { display: flex; align-items: center; gap: 6px; padding: 4px 12px; font-size: 13px; color: var(--tx2); }
.ctx .ctx-f .inp { width: 64px; height: 30px; }
.ctx .ctx-n { padding: 0 12px 6px; font-size: 12px; max-width: 240px; }
@media (max-width: 600px) {          /* телефон: вкладки листаются пальцем, действия — в «⋯», «Excel» на виду */
  .ob-act .wide-only { display: none; }
  .ob-name { max-width: 9ch; font-size: 13px; }
  .ob-row { gap: 6px; }
  .ob-next { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }     /* «дальше» — одной строкой */
}
/* вкладки шире полосы (телефон): затухание у края, где есть ещё вкладки (аудит 8.3) */
.ob-tabs.more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); }
.ob-tabs.more-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 44px), transparent); }
.ob-tabs.more-l.more-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent); }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 999px; color: var(--tx2);
  white-space: nowrap; font-size: 14px; border: 1px solid transparent; transition: background var(--t), color var(--t), border-color var(--t); }
.tab:hover { background: var(--sf3); color: var(--tx); text-decoration: none; }
.tab.on { background: var(--sf); color: var(--tx); border-color: var(--bd); box-shadow: var(--sh); }
.tab .cnt { font-family: var(--mono); font-size: 11.5px; padding: 0 7px; border-radius: 999px; background: var(--am-s); color: var(--am); }
.tab .cnt.ok { background: var(--ok-s); color: var(--ok); }

/* ── карточки ── */
.card { position: relative; background: var(--sf); border: 1px solid var(--bd); border-radius: var(--r); box-shadow: var(--sh);
  padding: 18px 20px; transition: box-shadow var(--t) var(--ease), border-color var(--t) var(--ease), transform var(--t) var(--ease); }
.card.edge::before { content: ""; position: absolute; left: 14px; right: 14px; top: -1px; height: 3px;
  border-radius: 0 0 3px 3px; background: var(--edge, var(--ac)); }
.card::after { content: ""; position: absolute; inset: 5px; pointer-events: none; opacity: var(--tick);
  background:
    linear-gradient(var(--bd2), var(--bd2)) 0 0 / 9px 1px no-repeat, linear-gradient(var(--bd2), var(--bd2)) 0 0 / 1px 9px no-repeat,
    linear-gradient(var(--bd2), var(--bd2)) 100% 0 / 9px 1px no-repeat, linear-gradient(var(--bd2), var(--bd2)) 100% 0 / 1px 9px no-repeat,
    linear-gradient(var(--bd2), var(--bd2)) 0 100% / 9px 1px no-repeat, linear-gradient(var(--bd2), var(--bd2)) 0 100% / 1px 9px no-repeat,
    linear-gradient(var(--bd2), var(--bd2)) 100% 100% / 9px 1px no-repeat, linear-gradient(var(--bd2), var(--bd2)) 100% 100% / 1px 9px no-repeat; }
a.card { display: block; color: inherit; }
a.card:hover, .card.hov:hover { text-decoration: none; box-shadow: var(--sh2); transform: translateY(-1px); border-color: var(--bd2); }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.card-h .sp { flex: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack > * + * { margin-top: 16px; }
.page { padding: 22px 0 60px; }
.page-h { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.page-h .sp { flex: 1; }
.lead { color: var(--tx2); max-width: 70ch; margin-top: 6px; }

/* ── кнопки и поля ── */
.btn { --b: var(--sf); --c: var(--tx); --bc: var(--bd2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: calc(var(--r-s) + 2px); border: 1px solid var(--bc); background: var(--b); color: var(--c);
  font: 600 14px/1 var(--sans); cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t), border-color var(--t); }
.btn:hover { transform: translateY(-1px); text-decoration: none; border-color: var(--ac); }
.btn:active { transform: none; }
.btn:disabled, .btn.off { opacity: .5; cursor: not-allowed; transform: none; }
.btn-p { --b: var(--ac); --c: var(--ac-tx); --bc: var(--ac); box-shadow: 0 6px 18px -8px var(--hl-glow); }
.btn-p:hover { --b: var(--ac2); --bc: var(--ac2); }
.btn-a { --b: var(--am-s); --c: var(--am); --bc: color-mix(in srgb, var(--am) 40%, transparent); }
.btn-g { --b: transparent; --bc: transparent; --c: var(--tx2); }
.btn-g:hover { --b: var(--sf3); --c: var(--tx); border-color: transparent; }
.btn-d { --c: var(--er); }
.btn-s { height: 30px; padding: 0 11px; font-size: 13px; }
.btn .ic { font-family: var(--mono); font-weight: 500; }
.inp, select.inp, textarea.inp { height: 36px; padding: 0 11px; border-radius: var(--r-s); border: 1px solid var(--bd);
  background: var(--sf2); color: var(--tx); font: 14px var(--sans); min-width: 0; transition: border-color var(--t), box-shadow var(--t); }
textarea.inp { height: auto; min-height: 64px; padding: 8px 11px; resize: vertical; width: 100%; line-height: 1.45; }
.inp:focus { outline: none; border-color: var(--ac); box-shadow: 0 0 0 3px var(--ac-s); }
.inp.num { text-align: right; width: 104px; }
.inp.bad { border-color: var(--er); box-shadow: 0 0 0 3px var(--er-s); }
label.fld { display: grid; gap: 5px; font-size: 13px; color: var(--tx2); }
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 999px; background: var(--sf2); border: 1px solid var(--bd); }
.seg button { border: 0; background: transparent; color: var(--tx2); font: 600 13px var(--sans); padding: 6px 13px; border-radius: 999px;
  cursor: pointer; transition: background var(--t), color var(--t); white-space: nowrap; }
.seg button.on { background: var(--sf); color: var(--tx); box-shadow: var(--sh); }
.seg button:disabled { opacity: .45; cursor: not-allowed; }
.iconbtn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--bd); background: var(--sf); color: var(--tx2);
  cursor: pointer; display: inline-grid; place-items: center; font-size: 16px; transition: color var(--t), border-color var(--t); }
.iconbtn:hover { color: var(--ac); border-color: var(--ac); }

/* ── метки ── */
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12.5px;
  border: 1px solid var(--bd); background: var(--sf2); color: var(--tx2); white-space: nowrap; }
button.chip { cursor: pointer; font-family: var(--sans); }
button.chip.on { border-color: var(--ac); background: var(--ac-s); color: var(--ac); }
.src { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px; font: 600 12px var(--mono); }
.src-Ч { background: var(--ac-s); color: var(--ac); }
.src-В { background: var(--sf3); color: var(--tx2); }
.src-П { background: var(--am-s); color: var(--am); }
.src-Т { background: var(--ok-s); color: var(--ok); }
.src-О { background: transparent; color: var(--ac); box-shadow: inset 0 0 0 1px var(--ac); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--mu); flex: none; }
.dot.high, .dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-s); }
.dot.mid, .dot.warn { background: var(--am); box-shadow: 0 0 0 3px var(--am-s); }
.dot.low, .dot.err { background: var(--er); box-shadow: 0 0 0 3px var(--er-s); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag.ok { background: var(--ok-s); color: var(--ok); }
.tag.warn { background: var(--am-s); color: var(--am); }
.tag.err { background: var(--er-s); color: var(--er); }
.tag.info { background: var(--ac-s); color: var(--ac); }
.tag.neu { background: var(--sf3); color: var(--tx2); }
.edited { box-shadow: inset 3px 0 0 var(--am); }

/* ── полоса фактов ── */
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--bd); border-radius: var(--r);
  background: var(--sf); box-shadow: var(--sh); overflow: hidden; }
.fact { padding: 14px 18px; border-left: 1px solid var(--bd); }
.fact:first-child { border-left: 0; }
.fact b { display: block; font: 600 24px/1.15 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.fact span { color: var(--tx2); font-size: 13px; }
.fact.warn b { color: var(--am); } .fact.ok b { color: var(--ok); } .fact.err b { color: var(--er); }

/* ── таблицы ── */
.tbl-w { overflow: auto; border: 1px solid var(--bd); border-radius: var(--r); background: var(--sf); box-shadow: var(--sh); }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { position: sticky; top: 0; z-index: 1; text-align: left; font: 600 11.5px var(--mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--mu); background: var(--sf2); padding: 9px 10px; border-bottom: 1px solid var(--bd); white-space: nowrap; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--bd); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl td.n { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.code { font-family: var(--mono); white-space: nowrap; color: var(--ac); }
.tbl tbody tr { transition: background var(--t); }
.tbl tbody tr.cl { cursor: pointer; }
.tbl tbody tr.cl:hover { background: var(--sf3); }
.tbl tbody tr.sel { background: var(--ac-s); }
.tbl tr.sec td { background: var(--sf2); font-weight: 650; color: var(--tx); padding: 10px; }
.tbl tr.mat td { color: var(--tx2); font-style: italic; }
.tbl tr.mat td.nm { padding-left: 26px; }
.tbl tr.det td { background: var(--sf2); }
.tbl .clip { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tx2); }
pre.f { margin: 0; font: 12.5px/1.5 var(--mono); white-space: pre-wrap; word-break: break-word; background: var(--sf);
  border: 1px dashed var(--bd2); border-radius: var(--r-s); padding: 8px 10px; }

/* ── лист чертежа ── */
.sheet { position: relative; background: var(--sheet-bg); border: 1px solid var(--bd); border-radius: var(--r); overflow: auto;
  box-shadow: var(--sh); max-height: min(78vh, 900px); overscroll-behavior: contain; }
.sheet .empty { min-height: 280px; }
.sheet .pg { position: relative; margin: 0 auto; transform-origin: 0 0; }
.sheet img { display: block; width: 100%; height: auto; filter: var(--sheet-filter); mix-blend-mode: var(--sheet-blend);
  user-select: none; -webkit-user-drag: none; }
.sheet .hl, .sv .hl { position: absolute; border: 2px solid var(--hl-bd); background: var(--hl); border-radius: 5px;
  box-shadow: 0 0 0 4px var(--hl), 0 0 22px var(--hl-glow); pointer-events: none; animation: hl-in 1.1s var(--ease) 2; }
.sheet .hl-lbl, .sv .hl-lbl { position: absolute; transform: translateY(calc(-100% - 6px)); background: var(--hl-bd); color: var(--ac-tx);
  font: 600 12px var(--mono); padding: 2px 7px; border-radius: 6px; white-space: nowrap; pointer-events: none; }
.sheet .empty, .sv .empty { display: grid; place-items: center; height: 100%; color: var(--mu); padding: 24px; text-align: center; }
/* контуры помещений поверх листа; координаты — pt страницы (viewBox), толщина линий не масштабируется */
.sheet svg.ov, .sv svg.ov { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.sheet svg.ov.editing, .sv svg.ov.editing { pointer-events: auto; cursor: crosshair; touch-action: none; }
.ov .cp { pointer-events: visiblePainted; cursor: pointer; fill: var(--c, var(--mu)); fill-opacity: .1; stroke: var(--c, var(--mu));
  stroke-width: 1.5; vector-effect: non-scaling-stroke; transition: fill-opacity var(--t); }
.ov .cp:hover { fill-opacity: .22; }
.ov .cp.sel { fill-opacity: .24; stroke-width: 3; filter: drop-shadow(0 0 4px var(--hl-glow)); }
.ov .st-green { --c: var(--ok); } .ov .st-yellow { --c: var(--am); } .ov .st-red { --c: var(--er); } .ov .st-проверено { --c: var(--ac); }
.ov .st-вручную { --c: var(--ac); }
.ov .ce-poly { fill: var(--hl); stroke: var(--hl-bd); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.ov polyline.ce-poly { fill: none; }
.ov .ce-rub { stroke: var(--hl-bd); stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.ov .vx { fill: var(--sf); stroke: var(--hl-bd); stroke-width: 2; vector-effect: non-scaling-stroke; cursor: grab; }
.ov .vx:active { cursor: grabbing; }
.ov .vx.first { fill: var(--hl-bd); }
.ov .mid { fill: var(--hl-bd); fill-opacity: .35; stroke: none; cursor: copy; }
.ov .mid:hover { fill-opacity: .8; }
.ov .snapmk { fill: none; stroke: none; pointer-events: none; }
.ov .snapmk.on { stroke: var(--am); stroke-width: 2; vector-effect: non-scaling-stroke; }
.ov .snapmk.k-c { stroke: var(--ok); }

/* ── опросник заказчика (бот): QR + ссылки с «Скопировать» ── */
.svy { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 14px; align-items: start; }
.svy .qr { margin: 0; text-align: center; }
.svy .qr img { width: 128px; height: 128px; image-rendering: pixelated; background: #fff; border-radius: var(--r-s);
  border: 1px solid var(--bd); display: block; }
.svy .qr figcaption { font-size: 11.5px; margin-top: 3px; }
.lnk { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; align-items: center; }
.lnk > span { grid-column: 1 / -1; font-size: 12.5px; }
.lnk .inp { font: 12.5px var(--mono); min-width: 0; }
@media (max-width: 640px) { .svy { grid-template-columns: minmax(0, 1fr); } .svy .qr { justify-self: center; } }

/* ── экран «Проверка модели»: на всю ширину и в высоту окна (docs\Навигация.md §«Раскладка экрана»).
   Доли и высоты — переменные: раскладку меняют здесь, не в разметке ── */
body.wide .wrap { width: calc(100% - 32px); }
#app.wide { padding-bottom: 12px; }
.mv { --mv-sheet: 63fr; --mv-side: 37fr; --mv-gap: 14px;
  display: grid; grid-template-columns: minmax(0, var(--mv-sheet)) 8px minmax(300px, var(--mv-side)); gap: calc(var(--mv-gap) / 2);
  height: calc(100dvh - var(--mv-top, 130px) - 12px); min-height: 420px; }
.mv-sheet { position: relative; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.mv-sheet .sheet-bar { margin-bottom: 8px; flex-wrap: nowrap; }
.mv-sheet .sheet-bar select { min-width: 0; flex: 0 1 auto; max-width: 52%; text-overflow: ellipsis; }
.sheet-bar .zoom { font-size: 12.5px; color: var(--tx2); white-space: nowrap; }
.sv { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--sheet-bg); border: 1px solid var(--bd);
  border-radius: var(--r); box-shadow: var(--sh); touch-action: none; user-select: none; cursor: grab; outline: none; }
.sv:focus-visible { box-shadow: 0 0 0 2px var(--ac); }
.sv.pan { cursor: grabbing; }
.sv-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.sv-world img { position: absolute; display: block; filter: var(--sheet-filter); mix-blend-mode: var(--sheet-blend);
  -webkit-user-drag: none; pointer-events: none; }
.sv-world .sv-base { left: 0; top: 0; width: 100%; height: 100%; }
.sv-mm { position: absolute; right: 10px; bottom: 10px; width: 180px; background: var(--sheet-bg); border: 1px solid var(--bd2);
  border-radius: 6px; box-shadow: var(--sh2); overflow: hidden; cursor: pointer; touch-action: none; }
.sv-mm[hidden] { display: none; }
.sv-mm img { display: block; width: 100%; height: 100%; filter: var(--sheet-filter); mix-blend-mode: var(--sheet-blend); pointer-events: none; }
.sv-mm i { position: absolute; border: 2px solid var(--ac); background: color-mix(in srgb, var(--ac) 12%, transparent); border-radius: 2px; }
.sv-tip { position: fixed; z-index: 65; pointer-events: none; padding: 5px 9px; border-radius: 6px; font-size: 12.5px;
  background: var(--tx); color: var(--bg); box-shadow: var(--sh2); white-space: nowrap; }
.sv-tip[hidden] { display: none; }
.ov .om { fill: var(--ac); fill-opacity: 0; stroke: none; pointer-events: visiblePainted; cursor: pointer; }
.ov .om:hover { fill-opacity: .25; }
.sv.ruler, .sv.ruler svg.ov { cursor: crosshair; }
.ov .ru { fill: color-mix(in srgb, var(--am) 18%, transparent); stroke: var(--am); stroke-width: 2; vector-effect: non-scaling-stroke; }
.ov polyline.ru { fill: none; }
.ov .ru-rub { stroke: var(--am); stroke-width: 1.5; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.ov .ru-p { fill: var(--sf); stroke: var(--am); stroke-width: 2; vector-effect: non-scaling-stroke; }
.ov .ru-p.first { fill: var(--am); }
.ov .ru-t { fill: var(--am); font-family: var(--mono); font-weight: 600; text-anchor: middle; paint-order: stroke;
  stroke: var(--sheet-bg); stroke-width: 3px; stroke-linejoin: round; }
.btn.on { background: var(--ac-s); color: var(--ac); border-color: var(--ac); }
.sv-chk.ru { border-color: var(--am); }
.sv-chk.ru .btn-s { padding: 2px 9px; }
.ru-h, .ru-v { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.ru-v { margin-top: 4px; }
.ru-v:empty { display: none; }
.ru-cmp { flex-basis: 100%; font-size: 12px; color: var(--tx2); }
.ru-cmp.warn { color: var(--er); font-weight: 600; }
.sv-chk .cp { cursor: copy; border-bottom: 1px dashed currentColor; }
.sv-chk .cp:hover { color: var(--ac); }
.ov .ru-cal { stroke: var(--ac); stroke-width: 2; stroke-dasharray: 6 3; vector-effect: non-scaling-stroke; }
.ov .ru-cal.on { stroke-dasharray: none; }
.ov .ru-p.cal { stroke: var(--ac); }
.ov .ru-rub.cal { stroke: var(--ac); }
.ov .ru-t.cal { fill: var(--ac); }
.mv-split { cursor: col-resize; border-radius: 4px; background: transparent; touch-action: none; }
.mv-split:hover, .mv-split.on { background: var(--ac-s); }
.mv-sheet:fullscreen { background: var(--bg); padding: 10px; }
.mv-sheet:fullscreen .sv { flex: 1; height: auto; }
.sv-chk { position: absolute; left: 12px; bottom: 12px; max-width: calc(100% - 24px); padding: 7px 11px; border-radius: var(--r-s);
  background: color-mix(in srgb, var(--sf) 92%, transparent); border: 1px solid var(--bd2); box-shadow: var(--sh2); font-size: 13px; }
.sv-chk[hidden] { display: none; }
.sv-chk.ok { border-color: color-mix(in srgb, var(--ok) 60%, transparent); }
.sv-chk.warn { border-color: var(--am); }
.mv-side { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.mv-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }   /* телефон: поиск — строкой ниже */
.mv-tools .inp { flex: 1; min-width: 80px; }
.mv-tep { font-size: 12.5px; }
.sel-card { padding: 12px 14px; }
.sel-card .big { font-size: 22px; font-weight: 600; margin: 2px 0; }
.sel-card .hint:not(:empty) { margin-top: 6px; font-size: 12.5px; }
.l1, .l2 { display: flex; gap: 6px; align-items: baseline; min-width: 0; }
.l1 .sp { flex: 1; }
.l1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.no { font: 600 12px var(--mono); color: var(--tx2); min-width: 1.6em; }
.mv-list { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; border: 1px solid var(--bd); border-radius: var(--r);
  background: var(--sf); overscroll-behavior: contain; }
.mv-list .it { padding: 7px 12px 8px; border-bottom: 1px solid var(--bd); cursor: pointer; }
.mv-list .it:hover { background: var(--sf3); }
.mv-list .it.sel { background: var(--ac-s); box-shadow: inset 3px 0 0 var(--ac); }
.mv-list .it.edited .l1 b::after { content: " ✎"; color: var(--am); font-weight: 400; }
.mv-list .l2 { font: 12.5px var(--mono); color: var(--tx2); margin-top: 2px; flex-wrap: wrap; gap: 0 4px; }
.mv-list .l2 .from { font-family: var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.ed { color: var(--tx); border-bottom: 1px dashed var(--bd2); cursor: text; }
.ed:hover { color: var(--ac); border-bottom-color: var(--ac); }
.ed.nofin { color: var(--mu); font-family: var(--sans); border-bottom-style: dotted; }
.inp.inl { width: 92px; padding: 2px 6px; font-size: 12.5px; height: auto; }
select.inp.inl { width: auto; }
/* фото или скан листа — как есть, без «негатива» тёмной темы (она для линий чертежа) */
.sv.photo { --sheet-filter: none; --sheet-blend: normal; --sheet-bg: #fff; }
/* Калькуляторы — вариант А (docs\Калькуляторы-макеты.html): вкладки сверху, поля слева, эскиз и итоги справа */
.calc-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--tx2); margin: 0 0 10px; }
.calc-legend i { display: inline-block; width: 22px; border-top: 2px solid; vertical-align: middle; margin-right: 6px; }
.calc-legend i.in { color: var(--ac); } .calc-legend i.out { color: var(--am); }
.calc-groups { flex-wrap: wrap; border-radius: var(--r-s); }
/* каталог калькуляторов слева: раздел (моно, прописные) → подгруппа → пункты; на узком — кнопка «Калькулятор ▾» */
.cal { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 14px; align-items: start; }
.cal .va { margin-top: 0; }
.ccat { padding: 10px; position: sticky; top: 70px; max-height: calc(100vh - 90px); overflow: auto; }
.ccat-t { display: none; width: 100%; justify-content: flex-start; text-align: left; }
.ccat-a { margin-left: auto; color: var(--tx2); }
.ccat #cFind { width: 100%; height: 32px; margin-bottom: 6px; }
.cc-s + .cc-s { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--bd); }
.cc-h { font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ac); padding: 4px 6px 2px; }
.cc-gt { font-size: 11.5px; color: var(--mu); padding: 6px 6px 2px; }
.cc-i { display: block; width: 100%; text-align: left; padding: 4px 8px 4px 14px; border: 0; border-radius: 6px; background: none;
  color: var(--tx2); font: inherit; font-size: 13px; line-height: 1.35; cursor: pointer; }
.cc-i:hover { background: var(--sf3); color: var(--tx); }
.cc-i.on { background: var(--ac-s); color: var(--ac); font-weight: 600; }
@media (max-width: 900px) {
  .cal { grid-template-columns: minmax(0, 1fr); }
  .ccat { position: static; max-height: none; padding: 0; background: none; border: 0; box-shadow: none; }
  .ccat::after, .ccat::before { display: none; }
  .ccat-t { display: flex; gap: 6px; }
  .ccat-b { display: none; margin-top: 8px; padding: 10px; border: 1px solid var(--bd); border-radius: var(--r-s); background: var(--sf); }
  .ccat.open .ccat-b { display: block; }
}
.calc-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0 0; }
.calc-i { padding: 5px 11px; border: 1px solid var(--bd); border-radius: 999px; background: var(--sf); color: var(--tx2);
  font: 500 13px var(--sans); cursor: pointer; }
.calc-i:hover { border-color: var(--ac); color: var(--ac); }
.calc-i.on { background: var(--ac-s); border-color: var(--ac); color: var(--ac); font-weight: 650; }
.va { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 14px; align-items: start; margin-top: 12px; }
.va > * { min-width: 0; }
.va .pane { padding: 12px 14px; }
.va .pane h3 { margin: 0 0 6px; font-size: 15px; }
.va .right { display: grid; gap: 14px; min-width: 0; }
.cf { display: grid; grid-template-columns: minmax(0, 1fr) 128px; gap: 4px 10px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--bd); }
.cf:last-child { border-bottom: 0; }
.cf.wide { grid-template-columns: minmax(0, 1fr); }
.cf label { font-size: 13px; color: var(--tx2); }
.cf .csrc { grid-column: 1 / -1; font-size: 11.5px; color: var(--ok); overflow-wrap: anywhere; }
.cf .csrc:empty { display: none; }
.cinp { display: flex; align-items: center; border: 1px solid var(--bd2); border-radius: 8px; background: var(--sf); overflow: hidden; }
.cinp:focus-within { border-color: var(--ac); box-shadow: 0 0 0 3px var(--ac-s); }
.cinp input, .cinp select[data-f] { width: 100%; border: 0; background: transparent; color: var(--tx); font: 14px var(--mono); padding: 6px 8px;
  text-align: right; outline: none; min-width: 0; }
.cinp span, .cu { font: 12px var(--mono); color: var(--mu); padding: 0 7px 0 2px; border: 0; background: transparent; white-space: nowrap; }
.cu { color: var(--ac); cursor: pointer; outline: none; }
.calc-chips { grid-column: 1 / -1; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.calc-src { cursor: pointer; font-size: 12px; }
.calc-src:hover { border-color: var(--ac); color: var(--ac); }
.mini-btn { border: 1px solid var(--bd); background: var(--sf2); color: var(--tx2); font: 12px var(--sans); padding: 3px 8px; border-radius: 7px; cursor: pointer; }
.mini-btn:hover { color: var(--ac); border-color: var(--ac); }
.calc-t { border-collapse: collapse; }
.calc-t th { font: 500 12px var(--sans); color: var(--tx2); text-align: left; padding: 0 4px 2px; }
.calc-t td { padding: 2px 4px 2px 0; }
.calc-t .inp { width: 88px; max-width: 100%; }
.calc-chips .chip { white-space: normal; text-align: left; max-width: 100%; height: auto; }   /* «проёмы модели: окна, витражи…» — переносом */
@media (max-width: 600px) {          /* таблица проёмов (3 поля + ✕) — в ширину поля, не шире экрана */
  .calc-t { width: 100%; table-layout: fixed; }
  .calc-t td:last-child, .calc-t th:last-child { width: 34px; }
  .calc-t .inp { width: 100%; }
}
.cres { width: 100%; border-collapse: collapse; }
.cres td { padding: 7px 6px; border-bottom: 1px solid var(--bd); vertical-align: top; }
.cres tr:last-child td { border-bottom: 0; }
.cres .v { font: 600 15px var(--mono); color: var(--am); white-space: nowrap; text-align: right; }
.cres .u { font: 12px var(--mono); color: var(--mu); white-space: nowrap; }
.cres .x { display: block; margin-top: 2px; font: 11.5px var(--mono); color: var(--mu); overflow-wrap: anywhere; }
.cres .x code { cursor: copy; border-bottom: 1px dashed currentColor; }
.cres .note-x { font-family: var(--sans); }
.cres .act { white-space: nowrap; text-align: right; }
.cres .calc-take td { background: var(--sf2); }
/* эскиз: свои цвета листа (как в макете), обе темы */
.csheet { --ink: #3a4350; --hatch: #c9bfa9; --paper: #fffdf8; background: var(--paper); border: 1px solid var(--bd); border-radius: 12px; overflow: hidden; }
[data-theme="dark"] .csheet { --ink: #c9c4b8; --hatch: #4f535b; --paper: #202329; }
.csheet[hidden] { display: none; }
.csheet svg { display: block; width: 100%; height: auto; }
.csheet .sk-line { stroke: var(--ink); fill: none; stroke-width: 1.6; stroke-linejoin: round; }
.csheet .sk-thin { stroke: var(--ink); fill: none; stroke-width: .8; opacity: .55; }
.csheet .sk-axis { stroke: var(--mu); stroke-width: .8; stroke-dasharray: 10 3 2 3; fill: none; }
.csheet .sk-fill { stroke: var(--ink); stroke-width: 1.3; }
.csheet .sk-fill:not([fill]) { fill: var(--sf3); }
.csheet .sk-soil { stroke: none; }
.csheet .dim { color: inherit; }
.csheet .dim line { stroke-width: .9; }
.csheet .dim.in line, .csheet .dim.in path { stroke: var(--ac); } .csheet .dim.in text { fill: var(--ac); }
.csheet .dim.out line, .csheet .dim.out path { stroke: var(--am); } .csheet .dim.out text { fill: var(--am); }
.csheet .dim text { font: 600 12.5px var(--mono); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
.csheet .sk-cap { font: 11px var(--mono); fill: var(--mu); }
.csheet .sk-big { font: 600 13px var(--mono); fill: var(--am); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
.csheet .sk-in { font: 600 12.5px var(--mono); fill: var(--ac); paint-order: stroke; stroke: var(--paper); stroke-width: 4px; }
.csheet .sk-dash { stroke: var(--ink); fill: none; stroke-width: 1.1; stroke-dasharray: 6 4; opacity: .75; }
.csheet .sk-hl { stroke: var(--am); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.csheet .sk-hl-fill { stroke: var(--am); stroke-width: 1.6; }
.csheet .sk-band { stroke: var(--hatch); stroke-width: 10; fill: none; stroke-linecap: square; }
.calc-demo { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 12px; }
@media (max-width: 600px) {          /* эскиз 640 ед. ужат до ~340 px: шрифт подписей — в единицах рисунка крупнее */
  .csheet .dim text { font-size: 20px; stroke-width: 6px; }
  .csheet .sk-big, .csheet .sk-in { font-size: 21px; stroke-width: 6px; }
  .csheet .sk-cap { font-size: 17px; }
  /* итог на телефоне: подпись и формула — во всю ширину, под ними число, ед. и кнопки (иначе таблица шире экрана) */
  .cres tr { display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: baseline; border-bottom: 1px solid var(--bd); }
  .cres tr[hidden] { display: none; }
  .cres tr:last-child { border-bottom: 0; }
  .cres td { border-bottom: 0; }
  .cres td:first-child { grid-column: 1 / -1; }
  .cres .v { text-align: left; }
}
@media (max-width: 820px) {
  .va { grid-template-columns: minmax(0, 1fr); }
  .cf { grid-template-columns: minmax(0, 1fr) 118px; }
}
/* блок «что прочитано из комплекта» */
.kit-g { margin-top: 4px; font-size: 13.5px; }
.kit-g summary { cursor: pointer; }
.kit-g ul { margin: 4px 0 6px 18px; padding: 0; color: var(--tx2); font-size: 13px; }
/* окно «Занести» (рулетка) */
.dlg { width: min(580px, calc(100% - 32px)); max-height: calc(100% - 32px); padding: 16px 18px; color: var(--tx); background: var(--sf);
  border: 1px solid var(--bd2); border-radius: var(--r); box-shadow: var(--sh2);
  margin: 6vh auto auto; }            /* прижато к верху: при смене вкладки высота меняется, а кнопки не уезжают (аудит 5.3) */
.dlg::backdrop { background: rgb(0 0 0 / .38); }
.rn-row { margin-top: 8px; flex-wrap: nowrap; }     /* имя помещения в карточке (аудит 3.2) */
/* «Обработка»: плашка замены чертежей (Ж-4), история расчётов (Ж-3) */
.repl-b { margin: 0 0 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.hist-i { padding-bottom: 8px; border-bottom: 1px solid var(--bd); }
.hist-i:last-child { border-bottom: 0; }
/* строки ведомости вручную (Ж-1, Ж-2): исключённая — зачёркнута; «⋯» у строки; поиск расценки */
#vor tr.excl td { color: var(--mu); }
#vor tr.excl td:not(:last-child) { text-decoration: line-through; text-decoration-color: var(--mu); }
#vor tr.excl .tag { text-decoration: none; display: inline-block; }
#vor .row-more { width: 28px; height: 28px; font-size: 15px; }
.aw-list { display: grid; gap: 2px; max-height: 220px; overflow: auto; }
.aw-i { text-align: left; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--tx); font: inherit; font-size: 13px; cursor: pointer; }
.aw-i:hover, .aw-i:focus { background: var(--ac-s); }
.floor-h { margin-top: 8px; flex-wrap: wrap; align-items: center; }   /* высота этажа одним полем (аудит 2.3) */
.floor-h .inp.num { width: 84px; }
.fin-bulk { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; }   /* отделка многим (1.16) */
.fin-pick { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.rn-row .inp { flex: 1; min-width: 0; }
.dlg .seg { flex-wrap: wrap; border-radius: var(--r-s); }
.ctx { position: fixed; z-index: 70; min-width: 190px; padding: 4px; background: var(--sf); border: 1px solid var(--bd2);
  border-radius: var(--r-s); box-shadow: var(--sh2); }
.ctx button { display: block; width: 100%; text-align: left; padding: 7px 12px; background: none; border: 0; border-radius: 6px;
  color: var(--tx); font: inherit; font-size: 13.5px; cursor: pointer; }
.ctx button:hover { background: var(--ac-s); color: var(--ac); }
.ctx button.bad, .ctx button.bad:hover, .ctx button.bad:focus { color: var(--er); }
.ctx button.bad:hover, .ctx button.bad:focus { background: var(--er-s); outline: none; }
/* удаление объекта: «⋯» на карточке списка (кнопка не может быть внутри ссылки — рядом, поверх угла) и окно подтверждения */
.obj { position: relative; }
.obj-more { position: absolute; top: 50%; right: 8px; transform: translateY(-50%); width: 30px; height: 30px; font-size: 17px; line-height: 1; }

/* ── главная: строка заголовка, три шага, форма по кнопке, объекты строками таблицы ── */
.lh { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.lh h1 { font-size: 24px; }
.lh-n { font: 600 12.5px var(--mono); color: var(--tx2); background: var(--sf3); border-radius: 999px; padding: 1px 9px; }
.lh #objSearch { width: min(340px, 100%); height: 34px; margin-left: 8px; }
.lh .sp { flex: 1; }
.howto { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--bd); border-radius: var(--r-s); background: var(--sf); }
.howto li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 14px; font-size: 13px; color: var(--tx2); line-height: 1.4; }
.howto li + li { border-left: 1px solid var(--bd); }
.howto b { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px;
  font: 600 11.5px var(--mono); color: var(--ac); border: 1px solid var(--ac); }
.howto em { font-style: normal; font-weight: 600; color: var(--tx); }
.newobj { margin-bottom: 16px; padding: 16px 18px; }
.newobj-h { font-size: 17px; margin-bottom: 12px; }
.newobj-g { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 12px; margin-bottom: 12px; }
.newobj-go { margin-top: 12px; }
.newobj-go #nNote { font-size: 12.5px; flex: 1; min-width: 220px; }
#nErr { color: var(--er); }
.olist { border: 1px solid var(--bd); border-radius: var(--r-s); background: var(--sf); overflow: hidden; }
.orow { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1.6fr) 64px 80px 82px 132px 116px; gap: 14px;
  align-items: center; padding: 9px 46px 9px 14px; color: var(--tx); font-size: 13.5px; }
a.orow:hover { background: var(--sf3); text-decoration: none; }
.obj + .obj, .ohead + .obj { border-top: 1px solid var(--bd); }
.ohead { padding-top: 7px; padding-bottom: 7px; background: var(--sf2); font: 600 11px var(--mono); letter-spacing: .06em;
  text-transform: uppercase; color: var(--mu); }
.orow .n { text-align: right; font-variant-numeric: tabular-nums; }
.orow .n b { font: 600 14px var(--mono); }
.orow .n i { display: none; font-style: normal; }
.orow .n.warn b { color: var(--am); }
.o-nm { min-width: 0; }
.o-nm b, .o-nm small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-nm b { font-weight: 600; }
.o-nm small { color: var(--tx2); font-size: 12px; }
.o-f { font: 12px var(--mono); color: var(--tx2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.o-st { grid-column: span 3; text-align: right; }
.o-t { font: 12px var(--mono); color: var(--tx2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.svy-t .tag { font-weight: 500; }
.olist-empty { padding: 14px; margin: 0; }
@media (max-width: 1100px) {      /* без колонки «Чертежи» */
  .orow { grid-template-columns: minmax(0, 1fr) 64px 80px 82px 132px 116px; }
  .o-f, .ohead span:nth-child(2) { display: none; }
}
@media (max-width: 760px) {       /* телефон: две строки — название; числа с подписями, опросник, дата */
  .howto { grid-template-columns: minmax(0, 1fr); }
  .howto li + li { border-left: 0; border-top: 1px solid var(--bd); }
  .newobj-g { grid-template-columns: minmax(0, 1fr); }
  .olist .ohead { display: none; }
  .orow { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 10px 46px 10px 14px; }
  .o-nm { flex-basis: 100%; }
  .orow .n i { display: inline; color: var(--tx2); font-size: 12px; }
  .orow .n b { font-size: 13px; }
  .o-st { text-align: left; }
  .o-t { margin-left: auto; }
  .lh #objSearch { order: 5; width: 100%; margin-left: 0; }
}
.dlg-s { width: min(440px, calc(100% - 32px)); }
/* заметки исполнителя (блокнот объекта) */
textarea.inp.nt { min-height: 96px; resize: vertical; font-size: 14px; line-height: 1.5; }
.nt-f { margin-top: 8px; font-size: 12.5px; }
.nt-f .dim { flex: 1; min-width: 200px; }
.nt-st { font-size: 12.5px; }
.nt-st.err { color: var(--er); }
.dlg-ans { width: min(860px, calc(100% - 32px)); max-height: calc(100vh - 48px); overflow: auto; }
.ans-h { font-size: 15px; margin-top: 18px; }
.ans { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 6px; }
.ans th, .ans td { text-align: left; vertical-align: top; padding: 6px 8px; border-top: 1px solid var(--bd); }
.ans tbody th { font-weight: 500; color: var(--tx2); width: 38%; }
.ans-r tbody th { width: auto; color: var(--tx); }
.ans thead th { font: 600 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--mu); border-top: 0; }
.ans td.warn { color: var(--am); }
.ans-x { font-size: 12px; font-weight: 400; margin-top: 2px; }
@media (max-width: 640px) { .ans-r thead { display: none; } .ans-r tr { display: grid; grid-template-columns: 1fr 1fr; } .ans-r th { grid-column: 1 / -1; } }
.dlg-s h2 { font-size: 18px; overflow-wrap: anywhere; }
.btn-del { --b: var(--er); --bc: var(--er); --c: var(--sf); }
.btn-del:hover { --b: color-mix(in srgb, var(--er) 85%, var(--tx)); --bc: var(--b); }
.l1 .num, .l1 .tag { white-space: nowrap; }
@media (max-width: 1199px) {      /* < 1200 px — список под листом, страница прокручивается */
  .mv { display: block; height: auto; }
  .mv-split { display: none; }
  .sv { height: min(78vh, calc((100vw - 32px) / 1.414)); flex: none; }
  .mv-sheet { margin-bottom: 12px; }
  .mv-list { max-height: none; overflow: visible; }
}
@media (max-width: 640px) {       /* телефон: строка листа в две строки, лист выше, сверка — под листом */
  .mv-sheet .sheet-bar { flex-wrap: wrap; }
  .mv-sheet .sheet-bar select { order: -1; flex: 1 1 100%; max-width: none; }
  .sv { height: min(62vh, 560px); }
  .sv-chk { position: static; margin-top: 8px; max-width: none; box-shadow: none; }
  .mv-list .l1 .dim { display: none; }
}
.ind-card { padding: 16px 18px; }
.ind-big { margin: 6px 0 2px; }
.ind-big b { font-size: clamp(24px, 2.4vw, 32px); font-weight: 600; letter-spacing: -.02em; }
.tbl.ind td:first-child { min-width: 220px; }
fieldset.opts { border: 1px solid var(--bd); border-radius: var(--r-s); padding: 8px 12px 12px; margin: 0; min-width: 0; }
fieldset.opts legend { font: 600 11.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--mu); padding: 0 6px; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 7px 8px; border-radius: var(--r-s); cursor: pointer; }
.opt:hover { background: var(--sf3); }
.opt input { margin-top: 3px; accent-color: var(--ac); }
.opt.off { opacity: .55; cursor: not-allowed; }
.opt.off:hover { background: transparent; }
.sheet-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.note { padding: 9px 12px; border-radius: var(--r-s); background: var(--am-s); color: var(--tx); font-size: 13px; border: 1px solid color-mix(in srgb, var(--am) 30%, transparent); }
.note.info { background: var(--ac-s); border-color: color-mix(in srgb, var(--ac) 30%, transparent); }
.note.err { background: var(--er-s); border-color: color-mix(in srgb, var(--er) 35%, transparent); }
.note.ok { background: var(--ok-s); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
@keyframes hl-in { 0% { box-shadow: 0 0 0 0 var(--hl-glow), 0 0 0 var(--hl-glow); } 50% { box-shadow: 0 0 0 10px var(--hl), 0 0 30px var(--hl-glow); } 100% { box-shadow: 0 0 0 4px var(--hl), 0 0 22px var(--hl-glow); } }

/* ── шаги конвейера ── */
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px dashed var(--bd); }
.steps li:first-child { border-top: 0; }
.steps .ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 600 13px var(--mono);
  background: var(--sf3); color: var(--mu); }
.steps .готово .ic, .steps .есть .ic { background: var(--ok-s); color: var(--ok); }
.steps .ошибка .ic { background: var(--er-s); color: var(--er); }
.steps .нет .ic, .steps .пропущен .ic { background: var(--sf3); color: var(--mu); }
.steps .ждёт .ic { background: var(--ac-s); color: var(--ac); animation: pulse 1.2s ease-in-out infinite; }
.steps .t { font-weight: 600; }
.steps .d { color: var(--tx2); font-size: 13.5px; }
.steps .ошибка .d { color: var(--er); }
@keyframes pulse { 50% { opacity: .45; } }

/* ── вопросы ── */
.q { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; }
.q .qn { font: 600 13px var(--mono); color: var(--mu); padding-top: 2px; }
.q .what { font-weight: 550; }
.q .meta { color: var(--tx2); font-size: 13px; margin-top: 4px; }
.q .ans { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.q.done { opacity: .78; }
.q.done .what { text-decoration: none; }

/* ── загрузка файлов ── */
.drop { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px;
  border: 1px dashed var(--bd2); border-radius: var(--r-s); background: var(--sf2); transition: border-color var(--t), background var(--t); }
.drop.over { border-color: var(--ac); background: var(--ac-s); }
.drop.has { border-style: solid; }
.drop .ext { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font: 600 11px var(--mono);
  background: var(--sf); border: 1px solid var(--bd); color: var(--tx2); }
.drop .nm { font-weight: 600; }
.drop .sub { color: var(--tx2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.drop input[type=file] { display: none; }

/* ── всплывающее сообщение ── */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 20px); opacity: 0; z-index: 50; max-width: min(560px, 100% - 32px);
  background: var(--sf); color: var(--tx); border: 1px solid var(--bd2); border-radius: var(--r); box-shadow: var(--sh2);
  padding: 12px 16px; transition: opacity var(--t), transform var(--t) var(--ease); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.err { border-color: var(--er); }
.busy { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; background: linear-gradient(90deg, transparent, var(--ac), var(--am), transparent);
  background-size: 50% 100%; background-repeat: no-repeat; animation: busy 1.1s linear infinite; }
@keyframes busy { from { background-position: -50% 0; } to { background-position: 150% 0; } }
/* ── ход обработки: размерная линия с засечками (листы или шаги) и персонаж (по очереди, рисунки в app.js PERS) ── */
.prog { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 49; width: min(620px, 100% - 32px);
  background: var(--sf); color: var(--tx); border: 1px solid var(--bd2); border-left: 3px solid var(--ac); border-radius: var(--r);
  box-shadow: var(--sh2); padding: 12px 16px 10px; font-size: 13.5px; }
.prog[hidden] { display: none; }
.prog.static { position: static; transform: none; width: auto; box-shadow: none; }
.prog.fail { border-left-color: var(--er); }
.prog.done { border-left-color: var(--ok); }
.prog-h { display: flex; gap: 8px; align-items: center; }
.prog-h .sp { flex: 1; }
.prog-h .iconbtn { width: 28px; height: 28px; }
.pg-time { color: var(--tx2); }
.trk { position: relative; height: 82px; margin: 2px 6px 4px 6px; }
.trk-line { position: absolute; left: 0; right: 0; bottom: 20px; border-top: 1px solid var(--tx2); }
.trk-done { position: absolute; left: 0; bottom: 19px; height: 3px; width: 0; background: var(--ac); border-radius: 2px;
  transition: width .9s linear; }
.trk-ticks .tk { position: absolute; bottom: 14px; width: 1px; height: 13px; background: var(--tx2); transform: translateX(-50%) rotate(45deg); }
.trk-ticks .tl { position: absolute; bottom: 0; transform: translateX(-50%); font: 10.5px var(--mono); color: var(--tx2); white-space: nowrap; }
.trk-ticks .tl.on { color: var(--ac); }
/* персонаж: viewBox -46…50 × -58…2, ноги (0,0) — ровно на линии; позу и движение задаёт app.js (persPose) */
.pr-w { position: absolute; bottom: 20px; left: 0; width: 96px; transform: translateX(-47.9%); transition: left .9s linear; pointer-events: none; }
.pers { display: block; width: 100%; height: auto; overflow: visible; }
.prog.fail .pers { filter: grayscale(.7); opacity: .8; }
.stamp { position: absolute; right: 84px; top: 8px; padding: 1px 9px; border: 2px solid var(--ac); border-radius: 4px; color: var(--ac);
  font: 700 13px var(--mono); letter-spacing: .22em; opacity: 0; transform: rotate(-8deg) scale(1.7); pointer-events: none;
  transition: opacity .25s, transform .25s var(--ease); }
.prog.done .stamp { opacity: 1; transform: rotate(-8deg) scale(1); }
.pg-sub { font-weight: 600; min-height: 1em; }
.pg-note { font-size: 12.5px; margin-top: 2px; }
.pg-steps { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 12.5px; color: var(--tx2); }
.pg-steps li.ok::before { content: "✓ "; color: var(--ok); }
.pg-steps li.cur { color: var(--tx); }
.pg-act { margin-top: 8px; }
/* без движения при prefers-reduced-motion: персонаж стоит (app.js не запускает кадры), остаются числа */
@media (prefers-reduced-motion: reduce) {
  .trk-done, .pr-w, .stamp { animation: none !important; transition: none !important; }
}

/* ── появление (один раз; без JS и при reduced motion — сразу видно) ── */
.js .rise { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.js .quiet .rise { animation: none; }   /* после пересчёта экран не «появляется» заново */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ── телефон ── */
@media (max-width: 900px) {
  .sheet { max-height: 62vh; }
  .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g2 { grid-template-columns: minmax(0, 1fr); }        /* две колонки уже 900 px сжимали поля файлов в столбик */
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  .wrap { width: calc(100% - 32px); }
  .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact:nth-child(3) { border-left: 0; }
  .fact:nth-child(n+3) { border-top: 1px solid var(--bd); }
  .fact b { font-size: 20px; }
  .card { padding: 14px 14px; }
  .top .wrap { height: 54px; gap: 10px; }
  .brand span.w { display: none; }
  .drop { grid-template-columns: 36px minmax(0, 1fr); }
  .drop .act { grid-column: 1 / -1; }
  .tbl .clip { max-width: 180px; }
  .hide-s { display: none; }
  /* ведомость на телефоне — строка-карточка: № · код · кол-во · ед · уверенность / наименование / запись для СИС */
  #vor, #vor tbody, #vor tr.sec, #vor tr.det, #vor tr.sec td, #vor tr.det td { display: block; }
  #vor thead { display: none; }
  #vor tr.cl { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto 12px; column-gap: 8px; row-gap: 3px;
    padding: 9px 12px; border-bottom: 1px solid var(--bd); align-items: baseline; }
  #vor tr.cl td { padding: 0; border: 0; }
  #vor tr.cl td:nth-child(3) { grid-column: 2 / -1; grid-row: 2; }
  #vor tr.cl td:nth-child(6) { grid-column: 2 / -1; grid-row: 3; color: var(--tx2); font-size: 12.5px; }
  #vor tr.cl td:nth-child(6)::before { content: "для СИС: "; font-family: var(--sans); color: var(--mu); }
  #vor tr.mat { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 6px 12px 6px 40px; border-bottom: 1px solid var(--bd); }
  #vor tr.mat td { padding: 0; border: 0; }
  #vor tr.mat td:empty { display: none; }
  #vor tr.mat td.nm { padding-left: 0; flex-basis: 100%; }
  #vor tr.det td:first-child { display: none; }
  .tbl.ind td:first-child { min-width: 0; }
  .tbl.ind td, .tbl.ind th { padding: 7px 6px; }
  .tbl.ind td:first-child .num { display: none; }                 /* формула — на широком экране */
  .tbl.ind td:last-child .tag { font-size: 0; width: 10px; height: 10px; padding: 0; box-shadow: inset 0 0 0 5px currentColor; }
  .tbl.ind th:last-child { font-size: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
