/* CEOACC inline crypto cashier r1.
 * The existing Bootstrap modal owns vertical scrolling and viewport sizing.
 * Put .s6-cashier-shell inside #shop6InlineCashier; no nested vertical scroller.
 */

#shop6InlineCashier,
#modalBoughtSuccess,
.s6-cashier-resume-bar {
    --s6-cashier-surface: #ffffff;
    --s6-cashier-subtle: #f7f9fd;
    --s6-cashier-text: #293342;
    --s6-cashier-muted: #66758d;
    --s6-cashier-border: #e3e9f3;
    --s6-cashier-blue: #3b66df;
    --s6-cashier-blue-hover: #2c52c0;
    --s6-cashier-blue-soft: #eef3ff;
    --s6-cashier-blue-soft-border: #dae4fc;
    --s6-cashier-on-blue: #ffffff;
    --s6-cashier-red: #d93e49;
    --s6-cashier-red-soft: #fff3f3;
    --s6-cashier-red-border: #ffdce0;
    --s6-cashier-warning: #8b641e;
    --s6-cashier-warning-soft: #fff6df;
    --s6-cashier-success: #267550;
    --s6-cashier-success-soft: #e9f7ee;
    --s6-cashier-focus: #5786fa;
    --s6-cashier-control-width: 92px;
    color: var(--s6-cashier-text);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
    -webkit-text-size-adjust: 100%;
}

/* These first three selectors match the existing Shop6 theme conventions. */
body.dark #shop6InlineCashier,
body.dark-mode #shop6InlineCashier,
html[data-theme="dark"] #shop6InlineCashier,
[data-theme="dark"] #shop6InlineCashier,
#shop6InlineCashier[data-theme="dark"],
body.dark #modalBoughtSuccess,
body.dark-mode #modalBoughtSuccess,
html[data-theme="dark"] #modalBoughtSuccess,
[data-theme="dark"] #modalBoughtSuccess,
#modalBoughtSuccess[data-theme="dark"],
body.dark .s6-cashier-resume-bar,
body.dark-mode .s6-cashier-resume-bar,
[data-theme="dark"] .s6-cashier-resume-bar,
.s6-cashier-resume-bar[data-theme="dark"] {
    --s6-cashier-surface: #172033;
    --s6-cashier-subtle: #1e2b40;
    --s6-cashier-text: #edf2fb;
    --s6-cashier-muted: #acbbd2;
    --s6-cashier-border: #34445d;
    --s6-cashier-blue: #a8c0ff;
    --s6-cashier-blue-hover: #bfd0ff;
    --s6-cashier-blue-soft: #263956;
    --s6-cashier-blue-soft-border: #3b5278;
    --s6-cashier-on-blue: #122445;
    --s6-cashier-red: #ff9299;
    --s6-cashier-red-soft: #3a2430;
    --s6-cashier-red-border: #64414b;
    --s6-cashier-warning: #f3cd83;
    --s6-cashier-warning-soft: #3d3220;
    --s6-cashier-success: #8ce0ad;
    --s6-cashier-success-soft: #1e3c32;
    --s6-cashier-focus: #b2cbff;
    color-scheme: dark;
}

#shop6InlineCashier *,
#shop6InlineCashier *::before,
#shop6InlineCashier *::after,
.s6-cashier-resume-bar,
.s6-cashier-resume-bar * {
    box-sizing: border-box;
}

#shop6InlineCashier[hidden],
#shop6InlineCashier [hidden],
.s6-cashier-resume-bar[hidden],
.s6-cashier-resume-bar [hidden] {
    display: none !important;
}

/* This existing purchase-modal child is the cashier's only vertical scroller. */
#modalBuy #shop6InlineCashier {
    padding: 0;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

#shop6InlineCashier button,
.s6-cashier-resume-bar button {
    font-family: inherit;
}

#shop6InlineCashier button:focus,
#shop6InlineCashier a:focus,
#shop6InlineCashier [tabindex]:focus,
.s6-cashier-resume-bar button:focus,
.s6-cashier-resume-bar a:focus {
    outline: 2px solid var(--s6-cashier-focus);
    outline-offset: 3px;
}

