/* Report module (web/report.js): dark side panel as the other modules, the report itself a white A4 page drawn as it prints */
.rp .rp-side{display:flex;flex-direction:column;gap:0}
.rp .rp-side .lh{margin-bottom:4px}
.rp-h{margin:24px 0 8px}
.rp-side .lbl{color:var(--acc)}
.rp-ref{width:100%;height:30px}
.rp-pt{display:grid;grid-template-columns:1fr 1fr;gap:6px 10px;align-items:center}
.rp-pt label{display:flex;align-items:center;gap:3px;font-size:11px;color:var(--ink3)}
.rp-pt .field{width:100%;height:26px;padding:0 6px;text-align:right}
.rp-pt small{width:16px}
.rp-sex{padding:2px;justify-self:start}.rp-sex a{height:20px;padding:0 10px}
.rp-warn{margin-top:8px;font-size:11.5px;color:var(--mild)}
.rp-note{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:6px 0 0;font-size:12px;color:var(--ink2)}
.rp-secs .tog{margin:5px 0}
.btn.sm{height:24px;padding:0 8px;font-size:12px}
.rp-w{width:100%;margin-top:14px}
.rp-sp{flex:1;min-height:16px}
.rp-vers{display:flex;flex-direction:column;gap:2px;margin-bottom:12px}
.rp-vers a{font-size:12px;color:var(--ink2);text-decoration:none;padding:3px 6px;border-radius:5px}
.rp-vers a:hover{background:var(--raised)}.rp-vers a.on{background:var(--field);color:var(--ink)}
.rp-acts{display:grid;grid-template-columns:1fr 1fr;gap:6px}
.rp-acts .btn.pri,.rp-acts #rp-amend,.rp-acts #rp-data{grid-column:1/-1}
.rp-ar{grid-column:1/-1;display:flex;gap:6px}.rp-ar .btn{flex:1;min-width:0;padding:0 6px}
/* Findings: several fields chosen at once (drag across them, ⌘A twice, or click the heading): a paste fills them line by line */
.rp-f.rp-gsel .rp-tx{background:#d9f3f0;border-left-color:#4ecdc4}
.rp-fsec h2[data-gsel]{cursor:pointer}
.rp-mid{flex:1;min-width:0;overflow:auto;background:#1c1c1c;padding:24px 24px 48px}
.rp-paper{max-width:794px;margin:0 auto;display:flex;flex-direction:column;gap:28px;transition:opacity .15s}
.rp-sheet{min-height:1123px;background:#fff;color:#161616;padding:44px 52px;font:13.5px/1.55 Inter,system-ui,sans-serif;box-shadow:0 10px 32px rgba(0,0,0,.45)}
.rp-paper.busy{opacity:.55}
.rp-hd{display:flex;flex-direction:column;align-items:flex-start;gap:14px;border-bottom:2px solid #4ecdc4;padding-bottom:8px;margin-bottom:14px}
.rp-logo{height:38px;max-width:240px;object-fit:contain;object-position:left center;display:block}
.rp-hd h1{font-size:20px;font-weight:650;margin:0;letter-spacing:-.01em}
.rp-kv{display:grid;grid-template-columns:auto 1fr auto 1fr;gap:4px 18px;margin:0 0 8px}
.rp-kv dt{color:#6a6a6a}.rp-kv dd{margin:0}
.rp-s{margin-top:24px;break-inside:avoid}
.rp-s h2{font-size:12.5px;font-weight:650;margin:0 0 9px;color:#1d6f69;text-transform:uppercase;letter-spacing:.06em}
.rp-tx{white-space:pre-wrap;min-height:1.5em;outline:none;border-radius:4px;padding:3px 6px;margin:0 -6px;background:#f5faf9;border-left:2px solid #cfe9e6}
.rp-tx:focus{background:#effaf8;border-left-color:#4ecdc4}
.rp-tx:not([contenteditable]){background:none;border-left-color:transparent}
.rp-res{margin-top:22px;border-top:1px solid #e4e4e4;padding-top:4px}
.rp-tb{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums}
.rp-tb th{font-size:11.5px;font-weight:600;color:#7a7a7a;text-align:left;padding:4px 9px;border-bottom:1px solid #dcdcdc}
.rp-tb td{padding:5px 9px;border-bottom:1px solid #efefef}
.rp-tb .n{text-align:right;white-space:nowrap}
.rp-tb tr.sh td{font-weight:600;color:#1d6f69;padding-top:9px;border-bottom-color:#dcdcdc}
.rp-tb td.gr{white-space:nowrap;font-weight:600}
.rp-tb td.gr.mi{color:#b07400}.rp-tb td.gr.mo{color:#c25400}.rp-tb td.gr.se{color:#c0282d}
.gw{color:#a35a00;font-size:11px}
.rp-ch{display:grid;gap:6px;margin-top:6px}
.rp-ch{grid-template-columns:repeat(4,1fr);gap:6px 10px}
.rp-ch svg{width:100%;display:block}
.rp-ch .ct{font:600 13px Inter,system-ui,sans-serif;fill:#222;text-anchor:middle}
.rp-ch .tk{font:11.5px Inter,system-ui,sans-serif;fill:#555;text-anchor:middle}
.rp-ch .tk.tl{text-anchor:end}
.rp-ch .gl{stroke:#d7dede;stroke-width:.7}
.rp-chl{display:flex;flex-direction:column;justify-content:center;gap:6px;padding-left:18px;font-size:11px;color:#444}
.rp-chl span{display:inline-flex;align-items:center;gap:6px}
.rp-chl i{width:14px;height:2px;display:inline-block}
.rp-chl b{font-size:12px;line-height:1}
.rp-bulls{display:flex;flex-wrap:wrap;gap:20px;margin-top:6px}
.rp-bulls figure{margin:0;text-align:center}
.rp-bull{width:108px;display:block}
.rp-bull text{font:600 8px Inter,system-ui,sans-serif;fill:#fff;text-anchor:middle;paint-order:stroke;stroke:rgba(0,0,0,.28);stroke-width:1.6px}
.rp-bulls figcaption{font-size:11px;color:#555;margin-top:4px}
.rp-keys figcaption{font-size:11px;color:#555;margin-top:3px}
.rp-keys{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.rp-keys figure{margin:0;break-inside:avoid}
.rp-keys img{width:100%;display:block;background:#000;border-radius:3px}
.rp-ft{margin-top:34px;break-inside:avoid}
.rp-sigsp{height:46px}
.rp-sig{display:flex;justify-content:space-between;align-items:baseline;gap:16px;padding-bottom:8px;border-bottom:1px solid #cfd5d6;font-size:12.5px}
.rp-sig b{font-weight:650}.rp-sig span{color:#6a6a6a;font-size:11.5px}
.rp-eval{margin:10px 0 0;color:#444;font-size:10px;font-weight:600}
.rp-refs{margin:6px 0 0;color:#7a7a7a;font-size:10px;line-height:1.45;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.rp-fs{display:flex;flex-direction:column;gap:5px}
.rp-f{display:grid;grid-template-columns:186px 1fr;gap:10px;align-items:start}
.rp-fl{font-weight:600;padding:3px 0;color:#262626}
.rp-f .rp-tx{margin:0}
.rp-tb td.wh{color:#7a7a7a;font-size:11px;text-align:right}
.rp-items{display:flex;flex-direction:column;gap:2px}
.rp-it{display:flex;align-items:center;gap:6px;font-size:12.5px;color:var(--ink2);padding:3px 4px 3px 8px;border-radius:5px;background:var(--raised)}
.rp-it .nm{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rp-it .x{width:20px;height:20px;border:0;background:none;color:var(--ink3);cursor:pointer;border-radius:4px;font-size:14px;line-height:1}
.rp-it .x:hover{color:var(--ink);background:var(--field)}
.rp-it.changed .nm::before,.rp-it.gone .nm::before{content:'';display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--mild);margin-right:6px;vertical-align:1px}
.rp-it.gone .nm{color:var(--ink3)}
.rp-up{height:20px;padding:0 7px;border-radius:4px;border:1px solid #5a4a20;background:none;color:var(--mild);font-size:11px;cursor:pointer}
.rp-gone{font-size:11px;color:var(--ink3)}
.rp-secs{margin-top:8px}
.toolbar .rp-add{height:28px;margin-left:8px}
#rp-toast{position:fixed;left:50%;bottom:22px;transform:translate(-50%,8px);background:#1d2b2a;border:1px solid #2f5551;color:var(--ink);padding:8px 14px;border-radius:8px;font-size:12.5px;opacity:0;pointer-events:none;transition:opacity .18s,transform .18s;z-index:60}
#rp-toast.on{opacity:1;transform:translate(-50%,0)}
@page{size:A4;margin:0}
@media print{
  body:has(>#view-report:not([hidden]))>*{display:none!important}
  body:has(>#view-report:not([hidden]))>#view-report{display:block!important;height:auto;overflow:visible;background:#fff}
  body:has(>#view-report:not([hidden])) #view-report .rp-side{display:none!important}
  body:has(>#view-report:not([hidden])) .rp-mid{padding:0;background:#fff;overflow:visible}
  body:has(>#view-report:not([hidden])) .rp-paper{max-width:none;display:block}
  body:has(>#view-report:not([hidden])) .rp-sheet{box-shadow:none;min-height:0;padding:14mm;box-decoration-break:clone;-webkit-box-decoration-break:clone}
  body:has(>#view-report:not([hidden])) .rp-sheet:not(.rp-isheet)>*{zoom:var(--rpz,1)}
  body:has(>#view-report:not([hidden])) .rp-isheet{break-before:page;min-height:296mm}
  body:has(>#view-report:not([hidden])) .rp-paper a{color:inherit;text-decoration:none}
  body:has(>#view-report:not([hidden])) .rp-igrid .im{height:258px}
  body:has(>#view-report:not([hidden])) .rp-igrid.r1 .im{height:330px}
  .itb,.igrip{display:none!important}
  body:has(>#view-report:not([hidden])) .rp-tx{background:none;border-left-color:transparent;padding:0;margin:0}
  body:has(>#view-report:not([hidden])) .rp-tx:empty,body:has(>#view-report:not([hidden])) .rp-t:has(.rp-tx:empty),body:has(>#view-report:not([hidden])) .rp-f.nil,body:has(>#view-report:not([hidden])) .rp-fsec.nil{display:none}
  html,body{height:auto;background:#fff}
}
.rp-sub{margin:7px 0 0;color:#7a7a7a;font-size:11px;text-align:center}
.rp-ox{width:470px;max-width:100%;margin:0 auto;border-collapse:collapse;font-variant-numeric:tabular-nums;table-layout:fixed}
.rp-ox th,.rp-ox td{border:1px solid #c9cfd1;padding:3px 4px;text-align:center;white-space:nowrap}
.rp-ox td{height:42px}
.rp-ox tr:first-child th{background:#f4f6f7;font-weight:650;font-size:10.5px}
.rp-ox th:first-child{width:44px;font-size:11px;text-align:left;font-weight:650;vertical-align:middle}
.rp-ox td b{font-weight:600;font-size:13px}
.rp-ox td{text-align:center!important;vertical-align:middle;line-height:1.25}
.rp-ox td b{display:block}
.rp-ox .nr{display:block;color:#7a7a7a;font-size:8.5px;font-weight:400;margin-top:1px}
.rp-ox td.blank{background:#f4f4f4}
.rp-ox td.mi b{color:#b07400}.rp-ox td.mo b{color:#c25400}.rp-ox td.se b{color:#c0282d}
.rp-paper .rp-f.nil .rp-tx:not([contenteditable]){min-height:0}
.rp-paper:not(:has([contenteditable])) .rp-f.nil,.rp-paper:not(:has([contenteditable])) .rp-fsec.nil,.rp-paper:not(:has([contenteditable])) .rp-t:has(.rp-tx:empty){display:none}
.vw-inrep{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--acc);margin-left:6px;vertical-align:1px}
/* flow, mapping, T2* and measurements: compact */
.rp-sm{font-size:12.5px}
.rp-sm th{font-size:11px;padding:4px 8px}
.rp-sm td{padding:4.5px 8px}
.rp-sm tr.sh td{padding-top:9px}
/* side panel: sections in page order, drag handle + tickbox */
.rp-sec{border-radius:5px;margin:0 -4px;padding:0 4px}
.rp-sech{display:flex;align-items:center;gap:4px}
.rp-sec .tog{margin:4px 0;flex:1}
.rp-sec.drag{background:var(--raised);box-shadow:0 2px 10px rgba(0,0,0,.4)}
.rp-dh{color:#5a5a5a;cursor:grab;display:inline-flex;padding:3px 2px;touch-action:none}
.rp-dh:hover{color:var(--ink2)}.rp-sec.drag .rp-dh{cursor:grabbing}
/* Settings > Report logo */
.rp-lg{display:flex;align-items:center;gap:10px;margin:4px 0 8px}
.rp-lg img{width:96px;height:34px;object-fit:contain;background:#fff;border-radius:4px;padding:4px}
.rp-lg-b{display:flex;flex-direction:column;gap:4px}
.rp-lg-b .btn{cursor:pointer}
.rp-subs{padding:0 0 4px 34px}
.rp-subs .tog{margin:3px 0;font-size:11.5px;color:var(--ink3)}
.rp-subs .tog:has(input:checked){color:var(--ink2)}
.rp-tp{display:flex;flex-direction:column;gap:6px;margin:4px 0 8px}
.rp-tp-b{flex-direction:row;flex-wrap:wrap}
/* images pages: up to 3 rows x 2 columns per A4 page */
.rp-ih{display:flex;align-items:center;gap:14px;border-bottom:2px solid #4ecdc4;padding-bottom:8px;margin-bottom:14px;font-size:11.5px;color:#6a6a6a}
.rp-ih span{margin-left:auto;font-weight:650;color:#111;font-size:17px;letter-spacing:-.005em}
.rp-logo.sm{height:24px}
.rp-igrid{display:grid;grid-template-columns:1fr 1fr;gap:14px 14px}
.rp-igrid figure{margin:0;break-inside:avoid}
.rp-igrid .im{position:relative;height:290px;background:#000;border-radius:3px;overflow:hidden;touch-action:none}
.rp-igrid .iv{position:absolute;inset:0;transform-origin:50% 50%}
.rp-igrid .iv svg{width:100%;height:100%;display:block}
.rp-igrid .iv.m-pan{cursor:grab}.rp-igrid .iv.m-pan:active{cursor:grabbing}
.rp-igrid .iv.m-pen,.rp-igrid .iv.m-arrow,.rp-igrid .iv.m-ellipse{cursor:crosshair}
.itb{position:absolute;top:6px;right:6px;display:flex;align-items:center;gap:1px;padding:2px;border-radius:7px;background:rgba(14,14,14,.82);opacity:0;transition:opacity .15s}
.rp-igrid figure:hover .itb,.itb:focus-within{opacity:1}
.itb button,.igrip{width:24px;height:24px;border:0;border-radius:5px;background:none;color:#cfcfcf;display:inline-flex;align-items:center;justify-content:center;cursor:pointer;padding:0}
.itb button:hover{background:#2a2a2a;color:#fff}.itb button.on{background:#264a47;color:#7fe3dc}
.itb .col i{width:12px;height:12px;border-radius:50%;display:block;box-shadow:0 0 0 1.5px rgba(255,255,255,.5)}
.itb .sep{width:1px;height:16px;background:#3a3a3a;margin:0 3px}
.igrip{position:absolute;top:6px;left:6px;background:rgba(14,14,14,.82);opacity:0;transition:opacity .15s;cursor:grab}
.rp-igrid figure:hover .igrip{opacity:1}
.rp-igrid figure.lift{opacity:.55}
.rp-igrid figure.drop .im{outline:2px solid #4ecdc4;outline-offset:2px}
.rp-igrid.r1 .im{height:330px}
.rp-igrid figcaption{font-size:11px;color:#444;padding:4px 2px;min-height:1.4em;outline:none;border-bottom:1px dashed transparent}
.rp-igrid figcaption[contenteditable]:hover{border-bottom-color:#cfe9e6}
.rp-igrid figcaption:focus{border-bottom-color:#4ecdc4}
/* side panel: images */
.rp-imtog{margin:2px 0 4px}
.rp-im .rp-sech{gap:6px;padding:2px 0}
.rp-im img{width:34px;height:26px;object-fit:cover;border-radius:3px;background:#000;flex:none}
.rp-im .nm{flex:1;min-width:0;font-size:11.5px;color:var(--ink2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rp-im .x{width:20px;height:20px;border:0;background:none;color:var(--ink3);cursor:pointer;border-radius:4px;font-size:14px;line-height:1}
.rp-im .x:hover{color:var(--ink);background:var(--field)}
.toolbar .rp-addimg{margin-left:2px}
.rp-fold{width:22px;height:22px;border:0;background:none;color:var(--ink3);cursor:pointer;border-radius:4px;display:inline-flex;align-items:center;justify-content:center;flex:none}
.rp-fold:hover{color:var(--ink);background:var(--raised)}
.rp-fold svg{transition:transform .15s}.rp-fold.on svg{transform:rotate(90deg)}
.rp-ref{margin-bottom:4px}
.rp-rep{width:100%;height:30px;margin-bottom:4px}
#rp-date{margin-bottom:12px;color-scheme:dark}
/* key images page: patient line as a slim footer at the foot of the page */
.rp-isheet{display:flex;flex-direction:column}
.rp-ift{margin-top:auto;padding-top:6px;border-top:1px solid #dfe3e4;display:flex;justify-content:space-between;gap:12px;font-size:9.5px;color:#7a7a7a}
.rp-igrid{margin-bottom:18px}
.rp-half{width:50%}
.rp-mapr{display:flex;align-items:flex-start;gap:30px}
.rp-mapr .rp-bulls{flex:1;justify-content:center;margin-top:0}
.rp-r>h2{text-align:center}
.rp-r .rp-half{margin:0 auto}
.rp-mapr{justify-content:center}
.rp-mapr .rp-half{margin:0;width:48%}
.rp-mapr .rp-bulls{flex:none}
.rp-subr{display:flex;align-items:center;gap:4px}
.rp-subr .tog{flex:1}
.rp-sec .x,.rp-subr .x{width:20px;height:20px;border:0;background:none;color:var(--ink3);cursor:pointer;border-radius:4px;font-size:14px;line-height:1;flex:none}
.rp-sec .x:hover,.rp-subr .x:hover{color:var(--ink);background:var(--field)}
.rp-addl{display:block;border:0;background:none;color:var(--acc);font-size:11.5px;cursor:pointer;padding:3px 0;opacity:.85;text-align:left}
.rp-addl:hover{opacity:1;text-decoration:underline}
.rp-addsec{margin:4px 0 0 18px}
.rp-newname{width:100%;height:26px;font-size:12px;margin:3px 0}
/* top-bar save icon (Report screen only): dot = waiting (grey), not saved yet (amber) */
.rp-topsave{position:relative;margin-right:4px}
body:has(#view-report[hidden]) .rp-topsave{display:none}
.rp-topsave i{position:absolute;top:6px;right:5px;width:6px;height:6px;border-radius:50%;display:none}
.rp-topsave.pending i,.rp-topsave.saving i{display:block;background:#8a8a8a}
.rp-topsave.saving i{animation:rpPulse .8s ease-in-out infinite alternate}
.rp-topsave.failed{color:var(--mild)}.rp-topsave.failed i{display:block;background:var(--mild)}
@keyframes rpPulse{from{opacity:.35}to{opacity:1}}
/* the panel: two columns side by side (patient, contents, reference, signature | sections, key images), buttons across the foot */
.rp .rp-side{width:500px}
.rp-cols{display:grid;grid-template-columns:1fr 1fr;gap:0 22px;align-items:start}
.rp-col{min-width:0}
.rp-col>.lbl.rp-h:first-child{margin-top:12px}
/* panel: patient across the top, a line, the two columns, a line, the buttons */
.rp .rp-side .rp-pt{grid-template-columns:auto 1fr 1fr 1fr}
.rp-div{border:0;border-top:1px solid var(--line2);margin:16px 0 0;width:100%}
.rp-div+.rp-cols .rp-col>.lbl.rp-h:first-child{margin-top:16px}
.rp-sp+.rp-div{margin:0 0 12px}
/* perfusion reading (web/perf.js) */
.rp-pf{align-items:center;justify-content:center;gap:28px}
.rp-pfl{font-size:12.5px;line-height:1.65;color:#222}
.rp-pfl i{display:inline-block;width:9px;height:9px;border-radius:2px;margin-right:6px;vertical-align:-1px}
.rp-pfl b{font-weight:600;margin-right:8px}

/* report to the PACS (side panel) and its setting */
.rp-px{display:flex;gap:6px;align-items:center}
.rp-px select{flex:1;min-width:0;height:26px}
.rp-px a.btn{text-decoration:none;display:inline-flex;align-items:center}
.rp-pxr{font-size:11.5px;color:var(--ink2);margin-top:5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.rp-pxr.sent::before{content:'';display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--acc);margin-right:6px;vertical-align:1px}
.rp-pxr.failed{color:var(--mod)}
.rp-pxr.sending{color:var(--ink3)}
.rp-sd-to{width:100%;margin:2px 0 6px}
/* identifiers on the report, from the scan and editable (2026-10-19) */
.rp-ids{display:flex;flex-direction:column;gap:6px;margin-top:10px}
.rp-id{display:grid;grid-template-columns:92px 1fr;align-items:center;gap:8px;font-size:12px;color:var(--ink2)}
.rp-id .field{height:26px;padding:0 6px;min-width:0}
