* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: calc(100% - 32px);
    max-width: 1280px;
    margin: 20px auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: visible;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.header p {
    font-size: 16px;
    opacity: 0.9;
}

.active-environment-panel {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    max-width: min(360px, calc(100vw - 24px));
    pointer-events: auto;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.25);
}

.active-environment-indicator {
    position: static;
    display: block;
    max-width: none;
    padding: 8px 12px;
    border: none;
    border-radius: 0;
    color: #ffffff;
    box-shadow: none;
    backdrop-filter: blur(10px);
    pointer-events: none;
}

.active-environment-indicator-main {
    display: grid;
    gap: 2px;
    min-width: 0;
}

#demo-country-wrap {
    margin-top: 0.25rem;
}

.shared-buyer-billing-section {
    margin: 0 0 14px;
    border: 1px solid #dbe3ee;
    border-radius: 9px;
    background: #ffffff;
    overflow: hidden;
}

.shared-buyer-billing-section[hidden],
#submit-button[hidden] {
    display: none !important;
}

.shared-buyer-billing-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    background: #f8fafc;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.shared-buyer-billing-summary::-webkit-details-marker {
    display: none;
}

.shared-buyer-billing-summary::after {
    content: '展开';
    flex: 0 0 auto;
    color: #2563eb;
    font-size: 11px;
    font-weight: 700;
}

.shared-buyer-billing-section[open] > .shared-buyer-billing-summary::after {
    content: '收起';
}

.shared-buyer-billing-summary-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.shared-buyer-billing-summary-copy strong {
    color: #334155;
    font-size: 14px;
    line-height: 1.3;
}

.shared-buyer-billing-summary-copy small {
    color: #64748b;
    font-size: 11px;
    line-height: 1.35;
}

.shared-buyer-billing-summary-badge {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.shared-buyer-billing-summary-badge.is-optional {
    background: #f1f5f9;
    color: #475569;
}

.shared-buyer-billing-body {
    padding: 13px 14px 4px;
    border-top: 1px solid #e2e8f0;
}

.demo-optional-address-panel {
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    background: #f8fbff;
}

.demo-optional-address-panel-header {
    margin-bottom: 0;
}

.demo-optional-address-panel-header + .demo-optional-address-panel-body {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #dbeafe;
}

.demo-billing-address-toggle-wrap {
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
}

.demo-billing-address-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.demo-billing-address-toggle-label input {
    width: 18px;
    height: 18px;
}

.active-environment-panel:not(.has-test-cards) .active-environment-indicator {
    border-radius: 10px;
}

.environment-test-card-section[hidden] {
    display: none !important;
}

.environment-test-card-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 10px;
    background: #f8fafc;
    border-top: 1px solid rgba(255, 255, 255, 0.35);
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
}

.environment-test-card-toolbar-label {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.35;
    color: #1e40af;
}

.environment-test-card-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding: 4px 10px;
    border: 1px solid #93c5fd;
    border-radius: 999px;
    background: #ffffff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
    cursor: pointer;
}

.environment-test-card-toggle:hover {
    background: #dbeafe;
}

.environment-test-card-toggle-icon {
    font-size: 10px;
    line-height: 1;
}

.environment-test-card-panel {
    background: rgba(255, 255, 255, 0.98);
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 10px 12px;
    max-height: min(180px, calc(100vh - 120px));
    overflow-y: auto;
}

.environment-test-card-preset-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.environment-test-card-preset-item {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.environment-test-card-preset-item.is-selected {
    border-color: #3b82f6;
    background: #eff6ff;
}

.environment-test-card-preset-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.environment-test-card-preset-label {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.35;
    color: #1e3a8a;
}

.environment-test-card-preset-use-btn {
    flex-shrink: 0;
    padding: 2px 8px;
    border: 1px solid #93c5fd;
    border-radius: 999px;
    background: #ffffff;
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.environment-test-card-preset-use-btn:hover {
    background: #dbeafe;
}

.environment-test-card-preset-item .test-card-info,
.environment-test-card-preset-item .test-cvv-info {
    margin-top: 4px;
    font-size: 11px;
}

.environment-test-card-preset-item .test-card-copy-value-button {
    font-size: 10px;
    padding: 1px 3px;
}

.environment-test-card-preset-meta,
.environment-test-card-preset-expiry {
    margin-top: 4px;
    font-size: 10px;
    line-height: 1.35;
    color: #64748b;
}

.environment-test-card-preset-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px;
}

.environment-test-card-preset-expiry {
    display: flex;
    align-items: center;
    gap: 3px;
}

.active-environment-indicator.test {
    background: rgba(4, 120, 87, 0.94);
}

.active-environment-indicator.prod {
    background: rgba(220, 38, 38, 0.96);
}

.active-environment-indicator-label {
    font-size: 10px;
    font-weight: 600;
    line-height: 1.2;
    opacity: 0.84;
}

.active-environment-indicator strong {
    font-size: 13px;
    line-height: 1.25;
    letter-spacing: 0.02em;
}

.active-environment-selection-summary {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 2px 8px;
    min-width: 0;
    margin: 5px 0 0;
    padding-top: 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 10px;
    line-height: 1.25;
}

.active-environment-selection-summary dt {
    opacity: 0.82;
}

.active-environment-selection-summary dd {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.active-environment-indicator.unselected strong {
    margin-top: 2px;
    padding: 3px 7px;
    border-radius: 6px;
    background: #dc2626;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(127, 29, 29, 0.32);
}

.hosted-session-control {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    align-items: stretch;
}

.hosted-session-control .btn-secondary {
    min-width: 132px;
    padding: 8px 12px;
    color: #047857;
    background: #ffffff;
    border: 1px solid #a7f3d0;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    white-space: normal;
}

.hosted-session-control .btn-secondary:hover:not(:disabled) {
    color: #065f46;
    background: #ecfdf5;
    border-color: #6ee7b7;
}

.hosted-session-control .btn-secondary:disabled {
    color: #ffffff;
    background: #9ca3af;
    border-color: #9ca3af;
    cursor: not-allowed;
}

.form-container {
    padding: 40px;
}

.config-section {
    min-width: 0;
    background: #f8f9fa;
    padding: 24px;
    margin-bottom: 30px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.config-section h3 {
    margin-bottom: 18px;
    color: #495057;
    font-size: 18px;
    font-weight: 600;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
    letter-spacing: 0.025em;
}

.form-label-with-tip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.field-info-tip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 1.5px solid #9ca3af;
    border-radius: 50%;
    background: #ffffff;
    color: #6b7280;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    cursor: help;
    flex-shrink: 0;
}

.field-info-tip:hover,
.field-info-tip:focus-visible {
    border-color: #3b82f6;
    color: #2563eb;
    outline: none;
}

.form-group input,
.form-group select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.2s ease;
    background-color: #ffffff;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background-color: #ffffff;
}

/* Readonly input field styling */
.form-group input[readonly] {
    background-color: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
}

.form-group input[readonly]:focus {
    border-color: #dee2e6;
    box-shadow: none;
    background-color: #f8f9fa;
}

/* Hide browser stepper on amount field; keep type=number for numeric validation */
#amount {
    -moz-appearance: textfield;
    appearance: textfield;
}

#amount::-webkit-outer-spin-button,
#amount::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.form-group input::placeholder {
    color: #9ca3af;
}

.api-secret-input {
    -webkit-text-security: disc;
}

.upsell-amount-control {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.upsell-amount-control input {
    flex: 1 1 auto;
    min-width: 0;
}

.upsell-amount-control select {
    flex: 0 0 140px;
}

.form-subject-control select {
    flex: 0 0 110px;
}

/* Form hint styling */
.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
}

.hint-line {
    display: block;
    line-height: 1.55;
}

.form-hint .hint-line {
    margin-top: 3px;
}

.form-hint .hint-line:first-child {
    margin-top: 0;
}

.form-group {
    min-width: 0;
}

.wallet-direct-section {
    min-width: 0;
    padding: 0;
    background: #ffffff;
    border: 1px solid #d8e2ed;
    border-radius: 10px;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
    overflow: hidden;
}

.wallet-section-header {
    display: flex;
    gap: 18px;
    align-items: flex-start;
    justify-content: space-between;
    padding: 18px 20px 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e3eaf2;
}

.wallet-section-header > div {
    min-width: 0;
}

.wallet-direct-section h3 {
    margin-bottom: 4px;
    color: #0f172a;
    font-size: 19px;
    letter-spacing: 0;
}

.wallet-flow-note {
    margin: 0;
    color: #475569;
    background: transparent;
    font-size: 13px;
    line-height: 1.4;
}

.wallet-test-chip {
    flex: 0 0 auto;
    padding: 5px 9px;
    color: #075985;
    background: #e0f2fe;
    border: 1px solid #bae6fd;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.wallet-direct-section .form-group {
    margin-bottom: 0;
}

.wallet-direct-section .form-group label {
    margin-bottom: 6px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
}

.wallet-direct-section .form-group input,
.wallet-direct-section .form-group select,
.wallet-direct-section .form-group textarea {
    max-width: 100%;
    min-height: 40px;
    padding: 8px 11px;
    border-width: 1px;
    border-color: #d7dfe8;
    border-radius: 7px;
    color: #111827;
    font-size: 14px;
}

.wallet-direct-section .form-hint {
    max-width: none;
    margin-top: 6px;
    color: #6b7280;
    font-size: 12px;
    font-style: normal;
    line-height: 1.35;
}

.wallet-direct-section .wallet-field-required-missing select {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.wallet-direct-section .wallet-field-required-missing .form-hint {
    color: #b91c1c;
    font-weight: 700;
}

.form-group.field-required-missing label {
    color: #b91c1c;
}

.form-group.field-required-missing select,
.form-group.field-required-missing input,
.form-group.field-required-missing textarea {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.form-group.field-required-missing .form-hint {
    color: #b91c1c;
    font-weight: 700;
}

.wallet-primary-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
    padding: 18px 20px;
    border-bottom: 1px solid #eef2f6;
}

.wallet-primary-row .form-group {
    min-width: 0;
}

.wallet-primary-row .form-hint,
.payermax-checkout-section .form-hint {
    display: block;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.wallet-integration-field {
    min-width: 0;
}

#wallet-sunpay-embedded-group {
    grid-column: 1 / -1;
}

#wallet-checkout-display-group {
    grid-column: span 1;
}

