:host{all:initial;display:block}
:host { --accent:#1F4E78; --fill:#fff8d6; --p:7.2mm; --pr:9.2mm; background:#e9ecef; color:#000; font-family:"Times New Roman","Liberation Serif",Times,serif; }
* { box-sizing:border-box; }
.ui { font-family:Arial,Helvetica,sans-serif; font-size:14px; }
.bar { position:sticky; bottom:0; z-index:5; background:#fff; border-top:1px solid #ccc; padding:10px 16px; display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.bar .next { margin-right:auto; } .bar .next b { font-size:18px; color:var(--accent); }
button { font:inherit; padding:8px 14px; border-radius:6px; border:1px solid #aaa; background:#f6f6f6; cursor:pointer; }
button.primary { background:var(--accent); color:#fff; border-color:var(--accent); font-weight:bold; }
button:disabled { opacity:.5; cursor:default; }
.wrap { padding:16px; overflow-x:auto; }
.msgline { font-family:Arial,Helvetica,sans-serif; font-size:13px; padding:0 4px; } .msgline.err { color:#a40000; } .msgline.ok { color:#1a7f37; }
.grid { grid-template-columns:repeat(2,max-content); }
.hint { max-width:210mm; margin:0 auto 10px; color:#666; }

/* ===== бланк ===== */
.sheet { width:210mm; min-height:297mm; margin:0 auto; background:#fff; padding:20mm 26mm 12mm 25mm;
         box-shadow:0 2px 12px rgba(0,0,0,.2); font-size:14pt; line-height:1.15;
         -webkit-print-color-adjust:exact; print-color-adjust:exact; }
.sheet input, .sheet textarea { font:inherit; color:inherit; background-color:transparent; border:0; padding:0; margin:0; outline:none; min-width:0; border-radius:0; }
.title { text-align:center; font-weight:bold; margin-bottom:4mm; line-height:6.4mm; }
.r { display:flex; align-items:flex-end; }
.dater { height:9.5mm; }
.dater .num { margin-left:auto; width:30mm; }
.u { border-bottom:.3mm solid #000 !important; text-align:center; height:calc(var(--pr) - 1.2mm); }
.w9 { width:9mm; } .w30 { width:34mm; }
.city { text-align:center; margin:1.5mm 0 8mm; }
.com { height:var(--pr); }
.com .ul { flex:1; display:flex; border-bottom:.3mm solid #000; height:calc(var(--pr) - 1.2mm); margin:0 0 0 2mm; }
.com .ul input { height:100%; }
.com .ul .f { width:38%; } .com .ul .p { flex:1; }
.com .ul > span { margin-right:1.5mm; }
.ruled { position:relative; }
.ruled textarea { display:block; width:100%; resize:none; overflow:hidden; line-height:var(--p); height:calc(var(--p) * var(--n,1)); position:relative; z-index:2; }
.rules { position:absolute; left:0; right:0; top:0; z-index:0; }
.rules i { display:block; height:var(--p); position:relative; }
.rules i::after { content:''; position:absolute; left:0; right:0; bottom:.6mm; border-bottom:.25mm solid #000; }
.ruled .lbl { position:absolute; left:0; top:0; height:var(--p); line-height:var(--p); background:#fff; padding-right:1.5mm; white-space:nowrap; z-index:1; pointer-events:none; }
.ruled .cap-r { position:absolute; right:0; bottom:0; height:var(--p); line-height:var(--p); background:#fff; padding-left:1mm; font-size:9pt; z-index:1; }
.who { height:var(--p); margin-top:1mm; margin-bottom:5mm; position:relative; }
.who .nm { flex:1; position:relative; border-bottom:.3mm solid #000; height:calc(var(--p) - 1mm); margin-left:2mm; }
.who .nm input { width:100%; height:100%; }
.who .nm small { position:absolute; left:0; right:0; top:100%; text-align:center; font-size:6pt; line-height:3mm; }
.who > * { flex:none; } .who .nm { flex:1; }
.note { font-size:8pt; line-height:4.4mm; text-align:justify; text-align-last:justify; margin:0; }
.note b { font-weight:normal; font-size:14pt; }
.sign, .ozn { display:flex; align-items:flex-end; height:6.2mm; }
.sign { margin-top:0; }
.sline { border-bottom:.3mm solid #000; height:5mm; }
.sign .sline { width:39mm; } .ozn .sline { width:32mm; }
.sign .nm, .ozn .nm { border-bottom:.3mm solid #000; height:5.2mm; display:flex; align-items:flex-end; }
.sign .nm { width:76mm; } .ozn .nm { flex:1; margin-right:5mm; }
.par { padding:0 .7mm; line-height:5mm; }
.sign .nm span, .ozn .nm input { line-height:5mm; white-space:nowrap; }
.ozn .nm input { width:100%; }
.cp { font-size:11pt; line-height:3.5mm; height:3.5mm; display:flex; }
.cp.s span:nth-child(2) { margin-left:6mm; }
.cp.o span:nth-child(1) { width:23mm; flex:none; } .cp.o span:nth-child(2) { flex:1; font-size:11.5pt; white-space:nowrap; text-align:left; }
.cp.o span:nth-child(1) { margin-right:0; }
.ozn .lab { white-space:nowrap; }
.foot { font-size:9pt; margin-top:3mm; }
details { max-width:210mm; margin:12px auto; background:#fff; border:1px solid #ccc; border-radius:6px; padding:8px 12px; }
summary { cursor:pointer; font-weight:bold; }
.grid { display:grid; grid-template-columns:repeat(3,max-content); gap:8px 12px; align-items:center; margin-top:8px; }
.grid input { border:1px solid #aaa; padding:4px 6px; width:90px; }
table { border-collapse:collapse; width:100%; margin-top:8px; } th,td { border:1px solid #ccc; padding:4px 6px; text-align:left; vertical-align:top; } th { background:#f0f0f0; }
.warn { color:#a40000; }
.fill textarea, .fill input, input.fill, textarea.fill { background-color:var(--fill) !important; }
.sheet input:focus, .sheet textarea:focus { background-color:#e6f0ff; }
