:root,
.dark {
    --background: #e9e4f0;
    --foreground: #2e1a47;
    --card: #faf5fb;
    --card-foreground: #2e1a47;
    --primary: #663399;
    --primary-foreground: #ffffff;
    --secondary: rgba(102, 51, 153, 0.1);
    --secondary-foreground: #685774;
    --muted: rgba(102, 51, 153, 0.12);
    --muted-foreground: #685774;
    --accent: #e6c7e6;
    --accent-foreground: #2e1a47;
    --destructive: #a53549;
    --success: #2d7352;
    --warning: #8c5a17;
    --border: rgba(102, 51, 153, 0.18);
    --ring: #663399;
    --font-sans: "IBM Plex Sans", sans-serif;
    --font-arabic: "Alexandria", sans-serif;
    --checkout-ground: #e9e4f0;
    --checkout-panel: #e7d8e9;
    --checkout-ink: #2e1a47;
    --checkout-soft: #685774;
    --checkout-lavender: #e6c7e6;
    --checkout-paper: #faf5fb;
    --checkout-raised: 14px 18px 36px rgba(46, 26, 71, 0.2), -8px -8px 22px rgba(255, 255, 255, 0.74);
    --checkout-raised-sm: 6px 8px 18px rgba(46, 26, 71, 0.2), -3px -3px 10px rgba(255, 255, 255, 0.52);
}

html {
    min-width: 320px;
    background: var(--checkout-ground);
    color-scheme: light;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    background: var(--checkout-ground);
    color: var(--checkout-ink);
    font-family: var(--font-sans);
    font-feature-settings: "ss02", "cv03";
}

html[dir="rtl"] body {
    font-family: var(--font-arabic);
}

.secure-header {
    position: sticky;
    z-index: 50;
    top: 0;
    padding: env(safe-area-inset-top) 0 0;
    border-bottom: 1px solid rgba(102, 51, 153, 0.16);
    background: rgba(233, 228, 240, 0.92);
    opacity: 1;
    backdrop-filter: blur(16px) saturate(1.1);
}

.header-content {
    width: min(1180px, calc(100% - 40px));
    min-height: 64px;
    margin-inline: auto;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
}

.checkout-wordmark {
    justify-self: start;
    color: #663399;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.04em;
}

.secure-badge {
    display: flex;
    align-items: center;
    justify-self: center;
    gap: 9px;
    color: var(--checkout-soft);
}

.secure-icon {
    width: 18px;
    height: 18px;
    background: transparent;
}

.secure-icon svg {
    width: 17px;
    height: 17px;
    stroke: #663399;
}

.secure-text {
    font-size: 0.75rem;
    font-weight: 600;
}

.header-controls {
    justify-self: end;
}

.theme-toggle {
    display: none;
}

.lang-switcher {
    gap: 0;
    padding: 4px;
    border: 1px solid rgba(102, 51, 153, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.26);
}

.lang-btn {
    min-width: 46px;
    min-height: 36px;
    padding-inline: 12px;
    border-radius: 8px;
    color: var(--checkout-soft);
    font-size: 0.82rem;
    font-weight: 600;
}

.lang-btn.active {
    background: var(--checkout-ink);
    color: #fff;
    box-shadow: none;
}

.checkout-container {
    width: min(1180px, calc(100% - 40px));
    max-width: none;
    margin-inline: auto;
    padding: 0;
}

#sessionState {
    padding-block: clamp(48px, 8vw, 96px);
}

#sessionState .glass-panel {
    border: 0;
    background: var(--checkout-panel);
    box-shadow: var(--checkout-raised);
}

#checkoutContainer {
    grid-template-columns: minmax(320px, 0.82fr) minmax(0, 1.55fr);
    /* Keep the narrow summary and wide payment tracks on their intended
     * physical sides. Letting RTL reverse the grid made the order summary
     * consume the wide track and squeezed the actionable checkout column. */
    direction: ltr;
    gap: 0;
    align-items: stretch;
    overflow: hidden;
    margin-top: clamp(24px, 4vw, 48px);
    margin-bottom: clamp(34px, 5vw, 72px);
    border-radius: 16px;
    background: var(--checkout-panel);
    box-shadow: var(--checkout-raised);
}

html[dir="rtl"] #checkoutContainer > * {
    direction: rtl;
}

