/* /zakaz-naryad-onlayn: the form uses the site's dark tokens, the paper stays white because it is a document. */
.zn-hero { display: block; }
.zn-hero .tf-lead { margin-top: 18px; }
.zn-tool { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 24px; align-items: start; margin-top: 8px; }
.zn-form { display: grid; gap: 14px; min-width: 0; }
.zn-form fieldset { min-width: 0; margin: 0; padding: 16px 18px 18px; border: 1px solid var(--t-line2); border-radius: 18px; background: var(--t-panel); display: grid; gap: 10px; }
.zn-form legend { padding: 0 8px; font-weight: 700; }
.zn-form label { display: grid; gap: 5px; min-width: 0; color: var(--t-mute); font-size: 13px; }
.zn-form input { width: 100%; min-width: 0; min-height: 40px; padding: 8px 11px; border: 1px solid var(--t-line2); border-radius: 10px; background: rgba(255, 255, 255, .05); color: inherit; font: inherit; font-size: 15px; }
.zn-form input:focus-visible { outline: 2px solid var(--t-gold); outline-offset: 1px; }
.zn-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.zn-lines { display: grid; gap: 10px; }
.zn-lines:empty { display: none; }
.zn-line { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 40px; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--t-line2); }
.zn-line .zn-wide { grid-column: 1 / 4; }
.zn-line label { align-content: end; }
.zn-drop { grid-column: 4; grid-row: 1; align-self: end; width: 40px; height: 40px; border: 1px solid var(--t-line2); border-radius: 10px; background: none; color: var(--t-mute); font-size: 20px; line-height: 1; cursor: pointer; }
.zn-drop:hover { color: inherit; }
.zn-add { justify-self: start; min-height: 40px; padding: 8px 14px; border: 1px dashed var(--t-line2); border-radius: 10px; background: none; color: var(--t-gold-hi); font: inherit; font-size: 14px; cursor: pointer; }
.zn-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.zn-preview { position: sticky; top: 84px; min-width: 0; max-height: calc(100vh - 100px); overflow: auto; border-radius: 12px; }

.zn-paper { padding: 22px 24px; background: #fff; color: #111; font: 12px/1.35 Arial, "Helvetica Neue", Helvetica, sans-serif; }
.zp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; padding-bottom: 6px; border-bottom: 2px solid #111; }
.zp-head h2 { margin: 0; color: #111; font: 700 20px/1.1 Arial, sans-serif; letter-spacing: .3px; }
.zp-num { font-size: 13px; white-space: nowrap; }
.zp-sub { margin: 4px 0 10px; color: #333; font-size: 11px; }
.zp-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; margin-top: 6px; }
.zp-card { min-width: 0; padding: 6px 8px 8px; border: 1px solid #777; }
.zp-card h3, .zp-h { margin: 0 0 4px; color: #000; font: 700 11px/1.2 Arial, sans-serif; text-transform: uppercase; letter-spacing: .5px; }
.zp-h { margin-top: 12px; }
.zp-car { margin-top: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.zp-car h3 { grid-column: 1 / -1; }
.zp-line { display: flex; align-items: flex-end; gap: 6px; min-height: 20px; }
.zp-line i { flex: none; max-width: 60%; color: #444; font-style: normal; font-size: 10.5px; }
.zp-line span { flex: 1; min-width: 0; min-height: 16px; border-bottom: 1px solid #999; overflow-wrap: anywhere; }
.zp-card .zp-line { display: block; margin-top: 3px; }
.zp-card .zp-line i { display: block; max-width: none; font-size: 9.5px; line-height: 1.2; }
.zp-card .zp-line span { display: block; }
.zn-paper table { width: 100%; border-collapse: collapse; table-layout: auto; color: #111; }
.zn-paper th, .zn-paper td { padding: 3px 5px; border: 1px solid #777; color: #111; background: #fff; vertical-align: top; text-align: left; overflow-wrap: anywhere; }
.zn-paper th { background: #efefef; font-size: 10px; line-height: 1.15; }
.zn-paper td { height: 21px; }
.zn-paper .r { text-align: right; white-space: nowrap; }
.zn-paper .c { text-align: center; }
.zp-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 10px 0 6px; border: 1px solid #111; }
.zp-totals div { padding: 5px 8px; border-right: 1px solid #999; }
.zp-totals div:last-child { border-right: 0; background: #111; color: #fff; }
.zp-totals i { display: block; font-style: normal; font-size: 9.5px; text-transform: uppercase; letter-spacing: .3px; opacity: .8; }
.zp-totals b { display: block; min-height: 19px; font-size: 14px; }
.zp-sign { margin-top: 18px; }
.zp-sign .zp-line { min-height: 34px; }
.zp-legal { margin: 14px 0 0; padding-top: 5px; border-top: 1px solid #bbb; color: #555; font-size: 9.5px; }

@media (max-width: 980px) {
  .zn-tool { grid-template-columns: minmax(0, 1fr); }
  .zn-preview { position: static; max-height: none; }
}
@media (max-width: 480px) {
  .zn-form fieldset { padding: 12px; }
  .zn-paper { padding: 14px 12px; }
  .zp-two, .zp-car { grid-template-columns: minmax(0, 1fr); }
  .zp-car h3 { grid-column: auto; }
}
@media print {
  @page { size: A4; margin: 10mm 11mm; }
  /* only the paper and its ancestors stay: visibility would keep the height of the whole page and print blank sheets */
  body *:not(:has(#zn-paper)):not(#zn-paper):not(#zn-paper *) { display: none !important; }
  html, body, body *:has(#zn-paper) { display: block !important; position: static !important; width: auto !important; max-width: none !important; max-height: none !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; border: 0 !important; background: #fff !important; box-shadow: none !important; }
  #zn-paper { padding: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .zn-paper tr, .zp-totals, .zp-sign { break-inside: avoid; }
}