.wallet-advanced-settings {
    padding: 0 20px;
    border-bottom: 1px solid #eef2f6;
}

.wallet-advanced-settings summary {
    display: grid;
    grid-template-columns: minmax(160px, max-content) minmax(0, 1fr) max-content;
    gap: 10px;
    align-items: center;
    padding: 12px 0;
    color: #334155;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.wallet-advanced-settings summary::-webkit-details-marker {
    display: none;
}

.wallet-advanced-settings summary span {
    font-size: 13px;
    font-weight: 700;
}

.wallet-advanced-settings summary small {
    color: #64748b;
    font-size: 12px;
}

.wallet-advanced-settings summary::after {
    content: "展开";
    padding: 3px 8px;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #d7dfe8;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.wallet-advanced-settings[open] summary::after {
    content: "收起";
}

.wallet-advanced-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    padding-bottom: 16px;
}

.control-notes {
    min-width: 0;
    overflow: hidden;
    margin-top: 7px;
    color: #475569;
    background: #f8fafc;
    border: 1px solid #d9e2ec;
    border-radius: 8px;
    font-style: normal;
}

.control-notes > summary {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    min-height: 32px;
    padding: 6px 9px;
    color: #334155;
    cursor: pointer;
    list-style: none;
    font-size: 11.5px;
    font-weight: 750;
    line-height: 1.35;
    user-select: none;
}

.control-notes > summary::-webkit-details-marker {
    display: none;
}

.control-notes > summary::after {
    content: "Details / 详情";
    flex: 0 0 auto;
    padding: 2px 7px;
    color: #1d4ed8;
    background: #ffffff;
    border: 1px solid #bfd2f1;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    white-space: nowrap;
}

.control-notes[open] > summary {
    color: #1e3a5f;
    background: #f1f6fb;
    border-bottom: 1px solid #d9e2ec;
}

.control-notes[open] > summary::after {
    content: "Hide / 收起";
}

.control-notes-body {
    padding: 8px 10px 9px;
}

.control-notes-body p {
    margin: 5px 0 0;
    color: #526175;
    font-size: 11px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.control-notes-body p:first-child {
    margin-top: 0;
}

.control-notes-body p[lang="zh-CN"] {
    color: #64748b;
}

.control-notes-body .control-notes-callout {
    margin-top: 9px;
    padding-top: 8px;
    color: #854d0e;
    border-top: 1px solid #f1d78c;
}

.control-notes-section {
    margin: 8px 20px 16px;
}

.shared-buyer-billing-body > .control-notes-section {
    margin: 0 0 12px;
}

.wallet-action-guidance {
    min-width: 0;
}

.wallet-action-guidance > .wallet-action-hint {
    display: block;
    margin: 0 0 7px;
}

.wallet-run-panel {
    display: grid;
    grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
    gap: 16px;
    align-items: start;
    padding: 18px 20px 20px;
}

.wallet-payment-id-field {
    min-width: 0;
}

.wallet-payment-id-field input[readonly] {
    color: #475569;
    background: #f8fafc;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    border-radius: 6px;
}

.wallet-action-stack {
    min-width: 0;
}

.wallet-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    justify-content: start;
    margin: 0;
}

.payermax-checkout-section .wallet-primary-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.payermax-checkout-section > .form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 0 20px 18px;
    margin: 0;
    border-bottom: 1px solid #eef2f6;
}

.payermax-checkout-section .wallet-run-panel {
    display: block;
}

.payermax-checkout-section .wallet-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: start;
}

.omnipay-hosted-checkout-section .wallet-primary-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.omnipay-hosted-checkout-section > .form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 0 20px 18px;
    margin: 0;
    border-bottom: 1px solid #eef2f6;
}

.omnipay-hosted-checkout-section .wallet-run-panel {
    display: block;
}

.omnipay-hosted-checkout-section .wallet-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: start;
}

.wallet-actions .submit-button,
.wallet-actions .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 9px 12px;
    border-radius: 7px;
    font-size: 13px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: normal;
    box-shadow: none;
}

.wallet-actions .submit-button {
    background: #059669;
}

#wallet-create-payment-btn {
    color: #047857;
    background: #ffffff;
    border: 1px solid #a7f3d0;
}

.wallet-actions .submit-button:hover:not(:disabled) {
    background: #047857;
    box-shadow: 0 5px 14px rgba(5, 150, 105, 0.22);
    transform: translateY(-1px);
}

#wallet-create-payment-btn:hover:not(:disabled) {
    color: #065f46;
    background: #ecfdf5;
    border-color: #6ee7b7;
}

.wallet-actions .btn-secondary {
    color: #334155;
    background: #ffffff;
    border: 1px solid #cfd8e3;
}

.wallet-actions .btn-secondary:hover:not(:disabled) {
    color: #111827;
    background: #eef2f7;
}

.wallet-actions .btn-secondary:disabled,
.wallet-actions .submit-button:disabled,
.wallet-actions .btn-secondary[aria-disabled="true"],
.wallet-actions .submit-button[aria-disabled="true"] {
    color: #ffffff;
    background: #9ca3af;
    border-color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.78;
    transform: none;
}

.wallet-actions a.submit-button,
.wallet-actions a.btn-secondary {
    text-decoration: none;
}

.wallet-actions .wallet-tooltip::after {
    left: 0;
    width: 100%;
    max-width: 100%;
    transform: translate(0, 4px);
}

.wallet-actions .wallet-tooltip:hover::after,
.wallet-actions .wallet-tooltip:focus-visible::after {
    transform: translate(0, 0);
}

.wallet-action-hint {
    margin-top: 7px;
    margin-bottom: 0;
    color: #6b7280;
    font-size: 12px;
    font-style: normal;
    line-height: 1.45;
}

.wallet-token-first-section {
    margin-top: 16px;
    border-color: #d6e3f3;
}

.wallet-token-first-section > summary.wallet-section-header {
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.wallet-token-first-section > summary.wallet-section-header::-webkit-details-marker {
    display: none;
}

.wallet-token-first-section > summary.wallet-section-header::after {
    content: "展开";
    flex: 0 0 auto;
    align-self: center;
    padding: 5px 9px;
    color: #0f172a;
    background: #ffffff;
    border: 1px solid #d7dfe8;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.wallet-token-first-section[open] > summary.wallet-section-header::after {
    content: "收起";
}

.wallet-token-first-chip {
    color: #1d4ed8;
    background: #dbeafe;
    border-color: #bfdbfe;
}

.wallet-token-first-panel {
    padding: 0;
}

.wallet-token-first-panel .wallet-inline-header {
    margin: 0 -20px;
    border-top: 0;
}

.wallet-token-first-panel .wallet-inline-header span {
    color: #64748b;
    font-size: 12px;
}

.wallet-pay-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(240px, 1fr));
    gap: 16px;
    margin: 20px 0 16px;
}

.wallet-pay-method {
    min-height: 58px;
}

.wallet-google-pay-standard {
    width: 100%;
    height: 58px;
}

.wallet-google-pay-standard:empty {
    display: none;
}

.wallet-google-pay-standard > *,
.wallet-pay-fallback,
.wallet-apple-pay-standard {
    width: 100%;
    height: 58px;
    min-height: 58px;
    border-radius: 7px;
}

.wallet-google-pay-standard.wallet-pay-button-disabled,
.wallet-pay-fallback:disabled,
.wallet-apple-pay-standard:disabled {
    cursor: not-allowed;
    opacity: 0.62;
    pointer-events: none;
}

.wallet-pay-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 18px;
    border: 1px solid #111827;
    border-radius: 7px;
    color: #ffffff;
    background: #111827;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.wallet-pay-fallback:hover:not(:disabled) {
    background: #0f172a;
    border-color: #0f172a;
    transform: translateY(-1px);
}

.wallet-google-pay-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.wallet-google-pay-logo {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    display: block;
}

.wallet-google-pay-word {
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1;
}

.wallet-apple-pay-standard {
    -webkit-appearance: -apple-pay-button;
    -apple-pay-button-type: plain;
    -apple-pay-button-style: black;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: #000000;
    border: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    cursor: pointer;
    overflow: hidden;
}

.wallet-apple-pay-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    gap: 7px;
    color: #ffffff;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1;
}

.wallet-apple-logo {
    display: inline-block;
    color: #ffffff;
    font-size: 29px;
    font-weight: 500;
    line-height: 1;
    transform: translateY(-1px);
}

.wallet-apple-pay-word {
    color: #ffffff;
    font-size: 24px;
    font-weight: 600;
    line-height: 1;
}

@supports (-webkit-appearance: -apple-pay-button) {
    .wallet-apple-pay-fallback {
        visibility: hidden;
    }
}

@supports not (-webkit-appearance: -apple-pay-button) {
    .wallet-apple-pay-standard {
        -webkit-appearance: none;
        appearance: none;
    }
}

.wallet-token-debug {
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #eef2f6;
}

.wallet-token-debug > summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: space-between;
    color: #334155;
    cursor: pointer;
    font-weight: 700;
}

.wallet-token-debug > summary small {
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
}

.wallet-token-first-note {
    margin: 14px 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.45;
}

.wallet-token-first-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(210px, 1fr));
    gap: 14px;
    align-items: start;
}

.wallet-token-first-fields .form-group:last-child {
    grid-column: 1 / -1;
}

.wallet-token-first-fields textarea {
    width: 100%;
    min-height: 112px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    line-height: 1.45;
}

.wallet-token-first-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 14px;
}

.wallet-token-first-actions .btn-secondary,
.wallet-token-first-actions .submit-button {
    width: auto;
    min-width: 170px;
    min-height: 38px;
    padding: 8px 12px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
}

.wallet-token-first-actions .btn-secondary {
    color: #334155;
    background: #ffffff;
    border: 1px solid #cfd8e3;
}

.wallet-token-first-actions .submit-button {
    color: #ffffff;
    background: #059669;
    border: 1px solid #059669;
}

.wallet-token-first-actions .btn-secondary:hover:not(:disabled) {
    color: #111827;
    background: #eef2f7;
}