#shop6InlineCashier button:disabled,
.s6-cashier-resume-bar button:disabled {
    cursor: not-allowed;
    opacity: .5;
}

#shop6InlineCashier .s6-cashier-shell {
    container: s6-cashier / inline-size;
    width: 100%;
    min-width: 0;
    margin: 0;
    border-radius: 20px;
    background: var(--s6-cashier-surface);
    color: var(--s6-cashier-text);
}

/* Leave .purchase-modal-scroll, .modal-dialog and .modal-content sizing intact. */
#shop6InlineCashier .s6-cashier-body,
#shop6InlineCashier .s6-cashier-grid,
#shop6InlineCashier .s6-cashier-fields {
    min-width: 0;
    max-height: none;
    overflow: visible;
}

#shop6InlineCashier .s6-cashier-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 24px 13px;
    border-radius: 20px 20px 0 0;
}

#shop6InlineCashier .s6-cashier-topbar .s6-cashier-close {
    display: inline-flex;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    margin: 0 0 0 8px;
    padding: 0;
    border: 1px solid var(--s6-cashier-border);
    border-radius: 9px;
    background: var(--s6-cashier-subtle);
    color: var(--s6-cashier-muted);
    box-shadow: none;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
}

#shop6InlineCashier .s6-cashier-topbar .s6-cashier-close:hover:not(:disabled) {
    background: var(--s6-cashier-surface);
    color: var(--s6-cashier-text);
}

#shop6InlineCashier .s6-cashier-title {
    margin: 0;
    color: var(--s6-cashier-text);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

#shop6InlineCashier .s6-cashier-subtitle {
    margin: 4px 0 0;
    color: var(--s6-cashier-muted);
    font-size: 12px;
}

#shop6InlineCashier .s6-cashier-steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 24px;
    margin: 0;
    padding: 0 24px 17px;
    list-style: none;
}

#shop6InlineCashier .s6-cashier-step {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--s6-cashier-muted);
    font-size: 12px;
}

#shop6InlineCashier .s6-cashier-step.is-active {
    color: var(--s6-cashier-blue);
    font-weight: 600;
}

#shop6InlineCashier .s6-cashier-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin: 0 24px 18px;
    padding: 12px 14px;
    border: 1px solid var(--s6-cashier-border);
    border-radius: 12px;
    background: var(--s6-cashier-subtle);
}

#shop6InlineCashier .s6-cashier-product {
    flex: 1 1 180px;
    min-width: 0;
    font-weight: 500;
    overflow-wrap: anywhere;
}

#shop6InlineCashier .s6-cashier-product-label {
    margin-right: 4px;
    color: var(--s6-cashier-muted);
    font-weight: 400;
}

#shop6InlineCashier .s6-cashier-quantity {
    flex: 0 0 auto;
    color: var(--s6-cashier-muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

#shop6InlineCashier .s6-cashier-network {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 15px 24px;
    border-top: 1px solid var(--s6-cashier-border);
    border-bottom: 1px solid var(--s6-cashier-border);
    background: var(--s6-cashier-subtle);
}

#shop6InlineCashier .s6-cashier-network-icon {
    display: inline-flex;
    position: relative;
    flex: 0 0 42px;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: contain;
    background: transparent;
    color: var(--s6-cashier-muted);
    font-size: 23px;
}

#shop6InlineCashier .s6-cashier-network-icon [data-s6-token-icon] {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 50%;
    object-fit: contain;
}

#shop6InlineCashier .s6-cashier-network-icon [data-s6-token-fallback] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border: 1px solid var(--s6-cashier-border);
    border-radius: 50%;
    background: var(--s6-cashier-subtle);
    color: var(--s6-cashier-muted);
    font-size: 22px;
    line-height: 1;
}

#shop6InlineCashier .s6-cashier-network-icon [data-s6-network-icon] {
    display: block;
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 18px;
    height: 18px;
    border: 2px solid var(--s6-cashier-surface);
    border-radius: 50%;
    background: var(--s6-cashier-surface);
    object-fit: contain;
}

