/* Invoice and act: layout only, the same field and button rules as the commercial offer. Colors and type come from the theme, tools-ui.css and calc.css. */
.doc-form [hidden], [data-doc-buttons][hidden]{display:none!important}
.doc-form label[for]{display:block}
.doc-form .doc-field input:not([type=file]),.doc-form .doc-field textarea,.doc-form .doc-field select{width:100%}
.doc-form .doc-field textarea{resize:vertical}
.doc-form .doc-group{border:0;margin:26px 0 0;padding:0;min-width:0}
.doc-form .doc-group>legend{font-size:14px;color:#666666;padding:0;margin:0 0 4px;letter-spacing:.02em}
.doc-form .doc-inn{display:grid;grid-template-columns:1fr auto;align-items:end;gap:0 16px}
.doc-plain{font:inherit;font-size:15px;border:0;border-bottom:1px solid #aaa;background:none;min-height:44px;padding:8px 0;cursor:pointer;color:var(--ink);text-decoration:none;display:inline-flex;align-items:center}
.doc-plain:focus-visible{outline:2px solid #202020;outline-offset:3px}
.doc-plain:disabled{opacity:.55;cursor:default}
/* The visually hidden column header is absolutely positioned: the wrapper must contain it, or it widens the page on a phone. */
.doc-form .pkt-calc-table-wrap{position:relative}
.doc-rows{min-width:600px;table-layout:auto}
.doc-rows td{vertical-align:top}
.doc-rows td:first-child{width:100%;min-width:180px}
.doc-rows td:nth-child(2),.doc-rows td:nth-child(3){min-width:72px}
.doc-rows td:nth-child(4){min-width:104px}
.doc-rows th:nth-child(2),.doc-rows th:nth-child(3),.doc-rows th:nth-child(4){text-align:left}
.doc-rows td:nth-child(5){white-space:nowrap;text-align:right;padding-top:14px}
.doc-rows input{width:100%;min-width:0}
.doc-rows .doc-row-tools{display:flex;gap:2px;white-space:nowrap}
.doc-rows .doc-row-tools button{font:inherit;font-size:15px;border:0;background:none;min-width:44px;min-height:44px;cursor:pointer;color:var(--ink)}
.doc-rows .doc-row-tools button:focus-visible{outline:2px solid #202020;outline-offset:-2px}
.doc-rows .doc-row-tools button:disabled{opacity:.3;cursor:default}
.doc-images{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 16px}
.doc-images input[type=file]{font-size:14px;max-width:100%}
.doc-buttons{display:flex;flex-wrap:wrap;gap:4px 24px;margin-top:16px}
[data-pkt-tool] .pkt-output [data-pkt-status]:not(:empty){padding:14px 16px;background:#fff8d8;border-left:3px solid var(--accent);margin-bottom:20px}
/* The template's copy and generic download buttons are replaced by the format buttons. */
:is([data-pkt-tool="schet-na-oplatu"],[data-pkt-tool="akt-vypolnennyh-rabot"]) .pkt-result-actions{display:none}

/* The document: on screen, in the sample and on paper. */
.doc-paper{padding:24px;border:1px solid var(--line);border-radius:7px;background:#fff;color:#202020;font-size:14px;line-height:1.5;overflow-wrap:anywhere}
.doc-paper p{margin:0 0 8px}
.doc-paper .doc-logo{max-height:56px;max-width:200px;display:block;margin-bottom:12px}
.doc-bank{width:100%;border-collapse:collapse;font-size:13px;margin-bottom:18px}
.doc-bank td{border:1px solid #bbb;padding:4px 6px;vertical-align:top}
.doc-bank small{display:block;color:#6b6b6b;font-size:12px}
.doc-title{font-size:20px;line-height:1.3;font-weight:500;margin:0 0 14px;padding-bottom:8px;border-bottom:2px solid #202020}
.doc-parties{display:grid;grid-template-columns:auto minmax(0,1fr);gap:4px 14px;margin:0 0 14px}
.doc-parties dt{color:#6b6b6b}
.doc-parties dd{margin:0}
/* The preview column is narrow: the document table fits it instead of scrolling, names wrap, numbers do not. */
/* On a phone the document table scrolls inside its box instead of squeezing the names into one letter per line. */
.doc-paper .pkt-calc-table-wrap{overflow-x:auto;margin-top:8px}
.doc-paper .doc-table{min-width:0;font-size:13px;table-layout:auto}
.doc-paper .doc-table th,.doc-paper .doc-table td{padding:5px 4px;font-size:13px;line-height:1.4}
.doc-paper .doc-table td:nth-child(2),.doc-paper .doc-table th:nth-child(2){text-align:left;width:100%;min-width:140px}
.doc-paper .doc-table td:nth-child(n+3),.doc-paper .doc-table th:nth-child(n+3){text-align:right;white-space:nowrap}
.doc-table .is-total td{font-weight:500}
.doc-table td[colspan]{text-align:right}
.doc-signs{display:flex;flex-wrap:wrap;gap:8px 32px;margin-top:20px!important;align-items:flex-end}
.doc-sign{position:relative;min-width:220px}
.doc-sign img{position:absolute;max-height:60px;max-width:140px;left:90px;bottom:4px;pointer-events:none}
.doc-stamp{display:block;max-height:120px;max-width:120px;margin-top:8px}
.doc-qr{width:120px;height:120px;margin-top:12px}
.doc-brand{font-size:11px;color:#6b6b6b;margin-top:16px!important}
.doc-sample{margin-top:72px}
.doc-sample .doc-paper{margin-top:20px}
.doc-legend{display:grid;grid-template-columns:minmax(160px,auto) minmax(0,1fr);gap:10px 24px;margin:28px 0 0;font-size:16px;line-height:1.6}
.doc-legend dt{color:#666}
.doc-legend dd{margin:0}

@media(min-width:801px){
:is([data-pkt-tool="schet-na-oplatu"],[data-pkt-tool="akt-vypolnennyh-rabot"]) .pkt-workspace>.pkt-output{position:sticky;top:24px;max-height:calc(100vh - 48px);overflow:auto}
}
@media(max-width:700px){
.doc-form .doc-inn{grid-template-columns:1fr}
.doc-images{grid-template-columns:1fr}
.doc-paper{padding:16px}
.doc-parties,.doc-legend{grid-template-columns:1fr}
.doc-parties dd{margin-bottom:6px}
}

/* «Печать» prints only the live document. */
@media print{
body.doc-printing *{visibility:hidden}
body.doc-printing .doc-live,body.doc-printing .doc-live *{visibility:visible}
body.doc-printing .doc-live{position:absolute;left:0;top:0;width:100%;border:0;padding:0}
body.doc-printing .doc-live .pkt-calc-table-wrap{overflow:visible}
}
