/* ── вкладка «ПТО» карточки объекта ─────────────────────────
   Вкладка занимает тело карточки целиком: сверху полоса видов и файла
   проекта, под ней — инструменты вида, ниже прокручивается только сам
   вид. Заголовки таблиц прилипают к верху прокрутки, как в прайсах. */
.pto-host { height: 100%; }
.pto { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.pto-bar {
  flex: none; display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  padding: 9px var(--gut); border-bottom: 1px solid var(--line2);
}
.pto-src { margin-left: auto; display: flex; align-items: center; gap: 9px; min-width: 0; }
.pto-file {
  max-width: 252px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; color: var(--ink2);
}
.pto-src .role-sel { max-width: 270px; }
.pto-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pto-tools {
  flex: none; display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 8px var(--gut); border-bottom: 1px solid var(--line2);
}
.pto-tools .grow { flex: 1; }
.pto-tools .pg-find input { width: 198px; }
.pto-main { flex: 1; min-height: 0; overflow: auto; }
.pto-saved { white-space: nowrap; }
.pto-saved.bad { color: var(--bad); }
.pto .btn-brand.sm svg, .pto .btn-ghost.sm svg { width: 12.5px; height: 12.5px; fill: none;
  stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pto .btn-brand.sm, .pto .btn-ghost.sm { display: inline-flex; align-items: center; gap: 5.5px; }
.pto-hint {
  margin: 12.5px var(--gut) 3.5px; padding: 9px 12.5px; border-radius: var(--r-sm);
  background: var(--raise); color: var(--ink2); font-size: 11px; line-height: 1.5;
}
.pto-h4 {
  margin: 0; padding: 16px var(--gut) 7px;
  font: 600 9.5px var(--sans); letter-spacing: .07em; text-transform: uppercase; color: var(--ink3);
}

/* ── состав проекта ── */
.pto-grp { border-bottom: 1px solid var(--line2); }
.pto-grp-h {
  display: flex; align-items: center; gap: 7px; width: 100%;
  padding: 11px var(--gut); border: 0; background: none; cursor: pointer;
  font: inherit; font-size: 11.5px; color: var(--ink); text-align: left;
}
.pto-grp-h:hover { background: var(--raise); }
.pto-grp-h svg { width: 12.5px; height: 12.5px; fill: none; stroke: var(--ink3); stroke-width: 2;
  transition: transform .15s var(--ease); }
.pto-grp.open > .pto-grp-h svg { transform: rotate(90deg); }
.pto-grp-h i { font-style: normal; font-size: 10.5px; color: var(--ink3); }
.tbl.pto-sheets thead th { top: 0; }
.tbl.pto-sheets tbody td { height: 36px; padding-top: 2.5px; padding-bottom: 2.5px; }
.pto-sheets .pto-no { color: var(--ink3); font-variant-numeric: tabular-nums; }
.pto-sel {
  width: 100%; height: 27px; padding: 0 5.5px; border: 1px solid transparent;
  border-radius: var(--r-sm); background: transparent; color: var(--ink2);
  font: inherit; font-size: 11px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pto-sel:hover { border-color: var(--line2); }
.pto-edited td:first-child { box-shadow: inset 3px 0 0 var(--brand-soft); }
.pto-open { display: inline-flex; align-items: center; gap: 3.5px; white-space: nowrap; }
.pto-open svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.pto-blind {
  display: inline-block; margin-left: 5.5px; padding: 0 5.5px; border-radius: 5.5px;
  background: var(--warn-soft); color: var(--warn); font-size: 9.5px; font-style: normal;
}
.pto-matrix-wrap { padding: 0 var(--gut) 14.5px; overflow-x: auto; }
.pto-matrix { border-collapse: separate; border-spacing: 0; font-size: 11px; }
.pto-matrix th, .pto-matrix td {
  border-bottom: 1px solid var(--line2); border-right: 1px solid var(--line2);
  padding: 4.5px 7px; vertical-align: top; text-align: left;
}
.pto-matrix thead th {
  background: var(--raise); font-weight: 600; color: var(--ink2); white-space: nowrap;
  border-top: 1px solid var(--line2);
}
.pto-matrix th:first-child { border-left: 1px solid var(--line2); }
.pto-matrix tbody th { font-weight: 600; color: var(--ink2); white-space: nowrap; background: var(--card); }
.pto-matrix td { min-width: 135px; }
.pto-chip {
  display: inline-block; margin: 1px 2.5px 1px 0; padding: 2px 6.5px; border-radius: 5.5px;
  border: 1px solid var(--line2); background: var(--card); color: var(--ink2);
  font: inherit; font-size: 10.5px; cursor: pointer;
}
.pto-chip:hover { border-color: var(--brand); color: var(--brand-deep); background: var(--brand-tint); }
.pto-chip-plan_light { border-color: var(--info-soft); }
.pto-chip-plan_power { border-color: var(--ok-soft); }
/* Кнопка секции живёт в шапке столбца: отсюда её и ищут, глядя на сетку. */
.pto-sec-pdf {
  margin-left: 3.5px; padding: 1px 5.5px; border-radius: 5.5px;
  border: 1px solid var(--line2); background: var(--card); color: var(--ink3);
  font: inherit; font-size: 9.5px; font-weight: 600; letter-spacing: .03em; cursor: pointer;
}
.pto-sec-pdf:hover { border-color: var(--brand); color: var(--brand-deep); background: var(--brand-tint); }
.pto-sec-pdf:disabled { opacity: .5; cursor: default; }
.pto-sec-pdf:disabled:hover { border-color: var(--line2); color: var(--ink3); background: var(--card); }
/* Полоса скачивания книги — рядом с её кнопкой. Секция весит 10–20 МБ,
   весь проект под 60: без полосы кажется, что платформа зависла. Пока
   сервер собирает книгу и размер ещё не известен, полоса бегает. */
.pto-pdf-prog {
  display: inline-flex; align-items: center; gap: 5.5px; margin-left: 5.5px;
  vertical-align: middle; white-space: nowrap;
  font-size: 9.5px; font-weight: 600; color: var(--ink3); font-variant-numeric: tabular-nums;
}
.pto-tools .pto-pdf-prog { margin: 0 3.5px 0 0; font-size: 10.5px; }
/* В шапке сетки полоса встаёт справа от кнопки, но места в столбце не
   занимает: на узком экране столбец иначе раздался бы на время скачивания
   и сетка дёрнулась. Что не влезло — срезает сама клетка шапки. */
.pto-matrix thead th { position: relative; overflow: hidden; }
.pto-matrix thead .pto-pdf-prog { position: absolute; }
.pto-pdf-bar {
  position: relative; width: 45px; height: 4.5px; border-radius: 999px;
  background: var(--box-bg); overflow: hidden;
}
.pto-tools .pto-pdf-bar { width: 90px; }
.pto-pdf-bar i {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: var(--brand); transition: width .15s linear;
}
.pto-pdf-prog.wait .pto-pdf-bar i { width: 40% !important; animation: ptoPdfWait 1.1s ease-in-out infinite alternate; }
@keyframes ptoPdfWait { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
.pto-pdf-prog.done { color: var(--ok); }
.pto-pdf-prog.done .pto-pdf-bar i { background: var(--ok); }
@media (prefers-reduced-motion: reduce) {
  .pto-pdf-prog.wait .pto-pdf-bar i { animation: none; }
}

/* ── чек-лист ── */
.tbl.pto-cl { width: auto; }
.tbl.pto-cl thead th { top: 0; }
.tbl.pto-cl tbody td { height: 32.5px; padding-top: 2px; padding-bottom: 2px; }
.pto-cl .pto-lbl { color: var(--ink); font-size: 11px; }
.pto-cl tr.pto-hl td { background: var(--ok-soft); font-weight: 600; }
.pto-cl tr.pto-hl .pos-in { font-weight: 600; }
.pto-cl .pto-calc { color: var(--ink); font-variant-numeric: tabular-nums; }
/* Тип квартир — две клетки в одной: количество и площадь. Столбиком, а
   не рядом: в колонке секции сотня пикселей, и «1 038,5» просит места
   целиком. Подпись «шт / м²» — у названия строки, чтобы не повторять её
   в каждой колонке. */
.pto-cl .pto-two { display: flex; flex-direction: column; gap: 1.5px; align-items: stretch; }
.pto-cl .pto-two .pos-in { padding-top: 2px; padding-bottom: 2px; }
.pto-cl .pto-two > span { text-align: right; }
.pto-cl .pto-sub { color: var(--ink3); font-size: 10.5px; font-style: normal; }
.pto-cl .pto-lbl .pto-sub { margin-left: 4.5px; }
/* Площадь паркинга — у итога: в «Итого общую площадь» она не входит, но
   на глазах у площадей ей место. */
.pto-parea { margin: 9px var(--gut) 0; font-size: 11px; color: var(--ink2); }
.pto-parea:empty { display: none; }
.pto-auto .pos-in, .pto-auto.pto-f .pos-in { color: var(--info); }
td.pto-auto { box-shadow: inset 0 -2px 0 var(--info-soft); }
.pto-ta { resize: none; line-height: 1.35; display: block; overflow: hidden; }
.pto-warn {
  margin: 11px var(--gut) 0; padding: 8px 12.5px; border-radius: var(--r-sm);
  background: var(--warn-soft); color: var(--warn); font-size: 11px; line-height: 1.6;
}
.tbl.pto-park { margin-bottom: 21.5px; }

/* ── карточка ── */
.pto-card { padding-bottom: 29px; }
.pto-card-head { padding: 14.5px var(--gut) 3.5px; }
.pto-card-head b { display: block; font-size: 13.5px; color: var(--ink); }
.pto-card-head span { display: block; margin-top: 2.5px; font-size: 11px; color: var(--ink3); }
.pto-card-head p { margin: 7px 0 0; max-width: 684px; font-size: 11px; color: var(--ink3); line-height: 1.5; }
.pto-blk { margin: 12.5px var(--gut) 0; max-width: 990px; border: 1px solid var(--line2);
  border-radius: var(--r-sm); overflow: hidden; }
.pto-blk h4 {
  margin: 0; padding: 8px 12.5px; background: var(--raise); border-bottom: 1px solid var(--line2);
  font-size: 11px; font-weight: 600; color: var(--ink);
}
.pto-f {
  display: grid; grid-template-columns: minmax(180px, 38%) 1fr; gap: 9px; align-items: start;
  padding: 3.5px 12.5px; border-bottom: 1px solid var(--line2);
}
.pto-f:last-child { border-bottom: 0; }
.pto-f > span { padding: 6.5px 0; font-size: 11px; color: var(--ink2); line-height: 1.35; }
.pto-f .pos-in { margin: 1px 0; }
/* В карточке поля — поля формы, а не клетки таблицы: рамку видно и в
   покое, иначе пустая карточка читается как список вопросов без места
   для ответа. */
.pto-blk .pos-in { border-color: var(--line2); background: var(--card); }
.pto-blk .pos-in:hover { border-color: var(--line); }
.pto-f.pto-auto .pos-in { background: var(--card); }
.pto-f.pto-auto { background: var(--info-soft); }
.pto-ro { padding: 6.5px 0; font-size: 11px; white-space: pre-wrap; }
.pto-ctbl-wrap { overflow-x: auto; }
.pto-ctbl { width: 100%; border-collapse: collapse; font-size: 11px; }
.pto-ctbl th {
  padding: 5.5px 7px; text-align: left; font-weight: 600; font-size: 10.5px; color: var(--ink3);
  border-bottom: 1px solid var(--line2); background: var(--card);
}
.pto-ctbl td { padding: 2px 3.5px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.pto-ctbl td.pto-lbl { padding: 7px 9px; color: var(--ink); white-space: nowrap; }
.pto-ctbl td.pto-x { width: 27px; text-align: center; }
.pto-empty-row { padding: 9px 11px !important; font-size: 11px; }
.pto-addrow { margin: 5.5px 9px 7px; }
.pto-auto-blk h4 { background: var(--info-soft); }
.pto-tag { font-style: normal; font-weight: 400; font-size: 10px; color: var(--info); margin-left: 5.5px; }

/* ── кабельный журнал ── */
.tbl.pto-jt { border-collapse: separate; border-spacing: 0; }
.tbl.pto-jt thead th { top: 0; }
.tbl.pto-jt tbody td { height: 34px; padding-top: 2px; padding-bottom: 2px; }
.tbl.pto-jt td, .tbl.pto-jt th { padding-left: 5.5px; padding-right: 5.5px; }
.tbl.pto-jt th:first-child, .tbl.pto-jt td:first-child { padding-left: calc(var(--gut) - 6.5px); }
.pto-jt tr.pto-jh td {
  height: auto; padding-top: 12.5px; padding-bottom: 5.5px; background: var(--card);
  border-bottom: 1px solid var(--line); font-size: 11px; color: var(--ink);
}
.pto-jt tr.pto-jh span { margin: 0 9px; color: var(--ink3); font-size: 11px; }
.pto-jt tr.pto-flag td { background: color-mix(in srgb, var(--warn-soft) 55%, transparent); }
.pto-checks { font-size: 10px; line-height: 1.3; }
.pto-chk {
  display: inline-block; margin: 1px 2.5px 1px 0; padding: 1px 5.5px; border-radius: 5.5px;
  background: var(--warn-soft); color: var(--warn);
}
.pto-chk.pto-chk-ref { background: var(--info-soft); color: var(--info); }
.pto-acts { opacity: 1; white-space: nowrap; }
.pto-acts .lnk { padding: 2px 6.5px; font-size: 12.5px; }
.pto-check { display: inline-flex; align-items: center; gap: 5.5px; font-size: 11px; color: var(--ink2); cursor: pointer; }
.pto-check i { font-style: normal; color: var(--warn); font-weight: 600; }
.pto-reserve { display: inline-flex; align-items: center; gap: 5.5px; font-size: 11px; color: var(--ink2); }
.pto-reserve .pos-in { width: 54px; border-color: var(--line2); }
.pto-jsheet { max-width: 288px; }
.tbl.pto-sum { width: 100%; }
.tbl.pto-sum thead th { top: 0; }
.pto-sum tr.pto-total td { font-weight: 600; color: var(--ink); background: var(--raise); }
.pto-warn-t { color: var(--warn); font-weight: 600; }

@media (max-width: 684px) {
  .pto-src { margin-left: 0; flex-wrap: wrap; }
  .pto-f { grid-template-columns: 1fr; gap: 0; }
  .pto-tools .pg-find input { width: 135px; }
}