#shop6InlineCashier .s6-cashier-network-title {
    margin: 0;
    color: var(--s6-cashier-text);
    font-size: 15px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

#shop6InlineCashier .s6-cashier-network-subtitle {
    margin: 2px 0 0;
    color: var(--s6-cashier-muted);
    font-size: 12px;
}

#shop6InlineCashier .s6-cashier-status {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    padding: 5px 10px;
    border-radius: 20px;
    background: var(--s6-cashier-warning-soft);
    color: var(--s6-cashier-warning);
    font-size: 12px;
    white-space: nowrap;
}

#shop6InlineCashier .s6-cashier-status.is-success {
    background: var(--s6-cashier-success-soft);
    color: var(--s6-cashier-success);
}

#shop6InlineCashier .s6-cashier-status.is-processing {
    background: var(--s6-cashier-blue-soft);
    color: var(--s6-cashier-blue);
}

#shop6InlineCashier .s6-cashier-status.is-waiting::before,
#shop6InlineCashier .s6-cashier-status.is-processing::before {
    content: "";
    display: inline-block;
    flex: 0 0 12px;
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: s6-cashier-status-spin .9s linear infinite;
}

#shop6InlineCashier .s6-cashier-status.is-success::before,
#shop6InlineCashier .s6-cashier-status.is-expired::before,
#shop6InlineCashier .s6-cashier-status.is-error::before {
    content: none;
    animation: none;
}

@keyframes s6-cashier-status-spin {
    to { transform: rotate(360deg); }
}

#shop6InlineCashier .s6-cashier-status.is-expired,
#shop6InlineCashier .s6-cashier-status.is-error {
    background: var(--s6-cashier-red-soft);
    color: var(--s6-cashier-red);
}

#shop6InlineCashier .s6-cashier-body {
    padding: 22px 24px 20px;
}

#shop6InlineCashier .s6-cashier-grid {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    align-items: center;
    gap: 22px;
}

#shop6InlineCashier .s6-cashier-qr {
    width: 100%;
    min-width: 0;
    text-align: center;
}

/* Keep a white quiet zone even in dark mode so wallet scanners can read it. */
#shop6InlineCashier .s6-cashier-qr-image {
    display: block;
    width: 190px;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    padding: 14px;
    border: 1px solid #e3e9f3;
    border-radius: 15px;
    background: #ffffff;
    image-rendering: pixelated;
    object-fit: contain;
}

#shop6InlineCashier .s6-cashier-qr-image img,
#shop6InlineCashier .s6-cashier-qr-image canvas,
#shop6InlineCashier .s6-cashier-qr-image svg {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

#shop6InlineCashier .s6-cashier-qr-caption {
    margin: 9px 0 0;
    color: var(--s6-cashier-muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

#shop6InlineCashier .s6-cashier-fields {
    display: grid;
    gap: 14px;
}

#shop6InlineCashier .s6-cashier-field {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--s6-cashier-border);
    border-radius: 12px;
    background: var(--s6-cashier-subtle);
}

#shop6InlineCashier .s6-cashier-field-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    min-width: 0;
}

#shop6InlineCashier .s6-cashier-field-label {
    display: block;
    margin: 0 0 7px;
    color: var(--s6-cashier-muted);
    font-size: 12px;
}

#shop6InlineCashier .s6-cashier-amount {
    border-color: var(--s6-cashier-red-border);
    background: var(--s6-cashier-red-soft);
    box-shadow: inset 3px 0 0 var(--s6-cashier-red);
}

/* Put .amount-unit inside .amount-number; its copy button is the next sibling. */
#shop6InlineCashier .s6-cashier-amount-number {
    flex: 1 1 126px;
    min-width: 0;
    margin: 0;
    color: var(--s6-cashier-red);
    font-size: 25px;
    font-weight: 600;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

#shop6InlineCashier .s6-cashier-amount-unit {
    display: inline;
    color: inherit;
    font-size: 17px;
    font-weight: 600;
    white-space: nowrap;
}