.wallet-token-first-actions .submit-button:hover:not(:disabled) {
    background: #047857;
    border-color: #047857;
}

.wallet-token-first-actions .submit-button:disabled {
    color: #ffffff;
    background: #9ca3af;
    border-color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.78;
}

.wallet-tooltip {
    position: relative;
}

.wallet-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    z-index: 50;
    width: max-content;
    max-width: min(460px, 82vw);
    padding: 8px 10px;
    color: #ffffff;
    background: #111827;
    border-radius: 6px;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
    opacity: 0;
    overflow-wrap: anywhere;
    pointer-events: none;
    text-align: left;
    transform: translate(-50%, 4px);
    transition:
        opacity 120ms ease,
        transform 120ms ease,
        visibility 0s linear 120ms;
    visibility: hidden;
    white-space: normal;
}

.wallet-tooltip::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    z-index: 51;
    width: 10px;
    height: 10px;
    background: #111827;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 4px) rotate(45deg);
    transition:
        opacity 120ms ease,
        transform 120ms ease,
        visibility 0s linear 120ms;
    visibility: hidden;
}

.wallet-tooltip:hover::after,
.wallet-tooltip:focus-visible::after,
.wallet-tooltip:hover::before,
.wallet-tooltip:focus-visible::before {
    opacity: 1;
    transform: translate(-50%, 0) rotate(0);
    transition-delay: 120ms, 120ms, 0s;
    visibility: visible;
}

.wallet-tooltip:hover::before,
.wallet-tooltip:focus-visible::before {
    transform: translate(-50%, 0) rotate(45deg);
}

.wallet-inline-header .wallet-tooltip::after {
    top: calc(100% + 10px);
    right: 0;
    bottom: auto;
    left: auto;
    transform: translate(0, -4px);
}

.wallet-inline-header .wallet-tooltip::before {
    top: calc(100% + 4px);
    right: 18px;
    bottom: auto;
    left: auto;
    transform: translate(0, -4px) rotate(45deg);
}

.wallet-inline-header .wallet-tooltip:hover::after,
.wallet-inline-header .wallet-tooltip:focus-visible::after {
    transform: translate(0, 0);
}

.wallet-inline-header .wallet-tooltip:hover::before,
.wallet-inline-header .wallet-tooltip:focus-visible::before {
    transform: translate(0, 0) rotate(45deg);
}

.wallet-auto-status {
    padding: 12px 14px;
    margin: 10px 0 14px;
    color: #1f2937;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.45;
}

.wallet-auto-status.polling {
    color: #075985;
    background: #e0f2fe;
    border-color: #7dd3fc;
}

.wallet-auto-status.success {
    color: #065f46;
    background: #d1fae5;
    border-color: #6ee7b7;
}

.wallet-auto-status.failed {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fca5a5;
}

@media (max-width: 1200px) {
    .wallet-primary-row {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .wallet-advanced-grid,
    .wallet-run-panel,
    .wallet-pay-buttons,
    .wallet-token-first-fields {
        grid-template-columns: 1fr;
    }

    .wallet-actions {
        grid-template-columns: repeat(3, minmax(140px, 1fr));
    }
}

.wallet-inline-checkout {
    margin: 14px 0;
    overflow-x: hidden;
    overflow-y: hidden;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.wallet-inline-header {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    color: #111827;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

.wallet-inline-header a {
    color: #2563eb;
    font-size: 14px;
    text-decoration: none;
}

.wallet-inline-header a:hover {
    text-decoration: underline;
}

.wallet-inline-status {
    padding: 10px 14px;
    color: #4b5563;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
}

.wallet-inline-status.wallet-inline-status-success {
    color: #065f46;
    background: #ecfdf5;
    border-bottom-color: #a7f3d0;
}

.wallet-inline-status.wallet-inline-status-failed {
    color: #991b1b;
    background: #fef2f2;
    border-bottom-color: #fecaca;
}

.wallet-inline-checkout iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: min(82vh, 860px);
    min-height: 720px;
    border: 0;
    background: #ffffff;
}

.wallet-dropin-panel {
    margin: 14px 0;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.wallet-dropin-panel .wallet-inline-header span {
    color: #64748b;
    font-size: 12px;
}

.wallet-dropin-result-card {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wallet-dropin-result-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    color: #ffffff;
    background: #059669;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.wallet-inline-status-failed .wallet-dropin-result-mark {
    background: #dc2626;
}

.wallet-dropin-result-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.wallet-dropin-result-title {
    color: #064e3b;
    font-size: 14px;
    font-weight: 800;
}

.wallet-inline-status-failed .wallet-dropin-result-title {
    color: #7f1d1d;
}

.wallet-dropin-result-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #047857;
    font-size: 12px;
    font-weight: 700;
}

.wallet-inline-status-failed .wallet-dropin-result-meta {
    color: #b91c1c;
}

.wallet-dropin-result-badge {
    padding: 3px 8px;
    color: #065f46;
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.wallet-inline-status-failed .wallet-dropin-result-badge {
    color: #991b1b;
    background: #fee2e2;
    border-color: #fca5a5;
}

.wallet-dropin-mount {
    min-height: 180px;
    padding: 16px;
    background: #ffffff;
}

.wallet-dropin-actions {
    display: flex;
    justify-content: flex-end;
    padding: 12px 14px 14px;
    border-top: 1px solid #e5e7eb;
}

.wallet-dropin-actions .btn-secondary {
    width: auto;
    min-width: 160px;
    min-height: 38px;
    padding: 8px 12px;
    color: #334155;
    background: #ffffff;
    border: 1px solid #cfd8e3;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 700;
}

.wallet-dropin-actions .btn-secondary:disabled {
    color: #ffffff;
    background: #9ca3af;
    border-color: #9ca3af;
    cursor: not-allowed;
    opacity: 0.78;
}

.wallet-result {
    width: 100%;
    max-height: 360px;
    overflow: auto;
    padding: 16px;
    margin-top: 14px;
    color: #111827;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (min-width: 769px) and (max-width: 900px) {
    body.wallet-flow .wallet-direct-section,
    body.payermax-checkout-flow .payermax-checkout-section,
    body.conflux-cash-flow .conflux-cash-section,
    body.omnipay-checkout-flow .omnipay-hosted-checkout-section {
        padding: 4px;
    }
}

@media (max-width: 1080px) {
    .wallet-run-panel {
        grid-template-columns: 1fr;
    }

    .wallet-actions {
        grid-template-columns: repeat(5, minmax(112px, 1fr));
    }

    .payermax-checkout-section .wallet-actions {
        grid-template-columns: repeat(4, minmax(120px, 1fr));
    }

    .conflux-cash-section .wallet-actions {
        grid-template-columns: repeat(5, minmax(112px, 1fr));
    }

    .omnipay-hosted-checkout-section .wallet-actions {
        grid-template-columns: repeat(4, minmax(120px, 1fr));
    }
}

.conflux-cash-qr-panel .conflux-cash-qr-image-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 16px;
    background: #fff;
}

.conflux-cash-qr-panel #conflux-cash-qr-image {
    display: block;
    width: 240px;
    height: 240px;
    object-fit: contain;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

@media (max-width: 940px) {
    .wallet-primary-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #wallet-checkout-display-group {
        grid-column: span 1;
    }
}

.wallet-return-banner {
    padding: 12px 14px;
    margin-top: 14px;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
}

.wallet-result-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: #0f172a;
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.14), transparent 34%),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.wallet-result-panel {
    width: min(760px, 100%);
    padding: 34px;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.13);
}

.wallet-result-eyebrow {
    margin-bottom: 16px;
    color: #64748b;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.wallet-result-heading {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.wallet-result-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: #047857;
    background: #d1fae5;
    border: 1px solid #a7f3d0;
    border-radius: 50%;
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
}

.wallet-result-page.wallet-result-cancel .wallet-result-icon {
    color: #b45309;
    background: #fef3c7;
    border-color: #fde68a;
}

.wallet-result-panel h1 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 30px;
    line-height: 1.2;
}

.wallet-result-panel p {
    margin-bottom: 14px;
    color: #4b5563;
    font-size: 15px;
    line-height: 1.6;
}

.wallet-result-note {
    padding: 12px 14px;
    margin: 22px 0 0;
    color: #334155;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.wallet-result-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 22px 0;
}

.wallet-result-meta div {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    color: #374151;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    word-break: break-word;
}

.wallet-result-meta strong {
    color: #64748b;
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.wallet-result-meta span {
    color: #0f172a;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 13px;
}

.wallet-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.wallet-result-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    text-decoration: none;
}

@media (max-width: 640px) {
    .wallet-result-panel {
        padding: 24px;
    }

    .wallet-result-heading {
        flex-direction: column;
    }

    .wallet-result-meta {
        grid-template-columns: 1fr;
    }
}

/* Payment Information Section */
.card-fields {
    position: relative;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 0.98) 100%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.12), transparent 34%);
    padding: 28px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    margin-bottom: 30px;
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.09);
    overflow: hidden;
}

.card-fields::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, #2563eb 0%, #7c3aed 48%, #f97316 100%);
}