.left-column {
    min-width: 0;
    padding: clamp(28px, 4vw, 46px);
    display: flex;
    flex-direction: column;
    color: #fff;
    background: var(--checkout-ink);
    box-shadow: inset 2px 2px 3px rgba(255, 255, 255, 0.08), inset -8px -9px 18px rgba(8, 3, 14, 0.32);
}

.right-column {
    min-width: 0;
    padding: clamp(28px, 4.6vw, 54px);
    background: var(--checkout-panel);
}

.glass-panel,
.dark .glass-panel {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.left-column .glass-panel {
    color: #fff;
}

.order-details-panel {
    order: 1;
}

.checkout-amount-panel {
    order: 2;
    margin-top: auto;
}

.checkout-amount-panel .total-section {
    margin-top: 34px;
}

.merchant-header {
    margin: 0 0 30px;
    padding: 0 0 30px;
    display: grid;
    grid-template-columns: 58px 1fr;
    align-items: center;
    gap: 0 16px;
    border-bottom: 1px solid rgba(230, 199, 230, 0.23);
    text-align: start;
}

.merchant-logo {
    grid-row: 1 / 3;
    width: 58px;
    height: 58px;
    margin: 0;
    border-radius: 14px;
    background: var(--checkout-lavender);
    color: var(--checkout-ink);
    box-shadow: 7px 9px 18px rgba(8, 3, 14, 0.42), -2px -2px 7px rgba(255, 255, 255, 0.1), inset 1px 1px 2px rgba(255, 255, 255, 0.72);
}

.merchant-logo svg {
    width: 27px;
    height: 27px;
    stroke: currentColor;
}

.merchant-name {
    align-self: end;
    color: #fff;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.35;
}

.powered-by {
    align-self: start;
    margin: 3px 0 0;
    color: rgba(245, 234, 245, 0.72);
    font-size: 0.72rem;
}

.left-column .section-title {
    margin: 0 0 18px;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.order-row {
    min-height: 0;
    padding-block: 13px;
    border-color: rgba(230, 199, 230, 0.17);
}

.order-label {
    color: rgba(245, 234, 245, 0.67);
    font-size: 0.86rem;
}

.order-value {
    color: #fff;
    font-size: 0.86rem;
    font-weight: 600;
}

.total-section {
    margin-top: 28px;
    padding-top: 28px;
    border-color: rgba(230, 199, 230, 0.23);
}

.total-label {
    color: rgba(245, 234, 245, 0.68);
    font-size: 1rem;
}

.amount-number {
    color: var(--checkout-lavender);
    font-size: clamp(2.35rem, 4vw, 3.7rem);
    font-weight: 600;
    letter-spacing: -0.04em;
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
}

.amount-currency {
    color: rgba(245, 234, 245, 0.72);
}

.checkout-timer {
    position: relative;
    margin-top: 32px;
    transform: translateY(8px);
    border-color: rgba(230, 199, 230, 0.2);
    background: rgba(8, 3, 14, 0.22);
    color: #fff;
}

.checkout-timer::before {
    content: "";
    position: absolute;
    inset-inline: 0;
    top: -25px;
    height: 1px;
    background: rgba(230, 199, 230, 0.2);
}

.checkout-timer-label {
    color: rgba(245, 234, 245, 0.72);
    font-size: 0.82rem;
}

.checkout-timer:not(.expired) .checkout-timer-label svg {
    stroke: var(--checkout-lavender);
}

.checkout-timer-value {
    color: var(--checkout-lavender);
}

.instructions-panel {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid rgba(230, 199, 230, 0.23);
}

.instructions-title,
.instructions-panel .instructions-title {
    color: #fff;
}

.instructions-panel .instructions-list li {
    position: relative;
    margin: 0;
    padding-bottom: 22px;
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    color: rgba(245, 234, 245, 0.76);
}

.instructions-panel .instructions-list li:last-child {
    padding-bottom: 0;
}

.instructions-panel .instructions-list li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 31px;
    bottom: 1px;
    left: 14px;
    width: 1px;
    background: rgba(230, 199, 230, 0.24);
}

[dir="rtl"] .instructions-panel .instructions-list li:not(:last-child)::after {
    right: 14px;
    left: auto;
}

.instructions-panel .step-number {
    position: relative;
    z-index: 1;
    width: 30px;
    min-width: 30px;
    height: 30px;
    background: var(--checkout-lavender);
    color: var(--checkout-ink);
    font-size: 0.72rem;
    box-shadow: 0 0 0 5px var(--checkout-ink);
}

.payment-route {
    margin: 0 0 30px;
    padding-top: 2px;
}

.payment-route ol {
    position: relative;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    list-style: none;
}

.payment-route ol::before {
    content: "";
    position: absolute;
    z-index: 0;
    top: 15px;
    right: 12.5%;
    left: 12.5%;
    height: 6px;
    border-radius: 6px;
    background: rgba(102, 51, 153, 0.16);
    box-shadow: inset 2px 3px 5px rgba(46, 26, 71, 0.17), inset -1px -1px 4px rgba(255, 255, 255, 0.58);
}

.payment-route li {
    position: relative;
    z-index: 1;
    min-width: 0;
    display: grid;
    justify-items: center;
    align-content: start;
    gap: 8px;
    color: var(--checkout-soft);
    text-align: center;
}

.payment-route .route-marker {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border: 5px solid var(--checkout-panel);
    border-radius: 50%;
    background: #a3779d;
    color: #fff;
    box-shadow: 4px 5px 10px rgba(46, 26, 71, 0.2);
    font-size: 0.66rem;
    font-weight: 700;
}

.payment-route .route-primary .route-marker {
    background: #663399;
}

.payment-route .route-label {
    min-width: 0;
    display: block;
    color: var(--checkout-soft);
    font-size: 0.76rem;
    font-weight: 650;
    line-height: 1.35;
}

.payment-route .route-pay-label {
    max-width: 15ch;
    overflow-wrap: anywhere;
    color: #663399;
    font-size: 0.78rem;
    font-weight: 700;
}

.instruction-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.instruction-copy strong {
    color: #fff;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
}

.instruction-copy > span {
    color: rgba(245, 234, 245, 0.68);
    font-size: 0.76rem;
    line-height: 1.6;
}

.instruction-copy .step-amount {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 6px;
    background: rgba(230, 199, 230, 0.16);
    color: var(--checkout-lavender);
    font-weight: 700;
    white-space: nowrap;
}

.popup-body .instruction-copy strong {
    color: var(--checkout-ink);
}

.popup-body .instruction-copy > span {
    color: var(--checkout-soft);
}

.popup-overlay {
    padding: 20px;
    background: rgba(20, 13, 29, 0.78);
    backdrop-filter: none;
}

.popup-content {
    max-width: 520px;
    max-height: min(680px, calc(100svh - 40px));
    color: var(--checkout-ink);
    border: 0;
    border-radius: 16px;
    background: var(--checkout-paper);
    box-shadow: 0 24px 60px rgba(8, 3, 14, 0.42);
}

.popup-content:focus {
    outline: none;
}

.popup-header {
    padding: 26px 28px 0;
}

.popup-header-title {
    gap: 12px;
    color: var(--checkout-ink);
    font-family: "Petrona", Georgia, serif;
    font-size: clamp(1.65rem, 5vw, 2.25rem);
    font-weight: 500;
    letter-spacing: -0.03em;
    line-height: 1;
}

html[dir="rtl"] .popup-header-title {
    font-family: var(--font-arabic);
    font-weight: 600;
    letter-spacing: 0;
}

.popup-header-title svg {
    width: 28px;
    height: 28px;
    stroke: #663399;
}

.popup-body {
    padding: 18px 28px 24px;
}

.popup-intro {
    max-width: 60ch;
    margin: 0 0 28px;
    color: var(--checkout-soft);
    font-size: 0.9rem;
    line-height: 1.6;
}

.popup-body .instructions-list {
    display: grid;
    gap: 0;
    border-top: 1px solid rgba(102, 51, 153, 0.16);
}

.popup-body .instructions-list li {
    margin: 0;
    padding: 18px 0;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: start;
    gap: 13px;
    border-bottom: 1px solid rgba(102, 51, 153, 0.16);
}

.popup-body .step-number {
    width: 32px;
    min-width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    color: #fff;
    border-radius: 10px;
    background: #663399;
    font-size: 0.75rem;
    font-weight: 700;
}

.popup-body .instruction-copy strong {
    font-size: 0.9rem;
}

.popup-body .instruction-copy > span {
    font-size: 0.82rem;
    line-height: 1.55;
}

.popup-body .instruction-copy .step-amount {
    color: #421d64;
    background: #ead5ee;
    box-shadow: inset 0 0 0 1px rgba(102, 51, 153, 0.18);
}

.popup-footer {
    padding: 0 28px 28px;
}

.popup-agree-btn {
    min-height: 52px;
    padding: 14px 20px;
    border-radius: 12px;
    background: var(--primary);
    color: #fff;
    box-shadow: none;
}

.popup-agree-btn:hover {
    background: #2e1a47;
    box-shadow: none;
    transform: translateY(-1px);
}

.payment-method {
    margin-bottom: 18px;
    padding: 15px 17px;
    border: 1px solid rgba(102, 51, 153, 0.22);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
}

.payment-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #663399;
    color: #fff;
    box-shadow: var(--checkout-raised-sm);
}

