/* ================================================================ نصيح — document sub-screens */
.dc-ov{position:fixed;inset:0;z-index:150;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(6,26,58,.0);backdrop-filter:blur(0);pointer-events:none;transition:background .3s,backdrop-filter .3s}
.dc-ov.in{background:rgba(6,26,58,.48);backdrop-filter:blur(4px);pointer-events:auto}
.dc-win{width:min(1080px,100%);max-height:100%;display:flex;flex-direction:column;background:#EEF4FC;border-radius:22px;box-shadow:0 40px 90px rgba(3,14,34,.45);overflow:hidden;transform:translateY(30px) scale(.97);opacity:0;transition:transform .35s cubic-bezier(.2,.8,.2,1),opacity .25s}
.dc-ov.in .dc-win{transform:none;opacity:1}
.dc-bar{display:flex;align-items:center;gap:8px;padding:10px 14px;background:#fff;border-bottom:1px solid var(--line)}
.dc-crumb{font-size:12.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dc-crumb i{font-style:normal;margin:0 4px;color:var(--dim)}
.dc-sp{flex:1}
.dc-btn{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--line2);background:#fff;border-radius:10px;padding:7px 12px;font-size:12.5px;color:var(--soft)}
.dc-btn svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.dc-btn:hover{background:var(--gold-bg);border-color:var(--gold);color:var(--gold)}
.dc-btn.x{padding:7px}
.dc-body{overflow:auto;padding:22px}
.dc-paper{position:relative;background:#fff;border-radius:18px;padding:26px 28px;box-shadow:0 10px 30px rgba(10,59,120,.08);display:flex;flex-direction:column;gap:18px;animation:dcIn .45s both}
@keyframes dcIn{from{opacity:0;transform:translateY(14px)}}
.dc-paper::before{content:"";position:absolute;inset:0 0 auto 0;height:6px;border-radius:18px 18px 0 0;background:linear-gradient(90deg,#0A3B78,#0A74F0,#0DB89B)}
.dc-paper.is-ret::before{background:linear-gradient(90deg,#B42F28,#FD5F3A,#F5B841)}
.dc-paper.is-adv::before{background:linear-gradient(90deg,#0DB89B,#21D19F)}
.dc-head{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:16px;padding-bottom:16px;border-bottom:1.5px dashed var(--line2)}
.dc-brand{display:flex;align-items:center;gap:10px}.dc-brand img{width:78px}.dc-brand b{display:block;font-size:15px;color:#0A3B78}.dc-brand small{font-size:11.5px;color:var(--muted)}
.dc-title{text-align:center}.dc-title h2{font-size:22px;color:#0A3B78;letter-spacing:.5px}.dc-paper.is-ret .dc-title h2{color:#B42F28}
.dc-title span{font-size:18px;font-weight:700;color:var(--gold)}
.dc-meta{display:flex;flex-direction:column;align-items:flex-end;gap:4px;font-size:12.5px;color:var(--muted)}.dc-meta b{color:var(--text)}
.dc-stamp{margin-top:4px;display:inline-block;padding:4px 12px;border-radius:8px;border:2px solid;font-weight:700;font-size:12.5px;transform:rotate(-4deg)}
.dc-stamp.green{color:#08795F;border-color:#0DB89B;background:var(--teal-bg)}.dc-stamp.amber{color:#8A5A00;border-color:#E3A33B;background:#FFF6E5}.dc-stamp.red{color:#B42F28;border-color:#E0413A;background:var(--red-bg)}
.dc-grid3{display:grid;grid-template-columns:1.4fr 1fr 1fr;gap:12px}
.dc-pt,.dc-box{border:1px solid var(--line);border-radius:14px;padding:12px 14px;background:#F8FBFF;display:flex;flex-direction:column;gap:3px;min-width:0}
.dc-pt{flex-direction:row;align-items:center;gap:10px;flex-wrap:wrap}
.dc-pt > div:nth-child(2){flex:1;min-width:120px;display:flex;flex-direction:column}
.dc-pt b,.dc-box b{font-size:14px;color:var(--text)}.dc-pt small,.dc-box small{font-size:11.5px;color:var(--muted)}.dc-box span{font-size:12.5px;color:var(--soft)}
.dc-box.ins{background:#EEF6FF;border-color:#BFD9FA}.dc-box.due{background:#FFF6E5;border-color:#F3D08F}
.dc-av{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:linear-gradient(160deg,#1E88F7,#0A3B78);flex:0 0 auto}
.dc-av svg{width:22px;height:22px;fill:none;stroke:#fff;stroke-width:1.8}
.dc-pt-act{display:flex;gap:6px;flex-wrap:wrap}
.dc-chip{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--line2);background:#fff;border-radius:999px;padding:5px 11px;font-size:12px;color:var(--gold);cursor:pointer}
.dc-chip svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.9}
.dc-chip:hover{background:var(--gold-bg);border-color:var(--gold)}
.dc-tblw{overflow:auto;border:1px solid var(--line);border-radius:14px}
.dc-tblw.tall{max-height:46vh}
.dc-tbl{width:100%;border-collapse:collapse;font-size:12.5px}
.dc-tbl th{position:sticky;top:0;background:#0A3B78;color:#fff;font-weight:600;padding:9px 10px;white-space:nowrap}
.dc-paper.is-ret .dc-tbl th{background:#8E2A24}
.dc-tbl td{padding:9px 10px;border-top:1px solid var(--line);text-align:center;white-space:nowrap}
.dc-tbl td.tl,.dc-tbl th.tl{text-align:right;white-space:normal}
.dc-tbl td small{display:block;color:var(--muted);font-size:11px}
.dc-tbl tbody tr:nth-child(even){background:#F8FBFF}
.dc-tbl tbody tr:hover{background:var(--gold-bg)}
.dc-tbl .b{font-weight:700}.dc-tbl .dim,.dim{color:var(--dim)}
.dc-tbl tr.k-receipt td{color:#08795F}.dc-tbl tr.k-return td{color:#B42F28}
.dc-tbl tr.ok td{color:#08795F}
.amber{color:#B07200 !important}
.dc-tooth{display:inline-block;font-size:10.5px;background:#F1ECFD;color:#7B55D6;border-radius:6px;padding:1px 6px}
.dc-tag{display:inline-block;font-size:10.5px;background:#EEF3FA;color:var(--soft);border-radius:999px;padding:1px 7px}.dc-tag.red{background:var(--red-bg);color:#B42F28}
.dc-foot{display:grid;grid-template-columns:1fr minmax(260px,330px);gap:16px;align-items:start}
.dc-pays{display:flex;flex-direction:column;gap:8px}.dc-pays > small{font-size:12px;color:var(--muted)}
.dc-pays > div{display:flex;flex-wrap:wrap;gap:6px}.dc-pays.center{align-items:center}
.dc-pay{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:999px;background:var(--teal-bg);color:#08795F;font-size:12.5px}
.dc-pay i{width:7px;height:7px;border-radius:50%;background:#0DB89B}
.dc-linkrow{display:flex;align-items:center;flex-wrap:wrap;gap:6px;font-size:12.5px;padding:8px 12px;border-radius:10px;background:#F3F7FC;color:var(--soft)}
.dc-linkrow.red{background:var(--red-bg);color:#8E2A24}
.dc-linkrow svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.9}
.dc-link{border:0;background:none;color:var(--gold);font-weight:700;cursor:pointer;padding:0;text-decoration:underline;text-underline-offset:3px}
.dc-link.red{color:#B42F28}
.dc-note{margin:0;font-size:12.5px;color:var(--soft);background:#FFF8EC;border-radius:10px;padding:8px 12px}
.dc-totals{border:1px solid var(--line);border-radius:14px;overflow:hidden}
.dc-totals > div{display:flex;justify-content:space-between;gap:10px;padding:8px 14px;font-size:13px;border-top:1px solid var(--line)}
.dc-totals > div:first-child{border-top:0}
.dc-totals > div.big{background:#0A3B78;color:#fff;font-size:15px}.dc-paper.is-ret .dc-totals > div.big{background:#8E2A24}
.dc-totals > div.due{background:#F3F7FC}.dc-totals > div.due.on{background:#FFF0D6;color:#8A5A00;font-weight:700}
.dc-sys{margin:0;font-size:11px;color:var(--dim);text-align:center}
.dc-amount{display:flex;align-items:baseline;justify-content:center;gap:10px;padding:16px;border-radius:16px;background:linear-gradient(135deg,#F3F8FF,#E8F2FE)}
.dc-amount small{font-size:13px;color:var(--muted)}.dc-amount b{font-size:40px;color:#0A3B78}.dc-amount span{color:var(--muted)}.dc-amount em{font-style:normal;font-size:12.5px;color:var(--soft)}
.dc-voucher .dc-amount{animation:dcIn .5s .1s both}
.dc-paper.is-ret .dc-amount{background:linear-gradient(135deg,#FFF4F2,#FDEEEC)}.dc-paper.is-ret .dc-amount b{color:#B42F28}
.dc-prog{position:relative;height:26px;border-radius:999px;background:#EEF3FA;overflow:hidden}
.dc-prog i{position:absolute;inset:0 0 0 auto;background:linear-gradient(90deg,#21D19F,#0DB89B);border-radius:999px;animation:xgrow 1s both;transform-origin:right}
.dc-prog span{position:relative;display:block;text-align:center;line-height:26px;font-size:12.5px;font-weight:700;color:#0B2A6B}
.dc-kpis{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px}
.dc-kpis > div{border:1px solid var(--line);border-radius:12px;padding:8px 10px;display:flex;flex-direction:column;gap:2px;background:#F8FBFF}
.dc-kpis small{font-size:11px;color:var(--muted)}.dc-kpis b{font-size:14px}
.dc-empty{background:#fff;border-radius:16px;padding:30px;text-align:center;display:flex;flex-direction:column;gap:10px;align-items:center;color:var(--soft)}
/* inline card in the answer */
.dc-inline{display:flex;align-items:center;gap:14px;padding:16px}
.dc-inline > div{flex:1;display:flex;flex-direction:column;gap:2px;min-width:0}
.dc-inline b{font-size:15px}.dc-inline small{font-size:12px;color:var(--muted)}.dc-inline span{font-size:13px;color:var(--soft)}
.dc-ic{width:48px;height:48px;border-radius:14px;display:grid;place-items:center;background:var(--gold-bg);flex:0 0 auto}
.dc-ic svg{width:24px;height:24px;fill:none;stroke:var(--gold);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.dc-ic.red{background:var(--red-bg)}.dc-ic.red svg{stroke:#E0413A}
.dc-open{border:0;border-radius:12px;padding:10px 16px;font-weight:600;white-space:nowrap}
.dc-list tbody tr{cursor:pointer}
.dc-list tbody tr:hover td{background:var(--gold-bg)}
.dc-list td small{color:var(--muted)}
@media (max-width:860px){
  .dc-ov{padding:0}.dc-win{border-radius:0;height:100%}.dc-body{padding:12px}.dc-paper{padding:18px 14px}
  .dc-head{grid-template-columns:1fr;text-align:center}.dc-meta{align-items:center}.dc-brand{justify-content:center}
  .dc-grid3,.dc-foot{grid-template-columns:minmax(0,1fr)}.dc-kpis{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media print{
  body.dc-printing > *:not(.dc-ov){display:none !important}
  body.dc-printing .dc-ov{position:static;background:none;backdrop-filter:none;padding:0}
  body.dc-printing .dc-win{box-shadow:none;max-height:none;background:#fff}
  body.dc-printing .dc-bar,body.dc-printing .dc-pt-act{display:none}
  body.dc-printing .dc-body{overflow:visible;padding:0}
  body.dc-printing .dc-tblw.tall{max-height:none}
}
@media (prefers-reduced-motion:reduce){ .dc-win,.dc-paper,.dc-voucher .dc-amount{animation:none;transition:none} }

/* ================================================================ documents — one calm system for invoice · return · receipt · statement · installment · patient record
   type scale 11.5 / 12.5 / 13.5 / 15 / 22 / 30 · one font (Plex Arabic) · brand navy + blue · equal-width grids */
.dc-win{font-family:'Plex Arabic',Tahoma,sans-serif}
.dc-win.wide{width:min(1160px,100%)}
.dc-body{background:#F3F7FC}
.px{--ink:#0B2A6B;--mut:#6E83A6;--ln:#E2EBF6;--soft:#F6F9FD;--navy:#0A3B78;--acc:#0A74F0;
  --c-cash:#0DB89B;--c-ins:#2D8DFA;--c-later:#6D5BD0;--c-adj:#A3B1C6;--c-due:#E9A23B;
  display:flex;flex-direction:column;gap:14px;color:var(--ink);font-size:13.5px;line-height:1.55;animation:dcIn .35s both}
.px.is-ret{--navy:#8E2A24;--acc:#D2453B}
.px .num{font-variant-numeric:tabular-nums}
.px small{font-size:11.5px}
.px .dim{color:#9FB0C8}
/* hero */
.px-hero{position:relative;background:#fff;border:1px solid var(--ln);border-radius:16px;padding:20px 22px 18px;display:flex;flex-direction:column;gap:16px;overflow:hidden}
.px-hero::before{content:"";position:absolute;inset:0 0 auto 0;height:4px;background:linear-gradient(90deg,var(--navy),var(--acc))}
.px-top{display:flex;align-items:center;gap:18px;flex-wrap:wrap}
.px-idb{flex:1;min-width:220px;display:flex;flex-direction:column;gap:3px}
.px-kicker{display:flex;align-items:center;flex-wrap:wrap;gap:8px;font-size:12.5px;color:var(--mut);font-weight:500}
.px-hero h2{margin:0;font-size:22px;font-weight:700;color:var(--navy);line-height:1.35}
.px-sub{font-size:12.5px;color:var(--mut)}
.px-en{font-size:13px;color:var(--mut);letter-spacing:.2px}
.px-amt{display:flex;flex-direction:column;align-items:flex-end;text-align:left;padding-inline-start:22px;border-inline-start:1px solid var(--ln)}
.px-amt small{color:var(--mut)}
.px-amt b{font-size:30px;font-weight:700;color:var(--navy);line-height:1.2}
.px-amt em{font-style:normal;font-size:12px;color:var(--mut)}
.px-pill{display:inline-flex;align-items:center;gap:5px;padding:2px 10px;border-radius:999px;font-size:11.5px;font-weight:600;background:#EEF3FA;color:#4C6390}
.px-pill::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor}
.px-pill.green{background:#E3F8F3;color:#08795F}.px-pill.amber{background:#FFF3DF;color:#9A6200}.px-pill.red{background:#FDEEEC;color:#B42F28}.px-pill.blue{background:#E8F2FE;color:#0A5FC4}
/* equal tiles */
.px-tiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.px-tile{background:var(--soft);border:1px solid var(--ln);border-radius:12px;padding:10px 14px;display:flex;flex-direction:column;gap:1px;min-width:0}
.px-tile small{color:var(--mut)}
.px-tile b{font-size:15px;font-weight:700;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.px-tile em{font-style:normal;font-size:11.5px;color:var(--mut);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.px-tile.due{background:#FFF8EC;border-color:#F5DDB0}.px-tile.due b{color:#A86600}
.px-tile.ok b{color:#08795F}
.px-tile.next{background:#EEF6FF;border-color:#CFE3FB}.px-tile.next b{color:#0A5FC4}
.px-tile .dc-link{font-size:15px}
/* actions */
.px-acts{display:flex;flex-wrap:wrap;gap:8px}
.px-act{display:inline-flex;align-items:center;gap:6px;height:34px;border:1px solid var(--ln);background:#fff;border-radius:10px;padding:0 12px;font-size:12.5px;font-weight:600;color:var(--navy);transition:background .15s,border-color .15s,color .15s}
.px-act svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.px-act:hover{background:var(--navy);border-color:var(--navy);color:#fff}
.px-copy{display:inline-flex;align-items:center;gap:4px;border:0;background:none;padding:0;color:inherit;font-weight:600;font-size:inherit}
.px-copy svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:2;opacity:.45}
.px-copy:hover svg{opacity:1}.px-copy.ok svg{stroke:#0DB89B;opacity:1}
/* flow bar */
.px-flow{display:flex;flex-direction:column;gap:8px;padding-top:14px;border-top:1px solid var(--ln)}
.px-bar,.px-prog{display:flex;height:10px;border-radius:999px;overflow:hidden;background:#EEF3FA;gap:2px}
.px-bar i{width:var(--w);transform-origin:right;animation:pxGrow .8s cubic-bezier(.2,.8,.2,1) both;animation-delay:var(--d,0ms)}
.px-bar i.none{background:#E3EAF4}
.px-prog i{background:linear-gradient(90deg,#0DB89B,#21D19F);border-radius:999px;transform-origin:right;animation:pxGrow .8s both}
@keyframes pxGrow{from{transform:scaleX(0)}}
.s-cash{background:var(--c-cash)}.s-ins{background:var(--c-ins)}.s-later{background:var(--c-later)}.s-adj{background:var(--c-adj)}.s-due{background:var(--c-due)}
.px-legend{display:flex;flex-wrap:wrap;gap:4px 18px;font-size:12px;color:var(--mut)}
.px-legend span{display:inline-flex;align-items:center;gap:6px}.px-legend span.off{opacity:.45}
.px-legend i{width:9px;height:9px;border-radius:3px}.px-legend b{color:var(--ink);font-weight:600}
/* layout */
.px-row2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;align-items:stretch}
.px-row2 > .wide{grid-column:1/-1}
.px-stack{display:flex;flex-direction:column;gap:14px;min-width:0}
.px-stack > .px-block{flex:1}
.px-block{background:#fff;border:1px solid var(--ln);border-radius:16px;padding:16px 18px;min-width:0;display:flex;flex-direction:column}
.px-bh{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px;flex-wrap:wrap}
.px-bh h3{display:flex;align-items:center;gap:8px;margin:0;font-size:15px;font-weight:700;color:var(--ink)}
.px-bh > span{font-size:12px;color:var(--mut)}
.px-h-ic{width:28px;height:28px;border-radius:8px;display:grid;place-items:center;background:#EEF5FE;color:var(--acc)}
.px-h-ic svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.px-empty{margin:0;padding:6px 0;color:var(--mut);font-size:13px}
/* party cards */
.px-who-s{display:flex;align-items:center;gap:12px;margin-bottom:14px}
.px-who-s > div{display:flex;flex-direction:column;min-width:0}
.px-who-s b{font-size:15px;font-weight:700}.px-who-s span{font-size:12.5px;color:var(--mut)}
.px-av{width:44px;height:44px;border-radius:12px;display:grid;place-items:center;flex:none;font-weight:700;font-size:15px;color:#fff;background:linear-gradient(150deg,#1E88F7,#0A3B78)}
.px-party .px-acts{margin-top:auto}
.px-cashbox{flex:1;display:flex;flex-direction:column;justify-content:center;gap:2px;padding:14px 16px;border-radius:12px;background:var(--soft);border:1px dashed #CBD8EA}
.px-cashbox b{font-size:15px}.px-cashbox span{font-size:12.5px;color:var(--mut)}
/* fields */
.px-fs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:18px}
.px-fs.c4{grid-template-columns:repeat(4,minmax(0,1fr))}
.px-f{padding:8px 0;border-bottom:1px solid #EEF3FA;min-width:0}
.px-f small{display:block;color:var(--mut)}
.px-f b{display:block;font-size:13.5px;font-weight:600;overflow-wrap:anywhere}
.px-f.wide{grid-column:1/-1}.px-f.en b{direction:ltr;text-align:right}
/* tables */
.px-tblw{overflow:auto;border:1px solid var(--ln);border-radius:12px}
.px-tblw.tall{max-height:52vh}
.px-tbl{width:100%;border-collapse:collapse;font-size:13px}
.px-tbl th{position:sticky;top:0;background:#F2F7FD;color:var(--navy);font-weight:600;font-size:12px;padding:9px 12px;text-align:left;white-space:nowrap;border-bottom:1px solid var(--ln)}
.px-tbl td{padding:10px 12px;border-top:1px solid #EEF3FA;text-align:left;white-space:nowrap}
.px-tbl tbody tr:first-child td{border-top:0}
.px-tbl .tl{text-align:right;white-space:normal}.px-tbl .c{text-align:center}
.px-tbl td b{font-weight:600}.px-tbl td small{display:block;color:var(--mut)}
.px-tbl td.b{font-weight:700}.px-tbl td.red{color:#C2492F}.px-tbl td.amber{color:#A86600}
.px-tbl tbody tr{animation:dcIn .3s both;animation-delay:var(--d,0ms)}
.px-tbl tbody tr:hover td{background:#F7FAFE}
.px-tbl tr.k-receipt td{color:#08795F}.px-tbl tr.k-return td{color:#B42F28}.px-tbl tr.ok td{color:#08795F}
.px-tooth{font-size:11px;background:#F1ECFD;color:#6B4BC8;border-radius:6px;padding:0 6px}
.px-tag{display:inline-block;font-size:11px;background:#EEF3FA;color:#4C6390;border-radius:999px;padding:0 8px}.px-tag.red{background:#FDEEEC;color:#B42F28}
/* timeline */
.px-tl{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.px-tl li{position:relative;display:flex;gap:12px;padding:0 0 14px;animation:dcIn .35s both;animation-delay:var(--d)}
.px-tl li::before{content:"";position:absolute;right:7px;top:18px;bottom:0;width:2px;background:var(--ln)}
.px-tl li:last-child::before{display:none}.px-tl li:last-child{padding-bottom:0}
.px-tl li > i{width:16px;height:16px;flex:none;margin-top:3px;border-radius:50%;background:#fff;border:2px solid #C8D6EA;position:relative;z-index:1}
.px-tl li.done > i{border-color:var(--c-cash);background:var(--c-cash);box-shadow:inset 0 0 0 3px #fff}
.px-tl li.wait > i{border-color:var(--c-ins)}
.px-tl li.skip > i{border-style:dashed}.px-tl li.skip b{color:var(--mut)}
.px-tl li.bad > i{border-color:#D2453B;background:#D2453B;box-shadow:inset 0 0 0 3px #fff}
.px-tl li.now.due > i{border-color:var(--c-due);background:var(--c-due);animation:pxPing 1.8s infinite}
.px-tl li.now.ok > i{border-color:var(--c-cash);background:var(--c-cash)}
@keyframes pxPing{0%{box-shadow:0 0 0 0 rgba(233,162,59,.45)}100%{box-shadow:0 0 0 9px rgba(233,162,59,0)}}
.px-tl b{display:block;font-size:13.5px;font-weight:600}.px-tl small{display:block;color:var(--mut);font-size:12px}
.px-tl small b{display:inline;font-size:12px;color:var(--ink)}
.px-note{margin:12px 0 0;font-size:12.5px;color:#7A5300;background:#FFF8EC;border:1px solid #F5DDB0;border-radius:10px;padding:8px 12px}
.px-note::before{content:"ملاحظة: ";font-weight:700}
/* totals */
.px-sum{display:flex;flex-direction:column}
.px-sum > div{display:flex;justify-content:space-between;gap:10px;padding:7px 2px;font-size:13px;color:#3C5683;border-bottom:1px dashed #E6EDF7}
.px-sum > div b{color:var(--ink);font-weight:600}
.px-sum .tot{margin:6px 0;padding:11px 14px;border:0;border-radius:12px;background:var(--navy);color:#fff;font-size:14px}
.px-sum .tot b{color:#fff;font-size:18px;font-weight:700}
.px-sum .due{margin-top:6px;padding:10px 14px;border:0;border-radius:12px;background:var(--soft)}
.px-sum .due.on{background:#FFF8EC;color:#8A5A00}.px-sum .due.on b{color:#A86600;font-size:15px}
.px-legal{display:flex;flex-wrap:wrap;justify-content:center;gap:4px 18px;font-size:11.5px;color:var(--mut)}
/* patient record */
.px-person{flex:1;min-width:260px;display:flex;align-items:center;gap:16px}
.px-avbig{position:relative;width:64px;height:64px;flex:none;border-radius:18px;display:grid;place-items:center;font-size:22px;font-weight:700;color:#fff;background:linear-gradient(150deg,#1E88F7,#0A3B78);box-shadow:0 8px 18px -10px rgba(10,59,120,.7)}
.px-avbig i{position:absolute;bottom:-3px;left:-3px;width:16px;height:16px;border-radius:50%;border:3px solid #fff;background:#A3B1C6}
.px-avbig i.on{background:#0DB89B}
.px-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.px-chips > span{display:inline-flex;align-items:center;gap:4px;padding:2px 10px;border-radius:8px;background:var(--soft);border:1px solid var(--ln);font-size:12.5px;color:#3C5683}
.px-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;background:#fff;border:1px solid var(--ln);border-radius:12px;padding:4px;position:sticky;top:-22px;z-index:3}
.px-tabs button{border:0;background:none;height:38px;border-radius:9px;font-size:13.5px;font-weight:600;color:var(--mut);transition:background .2s,color .2s}
.px-tabs button:hover{color:var(--ink);background:var(--soft)}
.px-tabs button.on{background:var(--navy);color:#fff}
.px-pane{display:none;flex-direction:column;gap:14px}.px-pane.on{display:flex;animation:dcIn .3s both}
.px-alert{display:flex;align-items:center;gap:8px;padding:10px 14px;border-radius:12px;background:#FDEEEC;border:1px solid #F6C9C4;color:#9B2C25;font-size:13px;font-weight:600}
.px-alert svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2}
.px-visits{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.px-visits li{display:grid;grid-template-columns:12px minmax(0,1fr) auto 92px;align-items:center;gap:12px;padding:10px 8px;border-top:1px solid #EEF3FA;cursor:pointer;animation:dcIn .35s both;animation-delay:var(--d);transition:background .15s}
.px-visits li:first-child{border-top:0}
.px-visits li:hover,.px-visits li:focus-visible{background:#F5F9FE;outline:none;border-radius:10px}
.px-visits li > i{width:10px;height:10px;border-radius:50%;background:var(--c-cash)}
.px-visits li.due > i{background:var(--c-due)}.px-visits li.ret > i{background:#D2453B}
.px-visits b{font-size:13.5px;font-weight:600}.px-visits small{display:block;color:var(--mut)}
.px-vt{display:flex;gap:4px;flex-wrap:wrap;justify-content:flex-end}
.px-vt em{font-style:normal;font-size:11px;padding:1px 8px;border-radius:999px;background:#EEF3FA;color:#4C6390}
.px-vt em.g{background:#E3F8F3;color:#08795F}.px-vt em.a{background:#FFF3DF;color:#9A6200}.px-vt em.r{background:#FDEEEC;color:#B42F28}
.px-va{text-align:left;font-size:13.5px}
.px-visits li.ret .px-va{text-decoration:line-through;color:var(--mut)}
.px-money{display:flex;align-items:center;gap:18px}
.px-donut{position:relative;width:128px;height:128px;flex:none}
.px-donut svg{width:100%;height:100%;transform:rotate(-90deg)}
.px-donut circle{fill:none;stroke-width:12;animation:dcIn .6s both}
.px-donut circle.bg{stroke:#EEF3FA}
.px-donut circle.s-cash{stroke:var(--c-cash)}.px-donut circle.s-ins{stroke:var(--c-ins)}.px-donut circle.s-later{stroke:var(--c-later)}.px-donut circle.s-adj{stroke:var(--c-adj)}.px-donut circle.s-due{stroke:var(--c-due)}
.px-donut > div{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
.px-donut b{font-size:18px;font-weight:700}.px-donut small{font-size:10.5px;color:var(--mut)}
.px-ml{list-style:none;margin:0;padding:0;flex:1;display:flex;flex-direction:column;gap:7px;font-size:13px;color:#3C5683}
.px-ml li{display:flex;align-items:center;gap:8px}.px-ml li b{margin-right:auto;color:var(--ink);font-weight:600}
.px-ml li i{width:9px;height:9px;border-radius:3px;flex:none}
.px-ml li.due{color:#9A6200;font-weight:600}.px-ml li.due b{color:#A86600}
.px-cl{display:flex;flex-direction:column;gap:10px}
.px-cl > div{display:grid;grid-template-columns:120px minmax(0,1fr) 28px;align-items:center;gap:10px;font-size:13px;animation:dcIn .35s both;animation-delay:var(--d)}
.px-cl span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.px-cl i{height:8px;border-radius:999px;background:#EEF3FA;overflow:hidden}
.px-cl u{display:block;height:100%;width:var(--w);border-radius:999px;background:linear-gradient(90deg,#2D8DFA,#0A3B78);transform-origin:right;animation:pxGrow .8s both}
.px-cl b{text-align:left;font-weight:600}
.px-inscard{display:flex;flex-direction:column;gap:10px;padding:16px 18px;margin-bottom:8px;border-radius:14px;color:#fff;background:linear-gradient(135deg,#0A3B78,#0A74F0)}
.px-ic-top{display:flex;justify-content:space-between;align-items:center;gap:8px}.px-ic-top b{font-size:15px}.px-ic-top span{font-size:11.5px;padding:1px 9px;border-radius:999px;background:rgba(255,255,255,.18)}
.px-ic-no{font-size:18px;letter-spacing:2px;font-weight:600}
.px-ic-bot{display:flex;justify-content:space-between;gap:10px;font-size:12px;opacity:.85}
.px-fam{display:flex;flex-wrap:wrap;gap:8px}
.px-fam span{display:inline-flex;align-items:center;gap:8px;padding:4px 12px 4px 4px;border-radius:999px;border:1px solid var(--ln);font-size:13px;background:var(--soft)}
.px-fam i{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;font-style:normal;font-size:11px;font-weight:700;color:#fff;background:linear-gradient(150deg,#1E88F7,#0A3B78)}
/* send-by-email card above the sub-screen */
.rp-ov{z-index:220}
.rp-form{display:grid;grid-template-columns:1fr auto auto;gap:8px;align-items:center;margin:4px 0 6px}
.rp-form label{grid-column:1/-1;font-size:12.5px;color:var(--muted)}
.rp-form input{height:42px;border:1px solid var(--line2);border-radius:12px;padding:0 12px;font-size:14px;min-width:0}
.rp-form input:focus{outline:2px solid var(--gold);outline-offset:1px}
.rp-form button{height:42px;padding:0 16px;border-radius:12px;font-weight:600}
.rp-fail{position:absolute;left:50%;top:38px;width:76px;height:76px;margin-left:-38px;border-radius:50%;background:#C53B3B;display:flex;align-items:center;justify-content:center;opacity:0;transform:scale(.5);transition:all .35s cubic-bezier(.3,1.4,.5,1)}
.rp-fail svg{width:36px;height:36px;fill:none;stroke:#fff;stroke-width:3;stroke-linecap:round}
.rp-card[data-phase="fail"] .rp-fail{opacity:1;transform:none}
.rp-card[data-phase="fail"] .rp-doc,.rp-card[data-phase="fail"] .rp-env{opacity:0}
.rp-steps li.err{color:#B42F28;font-weight:600}
.rp-steps li.err span{background:#C53B3B;border-color:#C53B3B}
.rp-steps li .rp-err:empty{display:none}
.rp-bar i.err{background:#C53B3B}
.dc-bar .dc-btn[data-dc="mail"]{color:#0A5FC4;border-color:#CFE3FB;background:#F2F8FF}
/* responsive */
@media (max-width:1000px){
  .px-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}
  .px-fs.c4{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:760px){
  .dc-bar .dc-btn{font-size:0;gap:0;padding:8px}.dc-bar .dc-btn svg{width:18px;height:18px}
  .px-hero{padding:16px 14px}
  .px-hero h2{font-size:19px}
  .px-amt{width:100%;align-items:flex-start;text-align:right;padding:10px 0 0;border:0;border-top:1px solid var(--ln)}
  .px-amt b{font-size:26px}
  .px-row2{grid-template-columns:minmax(0,1fr)}
  .px-block{padding:14px}
  .px-tabs{top:-12px}.px-tabs button{font-size:12.5px;height:36px}
  .px-visits li{grid-template-columns:10px minmax(0,1fr) auto;grid-template-areas:"i c a" "i t t"}
  .px-visits li > i{grid-area:i}.px-visits li > div{grid-area:c}.px-va{grid-area:a}.px-vt{grid-area:t;justify-content:flex-start}
  .px-money{flex-direction:column;align-items:stretch}.px-donut{align-self:center}
  .px-cl > div{grid-template-columns:96px minmax(0,1fr) 24px}
  .px-person{min-width:0;align-items:flex-start}.px-avbig{width:52px;height:52px;font-size:18px;border-radius:14px}
}
@media print{
  body.dc-printing .px-pane{display:flex !important;margin-bottom:12px}
  body.dc-printing .px-tabs,body.dc-printing .px-acts,body.dc-printing .px-act{display:none !important}
  body.dc-printing .px *{animation:none !important}
  body.dc-printing .px-block,body.dc-printing .px-hero{break-inside:avoid}
  body.dc-printing .px-tblw.tall{max-height:none}
  body.dc-printing .dc-body{background:#fff}
  body.dc-printing .px-hero,body.dc-printing .px-sum .tot,body.dc-printing .px-inscard,body.dc-printing .px-bar i{-webkit-print-color-adjust:exact;print-color-adjust:exact}
}
@media (prefers-reduced-motion:reduce){.px,.px *{animation:none !important;transition:none !important}}
.px-en{text-align:right}
