/* Техкарты */
.tc-output { align-items: center; flex-wrap: wrap; max-width: 360px; }
.tc-output input { flex: 0 0 140px; }
.tc-output > span { flex: none; }
.tc-lines { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.tc-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; background: var(--field); }
.tc-line select, .tc-line input {
  min-height: 56px; padding: 0 14px; font: inherit; font-size: 1.05rem; color: var(--text);
  border: 0; border-radius: 12px; background: var(--surface);
}
.tc-line select { flex: 1 1 260px; min-width: 0; }
.tc-qty { display: flex; align-items: center; gap: 8px; }
.tc-qty input { width: 120px; }
.tc-label { font-size: .85rem; color: var(--muted); }
.tc-unit { color: var(--muted); min-width: 24px; }
.tc-net { display: none; }
.show-net .tc-net { display: flex; }
.when-net { display: none; }
.show-net .when-net { display: inline; }
.show-net .when-no-net { display: none; }
.when-no-net { display: inline-flex; align-items: center; gap: 10px; }
.tc-line.is-removed { display: none; }
.tc-errors { flex-basis: 100%; color: var(--problem); font-weight: 600; display: flex; flex-direction: column; }
.tc-tools { margin: 8px 0 4px; }
/* Компактный редактор; стили строк прихода не затрагиваем. */
.tc-editor { max-width: 960px; margin: 0 auto; }
.tc-heading { margin: 8px 0 24px; }
.tc-heading h1 { margin: 0 0 8px; font-size: 1.7rem; line-height: 1.25; overflow-wrap: anywhere; }
.tc-heading p { margin: 0; font-size: .9rem; }
.tc-editor .tc-form { max-width: none; margin-bottom: 16px; }
.tc-editor .tc-output { max-width: none; gap: 14px; margin-bottom: 8px; }
.tc-editor .tc-output .field-label { margin: 0; flex: 0 0 auto; }
.tc-editor .tc-output input { flex: 0 0 100px; width: 100px; min-width: 0; }
.tc-composition-heading { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 8px 0 12px; }
.tc-composition-heading h2 { font-size: 1.05rem; margin: 0; }
.tc-composition-heading > span { font-size: .8rem; }
.tc-editor .tc-lines { gap: 0; }
.tc-editor .tc-line { border-radius: 0; background: transparent; border-top: 1px solid var(--field); padding: 14px 0; }
.tc-editor .tc-line select, .tc-editor .tc-line input { background: var(--field); }
.tc-editor .tc-line select { flex-basis: 260px; }
.tc-editor .tc-line .tc-qty input { width: 112px; }
.tc-editor .tc-tools { gap: 8px; flex-wrap: wrap; }
.tc-editor .tc-tools [data-add-line] { color: var(--accent); }
.tc-editor .tc-tools .btn { font-size: .9rem; }
.tc-save-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; border-top: 1px solid var(--field); padding-top: 24px; margin-top: 20px; }
.tc-cost-summary { flex: 1 1 240px; min-width: 0; }
.tc-cost-label, .tc-cost-caption { display: block; font-size: .85rem; }
.tc-cost-value { display: block; font-size: 1.8rem; line-height: 1.4; font-weight: 600; font-variant-numeric: tabular-nums; margin: 2px 0; }
.tc-cost-caption { margin-top: 3px; }
.tc-cost-pending > span { display: block; }
.tc-cost-pending > .muted { margin-top: 4px; font-size: .85rem; }
.tc-cost-pending[hidden], .tc-editor [data-saved-cost][hidden], .tc-editor [data-saved-details][hidden] { display: none; }
.tc-save-row > .btn { flex: 0 1 auto; }
.tc-disclosure { border-bottom: 1px solid var(--field); }
.tc-disclosure > summary { display: flex; align-items: center; gap: 12px; padding: 20px 4px; min-height: 68px; list-style: none; cursor: pointer; font-weight: 600; }
.tc-disclosure > summary::-webkit-details-marker { display: none; }
.tc-chevron { color: var(--muted); flex-shrink: 0; transition: transform .15s; }
.tc-disclosure[open] > summary .tc-chevron { transform: rotate(90deg); }
.tc-fold-hint { margin-left: auto; font-size: .8rem; font-weight: 400; text-align: right; }
.tc-fold-content { min-width: 0; padding: 0 8px 24px 36px; }
.tc-detail-note { font-size: .85rem; margin: 0 0 16px; }
.tc-old-version { padding: 12px 0; }
.tc-old-version strong { display: block; font-size: .9rem; }
.tc-old-version .muted { display: block; margin-top: 6px; font-size: .85rem; overflow-wrap: anywhere; }
.tc-archive .btn { font-size: .85rem; color: var(--muted); }
.tc-archive .btn-primary { color: var(--on-accent); }
@media (max-width: 700px) {
  .tc-editor .tc-form { padding: 20px 16px; }
  .tc-editor .tc-line { gap: 8px; }
  .tc-editor .tc-line select { flex-basis: calc(100% - 64px); order: 0; }
  .tc-editor .tc-line [data-remove-line] { order: 1; }
  .tc-editor .tc-line .tc-qty { order: 2; }
  .tc-editor .tc-errors { order: 3; }
  .tc-editor .tc-line .tc-qty input { width: 96px; }
  .tc-editor .tc-tools .btn { padding-inline: 10px; }
  .tc-save-row { gap: 18px; }
  .tc-save-row > .btn { width: 100%; }
  .tc-fold-hint { display: none; }
  .tc-fold-content { padding-left: 0; padding-right: 0; }
}
@media (prefers-reduced-motion: reduce) { .tc-chevron { transition: none; } }
@media (max-width: 480px) { .tc-topbar-title { display: none; } }
.notice-problem { display: flex; gap: 12px; align-items: flex-start; background: var(--problem-bg); border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 12px; font-weight: 600; }
.notice-problem .icon { color: var(--problem); }
.tag-check { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 4px 12px; border-radius: 999px; background: var(--check-bg); font-size: .9rem; font-weight: 600; }
.tag-check .icon { color: var(--check); width: 1em; height: 1em; }

/* Дерево раскладки техкарты */
.tree-card { padding: 16px 24px; }
.tree { list-style: none; margin: 0; padding: 0; }
.tree .tree { padding-left: 28px; border-left: 2px solid var(--field); margin-left: 10px; }
.tree-row { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.tree-qty { margin-left: auto; color: var(--muted); white-space: nowrap; }
.tree-link { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; color: var(--accent); font-weight: 600; text-decoration: none; }