.payment-icon svg {
    stroke: currentColor;
}

.payment-info h4 {
    color: var(--checkout-ink);
}

.payment-info p,
.hint {
    color: var(--checkout-soft);
}

.tab-toggle {
    margin-bottom: 18px;
    padding: 5px;
    border-radius: 14px;
    background: rgba(102, 51, 153, 0.1);
    box-shadow: inset 3px 4px 8px rgba(46, 26, 71, 0.14), inset -2px -2px 6px rgba(255, 255, 255, 0.55);
}

.tab-indicator {
    background: var(--checkout-paper);
    box-shadow: 4px 5px 12px rgba(46, 26, 71, 0.14), -2px -2px 7px rgba(255, 255, 255, 0.66);
}

.tab-btn {
    min-height: 46px;
    color: var(--checkout-soft);
    font-size: 0.82rem;
    font-weight: 600;
}

.tab-btn.active {
    color: #663399;
}

.payment-link-section,
.qr-section {
    margin-bottom: 30px;
    padding: 24px;
    border: 0;
    border-radius: 14px;
    background: var(--checkout-ink);
    color: #fff;
    box-shadow: inset 6px 7px 13px rgba(15, 7, 25, 0.5), inset -4px -4px 9px rgba(255, 255, 255, 0.06);
}

