/* Compact feedback dialogs, shared across public and console pages. */
body .prompt-modal{position:fixed!important;inset:0!important;display:flex;align-items:center;justify-content:center;width:100%!important;max-width:none!important;height:100%!important;max-height:none!important;margin:0!important;padding:20px!important;box-sizing:border-box;overflow:auto;background:rgba(15,23,42,.4);z-index:10020}
body .prompt-modal .mbox,body dialog.payment-password-dialog{box-sizing:border-box;width:344px!important;max-width:calc(100vw - 32px)!important;max-height:calc(100dvh - 40px)!important;padding:18px!important;border:1px solid #e3e8ef!important;border-radius:12px!important;background:#fff;box-shadow:0 14px 44px #0f172a22!important;overflow:auto;color:#172033;text-align:left}
body .prompt-modal .mbox h3,body dialog.payment-password-dialog h4{font-size:15px!important;font-weight:650;line-height:1.45;margin:0 0 10px!important}
body .prompt-modal .mbox p,body .prompt-modal .sb-body,body dialog.payment-password-dialog .rs-note{font-size:13px;line-height:1.65;color:#64748b;overflow-wrap:anywhere;margin:0 0 14px;max-height:45vh;overflow:auto}
body .prompt-modal .mrow,body dialog.payment-password-dialog form>div:last-child{display:flex;justify-content:flex-end;flex-wrap:wrap;gap:8px;margin-top:16px}
body .prompt-modal .btn,body dialog.payment-password-dialog .btn{width:auto!important;min-width:64px;min-height:32px;padding:6px 12px!important;border-radius:7px!important;font-size:13px!important;line-height:1.4;flex:0 0 auto!important}
body .prompt-modal :is(.alert-ico,.ok-ico){display:grid;place-items:center;width:28px;height:28px;line-height:1;font-size:16px;border-radius:8px;margin:0 0 12px;box-shadow:none;background:#eff5ff;color:#2563eb}
body .prompt-modal .ok-ico{background:#ecfdf5;color:#059669}
body dialog.payment-password-dialog{margin:auto!important}
body dialog.payment-password-dialog::backdrop{background:rgba(15,23,42,.4)}
body dialog.payment-password-dialog .fitem{margin:20px 0 0}
body dialog.payment-password-dialog label{display:block;color:#475569;font-size:13px;line-height:1.5}
body dialog.payment-password-dialog input{display:block;box-sizing:border-box;width:100%;height:44px;margin-top:8px;padding:10px 12px;border:1px solid #d8e0eb;border-radius:9px;background:#fff;font-size:16px;outline:none}
body dialog.payment-password-dialog input:focus{border-color:#3563e9;box-shadow:0 0 0 3px #3563e91a}
body .toast{box-sizing:border-box;width:max-content;max-width:min(380px,calc(100vw - 32px));white-space:normal;overflow-wrap:anywhere;line-height:1.6}

/* Shared compact geometry; task-specific widths remain available for complex forms. */
body[data-ui] :is(.modal-card,.merchant-modal,.mbox):not(.notify-panel){box-sizing:border-box;border-radius:12px!important;border:1px solid #e3e8ef;box-shadow:0 16px 48px #0f172a24!important;max-width:calc(100vw - 32px)!important;max-height:calc(100dvh - 32px)!important}
body[data-ui] .modal>.mbox:not(.notify-panel){padding:18px!important}
body[data-ui] :is(.modal-head,.merchant-modal-head){padding:14px 18px!important;min-height:0!important}
body[data-ui] :is(.modal-head,.merchant-modal-head) :is(h2,h3){font-size:15px!important;line-height:1.5;margin:0!important;font-weight:650}
body[data-ui] :is(.modal-head,.merchant-modal-head) .x{width:28px!important;height:28px!important;border-radius:7px!important;font-size:18px!important}
body[data-ui] :is(.modal-body,.merchant-modal-body){padding:16px 18px!important;min-height:0;overflow-y:auto;overflow-wrap:anywhere}
body[data-ui] :is(.modal-foot,.merchant-modal-foot){padding:12px 18px!important;gap:8px!important;margin-top:0!important}
body[data-ui] :is(.modal-foot,.merchant-modal-foot) .btn{min-height:32px!important;padding:6px 12px!important;border-radius:7px!important;font-size:13px!important;line-height:1.5;white-space:nowrap;justify-content:center}
body[data-ui] .modal :is(.form2,.frm){gap:14px!important}
body[data-ui] .modal :is(.form2,.frm) label{font-size:13px;line-height:1.6}
body[data-ui] .modal :is(.form2,.frm) :is(input:not([type=checkbox]):not([type=radio]):not([type=file]),select){padding:7px 10px;min-height:36px;border-radius:7px}
body[data-ui] .modal :is(.form2,.frm) textarea{padding:8px 10px;border-radius:7px}
body[data-ui] .modal>.mbox:not(.notify-panel) h3{font-size:15px!important;line-height:1.5}
body[data-ui] .modal>.mbox:not(.notify-panel) p{font-size:13px;line-height:1.65;margin-bottom:14px}
body .prompt-modal .mrow.center{justify-content:flex-end}
@media(max-width:520px){
 body .prompt-modal{padding:16px!important}
 body .prompt-modal .mbox,body dialog.payment-password-dialog{width:calc(100vw - 48px)!important;max-width:344px!important}
 body[data-ui] :is(.modal-head,.merchant-modal-head){padding:12px 14px!important}
 body[data-ui] :is(.modal-body,.merchant-modal-body){padding:14px!important}
 body[data-ui] :is(.modal-foot,.merchant-modal-foot){padding:10px 14px!important;flex-wrap:wrap}
}
/* Keep the overlay edge-to-edge even where older mobile styles inset the modal. */
body[data-ui] .modal{position:fixed!important;inset:0!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;margin:0!important;padding:16px!important;box-sizing:border-box;align-items:center!important;justify-content:center!important;overflow-y:auto;border-radius:0!important}
/* Credential prompts stay compact even when generic modal sizing is overridden. */
body[data-ui] #integrationPasswordModal{box-sizing:border-box;align-items:center;justify-content:center;padding:16px}
body[data-ui] #integrationPasswordModal .merchant-modal{width:min(380px,calc(100vw - 32px))!important;max-width:min(380px,calc(100vw - 32px))!important;margin:0!important;overflow:hidden}
body[data-ui] #integrationPasswordModal .merchant-modal-foot{flex-wrap:nowrap;justify-content:flex-end}
body[data-ui] #integrationPasswordModal .merchant-modal-foot .btn{width:auto!important;flex:0 0 auto}
body[data-ui] #credentialView .mbox{width:min(560px,calc(100vw - 32px))!important;max-width:min(560px,calc(100vw - 32px))!important}

/* Small forms opt in; override the console's generic 800px dialog width. */
body[data-ui] .modal.compact-form-modal{inset:0!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;margin:0!important;padding:16px!important;box-sizing:border-box;align-items:center!important;justify-content:center!important}
body[data-ui] .compact-form-modal>.modal-card{width:480px!important;max-width:100%!important;max-height:calc(100dvh - 32px)!important;margin:auto!important;align-self:center!important;overflow:hidden!important}
body[data-ui] .compact-form-modal .form2{grid-template-columns:minmax(0,1fr);gap:12px!important}
body[data-ui] .compact-form-modal .form2 .full{grid-column:1/-1;min-width:0}
body[data-ui] .compact-form-modal select{width:100%;min-width:0;max-width:100%;text-overflow:ellipsis}
body[data-ui] .compact-form-modal .err:empty{display:none}

/* The shared channel picker shows a provider icon and one channel name. */
body[data-ui] #applyChannelChooser .modal-card{width:560px!important;max-width:calc(100vw - 32px)!important;display:flex;flex-direction:column;overflow:hidden}
body[data-ui] #applyChannelChooser .modal-body{padding:22px!important;overflow-y:auto}
body[data-ui] #applyChannelChooser .apply-chooser-note{padding:0;background:none;border:0;margin:0 0 22px;font-size:13px}
body[data-ui] #applyChannelChooser .apply-chooser-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
body[data-ui] #applyChannelChooser .apply-chooser-item{min-width:0;min-height:64px;padding:13px 14px;gap:12px;border-radius:10px}
body[data-ui] #applyChannelChooser .apply-chooser-icon{width:34px;height:34px;border-radius:9px}
body[data-ui] #applyChannelChooser .apply-chooser-icon img{display:block;width:24px;height:24px;object-fit:contain}
body[data-ui] #applyChannelChooser .apply-chooser-item b{font-size:14px;font-weight:600}
body[data-ui] #applyChannelChooser .modal-foot{flex-shrink:0}
@media(max-width:520px){body[data-ui] #applyChannelChooser .apply-chooser-grid{grid-template-columns:minmax(0,1fr)}}

/* Complaint handling: bounded card, readable sections and persistent actions. */
body:is(.merchant-console,.admin-console,#adminWorkspace)[data-ui=console] .complaint-dialog{padding:20px;background:rgba(15,23,42,.38);backdrop-filter:blur(3px)}
body:is(.merchant-console,.admin-console,#adminWorkspace)[data-ui=console] .complaint-dialog>.merchant-modal{position:relative!important;inset:auto!important;width:600px!important;max-width:calc(100vw - 40px)!important;height:auto!important;max-height:min(760px,calc(100dvh - 40px))!important;margin:0!important;display:flex;flex-direction:column;overflow:hidden;border-radius:16px!important;box-shadow:0 24px 80px #0f172a30!important}
.complaint-dialog .merchant-modal-head{display:flex;align-items:center;gap:12px;border-bottom:1px solid #edf0f5}
.complaint-dialog .mc-heading{flex:1;min-width:0}.complaint-dialog .mc-heading b{font-size:16px;line-height:1.5;display:block;color:#172033}.complaint-dialog .mc-number{display:block;margin-top:3px;font-size:12px;line-height:1.5;color:#8290a5;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.complaint-dialog .merchant-modal-x{position:static;flex:none;width:28px;height:28px;border-radius:8px;background:#f3f5f8;color:#738096}
.complaint-dialog .merchant-modal-head .badge{flex:none;font-size:11px;white-space:nowrap}
.complaint-dialog .merchant-modal-body{display:flex;flex-direction:column;gap:18px;overscroll-behavior:contain}
.complaint-dialog .mc-summary{padding:13px 14px;background:#f7f9fc;border:1px solid #edf0f5;border-radius:10px}
.complaint-dialog .mc-subject{font-size:13px;line-height:1.6;font-weight:600;color:#344054;overflow-wrap:anywhere}
.complaint-dialog .mc-meta{display:flex;flex-wrap:wrap;column-gap:22px;row-gap:5px;margin-top:8px;font-size:12px;line-height:1.6;color:#8490a3}.complaint-dialog .mc-meta b{font-weight:400;color:#526174;margin-left:6px}
.complaint-dialog .mc-section{margin:0;min-width:0}.complaint-dialog .mc-section:empty{display:none}
.complaint-dialog .mc-section h4,.complaint-dialog .mc-reply-label label{margin:0 0 8px;font-size:13px;font-weight:600;line-height:1.5;color:#243044}
.complaint-dialog .mc-content{margin:0;font-size:14px;line-height:1.75;white-space:pre-wrap;overflow-wrap:anywhere;color:#42516a}
.complaint-dialog .mc-response{padding:10px 12px;background:#f7f9fc;border-radius:8px}
.complaint-dialog .mc-reply-label{display:flex;justify-content:space-between;align-items:baseline}.complaint-dialog #mcReplyCount{font-size:11px;color:#97a1b2;font-variant-numeric:tabular-nums}
body:is(.merchant-console,.admin-console,#adminWorkspace)[data-ui=console] .complaint-dialog #mcReply{box-sizing:border-box;display:block;width:100%;min-height:88px!important;height:96px;max-height:180px;padding:11px 12px;border:1px solid #dce2ec;border-radius:9px;background:#fff;font:inherit;font-size:13px;line-height:1.65;resize:vertical;outline:none;transition:border-color .15s,box-shadow .15s}
.complaint-dialog #mcReply:focus{border-color:#5d87ec;box-shadow:0 0 0 3px #2563eb0d}.complaint-dialog #mcReply::placeholder{color:#9aa4b4}
.complaint-dialog .mc-hint{margin:7px 0 0;font-size:11px;line-height:1.6;color:#8c97a8}
.complaint-dialog #mcHistory{border-top:1px solid #edf0f5;padding-top:16px}.complaint-dialog #mcHistory:empty{display:none}
.complaint-dialog #mcHistory p{margin:4px 0 0;font-size:13px;line-height:1.7}.complaint-dialog #mcHistory small{font-size:11px}
.complaint-dialog #mcHistory>p:empty,.complaint-dialog #mcError:empty{display:none}.complaint-dialog #mcError{margin:0;color:#dc2626;font-size:12px}
.complaint-dialog #mcHistory>button[hidden]{display:none!important}.complaint-dialog #mcHistory>button{margin-top:8px;font-size:12px;padding:5px 10px;min-height:28px}
.complaint-dialog .merchant-modal-foot{display:flex;align-items:center;border-top:1px solid #edf0f5;background:#fcfdff}.complaint-dialog .mc-close{margin-right:auto}
.complaint-dialog .mc-resolved{margin:0;color:#32805e;font-size:13px}
@media(max-width:600px){body:is(.merchant-console,.admin-console,#adminWorkspace)[data-ui=console] .complaint-dialog{padding:12px}body:is(.merchant-console,.admin-console,#adminWorkspace)[data-ui=console] .complaint-dialog>.merchant-modal{max-width:calc(100vw - 24px)!important;max-height:calc(100dvh - 24px)!important;border-radius:12px!important}.complaint-dialog .merchant-modal-body{gap:15px}.complaint-dialog .mc-meta{display:grid;gap:4px}.complaint-dialog .merchant-modal-foot .btn{flex:0 0 auto!important;width:auto!important}.complaint-dialog .merchant-modal-head{gap:8px}.complaint-dialog .mc-number{font-size:11px}}
/* In-place complaint replies. */
.complaint-dialog .mc-compose{position:relative;border:1px solid #dce2ec;border-radius:10px;background:#fff;overflow:hidden}
.complaint-dialog .mc-compose:focus-within{border-color:#5d87ec;box-shadow:0 0 0 3px #2563eb0d}
body:is(.merchant-console,.admin-console,#adminWorkspace)[data-ui=console] .complaint-dialog .mc-compose #mcReply{border:0;border-radius:0;height:130px;min-height:110px!important;padding-bottom:48px;box-shadow:none;resize:vertical}
.complaint-dialog .mc-compose #mcSend{position:absolute;right:9px;bottom:9px;min-height:30px;padding:5px 15px;font-size:12px;border-radius:7px}
.complaint-dialog #mcHistory .mc-chat-list{display:flex;flex-direction:column;gap:14px;padding:12px;background:#f6f8fa;border-radius:10px;max-height:260px;overflow:auto;overscroll-behavior:contain}
.complaint-dialog .mc-chat-message{align-self:flex-start;max-width:88%;min-width:0;overflow-wrap:anywhere}
.complaint-dialog .mc-chat-message.is-self{align-self:flex-end;text-align:right}
.complaint-dialog .mc-chat-message small{display:block;margin-bottom:5px;color:#8a96a8}
.complaint-dialog #mcHistory .mc-chat-message p{display:inline-block;text-align:left;margin:0;padding:9px 12px;background:#fff;border:1px solid #e9edf2;border-radius:3px 10px 10px;line-height:1.65;color:#344054}
.complaint-dialog #mcHistory .mc-chat-message.is-self p{background:#e5f2e7;border-color:#d8eadd;border-radius:10px 3px 10px 10px;color:#284c36}

/* Shared complaint dialog primitives for both consoles. */
body[data-ui=console] .complaint-dialog{position:fixed;inset:0;z-index:9999;display:flex;align-items:center;justify-content:center;box-sizing:border-box}
body[data-ui=console] .complaint-dialog>.merchant-modal{background:#fff;box-sizing:border-box}
body[data-ui=console] .complaint-dialog .merchant-modal-head,body[data-ui=console] .complaint-dialog .merchant-modal-foot{flex-shrink:0}
body[data-ui=console] .complaint-dialog .merchant-modal-body{min-height:0;max-height:60vh;overflow-y:auto}
body[data-ui=console] .complaint-dialog .merchant-modal-x{border:0;cursor:pointer;font-size:15px;line-height:1}
body[data-ui=console] .complaint-dialog .merchant-modal-foot{justify-content:flex-end}
#complaintRows .ops{white-space:nowrap;min-width:110px}#complaintRows .ops .btn{margin:3px 10px 3px 0;padding:5px 10px;font-size:12px}

.complaint-dialog .mc-order{padding:16px;border:1px solid #e2e8f0;border-radius:12px;background:#fafbfe}
.complaint-dialog .mc-order-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.complaint-dialog .mc-order-head h4{margin:0}
.complaint-dialog .mc-order-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px;margin:0}
.complaint-dialog .mc-order-fields dt{font-size:12px;color:#8796ad;margin-bottom:3px}
.complaint-dialog .mc-order-fields dd{margin:0;font-size:13px;color:#42526b;overflow-wrap:anywhere;user-select:text}
.complaint-dialog .mc-order-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:14px}
.complaint-dialog .mc-order-actions .mc-hint{flex:1;margin:0;min-width:120px}
.complaint-dialog #mcRefund{color:#dc4545;border-color:#f1c9c9}
.complaint-dialog #mcRefundError{font-size:12px;color:#dc4545;margin:8px 0 0;overflow-wrap:anywhere}
@media(max-width:480px){.complaint-dialog .mc-order-fields{grid-template-columns:1fr}}

body[data-ui=console] .complaint-dialog .mc-compose textarea#mcReply{display:block;box-sizing:border-box;width:100%!important;min-width:0!important;max-width:100%!important;margin:0!important;border:0!important;border-radius:0!important;padding:11px 12px 48px!important;background:transparent;box-shadow:none!important}
.complaint-dialog .mc-owner-actions{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:10px;padding-top:10px;border-top:1px solid #e2e8f0}
.complaint-dialog .mc-owner-actions .btn{white-space:nowrap;font-size:12px;padding:5px 10px}
.complaint-dialog .mc-owner-status{font-size:12px;color:#7b899e;overflow-wrap:anywhere}

body[data-ui=console] #txDetailModal.complaint-order-layer{z-index:10030!important}
body[data-ui=console] #txNotifyModal.complaint-order-notify-layer{z-index:10040!important}
/* Confirmations and their results must cover nested complaint/order windows. */
body[data-ui=console] .modal.prompt-modal{z-index:10050!important}
