/* RSW Docs — document generator, drawing canvas and A4 print sheet.
   Loaded only on document, drawing and annotation tools. */
.rsw-docgroup{border:1px solid var(--rsw-line);border-radius:12px;padding:14px 16px 16px;margin:0 0 16px;min-width:0}
.rsw-docgroup legend{padding:0 8px;font-weight:650;color:#fff;font-size:15.5px}
.rsw-doctop{flex-wrap:wrap;margin:0 0 14px}
.rsw-docintro{margin:0 0 14px}
.rsw-tool textarea{width:100%;min-height:84px;background:var(--rsw-sunk);color:var(--rsw-ink);
  border:1px solid var(--rsw-line2);border-radius:9px;padding:10px 12px;font:inherit;resize:vertical}
.rsw-docrows td input,.rsw-docrows td select{min-width:70px;width:100%}
.rsw-docrows td input[data-col=desc],.rsw-docrows td input[data-col=item]{min-width:180px}
.rsw-docamt{white-space:nowrap;text-align:right;font-variant-numeric:tabular-nums;color:#fff}
.rsw-logo-row{flex-wrap:wrap;gap:10px;align-items:center}
.rsw-docthumb{max-height:52px;max-width:160px;background:#fff;border-radius:6px;padding:3px}
.rsw-docphotos{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px;margin-top:10px}
.rsw-docphoto{margin:0;display:flex;flex-direction:column;gap:6px}
.rsw-docphoto img{width:100%;height:130px;object-fit:cover;border-radius:8px;border:1px solid var(--rsw-line)}
.rsw-docpreview{margin-top:18px}

/* the sheet itself: white paper on screen too, so the preview matches the PDF */
.rsw-docsheet{background:#fff;color:#111;border-radius:6px;padding:28px 30px;max-width:900px;margin:0 auto;
  font:14px/1.45 system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;box-shadow:0 10px 30px -12px rgba(0,0,0,.6)}
.rsw-docsheet *{color:#111}
.rsw-docsheet h2{margin:0 0 6px;font-size:22px;letter-spacing:.02em;text-transform:uppercase;color:#0B3A66}
.rsw-docsheet h3{margin:0 0 6px;font-size:13px;text-transform:uppercase;letter-spacing:.06em;color:#0B3A66}
.rsw-docsheet p{margin:0 0 3px}
.rsw-ds-head{display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap;border-bottom:3px solid #0B3A66;padding-bottom:12px;margin-bottom:14px}
.rsw-ds-brand{display:flex;gap:12px;align-items:flex-start}
.rsw-ds-logo{max-height:64px;max-width:170px}
.rsw-ds-bname{font-weight:700;font-size:17px}
.rsw-ds-bline{font-size:12.5px;color:#333}
.rsw-ds-title{text-align:right}
.rsw-ds-title span,.rsw-ds-party span{color:#555}
.rsw-ds-sample{background:#FFF4D6;border:1px dashed #B78300;padding:6px 10px;font-size:12px;font-weight:600;margin:0 0 12px}
.rsw-ds-parties{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin-bottom:12px}
.rsw-ds-party{border:1px solid #ccd;border-radius:4px;padding:8px 10px;font-size:13px}
.rsw-ds-meta{display:grid;grid-template-columns:max-content 1fr max-content 1fr;gap:4px 12px;margin:0 0 12px;font-size:13px}
.rsw-ds-meta dt{color:#555}.rsw-ds-meta dd{margin:0;font-weight:600}
.rsw-ds-lines,.rsw-ds-totals{width:100%;border-collapse:collapse;font-size:12.5px;margin:0 0 10px}
.rsw-ds-lines th,.rsw-ds-lines td{border:1px solid #bbc;padding:7px 9px;vertical-align:top;text-align:left;line-height:1.45}
.rsw-ds-lines thead th{background:#E8EEF5;font-weight:700}
.rsw-ds-lines tr{break-inside:avoid}
.rsw-ds-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%}
.rsw-ds-num{text-align:right!important;font-variant-numeric:tabular-nums;white-space:nowrap}
.rsw-ds-totals{width:auto;min-width:300px;margin-left:auto}
.rsw-ds-totals th,.rsw-ds-totals td{padding:6px 10px;border-bottom:1px solid #dde;text-align:right;line-height:1.45}
.rsw-ds-totals th{font-weight:500;color:#333}
.rsw-ds-grand th,.rsw-ds-grand td{font-weight:800;font-size:14px;border-top:2px solid #0B3A66;border-bottom:2px solid #0B3A66}
.rsw-ds-words{text-align:right;font-style:italic;font-size:12.5px;margin:0 0 12px}
.rsw-ds-sec{margin:10px 0;break-inside:avoid}
.rsw-ds-sec p{white-space:pre-wrap;font-size:13px}
.rsw-ds-photos{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}
.rsw-ds-photos h3{grid-column:1/-1}
.rsw-ds-photos figure{margin:0;break-inside:avoid}
.rsw-ds-photos img{width:100%;max-height:300px;object-fit:contain;border:1px solid #ccd}
.rsw-ds-photos figcaption{font-size:12px}
.rsw-ds-signs{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:24px;margin-top:34px;break-inside:avoid}
.rsw-ds-line{display:block;border-bottom:1px solid #333;height:36px;margin-bottom:4px}
.rsw-ds-small{font-size:11px;color:#666}
.rsw-ds-foot{margin-top:22px;border-top:1px solid #ccd;padding-top:6px;font-size:11px;color:#666}
.rsw-ds-foot p{color:#666}
.rsw-ds-badge{display:inline-block;padding:1px 7px;border-radius:9px;font-size:11.5px;font-weight:700}
@media(max-width:640px){
  .rsw-docsheet{padding:16px 14px;font-size:13px}
  .rsw-ds-title{text-align:left}
  .rsw-ds-meta{grid-template-columns:max-content 1fr}
  .rsw-ds-photos{grid-template-columns:1fr}
}

/* drawing / annotation tools */
.rsw-canvaswrap{border:1px solid var(--rsw-line);border-radius:12px;overflow:auto;background:#0A1118;margin:12px 0;touch-action:none}
.rsw-canvaswrap canvas{display:block;max-width:100%;height:auto;cursor:crosshair}
.rsw-toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin:8px 0}
.rsw-toolbar .rsw-btn[aria-pressed=true]{background:var(--rsw-btn);color:#fff;border-color:var(--rsw-btn)}
.rsw-toolbar label{font-size:14px;color:var(--rsw-mu);display:inline-flex;gap:6px;align-items:center}
.rsw-toolbar input[type=text]{min-width:140px}
.rsw-ordinates{font-variant-numeric:tabular-nums}

/* A4 printing of one document: everything else hidden */
@media print{
  @page{size:A4;margin:12mm}
  html.rsw-print-doc body>*:not(#rsw-print-root){display:none!important}
  html.rsw-print-doc,html.rsw-print-doc body{background:#fff!important}
  #rsw-print-root{display:block}
  #rsw-print-root .rsw-docsheet{box-shadow:none;border-radius:0;padding:0;max-width:none;font-size:10.5pt}
  #rsw-print-root .rsw-ds-head{flex-wrap:nowrap}
  #rsw-print-root .rsw-ds-title{text-align:right}
  #rsw-print-root *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  #rsw-print-root svg{max-width:100%}
  #rsw-print-root .rsw-ds-scroll{overflow:visible}
}
#rsw-print-root{display:none}