.payment-section-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.card-fields h3 {
    margin: 0;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.card-fields h3::before {
    content: "💳";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    font-size: 18px;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.payment-section-header p {
    margin-top: 8px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

.iframe-security-status {
    display: inline-flex;
    align-items: center;
    margin: 10px 0 0;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.iframe-security-status[data-state="enabled"] {
    background: #dcfce7;
    color: #166534;
}

.iframe-security-status[data-state="disabled"] {
    background: #fef3c7;
    color: #92400e;
}

.iframe-security-status[data-state="blocked"] {
    background: #fee2e2;
    color: #991b1b;
}

/* Card Brand Icons */
.card-icons {
    display: flex;
    gap: 12px;
    flex: 0 0 auto;
    margin: 0;
    padding: 4px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.card-icon {
    width: 72px;
    height: 46px;
    border-radius: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

.visa {
    background: linear-gradient(135deg, #1a1f71 0%, #0f4c8c 100%);
}

.mastercard {
    background: linear-gradient(135deg, #eb001b 0%, #ff5f00 100%);
}

.card-fields .form-group {
    margin-bottom: 20px;
}

.card-fields .form-group label {
    margin-bottom: 8px;
    color: #334155;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.card-fields .form-group select {
    min-height: 52px;
    height: auto;
    line-height: 1.35;
    padding: 12px 40px 12px 16px;
    font-size: 18px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    color: #111827;
    box-shadow: none;
    box-sizing: border-box;
    -webkit-appearance: menulist;
    appearance: menulist;
}

.card-fields .form-group select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12), 0 12px 24px rgba(15, 23, 42, 0.08);
}

/* Card Number Field */
.spreedly-field {
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    padding: 0;
    background: #ffffff;
    margin-bottom: 10px;
    min-height: 54px;
    height: 54px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    cursor: text;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.035);
    display: flex;
    align-items: center;
}

.spreedly-field iframe {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    padding: 0 !important;
    font-family: inherit !important;
    display: block;
    background: transparent !important;
}

.spreedly-field:focus,
.spreedly-field:focus-within {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12), 0 8px 16px rgba(15, 23, 42, 0.06);
    outline: none;
}

/* Expiry and CVV Row */
.expiry-cvv-row {
    display: flex;
    gap: 20px;
    align-items: end;
}

.card-fields>.form-row {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(300px, 1.1fr);
    gap: 24px;
    align-items: start !important;
    margin-bottom: 0;
}

.expiry-select-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(140px, 1fr));
    gap: 14px;
}

.expiry-select-row select {
    width: 100%;
    min-height: 52px;
    height: auto;
    line-height: 1.35;
    padding: 12px 40px 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 18px;
    background-color: #ffffff;
    color: #111827;
    cursor: pointer;
    box-sizing: border-box;
}

.expiry-select-row select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.expiry-group {
    flex: 2;
}

.cvv-group {
    flex: 1;
}

.expiry-group label {
    margin-bottom: 8px;
}

.expiry-group>div {
    display: flex;
    gap: 10px;
}

.expiry-group select {
    flex: 1;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    font-size: 16px;
    background-color: #ffffff;
    cursor: pointer;
}

.expiry-group select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Test parameter presets (3DS route / dedicated projects) */
.test-params-preset-wrap {
    margin-bottom: 20px;
    padding: 18px 20px;
    border-radius: 10px;
    border: 1px solid #dbeafe;
    background: linear-gradient(135deg, #f8fbff 0%, #eff6ff 100%);
}

.test-params-preset-wrap select {
    width: 100%;
    min-height: 52px;
    height: auto;
    line-height: 1.35;
    padding: 12px 40px 12px 16px;
    border: 2px solid #bfdbfe;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    background-color: #ffffff;
    color: #1e3a8a;
    cursor: pointer;
    box-sizing: border-box;
}

.test-params-preset-wrap select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.test-params-preset-wrap .form-hint {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.5;
}

.three-ds-test-params-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: #1e40af;
}

.test-params-preset-wrap .form-group {
    margin-bottom: 0;
}

.demo-test-card-guide-section {
    margin: 0 0 20px;
}

.card-fields.card-fields-preset-only {
    margin-top: 0;
}

.card-fields.card-fields-preset-only .test-params-preset-wrap {
    margin-bottom: 0;
}

.external-test-card-reference {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #bfdbfe;
}

.external-test-card-reference-title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: #1e40af;
}

.external-test-card-reference .test-card-info,
.external-test-card-reference .test-cvv-info,
.external-test-card-reference .test-expiry-info {
    margin-top: 8px;
}

.test-expiry-info,
.external-test-card-preset-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
}

.three-ds-test-params-detail {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(37, 99, 235, 0.15);
}

.three-ds-params-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.three-ds-params-table th,
.three-ds-params-table td {
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid #e5e7eb;
}

.three-ds-params-table th {
    width: 38%;
    color: #4b5563;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.65);
}

.three-ds-params-table td {
    color: #111827;
    font-family: 'Consolas', 'Courier New', monospace;
    word-break: break-all;
}

.three-ds-trigger-pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
}

.three-ds-trigger-pill.yes {
    background: #dcfce7;
    color: #166534;
}

.three-ds-trigger-pill.no {
    background: #f3f4f6;
    color: #4b5563;
}

.three-ds-trigger-pill.scenario {
    background: #dbeafe;
    color: #1d4ed8;
}

.three-ds-paste-action {
    display: inline;
    padding: 0;
    border: none;
    background: none;
    color: #1d4ed8;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.three-ds-paste-action:hover {
    color: #1e40af;
}

.three-ds-manual-paste-note {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 12px;
    line-height: 1.45;
}

/* Test Card Info */
.test-card-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    width: fit-content;
    background: #f8fafc;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 999px;
    padding: 8px 12px;
    margin-top: 6px;
    font-size: 13px;
    color: #1d4ed8;
    line-height: 1.35;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.test-cvv-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    background: #f8fafc;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 999px;
    padding: 8px 12px;
    margin-top: 6px;
    font-size: 13px;
    color: #1d4ed8;
    line-height: 1.35;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.test-card-copy-value-button {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
    border: 0;
    border-radius: 4px;
    padding: 1px 3px;
    background: transparent;
    color: inherit;
    font: inherit;
    line-height: inherit;
    cursor: copy;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 2px;
}

.test-card-copy-value-button:hover,
.test-card-copy-value-button:focus-visible {
    background: #dbeafe;
    color: #1d4ed8;
    outline: 2px solid rgba(37, 99, 235, 0.24);
    outline-offset: 1px;
}

.test-card-copy-value-button:disabled {
    color: #64748b;
    cursor: default;
    opacity: 0.55;
    text-decoration: none;
}

.test-card-copy-value-button:disabled:hover,
.test-card-copy-value-button:disabled:focus-visible {
    background: transparent;
    outline: none;
}

.test-card-copy-value-icon {
    flex: 0 0 auto;
    font-size: 0.9em;
    text-decoration: none;
}

.test-card-meta-separator {
    color: #94a3b8;
    user-select: none;
}