#shop6InlineCashier .s6-cashier-copy-button {
    display: inline-flex;
    flex: 0 0 var(--s6-cashier-control-width);
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: var(--s6-cashier-control-width);
    min-height: 36px;
    margin: 0 0 0 auto;
    padding: 7px 8px;
    border: 1px solid var(--s6-cashier-border);
    border-radius: 8px;
    background: var(--s6-cashier-surface);
    color: var(--s6-cashier-blue);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
}

#shop6InlineCashier .s6-cashier-copy-button:hover:not(:disabled) {
    border-color: var(--s6-cashier-blue);
    background: var(--s6-cashier-blue-soft);
}

#shop6InlineCashier .s6-cashier-amount .s6-cashier-copy-button {
    border-color: var(--s6-cashier-red-border);
    color: var(--s6-cashier-red);
}

#shop6InlineCashier .s6-cashier-address-field {
    min-width: 0;
}

/* Prefer the address's natural width: wrap the copy button before scrolling it. */
#shop6InlineCashier .s6-cashier-address {
    display: block;
    flex: 1 1 max-content;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 5px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--s6-cashier-text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.6;
    direction: ltr;
    text-align: left;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    overflow-x: auto;
    overflow-y: hidden;
    text-overflow: clip;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

#shop6InlineCashier .s6-cashier-meta {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 12px;
    min-width: 0;
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid var(--s6-cashier-border);
    border-radius: 12px;
    background: var(--s6-cashier-subtle);
}

#shop6InlineCashier .s6-cashier-order {
    flex: 1 1 0;
    min-width: 0;
    color: var(--s6-cashier-text);
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

#shop6InlineCashier .s6-cashier-meta [data-s6-order] {
    display: block;
    max-width: 100%;
    color: var(--s6-cashier-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    overflow-x: auto;
    overflow-y: hidden;
    text-overflow: clip;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

#shop6InlineCashier .s6-cashier-meta [data-s6-timer-wrap] {
    flex: 0 0 auto;
    min-width: 56px;
    text-align: right;
}

#shop6InlineCashier .s6-cashier-countdown {
    display: block;
    flex: 0 0 auto;
    color: var(--s6-cashier-text);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

#shop6InlineCashier .s6-cashier-meta .s6-cashier-field-label,
#shop6InlineCashier .s6-cashier-countdown .s6-cashier-field-label {
    margin-bottom: 3px;
    color: var(--s6-cashier-muted);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
}

#shop6InlineCashier .s6-cashier-notice {
    margin: 17px 0 0;
    padding: 10px 12px;
    border-radius: 9px;
    background: var(--s6-cashier-warning-soft);
    color: var(--s6-cashier-warning);
    font-size: 12px;
    overflow-wrap: anywhere;
}

#shop6InlineCashier .s6-cashier-notice.is-error {
    background: var(--s6-cashier-red-soft);
    color: var(--s6-cashier-red);
}

#shop6InlineCashier .s6-cashier-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 14px;
    padding: 14px 24px;
    border-top: 1px solid var(--s6-cashier-border);
    border-radius: 0 0 20px 20px;
    background: var(--s6-cashier-subtle);
    color: var(--s6-cashier-muted);
    font-size: 12px;
}

#shop6InlineCashier .s6-cashier-footer-note,
#shop6InlineCashier .s6-cashier-footer > .note {
    flex: 1 1 160px;
    min-width: 0;
    margin: 0;
    color: var(--s6-cashier-muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

#shop6InlineCashier .s6-cashier-footer-actions {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    max-width: 100%;
    margin-left: auto;
}

#shop6InlineCashier .s6-cashier-action,
.s6-cashier-resume-bar .s6-cashier-resume-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    margin: 0;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: var(--s6-cashier-blue);
    color: var(--s6-cashier-on-blue);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

#shop6InlineCashier .s6-cashier-action:hover:not(:disabled),
.s6-cashier-resume-bar .s6-cashier-resume-button:hover:not(:disabled) {
    background: var(--s6-cashier-blue-hover);
    color: var(--s6-cashier-on-blue);
    text-decoration: none;
}