.payment-link-section h4,
.qr-section h4 {
    color: #fff;
}

.payment-link-section h4 {
    margin-bottom: 12px;
}

.payment-link-section .hint,
.qr-section .hint {
    color: rgba(245, 234, 245, 0.7);
}

.link-display {
    border-color: rgba(230, 199, 230, 0.12);
    background: rgba(8, 3, 14, 0.23);
    box-shadow: inset 4px 5px 10px rgba(8, 3, 14, 0.48), inset -2px -2px 6px rgba(255, 255, 255, 0.05);
}

.link-text {
    color: var(--checkout-lavender);
}

.copy-btn {
    color: var(--checkout-lavender);
}

.open-link-btn {
    min-height: 50px;
    border-radius: 12px;
    background: var(--checkout-lavender);
    color: var(--checkout-ink);
    box-shadow: 6px 8px 16px rgba(8, 3, 14, 0.34), -2px -2px 7px rgba(255, 255, 255, 0.1);
}

.qr-container {
    width: min(280px, 100%);
    aspect-ratio: 1;
    margin: 18px auto 0;
    padding: 14px;
    border: 0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 7px 9px 18px rgba(8, 3, 14, 0.34);
}

.qr-container img,
.qr-container canvas {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    image-rendering: pixelated;
}

.qr-placeholder {
    color: #a3779d;
}

.proof-grace-notice {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(140, 90, 23, 0.32);
    border-inline-start: 1px solid rgba(140, 90, 23, 0.32);
    background: color-mix(in srgb, var(--checkout-lavender) 72%, #fff4dc);
    color: var(--checkout-ink);
    box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.48);
}

.proof-grace-icon {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    flex: none;
    border-radius: 10px;
    background: rgba(168, 111, 29, 0.14);
    color: #8c5a17;
}

.proof-grace-icon svg {
    width: 19px;
    height: 19px;
}

.proof-grace-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.proof-grace-notice strong {
    color: var(--checkout-ink);
    font-size: 0.88rem;
}

.proof-grace-notice span:not(.proof-grace-icon) {
    color: var(--checkout-soft);
    font-size: 0.8rem;
}