/* Billing same as Shipping Checkbox */
.billing-shipping-checkbox {
    background: linear-gradient(135deg, #e8f4f8 0%, #d1e7f0 100%);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #007cba;
    transition: all 0.3s ease;
}

.billing-shipping-checkbox label {
    display: flex;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
    color: #065f46;
    font-size: 16px;
    margin-bottom: 8px;
}

.billing-shipping-checkbox input[type="checkbox"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #007cba;
}

.billing-shipping-checkbox .form-hint {
    margin-top: 5px;
    margin-left: 30px;
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
}

/* Shipping Section */
.shipping-section {
    background: #f8f9fa;
    padding: 24px;
    margin-bottom: 30px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.shipping-section.hidden {
    display: none;
}

.shipping-section h3 {
    margin-bottom: 20px;
    color: #495057;
    font-size: 18px;
    font-weight: 600;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
}

/* Legacy Shipping Note (kept for compatibility) */
.shipping-note {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #10b981;
    font-size: 15px;
    color: #065f46;
    font-weight: 500;
}

/* Security Badges */
.security-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 30px 0;
    flex-wrap: wrap;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px solid #f3f4f6;
}

.security-badge {
    padding: 8px 12px;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    color: #4b5563;
    font-weight: 500;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Submit Button */
.submit-button {
    width: 100%;
    padding: 18px 24px;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: none;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.submit-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #047857 0%, #059669 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.submit-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    pointer-events: none;
    opacity: 0.72;
}

.loading {
    display: none;
    text-align: center;
    padding: 30px;
    color: #3b82f6;
}

.loading.show {
    display: block;
}

.hidden {
    display: none !important;
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #fecaca;
    font-weight: 500;
    white-space: pre-line;
}

.success-message {
    background: #f0fdf4;
    color: #16a34a;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #bbf7d0;
    font-weight: 500;
}

.api-response-log-section {
    margin-top: 16px;
    margin-bottom: 20px;
}

.api-response-log-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
    color: #374151;
}

.api-response-log-clear {
    padding: 6px 12px;
    font-size: 12px;
}

.api-response-log {
    max-height: 760px;
    overflow: auto;
    margin: 0;
    padding: 2px;
    border-radius: 8px;
    color: #334155;
}

.api-log-empty {
    margin: 0;
    padding: 22px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    color: #64748b;
    text-align: center;
}

.api-log-entry {
    margin: 0 0 10px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.api-log-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    padding: 12px 16px;
    background: #f8fafc;
    cursor: pointer;
    list-style: none;
}

.api-log-summary::-webkit-details-marker { display: none; }
.api-log-summary::before { content: '+'; font-weight: 700; }
.api-log-entry[open] > .api-log-summary::before { content: '-'; }
.api-log-summary:focus-visible, .api-log-raw > summary:focus-visible { outline: 2px solid #2563eb; outline-offset: -2px; }
.api-log-time { color: #64748b; font-size: 12px; font-variant-numeric: tabular-nums; }
.api-log-label { flex: 1; overflow-wrap: anywhere; }

.api-log-http {
    padding: 4px 10px;
    border-radius: 6px;
    background: #e0f2fe;
    color: #075985;
    font-size: 12px;
    font-weight: 700;
}

.api-log-http-error { background: #fee2e2; color: #991b1b; }
.api-log-content { padding: 16px; }
.api-log-error { padding: 12px 14px; margin-bottom: 12px; border-left: 3px solid #dc2626; background: #fef2f2; color: #991b1b; border-radius: 6px; overflow-wrap: anywhere; }
.api-log-error p { margin: 5px 0 0; }
.api-log-error-hint { font-size: 12px; }
.api-log-request-id { margin: 0 0 12px; font: 12px/1.6 Consolas, 'Courier New', monospace; overflow-wrap: anywhere; }
.api-log-exchange { display: grid; gap: 14px; }
.api-log-exchange-paired { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.api-log-pane { min-width: 0; border: 1px solid #dbe3ee; border-radius: 8px; overflow: hidden; background: #f8fafc; }
.api-log-pane h4 { margin: 0; padding: 12px 12px 4px; font-size: 14px; color: #1e40af; }
.api-log-response h4 { color: #0f766e; }
.api-log-direction { margin: 0; padding: 0 12px; font-size: 12px; font-weight: 600; }
.api-log-caption { margin: 4px 0 12px; padding: 0 12px; font-size: 12px; color: #64748b; }

.api-log-json {
    max-height: 360px;
    overflow: auto;
    margin: 0;
    padding: 12px;
    background: #111827;
    color: #e5e7eb;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.api-log-raw { margin-top: 14px; font-size: 12px; }
.api-log-raw > summary { padding: 8px 0; color: #475569; cursor: pointer; }
.api-log-raw .api-log-json { border-radius: 6px; }

/* 3DS Container Styles */
.threeds-container {
    margin-top: 30px;
    padding: 24px;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
}

/* Fingerprint container: Must NOT be display:none for scripts to run */
.fingerprint-container {
    position: absolute;
    width: 1px;
    height: 1px;
    top: -10px;
    left: -10px;
    opacity: 0.01;
    overflow: hidden;
}

.threeds-header {
    text-align: center;
    margin-bottom: 24px;
}

.threeds-header h3 {
    color: #1e293b;
    margin-bottom: 8px;
    font-size: 20px;
    font-weight: 600;
}

.threeds-header p {
    color: #64748b;
    margin: 0;
    font-size: 16px;
}

/* Challenge Modal */
.challenge-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.75) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    padding: 20px !important;
    overflow: auto !important;
    z-index: 10000 !important;
}

.challenge-modal.hidden {
    display: none !important;
}

.challenge-content {
    background: white;
    display: flex;
    flex-direction: column;
    padding: clamp(20px, 3vw, 32px);
    border-radius: 12px;
    width: min(1080px, 100%);
    max-width: none;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* PMD-3DS hosted challenge (challengeUrl iframe) — wider panel for bank ACS page */
.challenge-content.challenge-content--hosted {
    width: min(1120px, 100%);
    overflow: auto;
}

.challenge-frame {
    width: 100%;
    height: clamp(440px, 62vh, 640px);
    min-height: 0;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    margin: 20px 0;
    background: #ffffff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}

.challenge-frame.challenge-frame--pending {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    height: min(300px, 42vh);
    min-height: 220px;
    background: #f8fafc;
    border-style: dashed;
    color: #64748b;
    font-size: 18px;
    line-height: 1.5;
    text-align: center;
    padding: 24px;
}

.challenge-frame.challenge-frame--pending::before {
    content: attr(data-pending-message);
    max-width: 520px;
}

.challenge-frame.challenge-frame--pending::after {
    content: "";
    width: 32px;
    height: 32px;
    border: 3px solid #dbeafe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.challenge-iframe {
    display: block !important;
    width: max(100%, 980px) !important;
    min-width: 980px !important;
    height: 100% !important;
    min-height: 520px !important;
    border: none !important;
    border-radius: 8px !important;
}

.challenge-frame.challenge-frame--embedded-lifecycle {
    height: clamp(440px, 62vh, 680px);
    overflow: hidden;
}

.spreedly-lifecycle-host-frame {
    width: 100% !important;
    min-width: 0 !important;
    height: 100% !important;
    min-height: 0 !important;
    background: #f8fafc;
}

.challenge-actions {
    flex: 0 0 auto;
    text-align: center;
    margin-top: 16px;
}

.btn-secondary {
    padding: 12px 24px;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-secondary:hover {
    background: #4b5563;
}

/* 3DS Status */
.threeds-status {
    text-align: center;
    padding: 24px;
}

.status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 16px;
    color: #4b5563;
}

.status-indicator.status-success {
    color: #16a34a;
}

.status-indicator.status-error {
    color: #dc2626;
}

.status-indicator.status-warning {
    color: #d97706;
}

/* Spinner Animation */
.spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f4f6;
    border-top: 3px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Scenario Info */
.scenario-info {
    margin-top: 12px;
    padding: 16px;
    background: #eff6ff;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
}

.scenario-info p {
    margin: 0;
    color: #1e40af;
    font-weight: 500;
}

/* Environment Warning */
.environment-warning {
    margin-top: 20px;
}

.warning-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.warning-box h4 {
    margin: 0 0 12px 0;
    color: #92400e;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.warning-box p {
    margin: 0 0 12px 0;
    color: #92400e;
    font-size: 14px;
    line-height: 1.5;
}

.warning-box ul {
    margin: 0;
    padding-left: 20px;
    color: #92400e;
}

.warning-box li {
    margin: 6px 0;
    font-size: 14px;
    line-height: 1.4;
}

/* Environment Mode Styling */
#environment-mode {
    border: 2px solid #e5e7eb;
    font-weight: 600;
}

#environment-mode:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Production Mode Styling */
.production-mode #scenario-section-title {
    color: #dc2626;
}

.production-mode #test-scenario {
    opacity: 0.7;
    background-color: #fef2f2;
    border-color: #fecaca;
}

.production-mode #scenario-hint {
    color: #dc2626;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .active-environment-panel {
        top: 6px;
        right: 6px;
        max-width: calc(100vw - 12px);
        border-radius: 8px;
    }

    .active-environment-indicator {
        padding: 6px 9px;
    }

    .environment-test-card-toolbar {
        padding: 6px 8px;
    }

    .environment-test-card-toggle {
        font-size: 10px;
        padding: 3px 8px;
    }

    .environment-test-card-panel {
        padding: 8px 10px;
        max-height: min(320px, calc(100vh - 96px));
    }

    .active-environment-indicator-label {
        display: none;
    }

    .active-environment-indicator strong {
        font-size: 11px;
    }

    .container {
        width: calc(100% - 12px);
        margin: 6px auto;
    }

    .form-container {
        padding: 12px;
    }

    body.wallet-flow .wallet-direct-section,
    body.payermax-checkout-flow .payermax-checkout-section,
    body.conflux-cash-flow .conflux-cash-section,
    body.omnipay-checkout-flow .omnipay-hosted-checkout-section {
        border-radius: 8px;
    }

    .wallet-inline-checkout iframe {
        height: 78vh;
        min-height: 640px;
    }

    .wallet-section-header {
        flex-direction: column;
        padding: 16px;
    }

    .wallet-primary-row,
    .wallet-advanced-grid,
    .wallet-run-panel {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 16px;
    }

    .wallet-advanced-settings {
        padding: 0 16px;
    }

    .wallet-advanced-settings summary {
        grid-template-columns: 1fr max-content;
    }

    .wallet-advanced-settings summary small {
        grid-column: 1 / -1;
    }

    .control-notes-section {
        margin-right: 16px;
        margin-left: 16px;
    }

    .shared-buyer-billing-body > .control-notes-section {
        margin-right: 0;
        margin-left: 0;
    }

    .wallet-actions {
        grid-template-columns: 1fr;
    }

    .payermax-checkout-section .wallet-actions,
    .omnipay-hosted-checkout-section .wallet-actions {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .card-fields>.form-row {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .expiry-cvv-row {
        flex-direction: column;
        gap: 0;
    }

    .card-fields {
        padding: 28px 20px 22px;
        border-radius: 18px;
    }

    .payment-section-header {
        flex-direction: column;
        gap: 18px;
        margin-bottom: 24px;
    }

    .card-fields h3 {
        font-size: 21px;
    }

    .card-icons {
        justify-content: center;
        width: 100%;
    }

    .security-badges {
        gap: 8px;
    }

    .challenge-content {
        padding: 24px;
        margin: 10px;
    }

    .header {
        padding: 24px 20px;
    }

    .header h1 {
        font-size: 24px;
    }

    /* Billing Shipping responsive styles */
    .billing-shipping-checkbox {
        padding: 16px;
    }

    .billing-shipping-checkbox label {
        font-size: 14px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .billing-shipping-checkbox input[type="checkbox"] {
        margin-right: 8px;
        margin-bottom: 4px;
    }

    .billing-shipping-checkbox .form-hint {
        margin-left: 0;
        font-size: 12px;
    }

    .shipping-section {
        padding: 16px;
    }

    .shipping-section h3 {
        font-size: 16px;
    }
}

/* ================================
   STEP4: UPSELL Styles
   ================================ */

.upsell-container {
    background: #ffffff;
    padding: 32px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    margin-top: 30px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.upsell-success {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    color: white;
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
    text-align: center;
}

.upsell-success h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
}

.transaction-details {
    background: rgba(255, 255, 255, 0.1);
    padding: 16px;
    border-radius: 6px;
    text-align: left;
}

.transaction-details p {
    margin-bottom: 8px;
    font-size: 14px;
}

.transaction-details p:last-child {
    margin-bottom: 0;
}

.upsell-offer {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 2px solid #d1d5db;
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.upsell-offer:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #3b82f6;
}

.upsell-offer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #f59e0b 0%, #ef4444 50%, #8b5cf6 100%);
}

.upsell-offer-content h4 {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
    text-align: center;
}

.upsell-offer-content p {
    font-size: 16px;
    color: #4b5563;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.5;
}

.upsell-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.upsell-button {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    min-width: 140px;
}

.upsell-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.upsell-button:active {
    transform: translateY(0);
}

.decline-button {
    background: #f3f4f6;
    color: #4b5563;
    border: 2px solid #d1d5db;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 140px;
}

.decline-button:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
    color: #374151;
}

.final-completion {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    padding: 32px;
    border-radius: 12px;
    text-align: center;
}

.final-completion h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 24px;
}

.completion-summary {
    background: rgba(255, 255, 255, 0.1);
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 24px;
}

.completion-summary h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

#transaction-summary {
    text-align: left;
    background: rgba(255, 255, 255, 0.05);
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.completion-actions {
    text-align: center;
}

.new-payment-button {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.new-payment-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
    background: linear-gradient(135deg, #059669 0%, #065f46 100%);
}

/* UPSELL加载状态 */
.upsell-loading {
    text-align: center;
    padding: 20px;
    color: #6b7280;
}

.upsell-loading .spinner {
    display: inline-block;
    margin-right: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .upsell-container {
        padding: 20px;
        margin-top: 20px;
    }

    .upsell-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .upsell-button,
    .decline-button {
        width: 100%;
        padding: 16px 20px;
    }

    .final-completion {
        padding: 24px;
    }

    .completion-summary {
        padding: 16px;
    }
}

/* Environment Status Display */
.environment-display {
    text-align: center;
    padding: 20px;
}

.environment-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.environment-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.environment-badge.test {
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.environment-badge.prod {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

#environment-description {
    margin: 0;
    color: #6b7280;
    font-size: 14px;
    text-align: center;
}

.local-demo-config-status {
    max-width: 760px;
    padding: 10px 12px;
    margin: 0;
    border: 1px solid #bfdbfe;
    border-radius: 7px;
    color: #1e3a8a;
    background: #eff6ff;
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.local-demo-config-status.warning {
    color: #92400e;
    background: #fffbeb;
    border-color: #fcd34d;
}

.local-demo-config-status.success {
    color: #065f46;
    background: #ecfdf5;
    border-color: #6ee7b7;
}

/* Cart Items Styles */
.cart-section {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 0;
    margin-bottom: 25px;
    overflow: hidden;
}

.cart-section-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px;
    cursor: pointer;
    list-style: none;
}

.cart-section-summary::-webkit-details-marker {
    display: none;
}

.cart-section-summary h3 {
    margin: 0;
    color: #495057;
}

.cart-section-summary p {
    margin: 4px 0 0;
    color: #6c757d;
    font-size: 14px;
}

.cart-section-toggle::after {
    content: "展开";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid #d7dee8;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.cart-section[open] .cart-section-toggle::after {
    content: "收起";
}

.cart-section-body {
    padding: 0 20px 20px;
}

.cart-upsell-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 18px 0 16px;
    padding-top: 18px;
    border-top: 1px solid #e5e7eb;
}

.cart-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 16px;
    align-items: start;
    margin-bottom: 16px;
}

.cart-header p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.add-item-button {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
    white-space: nowrap;
}

.add-item-button:hover {
    background: #218838;
}

.cart-items-container {
    margin-bottom: 0;
}

.upsell-amount-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 0.44fr);
    gap: 10px;
    align-items: stretch;
}

.cart-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    position: relative;
}

.cart-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.cart-item-title {
    font-weight: bold;
    color: #495057;
    margin: 0;
}

.remove-item-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.remove-item-btn:hover {
    background: #c82333;
}

.cart-item-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.cart-item-row:last-child {
    margin-bottom: 0;
}

.cart-item-group {
    display: flex;
    flex-direction: column;
}

.cart-item-group label {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.cart-item-group input,
.cart-item-group select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.15s ease-in-out;
}

.cart-item-group input:focus,
.cart-item-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.cart-item-group input[type="number"] {
    text-align: right;
}

/* Full width cart item group for coupon code */
.cart-item-group.full-width {
    grid-column: 1 / -1;
    /* Span all columns */
}

.cart-item-group.full-width input {
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cart-summary {
    border-top: 2px solid #007bff;
    padding-top: 15px;
    text-align: right;
}

.cart-section-body .global-coupons-section {
    background: #ffffff;
    margin: 20px 0 0;
}

.cart-total {
    font-size: 16px;
    color: #495057;
}

.cart-total strong {
    color: #007bff;
}

/* Global Coupons Section */
.global-coupons-section {
    background: #f8f9fa;
    padding: 0;
    margin-bottom: 30px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.global-coupons-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    cursor: pointer;
    list-style: none;
}

.global-coupons-summary-header::-webkit-details-marker {
    display: none;
}

.global-coupons-summary-header h3 {
    margin: 0;
    color: #495057;
}

.global-coupons-summary-header p {
    margin: 6px 0 0;
    color: #6c757d;
    font-size: 14px;
}

.global-coupons-toggle::after {
    content: "展开";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    min-height: 32px;
    padding: 0 12px;
    border: 1px solid #d7dee8;
    border-radius: 999px;
    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.global-coupons-section[open] .global-coupons-toggle::after {
    content: "收起";
}

.global-coupons-body {
    padding: 0 24px 24px;
}

.global-coupons-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.global-coupons-header p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
}

.add-coupon-button {
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: 500;
}

.add-coupon-button:hover {
    background: #218838;
}

.global-coupons-container {
    margin-bottom: 15px;
}

.global-coupon-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.global-coupon-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Courier New', Courier, monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: border-color 0.15s ease-in-out;
}

.global-coupon-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.global-coupon-label {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-right: 10px;
    min-width: 60px;
}

.remove-global-coupon-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 3px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.remove-global-coupon-btn:hover {
    background: #c82333;
}

.global-coupons-summary {
    border-top: 1px solid #dee2e6;
    padding-top: 10px;
    text-align: center;
}

/* Responsive cart items */
@media (max-width: 768px) {
    .cart-item-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .cart-header {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .add-item-button {
        justify-self: flex-start;
    }

    .global-coupons-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .add-coupon-button {
        align-self: flex-end;
    }

    .global-coupon-item {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .global-coupon-label {
        min-width: auto;
    }
}

/* ================================
   NEW: Payment Flow Selector Styles
   ================================ */

.flow-selector-options {
    --flow-card-height: 112px;
    --flow-card-gap: 10px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--flow-card-gap);
    max-width: 100%;
    margin: 10px 0 0;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
    width: 100%;
    min-width: 0;
}

@media (max-width: 1180px) {
    .flow-selector-options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .flow-selector-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

#flow-section .form-group {
    width: 100%;
    min-width: 0;
}

.payment-flow-groups {
    display: grid;
    gap: 12px;
    margin-top: 10px;
}

.payment-flow-group {
    min-width: 0;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
}

.payment-flow-group h4 {
    display: block;
    margin: 0;
    color: #1f2937;
    font-size: 12px;
    font-weight: 800;
}

.payment-flow-group .flow-selector-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flow-option {
    min-width: 0;
    max-width: 100%;
    cursor: pointer;
    display: flex;
    width: 100%;
    height: var(--flow-card-height);
}

.flow-option input[type="radio"] {
    display: none;
}

.flow-card {
    flex: 1;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    height: var(--flow-card-height);
    min-height: var(--flow-card-height);
    max-height: var(--flow-card-height);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px 8px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    text-align: center;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
    box-sizing: border-box;
    overflow: hidden;
    transform: none;
}

.flow-option input[type="radio"]:checked+.flow-card {
    border-color: #667eea;
    background: #f0f4ff;
    box-shadow: none;
    transform: none;
    width: 100% !important;
    max-width: 100% !important;
}

.flow-card strong {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 34px;
    font-size: 11.5px;
    line-height: 1.2;
    margin-bottom: 6px;
    color: #1f2937;
    width: 100%;
    overflow-wrap: anywhere;
}

.flow-card p {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 34px;
    font-size: 10px;
    line-height: 1.28;
    color: #6b7280;
    margin: 0;
    width: 100%;
    overflow: hidden;
}

.flow-title-line,
.flow-copy-line {
    display: block;
    overflow-wrap: anywhere;
    max-width: 100%;
}

.flow-title-line {
    font-weight: 800;
    text-wrap: balance;
}

.flow-copy-line {
    font-weight: 700;
    text-wrap: balance;
}

.flow-title-line {
    white-space: normal;
}

.flow-copy-line {
    white-space: normal;
}

.flow-option input[type="radio"]:checked+.flow-card strong {
    color: #4f46e5;
}

/* Digital Flow Variants */
.digital-purchase-success #flow-section,
.digital-purchase-success #scenario-section,
.digital-purchase-success #payment-form {
    display: none !important;
}

.subscription-offer {
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
    border: 2px solid #6366f1;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    margin-top: 20px;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.1);
}

.subscription-offer h4 {
    color: #4338ca;
    font-size: 22px;
    margin-bottom: 12px;
}

.subscription-offer .price-tag {
    font-size: 32px;
    font-weight: 800;
    color: #1e1b4b;
    margin: 20px 0;
}

.subscription-offer .price-tag small {
    font-size: 16px;
    color: #6366f1;
    font-weight: 500;
}

.subscription-button {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.subscription-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
}

/* PMD-3DS reference table (pill cells, matches doc portal styling) */
.merchant-3ds-card-wrap {
    margin-top: 18px;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.merchant-3ds-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 14px;
}

.merchant-3ds-card-wrap .form-hint {
    margin-top: 12px;
    margin-bottom: 0;
}

.demo-asset-version-badge {
    position: fixed;
    left: 12px;
    bottom: 12px;
    z-index: 9999;
    max-width: min(320px, calc(100vw - 24px));
    border: 1px solid rgba(148, 163, 184, 0.38);
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.82);
    color: #f8fafc;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: 11px;
    line-height: 1.35;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(8px);
}

.demo-asset-version-badge summary {
    cursor: pointer;
    list-style: none;
    padding: 7px 10px;
    font-weight: 700;
    user-select: none;
}

.demo-asset-version-badge summary::-webkit-details-marker {
    display: none;
}

.demo-asset-version-badge summary::before {
    content: "ver";
    display: inline-block;
    margin-right: 6px;
    padding: 1px 5px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    font-size: 10px;
    font-weight: 800;
}

.demo-asset-version-badge dl {
    display: grid;
    gap: 3px;
    margin: 0;
    padding: 0 10px 9px;
}

.demo-asset-version-badge div {
    display: grid;
    grid-template-columns: minmax(132px, 1fr) auto;
    gap: 10px;
    align-items: baseline;
}

.demo-asset-version-badge dt,
.demo-asset-version-badge dd {
    margin: 0;
}

.demo-asset-version-badge dt {
    color: #cbd5e1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.demo-asset-version-badge dd {
    color: #bfdbfe;
    font-weight: 700;
    text-align: right;
}

/* Compact page density: reduce scrolling without shrinking checkout/challenge surfaces. */
body:not(.wallet-result-page) {
    font-size: 14px;
    line-height: 1.42;
}

body:not(.wallet-result-page) .container {
    width: calc(100% - 20px);
    max-width: 1560px;
    margin: 10px auto;
    border-radius: 10px;
}

body:not(.wallet-result-page) .header {
    padding: 16px 20px;
}

body:not(.wallet-result-page) .header h1 {
    margin-bottom: 3px;
    font-size: 22px;
}

body:not(.wallet-result-page) .header p {
    font-size: 13px;
}

body:not(.wallet-result-page) .form-container {
    padding: 18px;
}

body:not(.wallet-result-page) .config-section {
    padding: 14px 16px;
    margin-bottom: 14px;
    border-radius: 7px;
}

body:not(.wallet-result-page) .config-section h3 {
    margin-bottom: 9px;
    font-size: 16px;
}

body:not(.wallet-result-page) .form-row {
    gap: 12px;
    margin-bottom: 8px;
}

body:not(.wallet-result-page) .form-group {
    margin-bottom: 10px;
}

body:not(.wallet-result-page) .form-group label {
    margin-bottom: 4px;
    font-size: 12.5px;
    letter-spacing: 0.01em;
}

body:not(.wallet-result-page) .form-group input,
body:not(.wallet-result-page) .form-group select {
    min-height: 38px;
    padding: 8px 10px;
    border-width: 1px;
    border-radius: 6px;
    font-size: 14px;
}

body:not(.wallet-result-page) .form-hint {
    margin-top: 3px;
    font-size: 11.5px;
}

body:not(.wallet-result-page) .hint-line,
body:not(.wallet-result-page) .wallet-action-hint {
    line-height: 1.3;
}

body:not(.wallet-result-page) .form-hint .hint-line {
    margin-top: 1px;
}

body:not(.wallet-result-page) .environment-display {
    padding: 8px;
}

body:not(.wallet-result-page) .environment-info {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 12px;
}

body:not(.wallet-result-page) .environment-badge {
    padding: 5px 10px;
    font-size: 11px;
}

body:not(.wallet-result-page) #environment-description,
body:not(.wallet-result-page) .local-demo-config-status {
    font-size: 11.5px;
}

body:not(.wallet-result-page) .flow-selector-options {
    --flow-card-height: 80px;
    --flow-card-gap: 8px;
    margin-top: 5px;
}

body:not(.wallet-result-page) .flow-card {
    padding: 6px;
    border-radius: 8px;
}

body:not(.wallet-result-page) .flow-card strong {
    min-height: 27px;
    margin-bottom: 3px;
    font-size: 10.5px;
}

body:not(.wallet-result-page) .flow-card p {
    min-height: 25px;
    font-size: 9.5px;
    line-height: 1.2;
}

body:not(.wallet-result-page) .wallet-section-header {
    gap: 12px;
    padding: 11px 14px 10px;
}

body:not(.wallet-result-page) .wallet-direct-section h3 {
    font-size: 16px;
}

body:not(.wallet-result-page) .wallet-flow-note,
body:not(.wallet-result-page) .wallet-direct-section .form-hint {
    font-size: 11.5px;
}

body:not(.wallet-result-page) .wallet-primary-row {
    gap: 10px;
    padding: 12px 14px;
}

body:not(.wallet-result-page) .wallet-advanced-settings {
    padding: 0 14px;
}

body:not(.wallet-result-page) .wallet-advanced-settings summary {
    padding: 8px 0;
}

body:not(.wallet-result-page) .wallet-advanced-grid {
    gap: 10px;
    padding-bottom: 10px;
}

body:not(.wallet-result-page) .payermax-checkout-section > .form-row,
body:not(.wallet-result-page) .omnipay-hosted-checkout-section > .form-row {
    gap: 10px;
    padding: 0 14px 10px;
}

body:not(.wallet-result-page) .wallet-run-panel {
    gap: 10px;
    padding: 12px 14px;
}

body:not(.wallet-result-page) .wallet-actions .submit-button,
body:not(.wallet-result-page) .wallet-actions .btn-secondary {
    min-height: 36px;
    padding: 7px 9px;
    font-size: 11.5px;
}

body:not(.wallet-result-page) .wallet-action-hint {
    margin-top: 5px;
    font-size: 11px;
}

body:not(.wallet-result-page) .billing-contact-grid,
body:not(.wallet-result-page) #digital-wrap-billing-address {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
}

body:not(.wallet-result-page) #digital-wrap-billing-address > .form-row {
    display: contents;
}

body:not(.wallet-result-page) #payment-form > h3 {
    margin-bottom: 9px !important;
    font-size: 16px;
}

