/* Paper composition shared by the designer preview and the printed sheet. */
.designer{width:min(1200px,96vw);max-width:96vw}
.designer-grid{grid-template-columns:minmax(260px,340px) minmax(0,1fr);background:#f3f4f7}
.designer-grid>div:last-child{position:sticky;top:74px}
.designer-preview{background:#e1e4eb;padding:28px;border:1px solid #d5dbe4}
.designer-preview .document-sheet{font-size:12px;min-height:650px;width:min(100%,460px);aspect-ratio:210/297}
.designer-preview .document-sheet.sheet-a5{width:min(100%,440px);min-height:624px;aspect-ratio:148/210}
.document-sheet{position:relative;font-weight:400;color:#25303a;line-height:1.45;letter-spacing:0}
.document-sheet h2,.document-sheet strong{letter-spacing:0}
.sheet-topline{padding:12px 24px 8px;color:var(--ink);font-size:12px;font-weight:650;text-align:center;white-space:pre-wrap}
.sheet-heading{padding:14px 24px 18px;gap:16px;align-items:center;border-bottom:1px solid var(--ink);min-height:94px}
.sheet-practice{flex:1}.sheet-heading strong{color:var(--ink);font-size:17px;line-height:1.3;margin-bottom:7px;font-weight:700}
.sheet-practice div,.sheet-arabic div{font-size:10px;line-height:1.6;white-space:pre-wrap}
.sheet-arabic{font-family:Tahoma,Arial,sans-serif;flex:1;text-align:right}
.sheet-arabic strong{font-size:16px}
.sheet-logo{width:58px;height:58px;object-fit:contain;flex-shrink:0}
.sheet-content{padding:18px 24px 20px;gap:0}
.sheet-content h2{text-transform:uppercase;font-size:17px;letter-spacing:1.6px;font-weight:650;margin:0 0 17px;color:var(--ink)}
.sheet-meta{padding:10px 0 12px;border-top:0;border-bottom:1px solid #dce1e6;gap:8px 18px;justify-content:space-between}
.sheet-meta dt{font-size:9px;text-transform:uppercase;letter-spacing:.6px;color:#6c7680}
.sheet-meta dd{font-size:11px;font-weight:600;margin-top:3px}
.sheet-text{font-size:12px;line-height:1.9;white-space:pre-wrap;padding-block:8px;min-height:180px}
.sheet-duration{font-size:10px}
.sheet-content footer{margin-top:auto;padding-top:32px;min-height:82px;font-size:9px}
.sheet-signature{border:0;padding-top:0;min-height:50px;align-content:start;gap:5px}
.sheet-signature span{color:#8b929a;font-size:9px}
.sheet-contact{padding:12px 24px 14px;border-top:1px solid var(--ink);color:var(--ink);text-align:center;font-size:9px;line-height:1.6;white-space:pre-wrap}
.sheet-banner .sheet-topline{background:var(--ink);color:#fff;padding:12px 20px;font-size:13px}
.sheet-banner .sheet-heading{background:white;border-top:0;border-bottom:1px solid #cfd8e0}
.sheet-banner .sheet-contact{background:var(--ink);color:#fff;border:0}
.sheet-wave .sheet-topline{background:var(--tint);text-align:start;border-inline-start:5px solid var(--ink)}
.sheet-wave .sheet-heading{border-inline-start:5px solid var(--ink);border-bottom:1px solid #dce1e6}
.sheet-wave .sheet-content{border-inline-start:5px solid var(--ink)}
.sheet-wave .sheet-meta{background:transparent;padding-inline:0}
.sheet-wave .sheet-contact{background:var(--tint);border-top:0;border-inline-start:5px solid var(--ink)}
@media(max-width:760px){.designer-grid{grid-template-columns:minmax(0,1fr)}.designer-grid>div:last-child{position:static}.designer-preview{padding:12px}.designer-preview .document-sheet{font-size:11px}.sheet-heading{gap:10px;padding-inline:16px}.sheet-heading strong{font-size:14px}.sheet-arabic strong{font-size:14px}}
@media print{
 .document-sheet{width:100%;min-height:279mm;font-size:10.5pt;box-shadow:none;overflow:visible}
 .document-sheet.sheet-a5{min-height:193mm;font-size:9pt}
 .sheet-topline{font-size:10pt;padding:3mm 5mm 2mm}
 .sheet-heading{padding:4mm 5mm;min-height:24mm}
 .sheet-heading strong{font-size:13pt}.sheet-arabic strong{font-size:12pt}
 .sheet-practice div,.sheet-arabic div{font-size:8pt}
 .sheet-logo{width:18mm;height:18mm}
 .sheet-content{padding:5mm}
 .sheet-content h2{font-size:12pt;margin-bottom:4mm}
 .sheet-meta dt{font-size:7pt}.sheet-meta dd{font-size:9pt}
 .sheet-text{font-size:9.5pt;line-height:1.75;min-height:0;orphans:3;widows:3}
 .sheet-duration{font-size:8pt}
 .sheet-content footer{padding-top:8mm;min-height:22mm}
 .sheet-contact{font-size:7.5pt;padding:3mm 5mm}
 .sheet-heading,.sheet-meta,.sheet-contact{break-inside:avoid}
}

/* Keep older preview controls out of the document footer. */
.document-sheet footer > :is(small,label) {display:none !important}

/* A4 payment agreement. Keep long schedules printable across pages. */
.sheet-contract .sheet-heading {padding-inline:0;min-height:0}
.sheet-contract .sheet-logo {order:-1}
.sheet-contract .contract-frame {
 border:1px solid var(--ink);
 margin-top:4mm;
 padding:4mm 5mm;
 display:block;
 box-decoration-break:clone;
 -webkit-box-decoration-break:clone;
}
.contract-frame h2 {text-align:center;border-bottom:1px solid var(--ink);padding-bottom:2.5mm;margin-bottom:2mm;letter-spacing:.05em}
.contract-ref {text-align:end;color:var(--ink);font-size:.9em}
.contract-identity,.contract-totals {margin:2mm 0;display:grid;gap:1mm 4mm;grid-template-columns:repeat(2,minmax(0,1fr))}
.contract-frame dt {color:var(--ink);font-weight:650;font-size:.85em}
.contract-frame dd {margin:0;border-bottom:1px dotted #a7b4c0;overflow-wrap:anywhere}
.contract-totals {grid-template-columns:repeat(4,minmax(0,1fr));padding:2mm;background:#f3f6fa;break-inside:avoid}
.contract-frame h3 {margin:2mm 0 1mm;font-size:1em;color:var(--ink);break-after:avoid}
.contract-schedule {width:100%;border-collapse:collapse;text-align:start}
.contract-schedule th,.contract-schedule td {text-align:start;padding:.7mm 1.5mm;border-bottom:1px solid #d9e0e7}
.contract-schedule th {color:var(--ink)}
.contract-schedule thead {display:table-header-group}
.contract-schedule tr,.contract-signatures {break-inside:avoid}
.contract-conditions {white-space:pre-wrap;overflow-wrap:anywhere}
.contract-signatures {margin-top:4mm;text-align:center}
.contract-signatures div {display:grid;grid-template-columns:1fr 1fr;gap:6mm}
.contract-signatures span {min-height:20mm;border-top:1px solid #b5bec8;padding-top:1mm;font-size:.85em}
.sheet-contract .sheet-contact {border:0;padding-inline:0}
.sheet-contract .sheet-contact:empty {display:none}
@media print {
 .document-sheet.sheet-contract {display:block;min-height:0;font-size:9pt;line-height:1.35}
 .sheet-contract .sheet-heading {padding-block:1mm 3mm}
 .sheet-contract .contract-frame td {font-size:8.5pt}
}
