/* ============================================================================
   card-payments.css — Card payments, Phases 1-3 (public/js/card-payments.js)
   Settings → Payments pane, the order's saved-card row, and the customer
   drawer's "Card on file" section. Flat, navy, no gradients.
   ========================================================================== */

/* ── Settings → Payments ── */
#sx-pane-payments .cp-msg { margin: 0; font-size: 13px; color: var(--sx-ink2, #54607a); }
/* Quote / order form: "Card after signing" while Authorize.net is not connected */
.aq2-row .cp-req-note { margin: 0 0 4px; font-size: 11px; line-height: 1.35; color: #92400e; }
.aq2-row .aq2-switch span.cp-shake { animation: cp-shake .38s ease-in-out; }
@keyframes cp-shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .aq2-row .aq2-switch span.cp-shake { animation: none; } }
#sx-pane-payments .cp-msg.is-bad { color: #b91c1c; }
#sx-pane-payments .cp-tile { border: 1px solid var(--sx-border, #e4e9f1); border-radius: 10px; background: var(--sx-surface, #fff); overflow: hidden; margin-bottom: 18px; }
#sx-pane-payments .cp-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
#sx-pane-payments .cp-mark { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 9px; overflow: hidden; display: inline-flex; }
#sx-pane-payments .cp-mark img { display: block; width: 40px; height: 40px; }
#sx-pane-payments .cp-tile.is-empty .cp-mark img { filter: grayscale(1); opacity: .5; }
#sx-pane-payments .cp-who { flex: 1 1 auto; min-width: 0; }
#sx-pane-payments .cp-who b { display: block; font-size: 15px; font-weight: 700; color: var(--sx-ink, #101a2b); }
#sx-pane-payments .cp-who span { display: block; margin-top: 1px; font-size: 12.5px; color: var(--sx-ink2, #54607a); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sx-pane-payments .cp-pill { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
#sx-pane-payments .cp-pill::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
#sx-pane-payments .cp-pill.is-ok { background: #e9f7ef; color: #15803d; }
#sx-pane-payments .cp-pill.is-wait { background: #eef3ff; color: #2f5bd3; }
#sx-pane-payments .cp-pill.is-off { background: var(--sx-surface3, #eef2f8); color: var(--sx-ink2, #54607a); }
#sx-pane-payments .cp-result { margin: 0; padding: 10px 16px; font-size: 12.5px; border-top: 1px solid var(--sx-border, #e4e9f1); }
#sx-pane-payments .cp-result.is-ok { color: #15803d; background: #f3fbf6; }
#sx-pane-payments .cp-result.is-bad { color: #b91c1c; background: #fef6f6; }

#sx-pane-payments .cp-form { display: flex; flex-direction: column; gap: 16px; }
#sx-pane-payments .cp-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#sx-pane-payments .cp-seg-opt { position: relative; display: block; cursor: pointer; }
#sx-pane-payments .cp-seg-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
#sx-pane-payments .cp-seg-opt span { display: block; padding: 10px 12px; border: 1px solid var(--sx-border2, #d7deea); border-radius: 9px; background: var(--sx-surface, #fff); }
#sx-pane-payments .cp-seg-opt b { display: block; font-size: 13.5px; color: var(--sx-ink, #101a2b); }
#sx-pane-payments .cp-seg-opt small { display: block; font-size: 12px; color: var(--sx-ink2, #54607a); margin-top: 1px; }
#sx-pane-payments .cp-seg-opt input:checked + span { border-color: var(--sx-black, #111318); box-shadow: inset 0 0 0 1px var(--sx-black, #111318); }
#sx-pane-payments .cp-seg-opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(47, 107, 255, .2); }
#sx-pane-payments .cp-opt { font-weight: 500; color: var(--sx-faint, #8a94a6); }
#sx-pane-payments .cp-brands { display: flex; flex-wrap: wrap; gap: 8px 18px; padding-top: 2px; }
#sx-pane-payments .cp-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--sx-ink, #101a2b); cursor: pointer; font-weight: 500 !important; }
#sx-pane-payments .cp-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--sx-black, #111318); }
#sx-pane-payments .cp-err { margin: 0; padding: 9px 12px; border-radius: 8px; background: #fef6f6; color: #b91c1c; font-size: 12.5px; }
#sx-pane-payments .cp-actions { display: flex; gap: 10px; flex-wrap: wrap; }
#sx-pane-payments .cp-danger { color: #b91c1c; }
#sx-pane-payments .cp-help { margin-top: 18px; border-top: 1px solid var(--sx-border, #e4e9f1); padding-top: 14px; font-size: 13px; color: var(--sx-ink2, #54607a); }
#sx-pane-payments .cp-help summary { cursor: pointer; font-weight: 600; color: var(--sx-ink, #101a2b); }
#sx-pane-payments .cp-help ol { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 6px; line-height: 1.5; }
#sx-pane-payments .cp-help b { color: var(--sx-ink, #101a2b); font-weight: 600; }
@media (max-width: 640px) {
  #sx-pane-payments .cp-seg { grid-template-columns: 1fr; }
  #sx-pane-payments .cp-head { flex-wrap: wrap; }
}