body:not(.wallet-result-page) .cart-section {
    margin-bottom: 14px;
}

body:not(.wallet-result-page) .cart-section-summary,
body:not(.wallet-result-page) .global-coupons-summary-header {
    gap: 10px;
    padding: 11px 14px;
}

body:not(.wallet-result-page) .cart-section-summary p,
body:not(.wallet-result-page) .global-coupons-summary-header p,
body:not(.wallet-result-page) .cart-header p {
    font-size: 11.5px;
}

body:not(.wallet-result-page) .cart-section-toggle::after,
body:not(.wallet-result-page) .global-coupons-toggle::after {
    min-width: 44px;
    min-height: 26px;
    padding: 0 9px;
    font-size: 11px;
}

body:not(.wallet-result-page) .cart-section-body,
body:not(.wallet-result-page) .global-coupons-body {
    padding: 0 14px 12px;
}

body:not(.wallet-result-page) .cart-header {
    gap: 10px;
    margin-bottom: 10px;
}

body:not(.wallet-result-page) .cart-item {
    padding: 10px;
    margin-bottom: 8px;
}

body:not(.wallet-result-page) .cart-item-header,
body:not(.wallet-result-page) .cart-item-row {
    gap: 10px;
    margin-bottom: 8px;
}

body:not(.wallet-result-page) .cart-upsell-row {
    gap: 10px;
    margin: 10px 0;
    padding-top: 10px;
}

