/* Caixa: a session register beside one working surface. */
.cw-workspace { --cw-line:color-mix(in srgb,var(--border) 82%,transparent); min-width:0; max-width:1520px; margin:0 auto; color:var(--text); }
.cw-workspace, .cash-dialog, .cash-receipt-dialog { --font-body:'IBM Plex Sans',sans-serif; }
.cw-workspace *, .cash-dialog *, .cash-receipt-dialog * { box-sizing:border-box; }
.cw-workspace .sr-only, .cash-dialog .sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); clip-path:inset(50%); white-space:nowrap; border:0; }
.cw-workspace [hidden], .cash-dialog [hidden] { display:none !important; }
.cw-workspace :is(h1,h2,h3,p,dl) { margin:0; }
.cw-header { display:flex; align-items:center; justify-content:space-between; gap:18px; padding-bottom:25px; }
.cw-header h1 { font-family:var(--font-display); font-size:42px; font-weight:500; line-height:1.08; letter-spacing:0; }
.cw-eyebrow { display:block; margin-bottom:7px; color:var(--muted); font-size:11px; line-height:1.5; }
.cw-workspace :is(button,a.button,.cw-pdv-link) { display:inline-flex; align-items:center; justify-content:center; min-height:35px; padding:7px 12px; gap:7px; border:1px solid var(--border); border-radius:3px; background:transparent; box-shadow:none; color:var(--text); font:500 12px/1.5 var(--font-body); cursor:pointer; text-decoration:none; }
.cw-workspace button:hover:not(:disabled), .cw-workspace .cw-pdv-link:hover { background:var(--surface-hover); }
.cw-workspace button.primary { background:var(--accent-deep); border-color:var(--accent-deep); color:var(--on-accent); }
.cw-workspace button.primary:hover:not(:disabled) { background:var(--accent); border-color:var(--accent); }
.cw-workspace :disabled { cursor:default; opacity:.5; }
.cw-workspace :is(a,button,input,select,summary):focus-visible { outline:2px solid var(--accent-bright); outline-offset:3px; }
.cw-layout { display:grid; grid-template-columns:280px minmax(0,1fr); min-height:580px; border-top:1px solid var(--cw-line); }
.cw-rail { min-width:0; padding:22px 22px 0 0; border-right:1px solid var(--cw-line); }
.cw-rail h2 { font-size:13px; font-weight:500; }
.cw-filters { display:grid; gap:10px; margin:16px 0; }
.cw-workspace :is(input:not([type=checkbox]),select) { width:100%; min-width:0; height:38px; padding:8px 10px; border:1px solid var(--border); border-radius:3px; background:var(--surface-input); color:var(--text); font:400 12px/1.5 var(--font-body); box-shadow:none; }
.cw-workspace input::placeholder { color:var(--muted); opacity:.8; }
.cw-sessions { display:flex; flex-direction:column; gap:2px; max-height:60vh; overflow:auto; padding:3px; margin:0 -3px; }
.cw-rail-head { display:flex; align-items:center; justify-content:space-between; gap:15px; }
.cw-rail-head > span { color:var(--muted); font-size:11px; }
.cw-session-name { display:flex; flex-direction:column; align-items:flex-start; gap:5px; font-size:13px; font-weight:500; line-height:1.5; }
.cw-session-end, .cw-session-date { color:var(--muted); font-size:11px; line-height:1.5; }
.cw-session-end { margin-top:-5px; font-size:10px; }
.cw-list-empty, .cw-history-limit { padding:14px 0; color:var(--muted); font-size:11px; line-height:1.6; }
.cw-session-link { display:grid; gap:8px; position:relative; padding:14px 12px 14px 14px; color:var(--text); border-left:2px solid transparent; text-decoration:none; transition:background 150ms var(--ease-fluid); }
.cw-session-link:hover { background:var(--surface-hover); }
.cw-session-link[aria-current=true], .cw-session-link[aria-current=page], .cw-session-link.is-selected { background:var(--surface-raised); border-left-color:var(--accent-bright); }
.cw-session-link strong { display:block; font-weight:500; font-size:13px; line-height:1.5; overflow-wrap:anywhere; }
.cw-session-link small, .cw-session-link time { color:var(--muted); font-size:11px; line-height:1.5; }
.cw-session-date, .cw-session-top { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.cw-status { display:inline-flex; align-items:center; gap:6px; color:var(--muted); font-size:11px; line-height:1.5; white-space:nowrap; }
.cw-status::before { content:''; width:5px; height:5px; border-radius:50%; background:currentColor; }
.cw-status.is-open { color:var(--success); }
.cw-detail { min-width:0; padding:25px 0 0 32px; }
.cw-session-head { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; }
.cw-session-head h2 { font-family:var(--font-display); font-weight:500; font-size:32px; line-height:1.15; overflow-wrap:anywhere; }
.cw-actions { display:flex; align-items:center; flex-wrap:wrap; gap:7px; padding-top:4px; }
.cw-meta { display:flex; flex-wrap:wrap; align-items:center; gap:6px 19px; margin:10px 0 0; color:var(--muted); font-size:11px; line-height:1.6; }
.cw-meta strong { color:var(--text); font-weight:400; }
.cw-meta > div { display:flex; gap:7px; align-items:baseline; }
.cw-meta dd { margin:0; color:var(--text); }
.cw-meta .cw-status { color:var(--muted); }
.cw-meta .cw-status.is-open { color:var(--success); }
.cw-financial { display:grid; grid-template-columns:1fr 1.35fr; column-gap:32px; }
.cw-balance { display:flex; flex-direction:column; align-items:flex-start; justify-content:center; gap:0; padding:28px 0 23px; }
.cw-balance > div { min-width:0; }
.cw-balance span { display:block; color:var(--muted); font-size:12px; line-height:1.5; }
.cw-balance strong { display:block; margin-top:5px; font-family:var(--font-display); font-size:44px; font-weight:500; line-height:1.05; letter-spacing:.1px; font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
.cw-balance small { display:block; margin-top:7px; color:var(--muted); font-size:11px; }
.cw-workspace .cw-metrics { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:center; gap:14px 20px; margin:0; padding:28px 0 23px; }
.cw-metrics > div { min-width:0; }
.cw-metrics :is(dt,span,small) { display:block; color:var(--muted); font-size:11px; line-height:1.5; }
.cw-metrics :is(dd,strong) { display:block; margin:6px 0 0; color:var(--text); font-size:17px; font-weight:500; font-variant-numeric:tabular-nums; line-height:1.4; overflow-wrap:anywhere; }
.cw-metrics small { margin-top:3px; font-size:10px; }
.cw-sales-line { grid-column:1 / -1; display:flex; align-items:baseline; flex-wrap:wrap; gap:12px 26px; padding:12px 0; border-block:1px solid var(--cw-line); color:var(--muted); font-size:11px; line-height:1.6; }
.cw-sales-line > span { display:flex; align-items:baseline; flex-wrap:wrap; gap:8px; }
.cw-sales-line strong { color:var(--text); font-size:12px; font-weight:500; font-variant-numeric:tabular-nums; }
.cw-sales-line small { font-size:10px; }
.cw-tabs { display:flex; gap:24px; border-bottom:1px solid var(--cw-line); margin-top:22px; }
.cw-tabs a, .cw-tabs button { min-height:40px; padding:10px 0; border:0; border-bottom:2px solid transparent; border-radius:0; color:var(--muted); background:transparent; font-size:12px; text-decoration:none; white-space:nowrap; }
.cw-tabs [aria-current=page], .cw-tabs [aria-current=true], .cw-tabs [aria-selected=true], .cw-tabs .active { color:var(--text); border-bottom-color:var(--accent-bright); }
.cw-tabs a:hover, .cw-tabs button:hover { color:var(--text); background:transparent; }
.cw-tabs a > span { margin-left:6px; color:var(--muted); font-size:10px; }
.cw-section-head { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:23px 0 12px; }
.cw-section-head h3 { font-size:13px; font-weight:500; }
.cw-section-head > span { color:var(--muted); font-size:11px; }
.cw-payment-list { padding-top:5px; }
.cw-payment-row { border-bottom:1px solid var(--cw-line); }
.cw-payment-row summary { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:16px 0; cursor:pointer; list-style:none; font-size:13px; }
.cw-payment-row summary::-webkit-details-marker { display:none; }
.cw-payment-row summary strong { font-weight:500; font-size:15px; font-variant-numeric:tabular-nums; }
.cw-chevron { display:inline-block; width:12px; margin-left:10px; color:var(--muted); transition:transform 150ms var(--ease-fluid); }
.cw-payment-row[open] .cw-chevron { transform:rotate(180deg); }
.cw-payment-values { display:flex; align-items:center; justify-content:flex-end; gap:15px; }
.cw-method-index { width:22px; font-size:10px; color:var(--muted); font-variant-numeric:tabular-nums; }
.cw-payment-row summary > :first-child { flex:1; }
.cw-payment-row dl { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px 24px; padding:0 27px 18px 0; }
.cw-payment-row dt { color:var(--muted); font-size:11px; line-height:1.5; }
.cw-payment-row dd { margin:4px 0 0; font-size:13px; font-variant-numeric:tabular-nums; }
.cw-method { display:flex; align-items:center; gap:12px; }
.cw-method-dot, .cd-method-dot { display:inline-block; width:6px; height:6px; flex:0 0 6px; border-radius:1px; background:var(--accent-bright); }
.cw-method-0, .cd-method-0 { background:var(--success); }
.cw-method-1, .cd-method-1 { background:var(--accent-bright); }
.cw-method-2, .cd-method-2 { background:var(--muted); }
.cw-method-3, .cd-method-3 { background:var(--warning); }
.cw-difference { color:var(--muted); font-size:11px; }
.cw-workspace .has-difference, .cw-workspace .cash-difference { color:var(--warning); }
.cw-reconciliation-total { display:flex; align-items:center; justify-content:space-between; gap:20px; margin-top:15px; padding:15px 0; font-size:13px; }
.cw-reconciliation-total strong { font-size:18px; font-weight:500; }
.cw-ledger { list-style:none; margin:0; padding:0; }
.cw-ledger-row { display:grid; grid-template-columns:26px minmax(0,1fr) auto auto; gap:12px 18px; align-items:center; padding:18px 0; border-bottom:1px solid var(--cw-line); font-size:12px; }
.cw-ledger-main { min-width:0; }
.cw-ledger-main > span { display:block; color:var(--muted); font-size:10px; line-height:1.6; margin-top:3px; }
.cw-ledger-mark { align-self:start; padding-top:1px; font-size:23px; color:var(--muted); }
.cw-ledger-mark.is-in { color:var(--success); }
.cw-ledger-mark.is-out { color:var(--warning); }
.cw-ledger-row time { color:var(--muted); font-size:11px; line-height:1.5; }
.cw-ledger-row strong { font-weight:500; }
.cw-ledger-row small, .cw-ledger-row p { display:block; margin-top:4px; color:var(--muted); font-size:11px; line-height:1.6; overflow-wrap:anywhere; }
.cw-ledger-amount { font-size:15px; font-variant-numeric:tabular-nums; white-space:nowrap; }
.cw-ledger-total { display:flex; justify-content:space-between; align-items:center; gap:15px; padding:18px 0; font-size:12px; }
.cw-ledger-total strong { font-size:16px; font-weight:500; font-variant-numeric:tabular-nums; }
.cw-empty, .cw-notice { padding:28px 0; color:var(--muted); font-size:12px; line-height:1.7; }
.cw-empty h3, .cw-notice h2 { margin-bottom:8px; color:var(--muted); font-size:13px; font-weight:400; }
.cw-empty a, .cw-notice a { display:inline-block; margin-top:12px; color:var(--accent-bright); }
.cw-notice[role=alert], .cw-error { color:var(--warning); }
.cw-notes { margin-top:25px; font-size:12px; line-height:1.6; }
.cw-notes h3 { margin-bottom:8px; font-size:12px; font-weight:500; }
.cw-notes p { color:var(--muted); white-space:pre-wrap; }
.cw-identification { margin-top:26px; border-top:1px solid var(--cw-line); padding-top:14px; color:var(--muted); font-size:11px; line-height:1.7; overflow-wrap:anywhere; }
.cw-identification summary { width:fit-content; cursor:pointer; }
.cw-identification dl { display:grid; gap:12px; padding-top:12px; }
.cw-identification dd { margin:3px 0 0; color:var(--text); }
.cw-settings { margin-top:24px; padding-top:18px; border-top:1px solid var(--cw-line); color:var(--muted); font-size:11px; line-height:1.6; }
.cw-settings summary { cursor:pointer; }
.cw-settings form { padding-top:14px; }
.cw-settings label { display:flex; align-items:flex-start; gap:9px; }
.cw-settings input[type=checkbox] { flex:0 0 auto; width:14px; height:14px; margin:3px 0 0; accent-color:var(--accent-deep); }
.cw-settings button { margin-top:14px; }
.cw-settings p { margin-top:10px; }
.cw-feedback, .cw-readonly, .cw-access-note, .cw-detail-loading { color:var(--muted); font-size:12px; line-height:1.7; }
.cw-readonly { margin:0 0 15px !important; }
.cw-feedback { color:var(--warning); }
.cw-access-note { margin-top:20px !important; }
.cw-identification code { display:block; margin-top:12px; font-size:11px; }
@media (max-width:1250px) {
  .cw-layout { grid-template-columns:245px minmax(0,1fr); }
  .cw-detail { padding-left:25px; }
  .cw-financial { grid-template-columns:1fr; }
  .cw-workspace .cw-metrics { padding:0 0 20px; }
  .cw-session-head { flex-wrap:wrap; gap:12px; }
  .cw-actions { padding:0; }
  .cw-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:1000px) {
  .cw-layout { grid-template-columns:205px minmax(0,1fr); }
  .cw-rail { padding-right:16px; }
  .cw-detail { padding-left:20px; }
  .cw-header { padding-bottom:20px; }
  .cw-header h1 { font-size:38px; }
  .cw-payment-row dl { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .cw-ledger-row { grid-template-columns:20px minmax(0,1fr) auto; gap:7px 12px; }
  .cw-ledger-row button { grid-column:2 / -1; justify-self:start; margin-top:4px; }
}
@media (max-width:760px) {
  .cw-layout { grid-template-columns:1fr; min-height:0; }
  .cw-rail { padding:17px 0; border-right:0; border-bottom:1px solid var(--cw-line); }
  .cw-filters { grid-template-columns:minmax(0,1fr) 130px; }
  .cw-sessions { max-height:190px; }
  .cw-detail { padding:23px 0 0; }
  .cw-settings { margin-top:12px; padding-top:12px; }
  .cw-balance strong { font-size:38px; }
  .cw-tabs { gap:20px; }
}
@media screen {
  #modal.cash-dialog, #modal.cash-receipt-dialog { width:min(540px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); padding:0; border:1px solid var(--border); border-radius:6px; background:var(--surface); box-shadow:0 30px 100px #0005; }
  #modal.cash-dialog[open], #modal.cash-receipt-dialog[open] { display:flex; flex-direction:column; overflow:hidden; }
  #modal.cash-dialog::backdrop, #modal.cash-receipt-dialog::backdrop { background:rgb(5 9 16 / 64%); backdrop-filter:blur(5px); }
  #modal:is(.cash-dialog,.cash-receipt-dialog) > .modal-head { flex:none; padding:21px 26px 17px; border-bottom:1px solid var(--border); }
  #modal:is(.cash-dialog,.cash-receipt-dialog) > .modal-head h2 { font-family:var(--font-display); font-size:31px; font-weight:500; line-height:1.2; }
  #modal:is(.cash-dialog,.cash-receipt-dialog) > .modal-body { min-height:0; overflow-y:auto; padding:0; }
  .cd-form { min-width:0; margin:0; padding:0 26px; }
  .cd-form :is(input,textarea) { border-radius:3px; box-shadow:none; background:var(--surface-input); color:var(--text); border:1px solid var(--border); font:400 13px/1.5 var(--font-body); }
  .cd-form :is(button,input,textarea,summary):focus-visible { outline:2px solid var(--accent-bright); outline-offset:3px; }
  .cd-context { display:flex; align-items:center; gap:12px; padding:19px 0; border-bottom:1px solid var(--border); }
  .cd-context > div { flex:1; min-width:0; }
  .cd-context strong { display:block; font-size:12px; font-weight:500; line-height:1.5; }
  .cd-context > div > span { display:block; margin-top:2px; color:var(--muted); font-size:11px; line-height:1.5; }
  .cd-operator-mark { width:3px; align-self:stretch; margin-block:3px; background:var(--accent-bright); }
  .cd-cash-number { display:none; }
  .cd-money-field { margin:25px 0; }
  .cd-money-field label { display:block; margin-bottom:10px; color:var(--muted); font-size:12px; }
  .cd-money-field > div { display:flex; align-items:baseline; gap:13px; border-bottom:1px solid var(--border); }
  .cd-money-field > div:focus-within { border-bottom-color:var(--accent-bright); }
  .cd-money-field > div > span { color:var(--muted); font-family:var(--font-display); font-size:26px; }
  .cd-form .cd-money-field input { width:100%; min-width:0; padding:6px 0 12px; height:66px; border:0; border-radius:0; background:transparent; font-family:var(--font-display); font-size:44px; font-weight:500; line-height:1; font-variant-numeric:tabular-nums; }
  .cd-form .cd-money-field input:focus { outline:none; box-shadow:none; }
  .cd-form input[type=number] { appearance:textfield; -moz-appearance:textfield; }
  .cd-form input::-webkit-inner-spin-button, .cd-form input::-webkit-outer-spin-button { appearance:none; margin:0; }
  .cd-reason { margin:0 0 24px; }
  .cd-reason label { color:var(--muted); font-size:12px; }
  .cd-reason input { height:40px; }
  .cd-count-list { margin:22px 0 0; }
  .cd-count-heading, .cd-count-row { grid-template-columns:minmax(110px,1fr) minmax(80px,.8fr) minmax(110px,1fr); gap:14px; }
  .cd-count-heading { margin-bottom:5px; color:var(--muted); font-size:10px; }
  .cd-count-row { padding:12px 0; border-bottom:1px solid var(--border); }
  .cd-count-row label { display:flex; align-items:center; gap:10px; font-size:13px; font-weight:400; }
  .cd-expected { color:var(--muted); font-size:13px; font-variant-numeric:tabular-nums; }
  .cd-form .cd-count-row input { height:42px; padding:9px 12px; border-radius:3px; font-size:15px; }
  .cd-cash-counter { margin:23px 0; }
  .cd-counter-heading { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:10px; margin-bottom:10px; }
  .cd-counter-heading > label { color:var(--muted); font-size:12px; font-weight:500; }
  .cd-count-modes { display:flex; gap:2px; padding:3px; background:var(--canvas); border:1px solid var(--border); border-radius:5px; }
  .cd-count-modes button { min-height:28px; padding:4px 9px; color:var(--muted); background:transparent; border:0; border-radius:3px; box-shadow:none; font:500 11px/1.4 var(--font-body); }
  .cd-count-modes button[aria-pressed=true] { background:var(--surface); color:var(--text); box-shadow:0 1px 3px #0002; }
  .cd-count-modes button:hover:not(:disabled) { color:var(--text); }
  .cd-counter-total { display:flex; align-items:baseline; gap:12px; border-bottom:1px solid var(--border); }
  .cd-counter-total:focus-within { border-bottom-color:var(--accent-bright); }
  .cd-counter-total > span { color:var(--muted); font-family:var(--font-display); font-size:22px; }
  .cd-form .cd-counter-total input { flex:1; width:100%; min-width:0; height:58px; padding:3px 0 9px; border:0; border-radius:0; background:transparent; font-family:var(--font-display); font-size:38px; font-weight:500; font-variant-numeric:tabular-nums; }
  .cd-form .cd-counter-total input:focus { outline:none; box-shadow:none; }
  .cd-cash-counter[data-cash-count-mode=pieces] .cd-counter-total { position:sticky; top:0; z-index:1; background:var(--surface); }
  .cd-cash-counter-compact .cd-counter-total input { height:49px; font-size:31px; }
  .cd-denominations { width:100%; margin:12px 0 0; border-collapse:collapse; table-layout:fixed; font-variant-numeric:tabular-nums; }
  .cd-denominations thead th { padding:6px 0 8px; border:0; color:var(--muted); background:transparent; text-align:left; text-transform:none; letter-spacing:0; font:500 10px/1.4 var(--font-body); }
  .cd-denominations thead th:first-child { width:44%; }
  .cd-denominations thead th:nth-child(2) { width:24%; }
  .cd-denominations thead th:nth-child(3) { width:32%; }
  .cd-denominations tbody :is(th,td) { height:46px; padding:5px 0; border:0; border-top:1px solid var(--border); background:transparent; text-align:left; font-weight:400; }
  .cd-denominations :is(th,td):not(:first-child) { padding-left:10px; }
  .cd-denomination { display:flex; align-items:center; gap:8px; white-space:nowrap; font-size:11px; }
  .cd-form .cd-denominations input { width:100%; height:33px; padding:5px 8px; text-align:right; font-size:13px; font-variant-numeric:tabular-nums; }
  .cd-form .cd-denominations input::placeholder { color:var(--muted); opacity:.5; }
  .cd-form .cd-denominations input[aria-invalid=true] { border-color:var(--warning); }
  .cd-counter-error { margin:10px 0 0; color:var(--warning); font-size:12px; line-height:1.5; }
  .cd-cash-expected { display:flex; justify-content:space-between; gap:12px; margin:-13px 0 16px; color:var(--muted); font-size:11px; font-variant-numeric:tabular-nums; }
  .cd-cash-expected + .cd-count-list { margin-top:14px; }
  .cd-notes { padding:19px 0 23px; font-size:12px; color:var(--muted); }
  .cd-notes summary { width:fit-content; cursor:pointer; }
  .cd-notes .field { margin:13px 0 0; }
  .cd-notes textarea { width:100%; min-height:70px; resize:vertical; }
  .cd-footer { position:sticky; bottom:0; z-index:1; margin:0 -26px; padding:17px 26px; background:var(--surface); border-top:1px solid var(--border); }
  .cd-footer > div { display:flex; align-items:center; justify-content:flex-end; flex-wrap:wrap; gap:9px; }
  .cd-footer button { min-height:38px; padding:8px 14px; border:1px solid var(--border); border-radius:3px; background:transparent; color:var(--text); font:500 12px/1.5 var(--font-body); box-shadow:none; }
  .cd-footer button.primary { color:var(--on-accent); background:var(--accent-deep); border-color:var(--accent-deep); }
  .cd-footer button:hover:not(:disabled) { background:var(--surface-hover); }
  .cd-footer button.primary:hover:not(:disabled) { background:var(--accent); border-color:var(--accent); }
  .cd-feedback { margin:0 0 13px; color:var(--warning); font-size:12px; line-height:1.6; overflow-wrap:anywhere; }
  .cd-form .cd-feedback:not([hidden]):empty { display:none; }
  .cd-pending { padding:24px 0; }
  .cd-pending .cd-eyebrow { color:var(--warning); font-size:11px; }
  .cd-pending h3 { margin:7px 0 16px; font-family:var(--font-display); font-size:30px; font-weight:500; }
  .cd-pending-amount { display:block; font-family:var(--font-display); font-weight:500; font-size:40px; }
  .cd-pending p { margin:12px 0 0; font-size:12px; line-height:1.6; white-space:pre-wrap; overflow-wrap:anywhere; }
  .cd-pending .cd-pending-help { color:var(--muted); font-size:11px; }
  .cd-pending-values { display:grid; gap:12px; margin:0; }
  .cd-pending-values > div { display:flex; justify-content:space-between; gap:20px; }
  .cd-pending-values dt { color:var(--muted); font-size:12px; }
  .cd-pending-values dd { margin:0; font-size:14px; }
  #modal.cash-receipt-dialog { width:min(510px,calc(100vw - 32px)); }
  .cr-preview { padding:28px; background:var(--canvas); }
  .cr-preview .cr-paper { max-width:350px; padding:24px; color:#181818; background:#fff; box-shadow:0 3px 14px #0002; }
  .cr-document-header { text-align:center; }
  .cr-document-header h3 { margin:0; font-size:14px; }
  .cr-document-header h4 { margin:8px 0 18px; font-size:11px; }
  .cr-preview .cr-metadata { font-size:11px; }
  .cr-preview .cr-total { margin-block:13px; }
  .cash-receipt-dialog .cd-footer { margin:0; }
}
@media screen and (max-width:560px) {
  #modal:is(.cash-dialog,.cash-receipt-dialog) > .modal-head { padding:17px 18px; }
  .cd-form { padding-inline:18px; }
  .cd-footer { margin-inline:-18px; padding-inline:18px; }
  .cd-count-heading, .cd-count-row { grid-template-columns:minmax(80px,1fr) minmax(65px,.8fr) minmax(90px,1fr); gap:9px; }
  .cd-expected, .cd-count-row label { font-size:12px; }
  .cd-form .cd-count-row input { font-size:14px; padding:8px; }
  .cd-denomination { gap:5px; font-size:10px; }
  .cd-denominations :is(th,td):not(:first-child) { padding-left:7px; }
  .cd-form .cd-denominations input { padding-inline:6px; font-size:12px; }
  .cr-preview { padding:18px; }
}
@media print {
  .cr-preview { padding:0; background:#fff; }
  .cr-preview .cr-paper { width:100%; max-width:72mm; padding:0; margin:0; color:#000; background:#fff; box-shadow:none; }
}

/* Counting expands the workspace; total-only operations stay compact. */
@media screen {
  .cd-denominations caption { text-align:left; padding:5px 0 7px; color:var(--text); font:500 12px/1.5 var(--font-body); }
  .cd-denomination-groups[hidden] { display:none; }
  .cd-close-other { min-width:0; }
  .cd-close-other > .cd-cash-expected { margin:0 0 16px; }
}
@media screen and (min-width:900px) {
  #modal.cash-dialog:has(.cd-cash-counter[data-cash-count-mode=pieces]) { width:min(800px,calc(100vw - 32px)); max-width:none; }
  #modal.cash-dialog:has(.cd-close-workspace .cd-cash-counter[data-cash-count-mode=pieces]) { width:min(1120px,calc(100vw - 32px)); }
  #modal.cash-dialog:has(.cd-cash-counter[data-cash-count-mode=pieces]) .cd-context { padding-block:12px; }
  #modal.cash-dialog:has(.cd-cash-counter[data-cash-count-mode=pieces]) > .modal-head { padding-block:16px 12px; }
  #modal.cash-dialog:has(.cd-cash-counter[data-cash-count-mode=pieces]) .cd-footer { padding-block:12px; }
  .cd-cash-counter[data-cash-count-mode=pieces] { margin-block:10px; }
  .cd-cash-counter[data-cash-count-mode=pieces] .cd-counter-heading { margin-bottom:6px; }
  .cd-cash-counter[data-cash-count-mode=pieces] .cd-counter-total input { height:44px; font-size:30px; }
  .cd-denomination-groups:not([hidden]) { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:24px; align-items:start; }
  .cd-close-workspace:has(.cd-cash-counter[data-cash-count-mode=pieces]) { display:grid; grid-template-columns:minmax(0,1fr) 270px; gap:28px; align-items:start; }
  .cd-close-workspace:has(.cd-cash-counter[data-cash-count-mode=pieces]) .cd-close-other { margin-top:23px; padding-left:24px; border-left:1px solid var(--border); }
  .cd-close-workspace:has(.cd-cash-counter[data-cash-count-mode=pieces]) .cd-count-list { margin-top:0; }
  .cd-close-workspace:has(.cd-cash-counter[data-cash-count-mode=pieces]) :is(.cd-count-heading,.cd-count-row) { grid-template-columns:minmax(66px,1fr) minmax(66px,1fr) minmax(78px,1fr); gap:8px; }
  .cd-close-workspace:has(.cd-cash-counter[data-cash-count-mode=pieces]) .cd-count-row label { gap:6px; font-size:12px; }
  .cd-close-workspace:has(.cd-cash-counter[data-cash-count-mode=pieces]) .cd-count-row input { font-size:13px; padding-inline:7px; }
  .cd-cash-counter[data-cash-count-mode=pieces] .cd-counter-total { position:static; }
  .cd-cash-counter[data-cash-count-mode=pieces] .cd-denominations tbody :is(th,td) { height:43px; padding-block:3px; }
  .cd-cash-counter[data-cash-count-mode=pieces] .cash-money-image { height:36px; }
  .cd-cash-counter[data-cash-count-mode=pieces] .cash-money-image::before { transform:scale(.9); }
}
@media screen and (min-width:900px) and (max-width:1099px) {
  .cd-close-workspace:has(.cd-cash-counter[data-cash-count-mode=pieces]) { grid-template-columns:minmax(0,1fr); gap:0; }
  .cd-close-workspace:has(.cd-cash-counter[data-cash-count-mode=pieces]) .cd-close-other { margin:0; padding:0; border:0; }
}