#shop6InlineCashier .s6-cashier-action.is-secondary {
    border-color: var(--s6-cashier-border);
    background: var(--s6-cashier-surface);
    color: var(--s6-cashier-blue);
}

#shop6InlineCashier .s6-cashier-action.is-secondary:hover:not(:disabled) {
    border-color: var(--s6-cashier-blue);
    background: var(--s6-cashier-blue-soft);
}

/* Quiet, grouped footer actions match the surrounding purchase dialog. */
#shop6InlineCashier .s6-cashier-footer-actions .s6-cashier-action {
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--s6-cashier-border);
    border-radius: 8px;
    background: var(--s6-cashier-surface);
    color: var(--s6-cashier-blue);
    box-shadow: none;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

#shop6InlineCashier .s6-cashier-footer-actions .s6-cashier-action.primary {
    border-color: var(--s6-cashier-blue-soft-border);
    background: var(--s6-cashier-blue-soft);
    color: var(--s6-cashier-blue);
}

#shop6InlineCashier .s6-cashier-footer-actions .s6-cashier-action:hover:not(:disabled) {
    border-color: var(--s6-cashier-blue-soft-border);
    background: var(--s6-cashier-blue-soft);
    color: var(--s6-cashier-blue-hover);
}

#shop6InlineCashier .s6-cashier-footer-actions .s6-cashier-action.secondary,
#shop6InlineCashier .s6-cashier-footer-actions .s6-cashier-action.is-secondary {
    border-color: transparent;
    background: transparent;
    color: var(--s6-cashier-muted);
}

#shop6InlineCashier .s6-cashier-footer-actions .s6-cashier-action.secondary:hover:not(:disabled),
#shop6InlineCashier .s6-cashier-footer-actions .s6-cashier-action.is-secondary:hover:not(:disabled) {
    border-color: transparent;
    background: var(--s6-cashier-blue-soft);
    color: var(--s6-cashier-blue);
}

#shop6InlineCashier .s6-cashier-loading,
#shop6InlineCashier .s6-cashier-result {
    padding: 30px 12px;
    color: var(--s6-cashier-muted);
    text-align: center;
}

#shop6InlineCashier .s6-cashier-result-title {
    margin: 0 0 9px;
    color: var(--s6-cashier-text);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
}

#shop6InlineCashier .s6-cashier-result.is-success .s6-cashier-result-title {
    color: var(--s6-cashier-success);
}

#shop6InlineCashier .s6-cashier-result.is-error .s6-cashier-result-title,
#shop6InlineCashier .s6-cashier-result.is-expired .s6-cashier-result-title {
    color: var(--s6-cashier-red);
}

#shop6InlineCashier .s6-cashier-result-text {
    max-width: 380px;
    margin: 0 auto 18px;
    color: var(--s6-cashier-muted);
    font-size: 13px;
    overflow-wrap: anywhere;
}

/* The resume bar may be mounted outside the modal; it has its own theme tokens. */
.s6-cashier-resume-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 18px;
    width: 100%;
    min-width: 0;
    margin: 12px 0;
    padding: 14px 16px;
    border: 1px solid var(--s6-cashier-border);
    border-radius: 12px;
    background: var(--s6-cashier-surface);
    overflow-wrap: anywhere;
}

.s6-cashier-resume-bar .s6-cashier-resume-button {
    flex: 0 0 auto;
    margin-left: auto;
}

/* Respond to the actual dialog width, including narrow desktop modal layouts. */
@container s6-cashier (max-width: 559px) {
    #shop6InlineCashier .s6-cashier-topbar {
        padding: 18px 16px 13px;
    }
    #shop6InlineCashier .s6-cashier-steps {
        padding-left: 16px;
        padding-right: 16px;
    }
    #shop6InlineCashier .s6-cashier-summary {
        margin-left: 16px;
        margin-right: 16px;
    }
    #shop6InlineCashier .s6-cashier-network,
    #shop6InlineCashier .s6-cashier-footer {
        padding: 14px 16px;
    }
    #shop6InlineCashier .s6-cashier-body {
        padding: 18px 16px;
    }
    #shop6InlineCashier .s6-cashier-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }
    #shop6InlineCashier .s6-cashier-qr-image {
        width: 176px;
    }
    #shop6InlineCashier .s6-cashier-footer-note,
    #shop6InlineCashier .s6-cashier-footer > .note {
        flex-basis: 100%;
    }
    #shop6InlineCashier .s6-cashier-footer-actions {
        width: 100%;
    }
}

