/* Конструктор шаблонов сканов УПД (ADR-0114, web/scan_templates.js). */
.stpl h3 { margin: 18px 0 6px; }
.stpl h4 { margin: 14px 0 4px; }
.stpl .note { color: var(--accent); }
.stpl tr.warn td { background: var(--warn-bg); }
/* Скан выбирают строкой, операции — кнопками над таблицей (06.10.2026). */
.stpl tr.pick { cursor: pointer; }
.stpl tr.picked td { background: rgba(47, 111, 191, 0.18); }
.stpl-bar { flex-wrap: wrap; gap: 6px; }
.stpl-tools button.active, .stpl-bar button.active { background: var(--accent); color: #fff; }
.stpl-work { display: flex; gap: 12px; align-items: flex-start; }
.stpl-sheet { flex: 1 1 auto; min-width: 0; overflow: auto; max-height: calc(100vh - 140px);
              border: 1px solid var(--line); background: #fff; }
.stpl-page { position: relative; }
.stpl-page img { display: block; width: 100%; height: auto; user-select: none; }
.stpl-page svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.stpl-page svg.tool-нарисовать { touch-action: none; cursor: crosshair; }
.stpl-page svg.tool-удалить .cell { cursor: not-allowed; }
.stpl .cell { fill: rgba(47, 111, 191, 0.03); stroke: rgba(47, 111, 191, 0.55); cursor: pointer; }
.stpl .cell:hover { fill: rgba(47, 111, 191, 0.18); }
.stpl .cell.added { stroke: rgba(30, 140, 60, 0.9); fill: rgba(30, 140, 60, 0.08); }
.stpl .field { fill: rgba(230, 140, 20, 0.12); stroke: rgb(220, 120, 10); pointer-events: none; }
.stpl .field.act { fill: rgba(230, 140, 20, 0.3); }
/* В режиме удаления рамка реквизита сама ловит нажатие — и снимается
   (06.10.2026); в остальных режимах пропускает его к клетке под собой. */
.stpl-page svg.tool-удалить .field { pointer-events: all; cursor: not-allowed; }
/* Ручки границ выбранной рамки и колонки: тянуть мышью или пальцем. */
.stpl .handle { fill: #fff; stroke: rgb(220, 120, 10); touch-action: none; }
.stpl .handle.col { stroke: rgb(160, 60, 200); }
.stpl .field-label { fill: rgb(170, 80, 0); pointer-events: none; font-family: sans-serif; }
.stpl .col-band { fill: rgba(160, 60, 200, 0.07); pointer-events: none; }
.stpl .col-band.act { fill: rgba(160, 60, 200, 0.25); }
/* Черта разреза склеенного ряда (ADR-0139): снимается в режиме удаления. */
.stpl-page svg.tool-разрезать { touch-action: none; cursor: row-resize; }
.stpl .cut { stroke: rgb(210, 40, 40); stroke-dasharray: 14 8; pointer-events: none; }
.stpl-page svg.tool-удалить .cut { pointer-events: stroke; cursor: not-allowed; }
.stpl .drawing { fill: rgba(30, 140, 60, 0.15); stroke: rgb(30, 140, 60); stroke-dasharray: 6 4; }
.stpl-side { flex: 0 0 340px; max-height: calc(100vh - 140px); overflow: auto; }
.stpl-side label { display: block; margin: 4px 0; }
.stpl-side input:not([type]) { width: 100%; }
.stpl-list { list-style: none; margin: 0; padding: 0; }
.stpl-list li { display: flex; gap: 6px; align-items: baseline; padding: 6px 6px; border-bottom: 1px solid var(--line);
                cursor: pointer; min-height: 32px; }
.stpl-list li.act { background: rgba(230, 140, 20, 0.18); }
.stpl-list li.set .name { font-weight: 600; }
.stpl-list .name { flex: 0 0 45%; }
.stpl-list .val { flex: 1 1 auto; color: var(--muted); overflow-wrap: anywhere; font-size: 0.9em; }
.stpl-list .x { border: none; background: none; font-size: 1.2em; cursor: pointer; }
.stpl-preview table.small td { font-size: 0.85em; padding: 2px 4px; }
.stpl-save { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0; }
@media (max-width: 900px) {
  .stpl-work { flex-direction: column; }
  .stpl-side { flex: 1 1 auto; width: 100%; max-height: none; }
  .stpl-sheet { max-height: 70vh; width: 100%; }
}