/* ── Order → Customer box: Saved CC ──
   Card payments on: one compact bar, the same height as the text box it
   replaces, so the Customer box keeps its shape. */
#eoCardRow .eo-card-field { min-width: 0; }
#eoCardRow .eo-card-field > [hidden] { display: none !important; }
.eo-cardbar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 8px; row-gap: 1px; padding: 5px 5px 5px 8px; border: 1px solid #e2e8f0; border-radius: 6px; background: #fff; box-sizing: border-box; min-width: 0; }
.eo-cardbar.has-card { background: #fbfcfe; }
.eo-cardbar.is-asked { border-color: #f3d19c; background: #fffaf0; }
.eo-cardbar > .cp-logo, .eo-cb-logo { grid-row: 1; grid-column: 1; }
.eo-cb-logo.is-empty { width: 30px; height: 19px; border-radius: 4px; background: #eef2f7; color: #94a3b8; display: inline-flex; align-items: center; justify-content: center; }
.eo-cb-logo.is-empty svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.eo-cardbar.is-asked .eo-cb-logo.is-empty { background: #fdecc8; color: #a15c07; }
.eo-cb-title { grid-row: 1; grid-column: 2; min-width: 0; font-size: 12.5px; font-weight: 650; color: #0f172a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eo-cb-meta { grid-row: 2; grid-column: 1 / -1; min-width: 0; font-size: 11px; line-height: 1.35; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eo-cardbar.is-asked .eo-cb-meta { color: #a15c07; }
.eo-cb-acts { grid-row: 1; grid-column: 3; display: flex; align-items: center; gap: 3px; }
.eo-cb-btn { min-height: 0; height: 24px; padding: 0 8px; border-radius: 6px; border: 1px solid #d8dee8; background: #fff; color: #0a2540; font-family: inherit; font-size: 11px; font-weight: 600; line-height: 1; cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; transition: background .12s, border-color .12s; }
.eo-cb-btn:hover:not(:disabled) { background: #f5f7fb; border-color: #c5cedc; }
.eo-cb-btn:disabled { color: #a0aabb; cursor: not-allowed; }
.eo-cb-btn:focus-visible { outline: 2px solid #2f6bff; outline-offset: 1px; }
.eo-cb-btn.is-icon { width: 24px; padding: 0; color: #475569; }
.eo-cb-btn.is-icon svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.eo-cb-btn.is-spin svg { animation: cpx-spin .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .eo-cb-btn.is-spin svg { animation: none; } }

/* ── Customer drawer: Card on file ── */
#tab-customers .cp-cu-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 9px; margin-bottom: 10px; }
#tab-customers .cp-cu-mark { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; background: #0a2540; color: #fff; }
#tab-customers .cp-cu-card b { display: block; font-size: 14px; color: #0f172a; }
#tab-customers .cp-cu-card div > span { display: block; font-size: 12.5px; color: #64748b; }
#tab-customers .cp-cu-mark svg { width: 18px; height: 18px; display: block; margin: 0; }

/* ============================================================================
   Phase 2 — Charge CC
   ========================================================================== */

/* ── switches (Settings card fee + agent permission) ── */
.cp-switch { position: relative; flex: 0 0 auto; width: 38px; height: 22px; }
.cp-switch input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 1; }
.cp-switch i { position: absolute; inset: 0; border-radius: 22px; background: #cbd5e1; transition: background .15s; }
.cp-switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .2); transition: transform .15s; }
.cp-switch input:checked + i { background: #0a2540; }
.cp-switch input:checked + i::after { transform: translateX(16px); }
.cp-switch input:focus-visible + i { box-shadow: 0 0 0 3px rgba(47, 107, 255, .25); }
.cp-switch input:disabled + i { opacity: .55; }
@media (prefers-reduced-motion: reduce) { .cp-switch i, .cp-switch i::after { transition: none; } }

/* ── Settings → Payments: card fee ── */
#sx-pane-payments .cp-fee { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--sx-border, #e4e9f1); display: flex; flex-direction: column; gap: 12px; }
#sx-pane-payments .cp-sec-h h4 { margin: 0; font-size: 15px; font-weight: 700; color: var(--sx-ink, #101a2b); }
#sx-pane-payments .cp-sec-h p { margin: 2px 0 0; font-size: 12.5px; color: var(--sx-ink2, #54607a); }
#sx-pane-payments .cp-switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px; border: 1px solid var(--sx-border, #e4e9f1); border-radius: 9px; background: var(--sx-surface, #fff); cursor: pointer; }
#sx-pane-payments .cp-switch-text b { display: block; font-size: 13.5px; font-weight: 600; color: var(--sx-ink, #101a2b); }
#sx-pane-payments .cp-switch-text small { display: block; margin-top: 1px; font-size: 12px; color: var(--sx-ink2, #54607a); font-weight: 400; }
#sx-pane-payments .cp-fee-body { display: flex; flex-direction: column; gap: 12px; }
#sx-pane-payments .cp-fee-body[hidden] { display: none; }
#sx-pane-payments .cp-fee-pct { display: flex; align-items: center; gap: 12px; }
#sx-pane-payments .cp-fee-pct label { font-size: 13px; font-weight: 600; color: var(--sx-ink2, #54607a); min-width: 70px; }
#sx-pane-payments .cp-suffix { position: relative; width: 120px; }
#sx-pane-payments .cp-suffix .sx-in { padding-right: 30px; font-variant-numeric: tabular-nums; }
#sx-pane-payments .cp-suffix span { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--sx-ink2, #54607a); font-size: 14px; pointer-events: none; }
#sx-pane-payments .cp-fee-example { margin: 0; padding: 10px 12px; border-radius: 8px; background: var(--sx-surface2, #f6f8fc); font-size: 13px; color: var(--sx-ink2, #54607a); }
#sx-pane-payments .cp-fee-example b { color: var(--sx-ink, #101a2b); font-variant-numeric: tabular-nums; }
#sx-pane-payments .cp-fee-note { margin: 0; font-size: 12px; line-height: 1.5; color: var(--sx-faint, #8a94a6); }

/* ── Agent profile: Card payments permission ── */
.agent-card-perms { margin: 16px 0 14px; padding: 14px 16px; border: 1px solid #e3e8f0; border-radius: 10px; background: #fff; }
.agent-card-perms[hidden] { display: none; }
.agent-card-perms .acp-head h4 { margin: 0; font-size: 14px; font-weight: 700; color: #0f172a; }
.agent-card-perms .acp-head p { margin: 2px 0 10px; font-size: 12.5px; color: #64748b; }
.agent-card-perms .acp-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px; border: 1px solid #eef2f7; border-radius: 8px; background: #f8fafc; cursor: pointer; }
.agent-card-perms .acp-row b { display: block; font-size: 13.5px; color: #0f172a; }
.agent-card-perms .acp-row small { display: block; font-size: 12px; color: #64748b; }
.agent-card-perms .acp-list { display: grid; gap: 8px; }

/* ── Order → Payment History ── */
#eoTabPayments .eo-pay-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
#eoTabPayments .eo-charge-btn { display: inline-flex; align-items: center; gap: 6px; background: #0a2540; border-color: #0a2540; color: #fff; }
#eoTabPayments .eo-charge-btn:hover { background: #12345a; border-color: #12345a; color: #fff; }
#eoTabPayments .eo-charge-btn[hidden] { display: none; }
#eoTabPayments .eo-charge-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#eoTabPayments .eo-pay-card-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #eaf6ef; color: #15803d; font-size: 10.5px; font-weight: 650; vertical-align: 1px; }
#eoTabPayments .eo-pay-lock { display: inline-flex; color: #94a3b8; }
#eoTabPayments .eo-pay-lock svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#eoCardTxBanner[hidden], #eoCardTxList[hidden] { display: none; }
#eoCardTxBanner { display: grid; gap: 8px; margin-bottom: 10px; }
.cpx-banner { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; border: 1px solid #fcd9a5; background: #fffaf0; }
.cpx-banner-ic { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: #fdecc8; color: #a15c07; }
.cpx-banner-ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cpx-banner > div { flex: 1 1 auto; min-width: 0; }
.cpx-banner b { display: block; font-size: 13.5px; color: #7a4504; }
.cpx-banner span { display: block; font-size: 12.5px; color: #8a5a17; line-height: 1.45; }
#eoCardTxList { margin-top: 18px; }
.cpx-act-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.cpx-act-h h5 { margin: 0; font-size: 13px; font-weight: 700; color: #0f172a; }
.cpx-act-h span { font-size: 12px; color: #64748b; }
.cpx-act td { vertical-align: middle; }
.cpx-act .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cpx-act .num small { display: block; font-size: 11px; color: #64748b; }
.cpx-act-d { color: #475569; max-width: 280px; }
.cpx-pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.cpx-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cpx-pill.is-ok { background: #eaf6ef; color: #15803d; }
.cpx-pill.is-bad { background: #fdeeee; color: #b42318; }
.cpx-pill.is-wait { background: #fff4e0; color: #a15c07; }
.cpx-pill.is-off { background: #eef2f7; color: #475569; }

/* ── shared small buttons ── */
.cpx-btn {
  min-height: 0; height: 40px; padding: 0 16px; border-radius: 9px; border: 1px solid #d5dce7; background: #fff; color: #0f172a;
  font-family: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
}
.cpx-btn:hover:not(:disabled) { background: #f5f7fb; }
.cpx-btn:disabled { opacity: .55; cursor: not-allowed; }
.cpx-btn:focus-visible { outline: 3px solid rgba(47, 107, 255, .35); outline-offset: 1px; }
.cpx-banner .cpx-btn { height: 34px; padding: 0 12px; font-size: 12.5px; flex: 0 0 auto; }
.cpx-primary { background: #0a2540; border-color: #0a2540; color: #fff; }
.cpx-primary:hover:not(:disabled) { background: #12345a; }
.cpx-primary:disabled { background: #94a3b8; border-color: #94a3b8; opacity: 1; }

/* ── Charge card dialog ── */
body.cpx-open { overflow: hidden; }
.cpx-overlay { position: fixed; inset: 0; z-index: 12500; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(15, 23, 42, .45); }
.cpx-overlay[hidden] { display: none; }
.cpx-dialog { width: min(480px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(15, 23, 42, .28); overflow: hidden; color: #0f172a; font-size: 14px; }
#cpxBody { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; }
.cpx-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid #eef2f7; }
.cpx-head h3 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.01em; color: #0f172a; }
.cpx-head p { margin: 3px 0 0; font-size: 12.5px; color: #64748b; }
.cpx-x { min-height: 0; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: #64748b; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 0; flex: 0 0 auto; }
.cpx-x:hover:not(:disabled) { background: #f1f5f9; color: #0f172a; }
.cpx-x:disabled { opacity: .4; cursor: not-allowed; }
.cpx-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.cpx-main { padding: 18px 20px 6px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.cpx-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 14px 20px; border-top: 1px solid #eef2f7; background: #fbfcfe; }
.cpx-sp { flex: 1 1 auto; }

.cpx-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #e2e8f0; border-radius: 11px; background: #f8fafc; }
.cpx-card-ic { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 9px; background: #0a2540; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.cpx-card-ic svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cpx-card-t { flex: 1 1 auto; min-width: 0; }
.cpx-card-t b { display: block; font-size: 14.5px; font-weight: 650; color: #0f172a; letter-spacing: .01em; }
.cpx-card-t span { display: block; font-size: 12.5px; color: #64748b; }
.cpx-card-tag { flex: 0 0 auto; padding: 3px 9px; border-radius: 999px; background: #eaf6ef; color: #15803d; font-size: 11.5px; font-weight: 650; }

.cpx-field { display: flex; flex-direction: column; gap: 7px; }
.cpx-field > label { font-size: 12.5px; font-weight: 650; color: #334155; }
.cpx-field > label small { font-weight: 500; color: #94a3b8; margin-left: 4px; }
.cpx-amount { display: flex; align-items: center; height: 56px; padding: 0 14px; border: 1.5px solid #cfd8e5; border-radius: 11px; background: #fff; transition: border-color .12s, box-shadow .12s; }
.cpx-amount:focus-within { border-color: #2f6bff; box-shadow: 0 0 0 4px rgba(47, 107, 255, .14); }
.cpx-amount.is-bad { border-color: #d92d20; box-shadow: 0 0 0 4px rgba(217, 45, 32, .1); }
.cpx-amount span { font-size: 24px; font-weight: 600; color: #64748b; margin-right: 4px; }
.cpx-amount input { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; padding: 0; font-family: inherit; font-size: 26px; font-weight: 650; color: #0f172a; font-variant-numeric: tabular-nums; }
.cpx-amount input::placeholder { color: #cbd5e1; }
.cpx-err { margin: 0; font-size: 12.5px; color: #b42318; }
.cpx-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cpx-chip { min-height: 0; height: 30px; padding: 0 10px; border: 1px solid #dfe5ee; border-radius: 999px; background: #fff; cursor: pointer; font-family: inherit; font-size: 12px; color: #475569; display: inline-flex; align-items: center; gap: 6px; }
.cpx-chip b { color: #0f172a; font-weight: 650; font-variant-numeric: tabular-nums; }
.cpx-chip:hover { border-color: #0a2540; background: #f8fafc; }
.cpx-chip:focus-visible { outline: 3px solid rgba(47, 107, 255, .3); outline-offset: 1px; }
.cpx-in { height: 40px; padding: 0 12px; border: 1px solid #cfd8e5; border-radius: 9px; font-family: inherit; font-size: 14px; color: #0f172a; background: #fff; }
.cpx-in:focus { outline: none; border-color: #2f6bff; box-shadow: 0 0 0 3px rgba(47, 107, 255, .14); }

.cpx-sum { border: 1px solid #e2e8f0; border-radius: 11px; padding: 6px 14px; background: #fbfcfe; }
.cpx-sum-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 13.5px; color: #475569; font-variant-numeric: tabular-nums; }
.cpx-sum-row + .cpx-sum-row { border-top: 1px dashed #e2e8f0; }
.cpx-sum-row.is-total { border-top: 1px solid #d5dce7; font-size: 16px; font-weight: 700; color: #0f172a; padding: 10px 0 8px; }
.cpx-fee-in { display: inline-flex; align-items: center; gap: 2px; height: 30px; padding: 0 8px; border: 1px solid #cfd8e5; border-radius: 7px; background: #fff; }
.cpx-fee-in input { width: 64px; border: 0; outline: 0; text-align: right; font-family: inherit; font-size: 13.5px; color: #0f172a; font-variant-numeric: tabular-nums; background: transparent; }
.cpx-fee-in:focus-within { border-color: #2f6bff; }
.cpx-fine { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 8px; font-size: 12px; line-height: 1.5; color: #64748b; }
.cpx-fine svg { flex: 0 0 auto; width: 14px; height: 14px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cpx-spin { width: 15px; height: 15px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: cpx-spin .8s linear infinite; }
@keyframes cpx-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .cpx-spin { animation: none; } }

.cpx-empty { text-align: center; padding: 18px 8px 10px; }
.cpx-empty-ic { width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%; background: #eef2f7; color: #475569; display: flex; align-items: center; justify-content: center; }
.cpx-empty-ic svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cpx-empty b { display: block; font-size: 15px; color: #0f172a; }
.cpx-empty p { margin: 6px auto 0; max-width: 340px; font-size: 13px; color: #64748b; line-height: 1.5; }

.cpx-result { text-align: center; padding: 8px 6px 2px; }
.cpx-result-ic { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.cpx-result-ic svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cpx-result.is-ok .cpx-result-ic { background: #eaf6ef; color: #15803d; }
.cpx-result.is-bad .cpx-result-ic { background: #fdeeee; color: #b42318; }
.cpx-result.is-wait .cpx-result-ic { background: #fff4e0; color: #a15c07; }
.cpx-result h4 { margin: 0; font-size: 19px; font-weight: 700; color: #0f172a; }
.cpx-result p { margin: 6px auto 0; max-width: 360px; font-size: 13.5px; line-height: 1.5; color: #475569; }
.cpx-result p b { color: #0f172a; }
.cpx-dl { margin: 0; border: 1px solid #e2e8f0; border-radius: 11px; padding: 4px 14px; }
.cpx-dl > div { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 13px; }
.cpx-dl > div + div { border-top: 1px dashed #e2e8f0; }
.cpx-dl dt { color: #64748b; }
.cpx-dl dd { margin: 0; color: #0f172a; font-variant-numeric: tabular-nums; text-align: right; word-break: break-all; }
.cpx-reason { margin: 0; padding: 10px 12px; border-radius: 9px; background: #fef3f2; color: #912018; font-size: 13px; }
.cpx-note { margin: 0 0 8px; font-size: 12.5px; line-height: 1.5; color: #64748b; }
.cpx-note b { color: #0f172a; }

/* ── Phase 3: refunds ── */
.cpx-nw { white-space: nowrap; }
.cpx-kind { font-size: 12.5px; font-weight: 600; color: #334155; }
.cpx-kind.is-refund, .cpx-kind.is-void { color: #5b3fd1; }
.cpx-act tr.is-refund td { background: #fbfaff; }
.cpx-minus { color: #5b3fd1; font-weight: 650; }
.cpx-act-a { text-align: right; white-space: nowrap; }
.cpx-mini { min-height: 0; height: 28px; padding: 0 10px; border: 1px solid #dcd3fb; border-radius: 7px; background: #fff; color: #4b2fc4; font-family: inherit; font-size: 12px; font-weight: 650; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; transition: background .12s, border-color .12s; }
.cpx-mini:hover { background: #f5f2ff; border-color: #b9a8f5; }
.cpx-mini:focus-visible { outline: 3px solid rgba(91, 63, 209, .3); outline-offset: 1px; }
.cpx-mini svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
#eoTabPayments .eo-pay-card-tag.is-refund { background: #f1edff; color: #5b3fd1; }
#eoTabPayments .eo-pay-card-tag.is-off { background: #eef2f7; color: #475569; }
#eoTabPayments .eo-pay-minus { color: #5b3fd1; font-weight: 650; white-space: nowrap; }
#eoTabPayments .eo-pay-card-acts { display: inline-flex; align-items: center; gap: 8px; }

.cpx-danger { background: #b42318; border-color: #b42318; color: #fff; }
.cpx-danger:hover:not(:disabled) { background: #912018; border-color: #912018; }
.cpx-danger:disabled { background: #e8a29b; border-color: #e8a29b; opacity: 1; }
.cpx-danger .cpx-spin { border-color: rgba(255, 255, 255, .35); border-top-color: #fff; }
.cpx-refund-hero { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 12px; background: #f5f2ff; border: 1px solid #e4dcfd; }
.cpx-refund-ic { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 12px; background: #5b3fd1; color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.cpx-refund-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cpx-refund-k { display: block; font-size: 12.5px; color: #5b4a99; }
.cpx-refund-v { display: block; font-size: 28px; line-height: 1.15; font-weight: 750; letter-spacing: -.02em; color: #1e1250; font-variant-numeric: tabular-nums; }
.cpx-req { margin-left: 6px; font-size: 11px; font-weight: 600; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; }
.cpx-area { height: auto; min-height: 64px; padding: 10px 12px; line-height: 1.45; resize: vertical; }
.cpx-area.is-bad { border-color: #d92d20; box-shadow: 0 0 0 3px rgba(217, 45, 32, .1); }
.cpx-chip.is-on { border-color: #5b3fd1; background: #f5f2ff; color: #4b2fc4; }
.cpx-chip:disabled { opacity: .55; cursor: not-allowed; }
.cpx-info { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 8px; padding: 11px 13px; border-radius: 10px; background: #f4f7fb; color: #475569; font-size: 12.5px; line-height: 1.5; }
.cpx-info b { color: #0f172a; }
.cpx-info svg { flex: 0 0 auto; width: 16px; height: 16px; margin-top: 1px; fill: none; stroke: #64748b; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Dialog motion: the end state is the resting style, so no motion = no change. */
@keyframes cpx-rise { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes cpx-fade { from { opacity: 0; } }
@keyframes cpx-pop { 0% { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } }
@keyframes cpx-draw { from { stroke-dashoffset: 30; } }
.cpx-overlay:not([hidden]) { animation: cpx-fade .16s ease-out; }
.cpx-overlay:not([hidden]) .cpx-dialog { animation: cpx-rise .22s cubic-bezier(.2, .8, .2, 1); }
.cpx-result .cpx-result-ic { animation: cpx-pop .42s cubic-bezier(.2, .8, .2, 1); }
.cpx-result.is-ok .cpx-result-ic svg path { stroke-dasharray: 30; animation: cpx-draw .45s .18s ease-out both; }
.cpx-result h4, .cpx-result p { animation: cpx-rise .3s .08s ease-out both; }
@media (prefers-reduced-motion: reduce) {
  .cpx-overlay:not([hidden]), .cpx-overlay:not([hidden]) .cpx-dialog, .cpx-result .cpx-result-ic,
  .cpx-result.is-ok .cpx-result-ic svg path, .cpx-result h4, .cpx-result p { animation: none; }
}

@media (max-width: 560px) {
  .cpx-overlay { align-items: flex-end; padding: 0; }
  .cpx-dialog { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .cpx-foot .cpx-btn { flex: 1 1 auto; }
  .cpx-foot .cpx-sp { display: none; }
}

/* Card company logos (public/media/icons/brands, 2026-10-29). The artwork is
   square (100x100) with the mark in the middle, so the chip crops it. */
.cp-logo { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 22px; border-radius: 4px; overflow: hidden; background: #fff; box-shadow: inset 0 0 0 1px #e2e8f0; vertical-align: middle; }
.cp-logo img { display: block; width: 34px; height: 34px; flex: 0 0 auto; }
.cp-logo svg { width: 16px; height: 16px; fill: none; stroke: #64748b; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cp-logo.is-amex { background: #006fcf; box-shadow: none; }
.cp-logo.is-amex img { width: 42px; height: 42px; }
.cp-logo.is-xs { width: 26px; height: 17px; margin-right: 6px; vertical-align: -4px; }
.cp-logo.is-xs img { width: 26px; height: 26px; }
.cp-logo.is-xs.is-amex img { width: 32px; height: 32px; }
.cp-logo.is-sm { width: 30px; height: 19px; }
.cp-logo.is-sm img { width: 30px; height: 30px; }
.cp-logo.is-sm.is-amex img { width: 37px; height: 37px; }
.cp-logo.is-lg { width: 46px; height: 30px; border-radius: 6px; }
.cp-logo.is-lg img { width: 46px; height: 46px; }
.cp-logo.is-lg.is-amex img { width: 56px; height: 56px; }
.cp-card-cell { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
#sx-pane-payments .cp-check .cp-logo { margin-left: 2px; }


/* ── Phase 4: signed receipt ── */
.cpx-rcpt { display: flex; align-items: center; gap: 4px; width: max-content; margin-top: 5px; padding: 0; border: 0; background: none; font: inherit; font-size: 11.5px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.cpx-rcpt svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cpx-rcpt.is-ok { color: #15803d; }
.cpx-rcpt.is-wait { color: #a15c07; }
button.cpx-rcpt { min-height: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
button.cpx-rcpt:focus-visible { outline: 2px solid rgba(47, 107, 255, .4); outline-offset: 2px; border-radius: 3px; }
.cpx-act-a .cpx-mini + .cpx-mini { margin-left: 6px; }
.cpx-mini.is-plain { border-color: #dfe5ee; color: #334155; }
.cpx-mini.is-plain:hover { background: #f5f7fb; border-color: #c9d3e0; }
.cpx-rcpt-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 8px; padding: 10px 12px; border-radius: 9px; font-size: 12.5px; line-height: 1.45; }
.cpx-rcpt-note svg { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cpx-rcpt-note.is-ok { background: #eaf6ef; color: #166534; }
.cpx-rcpt-note.is-bad { background: #fef3f2; color: #912018; }
.cpx-rcpt-note b { color: inherit; }
.cpx-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Refund: "Are you sure?" step before the money moves (2026-10-29) */
.cpx-confirm { display: flex; gap: 10px; align-items: flex-start; margin: 0 20px 14px; padding: 12px 14px; border-radius: 10px; border: 1px solid #f5c2bd; background: #fef3f2; color: #912018; animation: cpx-rise .2s ease-out; }
.cpx-confirm svg { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cpx-confirm b { display: block; font-size: 14px; color: #7a1a12; }
.cpx-confirm span { display: block; font-size: 12.5px; line-height: 1.45; margin-top: 2px; }
@media (prefers-reduced-motion: reduce) { .cpx-confirm { animation: none; } }