body:not(.wallet-result-page) .cart-summary {
    padding-top: 9px;
}

body:not(.wallet-result-page) .cart-section-body .global-coupons-section {
    margin-top: 12px;
}

body:not(.wallet-result-page) .global-coupons-section {
    margin-bottom: 14px;
}

body:not(.wallet-result-page) .card-fields {
    padding: 16px;
    margin-bottom: 14px;
    border-radius: 12px;
}

body:not(.wallet-result-page) .payment-section-header {
    gap: 12px;
    padding-bottom: 10px;
    margin-bottom: 12px;
}

body:not(.wallet-result-page) .card-fields h3 {
    gap: 7px;
    font-size: 17px;
}

body:not(.wallet-result-page) .card-fields h3::before {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    font-size: 14px;
}

body:not(.wallet-result-page) .payment-section-header p {
    margin-top: 4px;
    font-size: 11.5px;
}

body:not(.wallet-result-page) .card-icons {
    gap: 7px;
    border-radius: 12px;
}

body:not(.wallet-result-page) .card-icon {
    width: 54px;
    height: 34px;
    border-radius: 9px;
    font-size: 10px;
}

body:not(.wallet-result-page) .card-fields .form-group {
    margin-bottom: 10px;
}

body:not(.wallet-result-page) .card-fields > .form-row {
    gap: 12px;
}

body:not(.wallet-result-page) .card-fields .form-group select,
body:not(.wallet-result-page) .expiry-select-row select,
body:not(.wallet-result-page) .expiry-group select {
    min-height: 40px;
    padding: 8px 32px 8px 10px;
    border-width: 1px;
    border-radius: 7px;
    font-size: 14px;
}

body:not(.wallet-result-page) .expiry-select-row,
body:not(.wallet-result-page) .expiry-cvv-row {
    gap: 10px;
}

body:not(.wallet-result-page) .test-card-info,
body:not(.wallet-result-page) .test-cvv-info {
    gap: 6px;
    padding: 5px 9px;
    margin-top: 4px;
    font-size: 11px;
}

body:not(.wallet-result-page) .billing-shipping-checkbox,
body:not(.wallet-result-page) .shipping-section {
    padding: 11px 13px;
    margin-bottom: 14px;
}

body:not(.wallet-result-page) .billing-shipping-checkbox label {
    margin-bottom: 4px;
    font-size: 13px;
}

body:not(.wallet-result-page) .billing-shipping-checkbox .form-hint {
    margin-left: 28px;
    font-size: 11px;
}

body:not(.wallet-result-page) .security-badges {
    gap: 7px;
    padding: 9px;
    margin: 12px 0;
}

body:not(.wallet-result-page) .security-badge {
    padding: 5px 8px;
    font-size: 10.5px;
}

body:not(.wallet-result-page) .submit-button {
    padding: 11px 16px;
    border-radius: 8px;
    font-size: 15px;
}

body:not(.wallet-result-page) .api-response-log-section {
    margin: 10px 0 12px;
}

@media (max-width: 768px) {
    body:not(.wallet-result-page) .active-environment-panel {
        position: relative;
        top: auto;
        right: auto;
        width: calc(100% - 8px);
        max-width: none;
        margin: 4px auto 0;
    }

    .shared-buyer-billing-summary {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 7px 10px;
        padding: 10px 11px;
    }

    .shared-buyer-billing-summary-copy {
        flex: 1 1 230px;
    }

    .shared-buyer-billing-summary-badge {
        order: 2;
    }

    .shared-buyer-billing-summary::after {
        order: 3;
        margin-left: auto;
    }

    .shared-buyer-billing-body {
        padding: 11px 10px 2px;
    }

    body:not(.wallet-result-page) .container {
        width: calc(100% - 8px);
        margin: 4px auto;
    }

    body:not(.wallet-result-page) .header {
        padding: 13px 10px;
    }

    body:not(.wallet-result-page) .header h1 {
        font-size: 19px;
    }

    body:not(.wallet-result-page) .form-container {
        padding: 8px;
    }

    body:not(.wallet-result-page) .config-section {
        padding: 10px;
        margin-bottom: 10px;
    }

    body:not(.wallet-result-page) .form-group input,
    body:not(.wallet-result-page) .form-group select {
        font-size: 16px;
    }

    body:not(.wallet-result-page) .environment-info {
        flex-direction: column;
        gap: 5px;
    }

    body:not(.wallet-result-page) .flow-selector-options {
        --flow-card-height: 76px;
        --flow-card-gap: 6px;
    }

    body:not(.wallet-result-page) .billing-contact-grid,
    body:not(.wallet-result-page) #digital-wrap-billing-address {
        grid-template-columns: 1fr;
        gap: 0;
    }

    body:not(.wallet-result-page) .wallet-section-header,
    body:not(.wallet-result-page) .wallet-primary-row,
    body:not(.wallet-result-page) .wallet-run-panel {
        padding: 10px;
    }

    body:not(.wallet-result-page) .payermax-checkout-section > .form-row,
    body:not(.wallet-result-page) .omnipay-hosted-checkout-section > .form-row {
        padding: 0 10px 10px;
    }

    body:not(.wallet-result-page) .card-fields {
        padding: 13px 10px 11px;
    }
}

