/* Генераторы документов (09.10.2026). Токены — из sv2026.css, устройство — как у генератора штрихкодов. */
.dg-hero { padding-bottom: clamp(36px, 6vw, 64px); }
.dg-hero h1 { max-width: 20ch; }
.dg-hero .sv-lede { max-width: 40em; }
.dg-files { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 16px 0 0; font-size: 15px; color: var(--muted); }
.dg-files a { color: var(--orange-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.dg-tool { display: grid; gap: 28px; align-items: start; margin-top: 28px; }
@media (min-width: 1100px) { .dg-tool { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 40px; } }

/* форма */
.dg-form { display: grid; gap: 14px; }
.dg-group { margin: 0; padding: 16px 18px 18px; border: 1px solid var(--line); background: var(--panel); min-width: 0; }
.dg-group[hidden] { display: none; }
.dg-group legend { padding: 0 6px; margin-left: -6px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink); }
.dg-fields { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .dg-fields { grid-template-columns: 1fr 1fr; } .dg-f { grid-column: 1 / -1; } .dg-f--half { grid-column: auto; } }
.dg-fields:empty { display: none; }
.dg-f { display: grid; gap: 5px; min-width: 0; }
.dg-f[hidden] { display: none; }
.dg-f__l { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.dg-f__h { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.dg-f input, .dg-f textarea, .dg-f select, .dg-item input {
  width: 100%; min-height: 44px; padding: 9px 12px; background: var(--paper); border: 1px solid var(--line);
  color: var(--ink); font: 400 16px/1.4 Inter, "Segoe UI", system-ui, sans-serif; border-radius: 0; }
.dg-f textarea { resize: vertical; min-height: 64px; }
.dg-f input::placeholder, .dg-f textarea::placeholder, .dg-item input::placeholder { color: #8A9096; }
.dg-f input:focus-visible, .dg-f textarea:focus-visible, .dg-f select:focus-visible, .dg-item input:focus-visible { outline: none; border-color: var(--orange); background: #fff; box-shadow: 0 0 0 2px rgba(206,68,9,.18); }

/* строки таблицы: работы, техника, товары */
.dg-items { display: grid; gap: 10px; }
.dg-item { position: relative; display: grid; gap: 8px; grid-template-columns: 1fr 1fr; padding: 12px 40px 12px 12px; background: var(--paper); border: 1px dashed var(--line); }
.dg-item__c { display: grid; gap: 3px; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.dg-item__c--l { grid-column: 1 / -1; }
.dg-item input { background: #fff; min-height: 40px; }
@media (min-width: 700px) {
  .dg-item { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .dg-item__c { grid-column: span 2; }
  .dg-item__c--l { grid-column: 1 / -1; }
  .dg-item__c--s { grid-column: span 2; }
}
.dg-item__del { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.dg-item__del:hover, .dg-item__del:focus-visible { color: var(--orange-ink); outline: none; }
.dg-add { margin-top: 10px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--ink); background: transparent; color: var(--ink); font: 600 14px/1 Inter, system-ui, sans-serif; cursor: pointer; }
.dg-add:hover, .dg-add:focus-visible { background: var(--ink); color: #fff; outline: none; }
.dg-group > .dg-fields { margin-top: 0; }
.dg-group .dg-items + .dg-add + .dg-fields:not(:empty) { margin-top: 12px; }

/* лист документа */
.dg-out { position: relative; min-width: 0; }
@media (min-width: 1100px) { .dg-out { position: sticky; top: 84px; } }
.dg-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.dg-acts .sv-btn--ink { background: var(--panel); }
.dg-acts .sv-btn[disabled] { opacity: .5; pointer-events: none; }
.dg-reset { margin-left: auto; align-self: center; border: 0; background: none; color: var(--muted); font: 500 14px/1 Inter, system-ui, sans-serif; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 44px; }
.dg-note { margin: 0 0 12px; min-height: 20px; font-size: 13.5px; color: var(--muted); }
.dg-paper { background: var(--paper-2); padding: clamp(10px, 2.4vw, 22px); border: 1px solid var(--line); }
@media (min-width: 1100px) { .dg-paper { max-height: calc(100vh - 210px); overflow: auto; } }
.dg-sheet { background: #fff; color: #1b1b1b; box-shadow: var(--shadow); padding: 7% 7.5%; font: 400 12.5px/1.45 Arial, "Helvetica Neue", Inter, sans-serif; aspect-ratio: auto; min-height: 420px; overflow-wrap: anywhere; }
.dg-sheet p { margin: 0 0 6px; }
.dg-d-title { text-align: center; font-weight: 700; font-size: 15px; margin-bottom: 2px !important; }
.dg-d-center { text-align: center; margin-bottom: 12px !important; }
.dg-d-h { font-weight: 700; margin-top: 10px !important; }
.dg-d-small { font-size: 11px; color: #444; }
.dg-d-space { height: 8px; }
.dg-d-cut { position: relative; margin: 16px 0; border-top: 1px dashed #999; }
.dg-d-cut span { position: absolute; left: 50%; top: -9px; transform: translateX(-50%); padding: 0 8px; background: #fff; font-size: 10.5px; color: #888; }
.dg-d-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 16px 0 8px; }
.dg-d-sign p { white-space: pre-line; }
.dg-d-table { width: 100%; border-collapse: collapse; table-layout: fixed; margin: 4px 0 10px; font-size: 11px; }
.dg-d-table th, .dg-d-table td { border: 1px solid #666; padding: 4px 5px; vertical-align: top; text-align: left; }
.dg-d-table th { background: #eee; font-weight: 700; font-size: 10.5px; line-height: 1.25; }
.dg-d-table td { height: 22px; }
.dg-d-table td.r { text-align: right; }
.dg-d-foot td { font-weight: 700; }
.dg-v { border-radius: 2px; transition: background-color .15s ease; }
.dg-v--empty { display: inline-block; min-height: 1em; border-bottom: 1px solid #888; vertical-align: baseline; max-width: 100%; }
.dg-v.is-hot { background: rgba(206,68,9,.16); box-shadow: 0 2px 0 var(--orange); }
@media (prefers-reduced-motion: reduce) { .dg-v { transition: none; } }

/* текстовые разделы ниже инструмента */
.dg-cols { display: grid; gap: 22px; margin-top: 28px; }
@media (min-width: 900px) { .dg-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; } }
.dg-cols h3 { margin: 0 0 8px; font-size: 19px; color: var(--ink); }
.dg-cols p, .dg-cols li { margin: 0 0 10px; max-width: 38em; }
.dg-cols ul { padding-left: 1.1em; margin: 0; }
.dg-cols a, .dg-text a { color: var(--orange-ink); text-decoration: underline; text-underline-offset: 3px; }
.dg-crm { display: grid; gap: 28px; align-items: center; }
@media (min-width: 1000px) { .dg-crm { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 56px; } }
.dg-crm p { max-width: 36em; margin: 14px 0 0; }
.dg-crm figure { margin: 0; }
.dg-crm img { width: 100%; height: auto; display: block; border: 1px solid var(--line); box-shadow: var(--shadow); }
.dg-crm figcaption { margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.dg-also { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.dg-also a { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); font-weight: 600; font-size: 15px; text-decoration: none; }
.dg-also a:hover, .dg-also a:focus-visible { border-color: var(--ink); }

@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff !important; }
  body * { visibility: hidden !important; }
  #dg-sheet, #dg-sheet * { visibility: visible !important; }
  #dg-sheet { position: absolute; left: 0; top: 0; width: 100%; padding: 0; box-shadow: none; font-size: 10.5pt; }
  .dg-paper { max-height: none !important; overflow: visible !important; padding: 0; border: 0; }
  .dg-out { position: static !important; }
  .dg-v.is-hot { background: none; box-shadow: none; }
}
