.p3-record-viewer-backdrop{position:fixed;inset:0;z-index:12000;background:rgba(15,23,42,.72);display:grid;place-items:center;padding:2vh 1.5vw}.p3-record-viewer-modal{width:min(96vw,1840px);height:96vh;background:#f8fafc;border-radius:20px;box-shadow:0 30px 90px rgba(15,23,42,.34);overflow:hidden;display:flex;flex-direction:column}/* PDF PREPARE & SEND (2026-08-23): top chrome trimmed for the hard height
   constraint (build order item 6, new plain-viewer height must be <= the
   old baseline) — the "Patient record" subtitle line (facility name + "PDF
   DOCUMENT" badge + "Scroll to review every page" hint) is removed
   entirely per the build order's own cleanup items, which is what makes
   the reduction possible: one text row is gone, not just shrunk. */
.p3-record-viewer-head{background:#fff;border-bottom:1px solid #dbe3ee;padding:9px 44px 9px 16px;display:flex;gap:14px;align-items:center;flex-wrap:wrap;flex:none;position:relative;min-height:0}
.p3-record-viewer-head h2{font-size:15px;margin:0;color:#17233b;font-weight:750;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:34vw}
.p3-record-x{position:absolute;top:8px;right:10px;width:26px;height:26px;border:0;background:#f2f4f7;border-radius:8px;color:#4f5b70;font-size:15px;line-height:1;cursor:default}
.p3-record-x:hover{background:#e7eaee}
.p3-record-viewer-actions{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap;flex:1;min-width:0}
/* Icon-led, tighter than before — no oversized buttons. Each .p3-act-* gets
   its OWN faint pastel tint (equal weight, none more prominent) except
   .p3-act-prepare (PDF Prepare & Send), the one deliberately distinct
   button per the visual spec. */
.p3-act{display:inline-flex;align-items:center;gap:5px;border:1px solid transparent;border-radius:8px;padding:6px 10px;font-weight:700;font-size:12px;white-space:nowrap;cursor:default}
.p3-act svg{flex:none}
.p3-act:disabled{opacity:.45;cursor:not-allowed}
.p3-act-prepare{background:#fdf1f5;border-color:#f3c9dc;color:#a23a6e}
.p3-act-prepare.active{background:#f9dde9;border-color:#e59fc0}
/* SECTION A / A3 FIX (2026-08-24, Button Color Law, from the original PDF
   Prepare & Send merge order): exactly ONE button in this workspace carries
   color emphasis — PDF Prepare & Send, in .p3-act-prepare's soft pink/rose
   (below, unchanged). Every other action here — Print, Download, Email, Send
   Fax, Add Document — shares this one neutral tint. They previously each had
   their own distinct pastel (blue/green/gold/purple/teal), which read as five
   more things competing for attention instead of one clear call to action. */
.p3-act-print,.p3-act-download,.p3-act-email,.p3-act-fax,.p3-act-adddoc,.p3-act-back-arrange{background:#f8fafc;border-color:#dbe3ee;color:#3e4d67}
/* #466 — THE LINK OFFER. The Button Color Law above says exactly one button carries emphasis: the call to action.
   When the viewer has been opened from the chooser to CONFIRM a document before attaching it, that one button is
   "Link This Record" — finishing the link is the only reason this window is open. It appears solely when a caller
   supplied a link offer, so every ordinary document open still shows the four neutral law-4.15 actions and no colour.
   Cancel sits beside it in the neutral tint: a labelled way back to the chooser, never the × alone (law 5.20). */
.p3-act-link{background:#eaf3ff;border-color:#b6d3f5;color:#1b4f8a;font-weight:800}
.p3-act-link:not(:disabled):hover{background:#dcebff;border-color:#99c1ef}
.p3-act-linkcancel{background:#f8fafc;border-color:#dbe3ee;color:#3e4d67}
:root:not([data-theme="light"]) .p3-act-link,:root[data-theme="dark"] .p3-act-link{background:#16324f;border-color:#2b5c8f;color:#cfe4ff}
:root:not([data-theme="light"]) .p3-act-linkcancel,:root[data-theme="dark"] .p3-act-linkcancel{background:#1b2331;border-color:#33405400;color:#c7d2e2}
.p3-record-viewer-actions button:not(.p3-act){border:1px solid #d7e0eb;background:#fff;color:#253653;border-radius:8px;padding:6px 11px;font-weight:750;font-size:12.5px}
.p3-record-viewer-actions button:disabled{opacity:.5;cursor:not-allowed}
.p3-record-viewer-layout>main.p3-adddoc-drag-over,.p3-record-viewer-layout>main{transition:box-shadow .12s}
.p3-record-viewer-layout>main.p3-adddoc-drag-over{box-shadow:inset 0 0 0 3px #2f72e5}.p3-record-viewer-message{margin:auto;display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center;color:#40516e}.p3-record-viewer-message>span{width:34px;height:34px;border:4px solid #dbe8fb;border-top-color:#3678e8;border-radius:50%;animation:p3ViewerSpin .8s linear infinite}.p3-record-viewer-message small{max-width:520px;color:#718096}.p3-record-viewer-message.error strong{color:#b4232d}.p3-record-viewer-message.error button{padding:9px 18px;border:1px solid #d5deea;border-radius:8px;background:#fff}.p3-record-viewer-layout{display:grid;grid-template-columns:190px minmax(0,1fr);min-height:0;flex:1}.p3-record-viewer-layout.email-open{grid-template-columns:150px minmax(360px,1fr) minmax(420px,48%)}.p3-record-viewer-layout>aside{background:#f8fafc;border-right:1px solid #dbe3ee;padding:16px 12px;overflow:auto}.p3-record-viewer-layout>aside>strong{color:#17233b}.p3-record-viewer-layout>aside>p{font-size:12px;line-height:1.45;color:#718096;margin:7px 0 12px}.p3-record-viewer-layout>aside>div{display:grid;gap:12px}.p3-record-viewer-layout>aside button{display:grid;gap:6px;border:2px solid transparent;background:#fff;border-radius:10px;padding:8px;color:#3e4d67;font-weight:750;box-shadow:0 2px 8px rgba(15,23,42,.07)}.p3-record-viewer-layout>aside button.active{border-color:#3479e8;background:#edf5ff}.p3-record-viewer-layout>aside canvas{display:block;max-width:100%;margin:auto;background:#fff}.p3-record-viewer-layout>main{overflow:auto;padding:18px 30px;background:#e8edf3;scroll-behavior:smooth}.p3-record-viewer-layout.email-open>main{padding:14px}.p3-record-viewer-layout>main article{width:max-content;max-width:100%;margin:0 auto 22px;background:#fff;border-radius:6px;box-shadow:0 4px 16px rgba(15,23,42,.15);position:relative;scroll-margin-top:16px}.p3-record-viewer-layout>main article canvas{display:block;max-width:100%;height:auto}.p3-record-viewer-layout>main article span{position:absolute;right:10px;bottom:8px;padding:4px 8px;border-radius:999px;background:rgba(15,23,42,.72);color:#fff;font-size:11px}.p3-record-viewer-print-frame{position:fixed;width:1px;height:1px;opacity:0;pointer-events:none}@keyframes p3ViewerSpin{to{transform:rotate(360deg)}}@media(max-width:1180px){.p3-record-viewer-layout.email-open{grid-template-columns:120px minmax(320px,.85fr) minmax(390px,1.15fr)}}@media(max-width:900px){.p3-record-viewer-head{align-items:flex-start;flex-direction:column}.p3-record-viewer-actions{justify-content:flex-start}.p3-record-viewer-layout,.p3-record-viewer-layout.email-open{grid-template-columns:110px minmax(0,1fr)}.p3-record-viewer-layout.email-open .p3-record-email-pane{position:absolute;inset:0 0 0 110px;z-index:3;box-shadow:-16px 0 40px rgba(15,23,42,.2)}.p3-record-viewer-layout{position:relative}.p3-record-viewer-layout>main{padding:12px}}

#p3-record-viewer-portal{position:relative;z-index:12000}
.p3-record-viewer-split-modal{width:min(98vw,1920px);height:96vh;display:block;overflow:auto;padding:18px;background:#f8fafc}
.p3-record-viewer-split-modal .p3-pdf-workspace{min-height:calc(96vh - 36px)}

/* ── PVT2'S SIZE AND SIMPLICITY (David's refinement, 2026-08-09) ──────
   The viewer was min(96vw,1840px) x 96vh — near-full-screen, which is what he
   compared unfavourably against PVT2 side by side.

   PVT2 renders each page at a target width of 900px
   ("Target ~900px wide for legibility", pvt2-export/html.txt:18128-18129) and
   appends the canvases vertically into ONE container. No rail, no page
   navigation furniture. So the modal only has to be wide enough to hold a
   900px page plus its gutters: 900 + 2x30 = 960px.

   Height is capped rather than filling the screen; a US Letter page at 900px
   wide is 1164px tall, so the pane scrolls — which is PVT2's behaviour too.
   These rules are appended last so they win without editing the originals. */
.p3-record-viewer-modal{width:min(94vw,960px);height:min(88vh,1120px);border-radius:14px}
/* THE RAIL IS GONE — one document pane, and one more column only when the
   email composer is open. */
.p3-record-viewer-layout{grid-template-columns:minmax(0,1fr)}
.p3-record-viewer-layout.email-open{grid-template-columns:minmax(0,1fr)}
.p3-record-viewer-layout>aside{display:none}
/* With the composer open the modal widens to hold both panes side by side,
   rather than squeezing the page it exists to show. */
.p3-record-viewer-modal:has(.p3-record-viewer-layout.email-open){width:min(96vw,1520px)}
.p3-record-viewer-layout.email-open{grid-template-columns:minmax(0,1fr) minmax(420px,540px)}
/* Quick-pick recipients for forward mode — the four practice accounts David
   named. Typing any other address stays available; these are shortcuts, not a
   restriction. */
.p3-record-email-chips{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}
.p3-record-email-chips button{border:1px solid #c9d3e0;border-radius:999px;background:#f4f7fb;padding:3px 9px;color:#31445f;font-size:10px;cursor:pointer}
.p3-record-email-chips button:hover{border-color:#7ba7e0;background:#e8f1fd}