/* Browsers without container queries retain the same phone layout. */
@supports not (container-type: inline-size) {
    @media (max-width: 559px) {
        #shop6InlineCashier .s6-cashier-topbar {
            padding: 18px 16px 13px;
        }
        #shop6InlineCashier .s6-cashier-steps {
            padding-left: 16px;
            padding-right: 16px;
        }
        #shop6InlineCashier .s6-cashier-summary {
            margin-left: 16px;
            margin-right: 16px;
        }
        #shop6InlineCashier .s6-cashier-network,
        #shop6InlineCashier .s6-cashier-footer {
            padding: 14px 16px;
        }
        #shop6InlineCashier .s6-cashier-body {
            padding: 18px 16px;
        }
        #shop6InlineCashier .s6-cashier-grid {
            grid-template-columns: minmax(0, 1fr);
            gap: 18px;
        }
        #shop6InlineCashier .s6-cashier-qr-image {
            width: 176px;
        }
        #shop6InlineCashier .s6-cashier-footer-note,
        #shop6InlineCashier .s6-cashier-footer > .note {
            flex-basis: 100%;
        }
        #shop6InlineCashier .s6-cashier-footer-actions {
            width: 100%;
        }
    }
}

@media (pointer: coarse) {
    #shop6InlineCashier .s6-cashier-copy-button,
    #shop6InlineCashier .s6-cashier-action,
    #shop6InlineCashier .s6-cashier-topbar button,
    #shop6InlineCashier .s6-cashier-topbar .s6-cashier-close,
    #shop6InlineCashier .s6-cashier-footer-actions .s6-cashier-action,
    .s6-cashier-resume-bar .s6-cashier-resume-button {
        min-width: 44px;
        min-height: 44px;
    }
    #shop6InlineCashier .s6-cashier-topbar .s6-cashier-close {
        flex-basis: 44px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #shop6InlineCashier .s6-cashier-status.is-waiting::before,
    #shop6InlineCashier .s6-cashier-status.is-processing::before {
        animation: none;
    }
}

/* Purchase success: restyle the existing dialog without changing its controls.
 * !important is limited to properties the original modal hardcodes inline or
 * forces with .modal-title * { color: #fff !important }.
 */
#modalBoughtSuccess {
    color-scheme: light;
}

body.dark #modalBoughtSuccess,
body.dark-mode #modalBoughtSuccess,
[data-theme="dark"] #modalBoughtSuccess,
#modalBoughtSuccess[data-theme="dark"] {
    color-scheme: dark;
}

#modalBoughtSuccess .modal-content {
    max-height: calc(100vh - 56px);
    max-height: calc(100dvh - 56px);
    border: 1px solid var(--s6-cashier-border) !important;
    border-radius: 18px;
    background: var(--s6-cashier-surface) !important;
    color: var(--s6-cashier-text) !important;
    box-shadow: 0 18px 48px rgba(20, 35, 58, .18);
    overflow-x: hidden;
    overflow-y: auto;
}

#modalBoughtSuccess .modal-header {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--s6-cashier-border);
    background: var(--s6-cashier-surface) !important;
    background-image: none !important;
    color: var(--s6-cashier-text) !important;
}

#modalBoughtSuccess .modal-title,
#modalBoughtSuccess .modal-title * {
    color: var(--s6-cashier-text) !important;
    font-weight: 600;
    text-shadow: none !important;
}

#modalBoughtSuccess .modal-title {
    min-width: 0;
    margin: 0;
    font-size: 19px;
    line-height: 1.4;
    letter-spacing: 0;
}