.right-column .section-title {
    color: var(--checkout-ink);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.upload-zone {
    min-height: 170px;
    padding: 26px;
    border: 1px dashed rgba(102, 51, 153, 0.45);
    border-radius: 12px 12px 8px 8px;
    background: color-mix(in srgb, var(--checkout-lavender) 58%, white);
    color: var(--checkout-ink);
    box-shadow: 8px 10px 20px rgba(46, 26, 71, 0.18), -4px -4px 12px rgba(255, 255, 255, 0.7), inset 1px 1px 2px rgba(255, 255, 255, 0.6);
}

.upload-zone:hover,
.upload-zone.dragging {
    border-color: #663399;
    background: color-mix(in srgb, var(--checkout-lavender) 72%, white);
    transform: translateY(-2px);
}

.upload-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #663399;
    color: #fff;
    box-shadow: var(--checkout-raised-sm);
}

.upload-icon svg {
    stroke: currentColor;
}

.upload-text {
    color: var(--checkout-ink);
}

.upload-hint {
    color: var(--checkout-soft);
}

.receipt-preview {
    overflow: hidden;
    border: 1px solid rgba(102, 51, 153, 0.2);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.28);
    box-shadow: var(--checkout-raised-sm);
}

.receipt-preview-header {
    min-height: 64px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid rgba(102, 51, 153, 0.16);
    background: color-mix(in srgb, var(--checkout-lavender) 42%, white);
}

.receipt-preview-status {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.receipt-preview-status > span:last-child {
    min-width: 0;
    display: grid;
    gap: 2px;
}

.receipt-preview-status strong {
    color: var(--checkout-ink);
    font-size: 0.8rem;
}

.receipt-preview-status #fileName {
    overflow: hidden;
    color: var(--checkout-soft);
    font-size: 0.72rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.receipt-preview-check {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    flex: none;
    border-radius: 10px;
    background: #2d7352;
    color: #fff;
}

.receipt-preview-check svg {
    width: 17px;
    height: 17px;
}

.receipt-preview .remove-btn,
[dir="rtl"] .receipt-preview .remove-btn {
    position: static;
    width: 36px;
    height: 36px;
    flex: none;
    border: 1px solid rgba(102, 51, 153, 0.18);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.46);
    color: var(--checkout-soft);
}

.receipt-preview .remove-btn:hover {
    background: #fff;
    color: #a53549;
}

.receipt-preview .remove-btn svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
}

.receipt-preview .preview-image {
    width: 100%;
    height: auto;
    max-height: 360px;
    display: block;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.42);
}

.replace-receipt {
    min-height: 44px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid rgba(102, 51, 153, 0.14);
    color: #663399;
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 700;
    transition: background-color 0.18s, color 0.18s;
}

.replace-receipt:hover {
    background: rgba(255, 255, 255, 0.52);
    color: var(--checkout-ink);
}

.btn-verify {
    min-height: 50px;
    margin-top: 22px;
    border-radius: 12px;
    background: #663399;
    color: #fff;
    box-shadow: var(--checkout-raised-sm);
}

.btn-verify:hover:not(:disabled) {
    background: var(--checkout-ink);
}

.btn-verify:disabled {
    background: rgba(102, 51, 153, 0.33);
    box-shadow: none;
}

.result-card {
    border-color: rgba(102, 51, 153, 0.18);
    background: rgba(255, 255, 255, 0.28);
}

.result-card.processing {
    border-color: rgba(102, 51, 153, 0.34);
    background: rgba(102, 51, 153, 0.08);
}

.result-icon {
    background: #663399;
}

.result-icon.processing {
    background: rgba(102, 51, 153, 0.14);
}

.result-icon.processing svg {
    stroke: #663399;
}

.result-title {
    color: var(--checkout-ink);
}

.result-message {
    color: var(--checkout-soft);
}

.progress-container {
    background: rgba(102, 51, 153, 0.12);
}

.progress-bar {
    background: #663399;
}