/* Mobile usability pass: keep the demo readable, reachable, and touch-friendly. */
@media (max-width: 560px) {
    body:not(.wallet-result-page) {
        background: #eef2f7;
        padding-bottom: env(safe-area-inset-bottom);
    }

    body:not(.wallet-result-page) .active-environment-indicator {
        position: relative;
        top: auto;
        right: auto;
        width: calc(100% - 20px);
        max-width: none;
        margin: 8px auto 0;
        padding: 8px 11px;
        border-radius: 10px;
        text-align: center;
    }

    body:not(.wallet-result-page) .active-environment-indicator-label {
        font-size: 10px;
    }

    body:not(.wallet-result-page) .active-environment-indicator strong {
        font-size: 12px;
    }

    body:not(.wallet-result-page) .container {
        width: 100%;
        margin: 8px 0 0;
        border-radius: 0;
        box-shadow: none;
    }

    body:not(.wallet-result-page) .header {
        padding: 20px 16px 18px;
    }

    body:not(.wallet-result-page) .header h1 {
        max-width: 21ch;
        margin: 0 auto 7px;
        font-size: 21px;
        line-height: 1.2;
    }

    body:not(.wallet-result-page) .header p {
        font-size: 12px;
        line-height: 1.35;
    }

    body:not(.wallet-result-page) .form-container {
        padding: 12px 12px 32px;
    }

    body:not(.wallet-result-page) .config-section {
        padding: 14px;
        margin-bottom: 12px;
        border-radius: 12px;
    }

    body:not(.wallet-result-page) .config-section h3 {
        margin-bottom: 12px;
        font-size: 16px;
        line-height: 1.25;
    }

    body:not(.wallet-result-page) .form-row,
    body:not(.wallet-result-page) .card-fields > .form-row {
        display: flex;
        flex-direction: column;
        gap: 0;
        margin-bottom: 0;
    }

    body:not(.wallet-result-page) .form-group {
        margin-bottom: 14px;
    }

    body:not(.wallet-result-page) .form-group label {
        margin-bottom: 6px;
        font-size: 13px;
        line-height: 1.3;
    }

    body:not(.wallet-result-page) .form-group input,
    body:not(.wallet-result-page) .form-group select {
        min-height: 48px;
        padding: 11px 12px;
        border-radius: 10px;
        font-size: 16px;
    }

    body:not(.wallet-result-page) .form-hint,
    body:not(.wallet-result-page) .hint-line {
        line-height: 1.38;
        overflow-wrap: anywhere;
    }

    body:not(.wallet-result-page) .form-hint {
        font-size: 11.5px;
    }

    body:not(.wallet-result-page) .environment-display {
        padding: 10px 2px 2px;
    }

    body:not(.wallet-result-page) .environment-info {
        gap: 8px;
    }

    body:not(.wallet-result-page) .environment-badge {
        padding: 7px 11px;
        font-size: 11px;
        letter-spacing: 0.04em;
    }

    body:not(.wallet-result-page) #environment-description {
        font-size: 12px;
        line-height: 1.4;
    }

    body:not(.wallet-result-page) .flow-selector-options {
        --flow-card-height: 94px;
        --flow-card-gap: 8px;
        margin-top: 7px;
    }

    body:not(.wallet-result-page) .flow-card {
        padding: 9px 7px;
        border-radius: 10px;
    }

    body:not(.wallet-result-page) .flow-card strong {
        min-height: 31px;
        margin-bottom: 5px;
        font-size: 11.5px;
    }

    body:not(.wallet-result-page) .flow-card p {
        min-height: 27px;
        font-size: 10px;
        line-height: 1.3;
    }

    body:not(.wallet-result-page) .wallet-section-header {
        flex-direction: column;
        gap: 9px;
        padding: 14px;
    }

    body:not(.wallet-result-page) .wallet-direct-section h3 {
        font-size: 17px;
        line-height: 1.25;
    }

    body:not(.wallet-result-page) .wallet-test-chip {
        align-self: flex-start;
    }

    body:not(.wallet-result-page) .wallet-primary-row,
    body:not(.wallet-result-page) .wallet-run-panel {
        padding: 14px;
    }

    body:not(.wallet-result-page) .wallet-primary-row,
    body:not(.wallet-result-page) .omnipay-hosted-checkout-section .wallet-primary-row,
    body:not(.wallet-result-page) .payermax-checkout-section .wallet-primary-row {
        grid-template-columns: 1fr;
        gap: 0;
    }

    body:not(.wallet-result-page) .payermax-checkout-section > .form-row,
    body:not(.wallet-result-page) .omnipay-hosted-checkout-section > .form-row {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 0 14px 4px;
    }

    body:not(.wallet-result-page) .wallet-actions,
    body:not(.wallet-result-page) .payermax-checkout-section .wallet-actions,
    body:not(.wallet-result-page) .omnipay-hosted-checkout-section .wallet-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    body:not(.wallet-result-page) .wallet-actions .submit-button,
    body:not(.wallet-result-page) .wallet-actions .btn-secondary {
        min-width: 0;
        min-height: 46px;
        padding: 9px 8px;
        font-size: 12px;
    }

    body:not(.wallet-result-page) .wallet-actions > :first-child {
        grid-column: 1 / -1;
    }

    body:not(.wallet-result-page) .wallet-action-hint {
        margin-top: 8px;
        font-size: 11px;
    }

    body:not(.wallet-result-page) .wallet-advanced-settings {
        padding: 0 14px;
    }

    body:not(.wallet-result-page) .wallet-advanced-settings summary {
        grid-template-columns: minmax(0, 1fr) max-content;
        gap: 8px;
        padding: 11px 0;
    }

    body:not(.wallet-result-page) .wallet-advanced-settings summary small {
        display: none;
    }

    body:not(.wallet-result-page) .wallet-inline-checkout,
    body:not(.wallet-result-page) .wallet-dropin-panel {
        margin: 12px 0;
        border-radius: 10px;
    }

    body:not(.wallet-result-page) .wallet-inline-header {
        align-items: flex-start;
        padding: 11px 12px;
    }

    body:not(.wallet-result-page) .wallet-inline-checkout iframe {
        height: 68vh;
        min-height: 480px;
    }

    body:not(.wallet-result-page) .wallet-pay-buttons {
        grid-template-columns: 1fr;
        gap: 10px;
        margin: 14px 0;
    }

    body:not(.wallet-result-page) .wallet-token-first-actions {
        flex-direction: column;
    }

    body:not(.wallet-result-page) .wallet-token-first-actions .btn-secondary,
    body:not(.wallet-result-page) .wallet-token-first-actions .submit-button {
        width: 100%;
        min-height: 46px;
    }

    body:not(.wallet-result-page) .card-fields {
        padding: 16px 12px 14px;
        border-radius: 14px;
    }

    body:not(.wallet-result-page) .payment-section-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 9px;
        margin-bottom: 14px;
        padding-bottom: 12px;
    }

    body:not(.wallet-result-page) .card-fields h3 {
        font-size: 18px;
    }

    body:not(.wallet-result-page) .card-fields .form-group {
        margin-bottom: 14px;
    }

    body:not(.wallet-result-page) .expiry-select-row {
        gap: 8px;
    }

    body:not(.wallet-result-page) .expiry-select-row select {
        min-height: 48px;
        padding: 10px 30px 10px 11px;
        border-radius: 10px;
        font-size: 16px;
    }

    body:not(.wallet-result-page) .test-card-info,
    body:not(.wallet-result-page) .test-cvv-info {
        display: flex;
        align-items: flex-start;
        width: 100%;
        border-radius: 10px;
        padding: 8px 9px;
        font-size: 11px;
    }

    body:not(.wallet-result-page) .billing-shipping-checkbox {
        padding: 14px;
        margin-bottom: 14px;
        border-left-width: 3px;
    }

    body:not(.wallet-result-page) .billing-shipping-checkbox label {
        align-items: flex-start;
        font-size: 13px;
        line-height: 1.35;
    }

    body:not(.wallet-result-page) .billing-shipping-checkbox input[type="checkbox"] {
        flex: 0 0 auto;
        width: 20px;
        height: 20px;
        margin: 0 9px 0 0;
    }

    body:not(.wallet-result-page) .billing-shipping-checkbox .form-hint {
        margin-left: 29px;
    }

    body:not(.wallet-result-page) .shipping-section {
        padding: 14px;
        margin-bottom: 14px;
        border-radius: 10px;
    }

    body:not(.wallet-result-page) .security-badges {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
        padding: 10px;
        margin: 14px 0;
    }

    body:not(.wallet-result-page) .security-badge {
        justify-content: center;
        min-height: 36px;
        padding: 6px 5px;
        font-size: 10px;
        text-align: center;
    }

    body:not(.wallet-result-page) #submit-button {
        position: sticky;
        bottom: calc(10px + env(safe-area-inset-bottom));
        z-index: 20;
        min-height: 52px;
        padding: 13px 14px;
        border-radius: 12px;
        font-size: 16px;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
    }

    body:not(.wallet-result-page) .api-response-log-header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    body:not(.wallet-result-page) .api-response-log {
        max-height: 760px;
    }

    .api-log-exchange-paired { grid-template-columns: minmax(0, 1fr); }
    .api-log-content { padding: 10px; }
    .api-log-summary { padding: 10px; }
    .api-log-json { max-height: 280px; font-size: 11px; }

    body:not(.wallet-result-page) .demo-asset-version-badge {
        position: static;
        width: fit-content;
        max-width: calc(100% - 24px);
        margin: 12px auto 0;
    }

    body:not(.wallet-result-page) button,
    body:not(.wallet-result-page) select,
    body:not(.wallet-result-page) input {
        -webkit-tap-highlight-color: transparent;
    }

    body:not(.wallet-result-page) button:focus-visible,
    body:not(.wallet-result-page) select:focus-visible,
    body:not(.wallet-result-page) input:focus-visible,
    body:not(.wallet-result-page) summary:focus-visible {
        outline: 3px solid rgba(37, 99, 235, 0.32);
        outline-offset: 2px;
    }
}