#modalBoughtSuccess .modal-title > span:first-child {
    flex: 0 0 32px;
    width: 32px !important;
    height: 32px !important;
    background: var(--s6-cashier-success-soft) !important;
    color: var(--s6-cashier-success) !important;
}

#modalBoughtSuccess .modal-title > span:first-child i {
    display: none !important;
}

#modalBoughtSuccess .modal-title > span:first-child::after {
    content: "";
    display: block;
    width: 9px;
    height: 18px;
    border-right: 3px solid var(--s6-cashier-success);
    border-bottom: 3px solid var(--s6-cashier-success);
    transform: translateY(-2px) rotate(45deg);
}

#modalBoughtSuccess .modal-header .close {
    display: inline-flex;
    flex: 0 0 34px;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--s6-cashier-border);
    border-radius: 9px;
    background: var(--s6-cashier-subtle) !important;
    color: var(--s6-cashier-muted) !important;
    font-size: 22px;
    font-weight: 400;
    line-height: 1;
    text-shadow: none;
    opacity: 1 !important;
}

#modalBoughtSuccess .modal-header .close:hover {
    background: var(--s6-cashier-surface) !important;
    color: var(--s6-cashier-text) !important;
}

#modalBoughtSuccess .modal-body {
    flex: 0 0 auto;
    min-width: 0;
    padding: 18px 20px;
    background: var(--s6-cashier-surface) !important;
    color: var(--s6-cashier-text);
}

#modalBoughtSuccess .modal-body > .text-center {
    margin-bottom: 12px !important;
    text-align: left !important;
}

#modalBoughtSuccess #orderDetailLink {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    max-width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--s6-cashier-border) !important;
    border-radius: 8px;
    background: var(--s6-cashier-subtle) !important;
    color: var(--s6-cashier-text) !important;
    font-size: 12px;
    font-weight: 400;
    overflow-wrap: anywhere;
}

#modalBoughtSuccess #orderDetailLink b,
#modalBoughtSuccess #boughtTransId {
    color: var(--s6-cashier-text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

#modalBoughtSuccess textarea#boughtAccounts {
    display: block;
    width: 100%;
    min-height: 140px !important;
    height: clamp(160px, 34vh, 340px);
    max-height: min(60vh, 560px) !important;
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--s6-cashier-border) !important;
    border-radius: 10px;
    background: var(--s6-cashier-subtle) !important;
    color: var(--s6-cashier-text) !important;
    font-size: 12px !important;
    line-height: 1.6 !important;
    resize: vertical !important;
    scrollbar-color: var(--s6-cashier-border) var(--s6-cashier-subtle);
}

#modalBoughtSuccess textarea#boughtAccounts:focus {
    border-color: var(--s6-cashier-focus) !important;
    outline: 2px solid var(--s6-cashier-focus) !important;
    outline-offset: 2px;
    box-shadow: none;
}

#modalBoughtSuccess textarea#boughtAccounts::-webkit-scrollbar-track {
    background: var(--s6-cashier-subtle);
}

#modalBoughtSuccess textarea#boughtAccounts::-webkit-scrollbar-thumb {
    background: var(--s6-cashier-border);
}

#modalBoughtSuccess textarea#boughtAccounts::-webkit-scrollbar-thumb:hover {
    background: var(--s6-cashier-muted);
}

#modalBoughtSuccess .modal-footer {
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end !important;
    gap: 8px;
    padding: 14px 20px;
    border-top: 1px solid var(--s6-cashier-border) !important;
    background: var(--s6-cashier-subtle) !important;
}

#modalBoughtSuccess .modal-footer > * {
    margin: 0;
}

#modalBoughtSuccess .modal-footer > div {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

#modalBoughtSuccess .modal-footer .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 96px;
    min-height: 38px;
    margin: 0;
    padding: 9px 12px;
    border: 1px solid var(--s6-cashier-blue-soft-border) !important;
    border-radius: 9px;
    background: var(--s6-cashier-blue-soft) !important;
    color: var(--s6-cashier-blue) !important;
    box-shadow: none !important;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
    filter: none !important;
}

