/* Cashflow OS free document maker — on-document editor, A4 paper (Classic / Modern / Compact) and print (2026-11-07).
   Used by /tools/*-generator|maker and /formats/*. The tool widgets (GST, QR, logo…) are styled in widgets.css. */
.dm,.dm-sample{--dm-ink:#0f1420;--dm-line:#e2e6ef;--dm-soft:#f3f5fa;--dm-blue:#1559EA;min-width:0}
.dm{position:relative;margin:4px 0 34px}
.dm-sample,.dm-table{margin:8px 0 30px}
.dm-vh{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0 0 0 0)!important;white-space:nowrap!important;opacity:0}
.dm-hint{font-size:13px;color:#b42318;margin:6px 0 0;font-weight:600}
.dm-only-m{display:none!important}

/* ── toolbar */
.dm-tb{position:sticky;top:var(--dm-top,72px);z-index:4;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:8px;
  background:rgba(255,255,255,.9);-webkit-backdrop-filter:saturate(1.6) blur(14px);backdrop-filter:saturate(1.6) blur(14px);border:1px solid var(--dm-line);border-radius:16px;
  box-shadow:0 1px 2px rgba(15,23,42,.05),0 14px 34px -18px rgba(15,23,42,.28)}
.dm-tb.dm-open{z-index:1000}
.dm-tb-l,.dm-tb-r{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0}
.dm-tbtn{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:38px;padding:0 13px;border-radius:11px;border:1px solid var(--dm-line);background:#fff;color:var(--dm-ink);
  font-family:inherit;font-size:14px;font-weight:650;line-height:1;cursor:pointer;text-decoration:none;white-space:nowrap;transition:background .15s,border-color .15s,box-shadow .15s,transform .08s}
.dm-tbtn svg{width:17px;height:17px;flex:none}
.dm-tbtn:hover{background:#f2f6ff;border-color:#c8d6f6;color:var(--dm-ink)}
.dm-tbtn:active{transform:translateY(1px)}
.dm-tbtn:focus-visible,.dm-seg button:focus-visible,.dm-sw button:focus-visible,.dm-type select:focus-visible,.dm-mini:focus-visible,.dm-rt button:focus-visible,.dm-addrow button:focus-visible,.dm-logo-add:focus-visible,.dm-sig-add:focus-visible,.dm-ghostbtn:focus-visible,.dm-logo-hit:focus-visible{outline:3px solid rgba(21,89,234,.38);outline-offset:2px}
.dm-icon{width:38px;padding:0}
.dm-primary{background:var(--dm-blue);border-color:var(--dm-blue);color:#fff;box-shadow:0 8px 18px -10px rgba(21,89,234,.9)}
.dm-primary:hover{background:#0d3fb8;border-color:#0d3fb8;color:#fff}
.dm-wa{background:#25D366;border-color:#25D366;color:#fff}
.dm-wa:hover{background:#1eb757;border-color:#1eb757;color:#fff}
.dm-type{position:relative;display:inline-flex;align-items:center;gap:6px;height:38px;padding:0 4px 0 10px;border-radius:11px;background:var(--dm-soft);border:1px solid var(--dm-line);min-width:0}
.dm-type svg{width:17px;height:17px;color:var(--dm-blue);flex:none}
.dm-type select{border:0;background:transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%233a4254' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 6px center/10px 6px;
  -webkit-appearance:none;appearance:none;font-family:inherit;font-size:14.5px;font-weight:750;color:var(--dm-ink);padding:0 24px 0 0;height:36px;cursor:pointer;min-width:0;max-width:100%;border-radius:8px}
.dm-seg{display:inline-flex;padding:3px;gap:2px;background:var(--dm-soft);border:1px solid var(--dm-line);border-radius:11px}
.dm-seg button{border:0;background:transparent;height:30px;padding:0 10px;border-radius:8px;font-family:inherit;font-size:13.5px;font-weight:650;color:#4a5468;cursor:pointer;transition:background .15s,color .15s}
.dm-seg button:hover{color:var(--dm-ink)}
.dm-seg button[aria-pressed=true]{background:#fff;color:var(--dm-blue);box-shadow:0 1px 3px rgba(15,23,42,.14)}
.dm-sw{display:inline-flex;gap:6px;align-items:center;padding:0 4px;flex-wrap:wrap}
.dm-sw button{width:20px;height:20px;border-radius:50%;border:2px solid #fff;background:var(--sw);box-shadow:0 0 0 1px rgba(15,23,42,.18);cursor:pointer;padding:0;transition:transform .12s}
.dm-sw button:hover{transform:scale(1.12)}
.dm-sw button[aria-pressed=true]{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--sw)}
.dm-saved{display:inline-flex;align-items:center;gap:5px;font-size:12.5px;font-weight:650;color:#15803d;padding:0 4px}
.dm-saved svg{width:15px;height:15px}
.dm-saved[data-st=busy]{color:#8a93a6}.dm-saved[data-st=err]{color:#b42318}

/* options popover (desktop) / bottom sheet (phone) */
.dm-sheet{position:absolute;top:calc(100% + 8px);left:8px;z-index:6;width:min(350px,calc(100vw - 32px));max-height:min(70vh,560px);overflow:auto;background:#fff;border:1px solid var(--dm-line);border-radius:18px;
  box-shadow:0 28px 64px -24px rgba(15,23,42,.5);padding:12px 16px 16px;animation:dmPop .16s ease-out}
.dm-sheet[hidden],.dm-backdrop[hidden],.dm-toast[hidden]{display:none!important}
@keyframes dmPop{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:none}}
.dm-backdrop{position:fixed;inset:0;z-index:999;background:transparent}
.dm-sheet-h{display:flex;justify-content:space-between;align-items:center;margin:0 0 2px;font-size:15px}
.dm-sheet-h .dm-mini{color:#3a4254;border-color:transparent;box-shadow:none}
.dm-sgroup{padding:8px 0 6px;border-top:1px solid #eef0f5}
.dm-sheet-h+.dm-sgroup{border-top:0}
.dm-sl{font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:#6b7385;margin:4px 0 8px}
.dm-switch{position:relative;display:flex;gap:11px;align-items:flex-start;padding:7px 0;cursor:pointer;line-height:1.3}
.dm-switch input{position:absolute;opacity:0;width:1px;height:1px}
.dm-track{flex:none;width:38px;height:22px;border-radius:999px;background:#cfd5e2;position:relative;transition:background .15s;margin-top:1px}
.dm-track::after{content:"";position:absolute;top:3px;left:3px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .15s}
.dm-switch input:checked+.dm-track{background:var(--dm-blue)}
.dm-switch input:checked+.dm-track::after{transform:translateX(16px)}
.dm-switch input:focus-visible+.dm-track{outline:3px solid rgba(21,89,234,.38);outline-offset:2px}
.dm-switch b{display:block;font-size:14px;font-weight:700;color:var(--dm-ink)}
.dm-switch small{display:block;font-size:12px;color:#6b7385;font-weight:500;margin-top:2px}
.dm-ssel{width:100%;height:40px;border:1px solid var(--dm-line);border-radius:10px;padding:0 10px;font-family:inherit;font-size:14px;font-weight:600;background:#fff;color:var(--dm-ink)}
.dm-sheet .dm-sacts{display:grid;grid-template-columns:1fr;gap:8px;padding-top:10px;border-top:1px solid #eef0f5}
.dm-snote{font-size:12px;color:#6b7385;margin:12px 0 0;line-height:1.45}

/* status chips and toast */
.dm-status{display:flex;flex-wrap:wrap;gap:6px;margin:10px 2px 0;min-height:26px}
.dm-chip{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:650;color:#3a4254;background:#fff;border:1px solid var(--dm-line);border-radius:999px;padding:4px 11px;line-height:1.3}
.dm-chip svg{width:14px;height:14px;flex:none}
.dm-chip-b{background:#eef3ff;border-color:#d6e2fd;color:#1546b8}
.dm-chip-w{background:#fff7ed;border-color:#fed7aa;color:#9a3412}
.dm-toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);z-index:60;background:#0f1420;color:#fff;font-size:14px;font-weight:600;padding:12px 18px;border-radius:12px;
  box-shadow:0 14px 34px -10px rgba(0,0,0,.5);max-width:calc(100vw - 32px);text-align:center;animation:dmPop .18s ease-out}

/* ── the desk the paper sits on */
.dm-desk{margin-top:10px;padding:30px 26px 40px;border-radius:22px;border:1px solid #e0e5ee;
  background:radial-gradient(900px 320px at 50% -8%,#fff 0,rgba(255,255,255,0) 70%),linear-gradient(180deg,#eef1f7,#e5e9f1)}
.dm-stage{position:relative;max-width:794px;margin:0 auto}
.dm-stage>.dm-paper{position:absolute;left:0;top:0;transform-origin:0 0;box-shadow:0 1px 2px rgba(15,23,42,.08),0 34px 70px -30px rgba(15,23,42,.5)}
.dm-desk.dm-z100{overflow-x:auto;-webkit-overflow-scrolling:touch}
.dm-stage.dm-z100{max-width:none;width:794px}
.dm-stage.dm-z100>.dm-paper{position:relative}
.dm-sbar{display:flex;flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px;margin:0 0 10px}
.dm-sacts{display:flex;flex-wrap:wrap;gap:8px}
.dm-sample .dm-desk{margin-top:0}

/* ── the document */
.dm-paper{--dm-c:#1559EA;--px:40px;--py:36px;box-sizing:border-box;width:794px;min-height:1123px;padding:var(--py) var(--px) 26px;background:#fff;color:#151a24;border-radius:3px;
  font:12px/1.45 "Plus Jakarta Sans",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;text-align:left;-webkit-print-color-adjust:exact;print-color-adjust:exact}
.dm-paper *{box-sizing:border-box}
.dm-paper b{font-weight:700}
.dm-paper p{margin:0}
.dm-top{display:flex;justify-content:space-between;align-items:flex-start;gap:24px;padding-bottom:16px;margin-bottom:14px;border-bottom:3px solid var(--dm-c)}
.dm-brand{display:flex;gap:14px;align-items:flex-start;min-width:0;flex:1}
.dm-biz{min-width:0;flex:1}
.dm-logo-box{position:relative;flex:none;display:inline-block}
.dm-logo{display:block;max-width:120px;max-height:72px;object-fit:contain}
.dm-sname{font-size:21px;font-weight:800;letter-spacing:-.015em;color:#0f1420;line-height:1.2;margin-bottom:3px}
.dm-small{font-size:11.5px;color:#4b5263}
.dm-pl{margin-top:1px}
.dm-kv{display:inline-flex;align-items:baseline;gap:4px;margin-right:14px;max-width:100%}
.dm-k{color:#6b7385}
.dm-up{text-transform:uppercase}
.dm-title{text-align:right;flex:none;max-width:44%}
.dm-tname{font-size:24px;font-weight:800;text-transform:uppercase;letter-spacing:.05em;color:var(--dm-c);line-height:1.15}
.dm-copy{font-size:10.5px;color:#555b68;border:1px solid #c9cdd6;border-radius:999px;padding:2px 9px;display:inline-block;margin-top:7px}
.dm-copy-e{padding:0 4px}
.dm-meta{display:grid;grid-template-columns:repeat(auto-fit,minmax(128px,1fr));border:1px solid #e1e5ee;border-radius:8px;overflow:hidden;margin:0 0 14px;background:#fbfcfe}
.dm-meta>div{padding:7px 10px;border-right:1px solid #e7eaf1;border-bottom:1px solid #e7eaf1;margin:0 -1px -1px 0;min-width:0}
.dm-meta span{display:block;font-size:9.5px;color:#6b7385;text-transform:uppercase;letter-spacing:.07em;font-weight:700;margin-bottom:1px}
.dm-meta b{font-size:12.5px;word-break:break-word}
.dm-parties{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:12px;margin:0 0 14px}
.dm-party{border:1px solid #e1e5ee;border-radius:8px;padding:8px 12px;font-size:11.5px;min-width:0}
.dm-pname{display:block;font-size:14px;font-weight:700;color:#0f1420;margin-bottom:1px}
.dm-lbl{font-size:9.5px;color:var(--dm-c);text-transform:uppercase;letter-spacing:.09em;font-weight:800;margin-bottom:3px}
.dm-notice{background:#fff7e6;border:1px solid #f5d38a;border-radius:8px;padding:7px 11px;font-size:12px;margin:0 0 14px;font-weight:600}
.dm-items{width:100%;border-collapse:collapse;font-size:12px;margin:0 0 12px;display:table;background:transparent}
.dm-items th{background:var(--dm-c);color:#fff;font-weight:700;padding:7px 6px;text-align:left;font-size:10.5px;letter-spacing:.02em;white-space:nowrap;border:0}
.dm-items td{padding:6px 6px;border:0;border-bottom:1px solid #eceef3;vertical-align:top;background:transparent}
.dm-items .dm-dh{width:99%}
.dm-items .n{text-align:right;white-space:nowrap}
.dm-items .c{text-align:center;width:26px;position:relative}
.dm-items tfoot td{border-top:1.5px solid #9aa1af;border-bottom:0;background:#f5f7fb}
.dm-items tr.dm-empty td{height:26px;border-bottom:1px solid #dde0e7;border-right:1px solid #eef0f4}
.dm-none{color:#8a93a6;text-align:center;padding:18px!important}
.dm-sum{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:18px;align-items:start;margin:0 0 12px;break-inside:avoid}
.dm-tax{width:100%;border-collapse:collapse;font-size:11px;margin:0 0 9px;display:table}
.dm-tax th,.dm-tax td{border:1px solid #e3e6ee;padding:4px 7px;text-align:left;background:transparent}
.dm-tax th{background:#f5f6f9;font-weight:700}
.dm-tax .n{text-align:right}.dm-tax small{color:#7b8292}
.dm-words span{display:block;font-size:9.5px;color:#6b7385;text-transform:uppercase;letter-spacing:.07em;font-weight:700}
.dm-words b{font-size:12.5px}
.dm-totals>div{display:flex;justify-content:space-between;gap:10px;padding:3px 0;border-bottom:1px dashed #e1e5ee;font-size:12.5px}
.dm-totals .dm-grand{border-bottom:0;border-top:2px solid var(--dm-c);margin-top:4px;padding-top:8px;font-size:16px}
.dm-totals .dm-grand b{color:var(--dm-c)}
.dm-totals .dm-grand span{font-weight:800}
.dm-rcpt{display:grid;grid-template-columns:1fr auto;gap:18px;align-items:center;border:1px solid #e1e5ee;border-radius:8px;padding:14px 16px;margin:0 0 14px;font-size:14px;line-height:1.8}
.dm-rbox{font-size:22px;font-weight:800;border:2px solid var(--dm-c);color:var(--dm-c);border-radius:10px;padding:10px 16px;min-width:150px;text-align:center}
.dm-pay{display:flex;justify-content:space-between;gap:18px;border:1px solid #e1e5ee;border-radius:8px;padding:8px 12px;margin:0 0 10px;font-size:11px;break-inside:avoid}
.dm-bank{flex:1;min-width:0}
.dm-qr{display:flex;gap:11px;align-items:center;flex:none;max-width:52%}
.dm-qrimg img{width:86px;height:86px;display:block}
.dm-qrph{display:block;width:86px;height:86px;border:1.5px dashed #c3cbe0;border-radius:8px;background:repeating-linear-gradient(45deg,#f6f8fc 0 6px,#fff 6px 12px)}
.dm-notes{font-size:11px;margin:0 0 8px;color:#333a47;break-inside:avoid}
.dm-sign{display:flex;justify-content:space-between;align-items:flex-end;gap:20px;margin-top:20px;font-size:12px;break-inside:avoid}
.dm-signer{text-align:right;min-width:210px}
.dm-sigwrap{display:flex;justify-content:flex-end}
.dm-sigbox{position:relative;display:inline-block}
.dm-sigimg{display:block;max-width:190px;max-height:62px;margin:6px 0 -12px auto}
.dm-sline{border-bottom:1px solid #7a8090;width:190px;height:32px;margin:0 0 4px auto}
.dm-sigwrap:not(:empty)+.dm-sline{height:8px}
.dm-sign>div:first-child .dm-sline{margin-left:0}
.dm-line{border-bottom:1px solid #aab0bd;height:20px;margin:2px 0}
.dm-made{font-size:9.5px;color:#a0a6b3;text-align:center;margin-top:18px}
.dm-tpaper{min-height:0}
.dm-tpaper table{width:100%;border-collapse:collapse;font-size:12px;display:table}
.dm-tpaper th,.dm-tpaper td{border:1px solid #ddd;padding:5px 7px;text-align:left}
.dm-tpaper th{background:#f0eee7}.dm-tpaper .n,.dm-tpaper .amt{text-align:right}
.dm-tpaper tr.grp td,.dm-tpaper tr.tot td{font-weight:800;background:#f6f7fb}

/* ── editing affordances (only inside the editor) */
.dm-edit .dm-e{display:inline-block;min-width:3em;max-width:100%;border-radius:4px;padding:1px 4px;margin:-1px -4px;outline:none;cursor:text;vertical-align:top;word-break:break-word;transition:background .12s,box-shadow .12s}
.dm-edit div.dm-e{display:block}
.dm-edit .dm-ml{white-space:pre-wrap}
.dm-edit .dm-e:empty::before{content:attr(data-ph);color:#a3abbb;pointer-events:none}
.dm-edit .dm-in,.dm-edit .dm-sel{font:inherit;color:inherit;background:transparent;border:0;border-radius:4px;padding:2px 4px;margin:-2px -4px;width:calc(100% + 8px);min-width:0;outline:none;transition:background .12s,box-shadow .12s;letter-spacing:inherit}
.dm-edit .dm-sel{-webkit-appearance:none;appearance:none;cursor:pointer;padding-right:14px;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238a93a6' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 3px center/8px 5px}
.dm-edit .dm-in::placeholder{color:#a3abbb;opacity:1}
.dm-edit .dm-in.n{text-align:right}
.dm-edit .dm-date{width:auto;min-width:118px;font-weight:700}
.dm-edit .dm-e:hover,.dm-edit .dm-in:hover,.dm-edit .dm-sel:hover{background:rgba(21,89,234,.06);box-shadow:inset 0 0 0 1px rgba(21,89,234,.28)}
.dm-edit .dm-e:focus,.dm-edit .dm-in:focus,.dm-edit .dm-sel:focus{background:#fff;box-shadow:inset 0 0 0 1.5px var(--dm-c),0 0 0 3px rgba(21,89,234,.13)}
.dm-edit .dm-meta .dm-e,.dm-edit .dm-meta .dm-in,.dm-edit .dm-meta .dm-sel{font-weight:700;font-size:12.5px;display:block;width:calc(100% + 8px)}
.dm-edit .dm-st,.dm-edit .dm-copy .dm-sel,.dm-edit .dm-pos,.dm-edit .dm-gst,.dm-rcpt .dm-sel{width:auto;max-width:100%;field-sizing:content}
.dm-edit .dm-kv .dm-e{min-width:6em}
.dm-edit .dm-gstin{min-width:11em}
.dm-edit .dm-pos{font-weight:700}
.dm-edit .dm-copy .dm-sel{font-size:10.5px;padding-right:14px}
.dm-flag{display:inline-block;margin-left:5px;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:#b42318;background:#fee4e2;border-radius:999px;padding:1px 7px;vertical-align:middle}
.dm-flag[hidden]{display:none}
.dm-edit .dm-dcell .dm-e{min-height:1.5em}
.dm-qu{display:inline-flex;gap:4px;justify-content:flex-end;align-items:baseline}
.dm-edit .dm-q{width:46px;min-width:46px;flex:none}.dm-edit .dm-unit{width:44px;min-width:44px;flex:none;color:#5b6475}
.dm-edit .dm-gst{min-width:54px}
.dm-edit .dm-pc{min-width:38px}
.dm-edit .dm-copy .dm-sel{padding-right:16px}
.dm-hsnl{display:block;font-size:10.5px;color:#6b7385;margin-top:1px}
.dm-thsn{font-weight:500;opacity:.85}
label.dm-hsnl{display:flex;align-items:baseline;gap:4px;cursor:text}
.dm-edit .dm-hsn{width:74px;font-size:10.5px;color:#4b5263}
.dm-edit .dm-pc{width:38px}
.dm-edit .dm-gst{width:auto;text-align:right;font-variant-numeric:tabular-nums}
.dm-edit td.n input[data-k="r"]{width:68px;min-width:68px}
.dm-edit .dm-qr>div:last-child{min-width:150px}
.dm-upi{word-break:break-all}
.dm-rt{position:absolute;left:-31px;top:2px;display:flex;flex-direction:column;align-items:center;opacity:0;transition:opacity .12s;cursor:grab;padding:1px 2px;border-radius:6px}
.dm-rt:active{cursor:grabbing}
.dm-edit tr:hover .dm-rt,.dm-edit tr:focus-within .dm-rt{opacity:1}
.dm-rt button{width:22px;height:13px;border:0;background:transparent;color:#7a8396;padding:0;cursor:pointer;display:grid;place-items:center;border-radius:4px}
.dm-rt button svg{width:9px;height:6px}
.dm-rt button:hover{background:#e8efff;color:var(--dm-c)}
.dm-rt button:disabled{opacity:.25;cursor:default;background:transparent}
.dm-grip{display:block;width:10px;height:8px;margin:1px 0;background:radial-gradient(circle,#9aa1af 1px,transparent 1.3px) 0 0/4px 4px}
.dm-last{position:relative}
.dm-mini{width:22px;height:22px;border-radius:50%;border:1px solid #e3e6ee;background:#fff;color:#b42318;font-family:inherit;font-size:15px;font-weight:700;line-height:1;display:inline-grid;place-items:center;cursor:pointer;padding:0;box-shadow:0 2px 6px -2px rgba(15,23,42,.3)}
.dm-mini svg{width:12px;height:12px}
.dm-mini:hover{background:#fee4e2}
.dm-del{position:absolute;right:-32px;top:5px;opacity:0;transition:opacity .12s}
.dm-edit tr:hover .dm-del,.dm-edit tr:focus-within .dm-del{opacity:1}
.dm-mini-x{position:absolute;top:-9px;right:-9px;opacity:0;z-index:2}
.dm-logo-box:hover .dm-mini-x,.dm-logo-box:focus-within .dm-mini-x,.dm-sigbox:hover .dm-mini-x,.dm-sigbox:focus-within .dm-mini-x{opacity:1}
@media (hover:none){.dm-rt,.dm-del,.dm-mini-x{opacity:1}}
.dm-dragging{opacity:.45}
.dm-dropb td{box-shadow:inset 0 2px 0 var(--dm-c)}
.dm-dropa td{box-shadow:inset 0 -2px 0 var(--dm-c)}
.dm-addrow td{border-bottom:0!important;padding:8px 0 4px!important;background:transparent!important}
.dm-addrow button,.dm-ghostbtn{display:inline-flex;align-items:center;gap:6px;border:1.5px dashed color-mix(in srgb,var(--dm-c) 45%,#fff);background:color-mix(in srgb,var(--dm-c) 6%,#fff);color:var(--dm-c);
  font-family:inherit;font-size:12.5px;font-weight:700;border-radius:8px;padding:7px 12px;cursor:pointer;transition:background .12s}
.dm-addrow button:hover,.dm-ghostbtn:hover{background:color-mix(in srgb,var(--dm-c) 12%,#fff)}
.dm-addrow svg{width:14px;height:14px}
.dm-ghostbtn{margin:0 0 14px}
.dm-tip{font-size:10.5px;color:#8a93a6;margin-left:12px}
.dm-logo-add{flex:none;width:92px;height:68px;border:1.5px dashed #c3cbe0;border-radius:10px;background:#f7f9ff;color:#5a6b92;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;
  font-family:inherit;font-size:11px;font-weight:650;cursor:pointer;transition:border-color .12s,color .12s}
.dm-logo-add svg{width:22px;height:22px}
.dm-logo-add:hover{border-color:var(--dm-c);color:var(--dm-c)}
.dm-logo-hit{position:absolute;inset:0;border:0;background:transparent;cursor:pointer;border-radius:6px;padding:0}
.dm-logo-hit:hover{box-shadow:inset 0 0 0 1.5px rgba(21,89,234,.45)}
.dm-sig-add{margin:6px 0 2px;border:1.5px dashed #c3cbe0;background:#f7f9ff;color:#5a6b92;border-radius:8px;font-family:inherit;font-size:11px;font-weight:650;padding:7px 12px;cursor:pointer}
.dm-sig-add:hover{border-color:var(--dm-c);color:var(--dm-c)}
.dm-rcpt .dm-amt{width:110px;font-weight:800;display:inline-block}
.dm-rcpt .dm-sel{width:auto;display:inline-block;font-weight:700}
.dm-edit .dm-rcpt .dm-e{min-width:6em}

/* ── Modern layout: colour band header, soft cards, filled total */
.dm-t-modern .dm-top{position:relative;background:var(--dm-c) linear-gradient(135deg,rgba(255,255,255,.16),rgba(255,255,255,0) 58%);color:#fff;border-bottom:0;
  margin:calc(-1 * var(--py)) calc(-1 * var(--px)) 18px;padding:30px max(var(--px),20px) 26px;border-radius:3px 3px 0 0}
.dm-t-modern .dm-sname,.dm-t-modern .dm-tname,.dm-t-modern .dm-top .dm-pname{color:#fff}
.dm-t-modern .dm-top .dm-small,.dm-t-modern .dm-top .dm-k{color:rgba(255,255,255,.84)}
.dm-t-modern .dm-tname{font-size:30px;letter-spacing:.01em;text-transform:none}
.dm-t-modern .dm-copy{color:#fff;border-color:rgba(255,255,255,.55)}
.dm-t-modern .dm-logo{background:#fff;border-radius:12px;padding:6px}
.dm-t-modern .dm-logo-add,.dm-t-modern .dm-top .dm-sig-add{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.6);color:#fff}
.dm-t-modern .dm-top .dm-e:empty::before,.dm-t-modern .dm-top .dm-in::placeholder{color:rgba(255,255,255,.62)}
.dm-t-modern .dm-top .dm-e:hover,.dm-t-modern .dm-top .dm-sel:hover{background:rgba(255,255,255,.12);box-shadow:inset 0 0 0 1px rgba(255,255,255,.45)}
.dm-t-modern .dm-top .dm-e:focus,.dm-t-modern .dm-top .dm-sel:focus{background:rgba(255,255,255,.16);box-shadow:inset 0 0 0 1.5px #fff}
.dm-t-modern .dm-top .dm-sel{color:#fff;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23ffffff' stroke-width='1.5'/%3E%3C/svg%3E")}
.dm-t-modern .dm-top option{color:#111}
.dm-t-modern .dm-flag{background:#fff}
.dm-t-modern .dm-meta{border:0;background:transparent;gap:8px;overflow:visible}
.dm-t-modern .dm-meta>div{background:color-mix(in srgb,var(--dm-c) 7%,#fff);border:0;border-radius:9px;margin:0}
.dm-t-modern .dm-meta span{color:color-mix(in srgb,var(--dm-c) 70%,#111)}
.dm-t-modern .dm-party{border:0;background:#f6f7fa;border-left:3px solid var(--dm-c);border-radius:0 9px 9px 0}
.dm-t-modern .dm-items th{background:color-mix(in srgb,var(--dm-c) 10%,#fff);color:color-mix(in srgb,var(--dm-c) 80%,#000);border-bottom:2px solid var(--dm-c)}
.dm-t-modern .dm-items tbody tr[data-i]:nth-child(even) td,.dm-t-modern .dm-items tbody tr:not([data-i]):not(.dm-addrow):not(.dm-empty):nth-child(even) td{background:#fafbfd}
.dm-t-modern .dm-pay,.dm-t-modern .dm-rcpt{border:0;background:#f6f7fa;border-radius:10px}
.dm-t-modern .dm-totals .dm-grand{background:var(--dm-c);color:#fff;border:0;border-radius:9px;padding:9px 12px;margin-top:8px}
.dm-t-modern .dm-totals .dm-grand b{color:#fff}

/* ── Compact layout: tight grid, more rows per page */
.dm-t-compact{--px:32px;--py:28px;font-size:11.5px}
.dm-t-compact .dm-top{border-bottom:1px solid #c9ced8;padding-bottom:10px;margin-bottom:10px}
.dm-t-compact .dm-sname{font-size:17px}
.dm-t-compact .dm-tname{font-size:15px;letter-spacing:.09em;color:#0f1420;border-left:4px solid var(--dm-c);padding-left:9px;text-align:left}
.dm-t-compact .dm-meta{grid-template-columns:repeat(auto-fit,minmax(104px,1fr));border-radius:0;background:#fff;margin-bottom:10px}
.dm-t-compact .dm-meta>div{padding:4px 7px}
.dm-t-compact .dm-parties{gap:8px;margin-bottom:10px}
.dm-t-compact .dm-party{border-radius:0;padding:6px 9px}
.dm-t-compact .dm-items{font-size:11px}
.dm-t-compact .dm-items th{background:#f1f3f7;color:#0f1420;border:1px solid #d5d9e2;border-bottom:2px solid var(--dm-c);padding:5px}
.dm-t-compact .dm-items td{border:1px solid #e1e4eb;padding:4px 5px}
.dm-t-compact .dm-addrow td{border:0!important}
.dm-t-compact .dm-totals>div{padding:2px 0;font-size:11.5px}
.dm-t-compact .dm-totals .dm-grand{font-size:14px}
.dm-t-compact .dm-pay,.dm-t-compact .dm-rcpt{border-radius:0}
.dm-t-compact .dm-sign{margin-top:16px}

/* ── report templates on /formats/ */
.dm-table .tplwrap{overflow-x:auto;background:#fff;border:1px solid var(--line,#e6e3da);border-radius:14px}
.dm-table table{margin:0!important;font-size:14px}
.dm-table td.n,.dm-table td.amt,.dm-table th.n{text-align:right;white-space:nowrap}
.dm-table tr.tot td{font-weight:800;background:#f6f7fb}
.dm-table tr.grp td{font-weight:800;background:#faf9f5}

/* ── phones */
.dm-hide-s{display:inline}
@media (max-width:1420px){.dm-hide-l{display:none}.dm-wa{width:38px;padding:0}.dm-saved>span{display:none}.dm-type select{max-width:150px}.dm-seg button{padding:0 9px;font-size:13px}}
@media (max-width:760px){
  .dm-hide-m{display:none!important}
  .dm-only-m{display:inline-flex!important}
  .dm-sgroup.dm-only-m{display:block!important}
  .dm-sheet .dm-sacts{grid-template-columns:1fr 1fr}
  .dm-tb{-webkit-backdrop-filter:none;backdrop-filter:none;background:#fff;padding:6px;gap:6px;flex-wrap:nowrap;border-radius:14px}
  .dm-tb-l{flex:1 1 auto;min-width:0;flex-wrap:nowrap}
  .dm-tb-r{flex:none;flex-wrap:nowrap;gap:6px}
  .dm-type{width:100%}
  .dm-type select{width:100%;text-overflow:ellipsis}
  .dm-saved{padding:0}.dm-saved>span{display:none}
  .dm-tbtn{height:40px}.dm-icon{width:40px}
  .dm-wa{width:40px;padding:0}
  .dm-sheet{position:fixed;left:0;right:0;bottom:0;top:auto;width:auto;max-height:84vh;border-radius:22px 22px 0 0;padding:14px 18px calc(20px + env(safe-area-inset-bottom));animation:dmUp .2s ease-out}
  .dm-backdrop{background:rgba(15,20,32,.4)}
  .dm-desk{padding:10px 8px 14px;border-radius:16px}
  .dm-status .dm-chip-b{display:none}
}
@keyframes dmUp{from{transform:translateY(30px);opacity:.4}to{transform:none;opacity:1}}
@media (max-width:420px){.dm-hide-s{display:none}.dm-tbtn.dm-primary{padding:0 12px}}

/* ── print: only the document, on A4 */
#dm-print-root{display:none}
@media print{
  @page{size:A4;margin:9mm 10mm}
  html.dm-printing body>*:not(#dm-print-root),html.dm-print-doc body>*:not(#dm-print-root){display:none!important}
  html.dm-printing #dm-print-root,html.dm-print-doc #dm-print-root{display:block}
  html.dm-printing,html.dm-print-doc,html.dm-printing body,html.dm-print-doc body{background:#fff!important;margin:0!important;padding:0!important}
  #dm-print-root .dm-paper{--px:0px;--py:0px;width:auto;min-height:0;padding:0;box-shadow:none;border-radius:0;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  #dm-print-root .dm-t-modern .dm-top{margin:0 0 16px;padding:20px 20px 18px;border-radius:10px}
  #dm-print-root .dm-items tr{break-inside:avoid}
  #dm-print-root .dm-sign,#dm-print-root .dm-sum,#dm-print-root .dm-pay{break-inside:avoid}
  #dm-print-root .dm-made{display:none}
  #dm-print-root .dm-sign{margin-top:16px}
  #dm-print-root .dm-top{padding-bottom:12px;margin-bottom:12px}
}

/* ── phones: "Edit" view — the same editable document, reflowed to the phone width with 16px fields (no iOS zoom).
      "Preview" shows the scaled A4 that prints. */
.dm-mview .dm-seg button{height:34px;padding:0 12px;font-size:14px}
@media (max-width:760px){
  .dm-tb-l{flex:0 1 auto}
  .dm-is-mobedit .dm-desk{padding:0;background:none;border:0}
  .dm-stage.dm-mobedit{max-width:none}
  .dm-stage.dm-mobedit>.dm-paper{position:relative;width:100%;min-height:0;transform:none!important;left:0!important;padding:16px 14px 18px;font-size:15px;border-radius:16px;
    border:1px solid #e2e6ef;box-shadow:0 18px 40px -30px rgba(15,23,42,.45)}
  .dm-mobedit .dm-paper .dm-e,.dm-mobedit .dm-paper .dm-in,.dm-mobedit .dm-paper .dm-sel,.dm-mobedit .dm-meta .dm-e,.dm-mobedit .dm-meta .dm-in,.dm-mobedit .dm-meta .dm-sel{font-size:16px!important}
  .dm-mobedit .dm-e,.dm-mobedit .dm-in,.dm-mobedit .dm-sel{min-height:30px;line-height:1.4}
  .dm-mobedit .dm-in,.dm-mobedit .dm-sel{padding:4px 6px;margin:0;width:100%;background-color:#f6f8fc;box-shadow:inset 0 0 0 1px #e3e7ef}
  .dm-mobedit .dm-e{display:block;padding:4px 6px;margin:2px 0;background:#f6f8fc;box-shadow:inset 0 0 0 1px #e3e7ef}
  .dm-mobedit .dm-kv{display:flex;flex-direction:column;align-items:stretch;gap:2px;margin:6px 0 0;width:100%}
  .dm-mobedit .dm-kv .dm-k{font-size:12px;font-weight:700}
  .dm-mobedit .dm-top{flex-direction:column;gap:12px}
  .dm-mobedit .dm-brand{flex-direction:column;width:100%}
  .dm-mobedit .dm-biz{width:100%}
  .dm-mobedit .dm-sname{font-size:19px}
  .dm-mobedit .dm-small{font-size:15px}
  .dm-mobedit .dm-title{text-align:left;max-width:none;order:-1;width:100%}
  .dm-mobedit .dm-tname{font-size:20px}
  .dm-mobedit.dm-stage .dm-t-modern .dm-top{margin:-16px -14px 16px;padding:18px 14px;border-radius:16px 16px 0 0}
  .dm-mobedit .dm-meta{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px;border:0;background:none;overflow:visible}
  .dm-mobedit .dm-meta>div{margin:0;border:1px solid #e7eaf1;border-radius:10px;background:#fbfcfe}
  .dm-mobedit .dm-meta span{font-size:11px}
  .dm-mobedit .dm-date{min-width:0}
  .dm-mobedit .dm-parties{grid-template-columns:minmax(0,1fr)}
  .dm-mobedit .dm-party{font-size:15px}
  .dm-mobedit .dm-items,.dm-mobedit .dm-items tbody,.dm-mobedit .dm-items tr,.dm-mobedit .dm-items td{display:block;width:auto}
  .dm-mobedit .dm-items thead,.dm-mobedit .dm-items tfoot{display:none}
  .dm-mobedit .dm-items tr[data-i]{position:relative;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px 10px;border:1px solid #e2e6ef;border-radius:14px;padding:12px;margin:0 0 10px;background:#fff!important}
  .dm-mobedit .dm-items tr[data-i] td{padding:0!important;border:0!important;background:none!important;text-align:left;white-space:normal;font-size:15px}
  .dm-mobedit .dm-items td[data-l]::before{content:attr(data-l);display:block;font-size:11px;font-weight:700;color:#6b7385;text-transform:uppercase;letter-spacing:.05em;margin-bottom:2px}
  .dm-mobedit .dm-items .c{grid-column:1/-1;width:auto;text-align:left!important;font-size:12px!important;font-weight:800;color:var(--dm-c);display:flex!important;align-items:center;gap:8px;padding-right:44px!important}
  .dm-mobedit .dm-items .c::before{content:"Item"}
  .dm-mobedit .dm-rt{position:static;opacity:1;flex-direction:row;gap:4px;order:2;margin-left:auto}
  .dm-mobedit .dm-rt button{width:34px;height:30px;border:1px solid #e2e6ef;background:#fff}
  .dm-mobedit .dm-rt button svg{width:11px;height:7px}
  .dm-mobedit .dm-grip{display:none}
  .dm-mobedit .dm-dcell{grid-column:1/-1}
  .dm-mobedit .dm-hsnl{font-size:13px;margin-top:4px}
  .dm-mobedit .dm-hsnl span{flex:none}
  .dm-mobedit .dm-cq{grid-column:span 2}
  .dm-mobedit .dm-qu{display:flex;gap:6px;width:100%}
  .dm-mobedit .dm-q,.dm-mobedit .dm-unit{flex:1;width:auto!important;min-width:0!important}
  .dm-mobedit .dm-in[data-k="r"],.dm-mobedit .dm-pc,.dm-mobedit .dm-gst{width:100%!important;min-width:0!important}
  .dm-mobedit .dm-ctv,.dm-mobedit .dm-ctx{color:#4b5263}
  .dm-mobedit .dm-last{grid-column:1/-1;display:flex!important;justify-content:space-between;align-items:baseline;border-top:1px dashed #e2e6ef!important;padding-top:8px!important;font-weight:800;font-size:17px!important}
  .dm-mobedit .dm-last::before{margin:0!important}
  .dm-mobedit .dm-items .dm-last{position:static}
  .dm-mobedit .dm-del{position:absolute;top:10px;right:10px;opacity:1;width:32px;height:32px}
  .dm-mobedit .dm-items .c{padding-right:118px!important;position:static}
  .dm-mobedit .dm-rt{position:absolute;top:10px;right:50px}
  .dm-mobedit .dm-addrow td{padding:0!important}
  .dm-mobedit .dm-addrow button{width:100%;justify-content:center;min-height:48px;font-size:16px}
  .dm-mobedit .dm-tip{display:none}
  .dm-mobedit .dm-sum{grid-template-columns:minmax(0,1fr);gap:10px;border:1px solid #e2e6ef;border-radius:14px;padding:12px}
  .dm-mobedit .dm-tax{font-size:12.5px}
  .dm-mobedit .dm-totals>div{font-size:15px;padding:5px 0}
  .dm-mobedit .dm-totals .dm-grand{font-size:19px}
  .dm-mobedit .dm-words b{font-size:14px}
  .dm-mobedit .dm-pay{flex-direction:column;gap:12px}
  .dm-mobedit .dm-qr{max-width:none}
  .dm-mobedit .dm-rcpt{grid-template-columns:minmax(0,1fr);font-size:16px}
  .dm-mobedit .dm-rcpt .dm-amt{width:140px}
  .dm-mobedit .dm-notes{font-size:15px}
  .dm-mobedit .dm-sign{flex-direction:column;align-items:stretch;font-size:14px}
  .dm-mobedit .dm-signer{min-width:0}
  .dm-mobedit .dm-logo-add{width:100%;height:56px;flex-direction:row;font-size:14px}
  .dm-mobedit .dm-made{display:none}
  .dm-mobedit .dm-flag{font-size:11px}
}