.progress-bar.shimmer {
    background: linear-gradient(90deg, #663399, #b786c8, #663399);
    background-size: 200% 100%;
}

button:focus-visible,
input:focus-visible,
label[for="screenshot"]:focus-within {
    outline: 3px solid color-mix(in srgb, #663399 60%, white);
    outline-offset: 4px;
}

@media (max-width: 900px) {
    .checkout-store-panel {
        display: block;
        order: 1;
        margin-bottom: 0;
        padding: 20px 24px;
    }

    .checkout-store-panel .merchant-header {
        margin: 0;
        padding: 0;
        border-bottom: 0;
    }

    #checkoutContainer {
        grid-template-columns: 1fr;
        gap: 12px;
        overflow: visible;
        background: transparent;
        box-shadow: none;
    }

    .left-column {
        display: contents;
    }

    .right-column {
        padding: 30px 24px;
    }

    .checkout-amount-panel,
    .dark .checkout-amount-panel,
    .order-details-panel,
    .dark .order-details-panel {
        padding: 30px 24px;
        color: #fff;
        border-radius: 16px;
        background: var(--checkout-ink);
        box-shadow: 0 16px 34px rgba(46, 26, 71, 0.18);
    }

    .checkout-amount-panel {
        order: 2;
        margin: 0;
    }

    .right-column {
        order: 3;
        border-radius: 16px;
        box-shadow: 0 16px 34px rgba(46, 26, 71, 0.16);
    }

    .order-details-panel {
        order: 4;
    }

    .checkout-amount-panel .total-section {
        margin: 0;
        padding: 0;
        border: 0;
    }

    .payment-route {
        display: block;
        margin-bottom: 18px;
    }

    .payment-method {
        display: none;
    }
}

.checkout-store-panel {
    display: none;
}

.checkout-store-panel .merchant-name {
    color: var(--checkout-ink);
}

.checkout-store-panel .powered-by {
    color: var(--checkout-soft);
}

@media (max-width: 900px) {
    .checkout-store-panel { display: block; }
    .desktop-merchant-header { display: none; }
}

@media (max-width: 620px) {
    .secure-header {
        background: var(--checkout-ground);
        backdrop-filter: none;
    }

    .header-content,
    .checkout-container {
        width: min(calc(100% - 28px), 1180px);
    }

    .header-content {
        min-height: 58px;
        grid-template-columns: auto 1fr auto;
        gap: 8px;
    }

    .checkout-wordmark {
        font-size: 1rem;
    }

    .secure-badge {
        gap: 5px;
    }

    .secure-icon,
    .secure-icon svg {
        width: 15px;
        height: 15px;
    }

    .secure-text {
        font-size: 0.65rem;
    }

    .lang-btn {
        min-width: 42px;
        min-height: 36px;
        padding-inline: 9px;
    }

    #checkoutContainer {
        margin-bottom: max(46px, env(safe-area-inset-bottom));
    }

    .left-column,
    .right-column {
        padding: 26px 20px;
    }

    .checkout-amount-panel,
    .dark .checkout-amount-panel,
    .order-details-panel,
    .dark .order-details-panel {
        padding: 24px 20px;
    }

    .checkout-amount-panel .total-row {
        align-items: end;
    }

    .checkout-amount-panel .amount-number {
        font-size: clamp(2.8rem, 15vw, 4.25rem);
    }

    .checkout-amount-panel .checkout-timer {
        margin-top: 28px;
        transform: none;
    }

    .checkout-amount-panel .checkout-timer::before {
        top: -15px;
    }

    .merchant-header {
        grid-template-columns: 50px 1fr;
    }

    .merchant-logo {
        width: 50px;
        height: 50px;
    }

    .payment-link-section,
    .qr-section,
    .upload-zone {
        padding: 20px;
    }

    .tab-toggle {
        margin-top: 0;
    }

    .popup-overlay {
        align-items: flex-end;
        padding: 12px;
    }

    .popup-content {
        max-height: calc(100svh - 24px);
        border-radius: 16px;
    }

    .popup-header {
        padding: 22px 20px 0;
    }

    .popup-body {
        padding: 16px 20px 20px;
    }

    .popup-footer {
        padding: 0 20px max(20px, env(safe-area-inset-bottom));
    }

    .payment-route {
        margin-bottom: 24px;
    }

    .payment-route .route-marker {
        width: 30px;
        height: 30px;
    }

    .payment-route ol::before {
        top: 14px;
    }

    .payment-route .route-label {
        font-size: 0.69rem;
    }

    .payment-route .route-pay-label {
        max-width: 12ch;
        font-size: 0.66rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