#modalBoughtSuccess .modal-footer .btn:hover {
    border-color: var(--s6-cashier-blue-soft-border) !important;
    background: var(--s6-cashier-blue-soft) !important;
    color: var(--s6-cashier-blue-hover) !important;
}

#modalBoughtSuccess .btn:focus,
#modalBoughtSuccess .close:focus {
    outline: 2px solid var(--s6-cashier-focus) !important;
    outline-offset: 3px;
    box-shadow: none !important;
}

@media (max-width: 576px) {
    #modalBoughtSuccess .modal-dialog {
        margin: 8px;
    }
    #modalBoughtSuccess .modal-content {
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
        border-radius: 15px;
    }
    #modalBoughtSuccess .modal-header,
    #modalBoughtSuccess .modal-body {
        padding: 16px;
    }
    #modalBoughtSuccess .modal-footer {
        padding: 12px 16px;
    }
    #modalBoughtSuccess textarea#boughtAccounts {
        height: clamp(140px, 30vh, 260px);
        padding: 10px 12px;
    }
}

@media (pointer: coarse) {
    #modalBoughtSuccess .modal-footer .btn,
    #modalBoughtSuccess #orderDetailLink,
    #modalBoughtSuccess .modal-header .close {
        min-height: 44px;
    }
    #modalBoughtSuccess .modal-header .close {
        flex-basis: 44px;
        width: 44px;
    }
}

/* r6: compact title-bar return action and payment-state confirmation. */
#shop6InlineCashier .s6-cashier-top-actions { display:flex; align-items:center; gap:16px; }
#shop6InlineCashier .s6-cashier-reselect { display:inline-flex; align-items:center; gap:5px; padding:7px 0; border:0; background:transparent; color:var(--s6-cashier-blue); font-size:12px; font-weight:500; line-height:1.4; white-space:nowrap; }
#shop6InlineCashier .s6-cashier-reselect:hover { color:var(--s6-cashier-blue-hover); }
#shop6InlineCashier .s6-cashier-return-overlay { position:fixed; inset:0; z-index:1100; display:flex; align-items:center; justify-content:center; padding:20px; background:rgba(20,30,50,.38); }
#shop6InlineCashier .s6-cashier-return-card { width:400px; max-width:100%; max-height:100%; overflow:auto; padding:22px; border:1px solid var(--s6-cashier-border); border-radius:16px; background:var(--s6-cashier-surface); color:var(--s6-cashier-text); box-shadow:0 16px 55px rgba(15,23,42,.2); }
#shop6InlineCashier .s6-cashier-return-card h5 { margin:0 0 12px; font-size:17px; font-weight:600; }
#shop6InlineCashier .s6-cashier-return-card p { margin:0; color:var(--s6-cashier-muted); font-size:13px; line-height:1.8; }
#shop6InlineCashier .s6-cashier-return-card .s6-cashier-return-error { font-size:12px; color:var(--s6-cashier-red); }
#shop6InlineCashier .s6-cashier-return-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; margin-top:18px; }
#shop6InlineCashier .s6-cashier-return-actions button { min-height:32px; padding:6px 11px; border:1px solid var(--s6-cashier-border); border-radius:8px; background:var(--s6-cashier-subtle); color:var(--s6-cashier-muted); font-size:12px; line-height:1.5; font-weight:500; box-shadow:none; }
#shop6InlineCashier .s6-cashier-return-actions button.primary { background:var(--s6-cashier-blue); border-color:var(--s6-cashier-blue); color:#fff; }
#shop6InlineCashier .s6-cashier-return-actions button:hover:not(:disabled) { filter:brightness(.96); }
@media (max-width:480px) { #shop6InlineCashier .s6-cashier-top-actions { gap:10px; } #shop6InlineCashier .s6-cashier-return-card { padding:18px; } }
@media (pointer:coarse) { #shop6InlineCashier .s6-cashier-return-actions button, #shop6InlineCashier .s6-cashier-reselect { min-height:40px; } }
