/* =========================
TRUST WALLET STYLE MODAL
FULLY ISOLATED
========================= */

.tw-modal-root,
.tw-modal-root * {
    box-sizing: border-box;
}

.tw-modal-root {
    --tw-blue: #1637ff;
    --tw-blue-dark: #102de0;
    --tw-text: #17181f;
    --tw-gray: #7f8497;
    --tw-border: #e4e6ee;
    --tw-bg: #ffffff;

    font-family: Inter, Arial, sans-serif;
}

/* BUTTON */

.tw-open-btn {
    border: none;
    outline: none;
    cursor: pointer;

    height: 56px;
    padding: 0 28px;

    border-radius: 18px;

    background: var(--tw-blue);
    color: #fff;

    font-size: 16px;
    font-weight: 700;

    transition: .2s;
}

.tw-open-btn:hover {
    background: var(--tw-blue-dark);
}

/* OVERLAY */

.tw-modal-overlay {
    position: fixed;
    inset: 0;

    z-index: 999999;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0,0,0,.65);

    opacity: 0;
    visibility: hidden;

    transition:
            opacity .25s ease,
            visibility .25s ease;
}

.tw-modal-overlay.tw-active {
    opacity: 1;
    visibility: visible;
}

/* MODAL */

.tw-modal-box {
    position: relative;

    width: 100%;
    max-width: 580px;

    background: var(--tw-bg);

    border-radius: 28px;

    padding: 34px;

    /* МЕНЬШЕ НА 20% */
    transform: translateY(25px) scale(0.8);

    transition: .25s ease;

    box-shadow:
            0 20px 60px rgba(0,0,0,.25);
}

.tw-modal-overlay.tw-active .tw-modal-box {
    transform: translateY(0) scale(0.8);
}

/* CLOSE */

.tw-modal-close {
    position: absolute;

    top: 22px;
    right: 22px;

    width: 42px;
    height: 42px;

    border: none;
    background: transparent;

    cursor: pointer;
}

.tw-modal-close::before,
.tw-modal-close::after {
    content: "";

    position: absolute;

    top: 50%;
    left: 50%;

    width: 20px;
    height: 2px;

    background: #1c1d24;
    border-radius: 20px;
}

.tw-modal-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.tw-modal-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* TITLE */

.tw-modal-title {
    margin: 0;

    text-align: center;

    color: var(--tw-text);

    font-size: 34px;
    font-weight: 800;
}

.tw-modal-subtitle {
    margin-top: 12px;
    margin-bottom: 28px;

    text-align: center;

    color: var(--tw-gray);

    font-size: 18px;
}

/* CARD LIST */

.tw-card-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* CARD ITEM */

.tw-card-item {
    position: relative;

    display: flex;
    align-items: center;

    gap: 18px;

    min-height: 104px;

    padding: 18px 72px 18px 18px;

    border: 2px solid var(--tw-border);
    border-radius: 22px;

    background: #fff;

    cursor: pointer;

    transition: .2s ease;
}

.tw-card-item input {
    display: none;
}

.tw-card-item.tw-selected {
    border-color: var(--tw-blue);
    background: #f5f7ff;
}

/* CARD VISUAL */

.tw-bank-card {
    flex-shrink: 0;

    width: 102px;
    height: 64px;

    border-radius: 14px;

    padding: 10px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;

    overflow: hidden;

    box-shadow:
            0 10px 18px rgba(0,0,0,.12);
}

.tw-card-white {
    background:
            linear-gradient(135deg,#ecebff,#bdb9ff);

    color: #2b2bb1;
}

.tw-card-blue {
    background:
            linear-gradient(135deg,#2d33ff,#0010cc);

    color: #fff;
}

.tw-card-metal {
    background:
            linear-gradient(135deg,#43454f,#1c1d23);

    color: #fff;
}

.tw-bank-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    font-size: 8px;
    font-weight: 700;
}

.tw-bank-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tw-chip {
    width: 14px;
    height: 10px;

    border-radius: 3px;

    background: rgba(255,255,255,.35);
}

.tw-bank-number {
    font-size: 8px;
    letter-spacing: 1px;
}

/* INFO */

.tw-card-info {
    flex: 1;
}

.tw-card-info h3 {
    margin: 0 0 6px;

    font-size: 20px;
    font-weight: 800;

    color: var(--tw-text);
}

.tw-card-info p {
    margin: 0;

    color: var(--tw-gray);

    font-size: 14px;
    line-height: 1.45;
}

.tw-badge {
    margin-left: 6px;

    color: var(--tw-blue);

    font-size: 14px;
    font-weight: 800;
}

/* RADIO */

.tw-radio {
    position: absolute;

    right: 22px;
    top: 50%;

    transform: translateY(-50%);

    width: 26px;
    height: 26px;

    border-radius: 50%;
    border: 2px solid #d1d5df;

    transition: .2s;
}

.tw-card-item.tw-selected .tw-radio {
    background: var(--tw-blue);
    border-color: var(--tw-blue);
}

.tw-card-item.tw-selected .tw-radio::after {
    content: "";

    position: absolute;

    left: 7px;
    top: 3px;

    width: 6px;
    height: 12px;

    border: solid #fff;
    border-width: 0 2px 2px 0;

    transform: rotate(45deg);
}

/* BUTTON */

.tw-continue-btn {
    width: 100%;
    height: 62px;

    margin-top: 24px;

    border: none;
    outline: none;

    border-radius: 999px;

    background: var(--tw-blue);

    color: #fff;

    font-size: 18px;
    font-weight: 700;

    cursor: pointer;

    transition: .2s;
}

.tw-continue-btn:hover {
    background: var(--tw-blue-dark);
}

/* MOBILE */

@media (max-width: 640px) {

    .tw-modal-box {
        padding: 26px 18px 20px;
    }

    .tw-card-item {
        align-items: flex-start;
        flex-direction: column;

        padding-right: 60px;
    }

    .tw-radio {
        top: 24px;
        transform: none;
    }
}

/* =========================
STEP SWITCHING / SHARED CONTROLS
========================= */

.tw-modal-step {
    display: none;
}

.tw-modal-step.tw-modal-step-active {
    display: block;
}

.tw-modal-close::before,
.tw-modal-close::after,
.tw-modal-back::before,
.tw-modal-back::after {
    content: none !important;
}

.tw-modal-back,
.tw-modal-close {
    position: absolute;
    top: 22px;
    width: 42px;
    height: 42px;
    border: none;
    outline: none;
    background: transparent;
    color: #17181f;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: opacity .2s ease, color .2s ease;
}

.tw-modal-close {
    right: 22px;
}

.tw-modal-back {
    left: 22px;
    opacity: 0;
    visibility: hidden;
}

.tw-modal-box.tw-has-back .tw-modal-back {
    opacity: 1;
    visibility: visible;
}

.tw-modal-back i,
.tw-modal-close i {
    font-size: 25px;
    line-height: 1;
    pointer-events: none;
}

/* =========================
STEP 2 — REVIEW
same modal, content only changes
========================= */

.tw-modal-box.tw-review-mode,
.tw-modal-box.tw-wallet-mode {
    max-width: 580px;
    padding: 34px;
}

.tw-review-title,
.tw-wallet-title {
    margin: 0;
    font-size: 34px;
    line-height: 1.12;
    font-weight: 800;
}

.tw-review-hero {
    margin: 34px 0 28px;
    text-align: center;
}

.tw-review-ready {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.tw-review-check {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 3px solid #5fbb6b;
    color: #5fbb6b;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tw-review-check i {
    font-size: 13px;
    line-height: 1;
}

.tw-review-ready h3 {
    margin: 0;
    color: var(--tw-text);
    font-size: 26px;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: .2px;
}

.tw-review-hero p {
    margin: 12px 0 0;
    color: var(--tw-gray);
    font-size: 20px;
    line-height: 1.35;
    font-weight: 400;
    letter-spacing: .55px;
}

.tw-review-summary {
    width: 100%;
    margin: 0 0 29px;
    padding: 24px 31px;
    border: 2px solid var(--tw-border);
    border-radius: 24px;
    background: #fff;
}

.tw-review-row {
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    color: var(--tw-gray);
    font-size: 20px;
    line-height: 1.2;
    font-weight: 400;
    letter-spacing: .55px;
}

.tw-review-row + .tw-review-row {
    margin-top: 10px;
}

.tw-review-row strong {
    color: var(--tw-text);
    text-align: right;
    font-size: 20px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: .1px;
}

.tw-review-row strong.tw-green {
    color: #58b765;
}

.tw-perks-title {
    margin: 0 0 16px;
    text-align: center;
    color: var(--tw-gray);
    text-transform: uppercase;
    letter-spacing: 5.4px;
    font-size: 14px;
    line-height: 1.2;
    font-weight: 800;
}

.tw-perks-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
}

.tw-perk-item {
    height: 52px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 18px;
    border: 2px solid var(--tw-border);
    border-radius: 16px;
    background: #fff;
    color: var(--tw-text);
    font-size: 18px;
    line-height: 1.15;
    font-weight: 500;
    letter-spacing: .05px;
    overflow: hidden;
}

.tw-perk-item span {
    display: block;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tw-perk-icon {
    width: 24px;
    min-width: 24px;
    height: 24px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    color: var(--tw-blue);
    font-size: 22px;
    line-height: 1;
    text-align: center;
}

.tw-perk-item .fa-plane {
    font-size: 22px;
    transform: rotate(-35deg);
}

.tw-perk-item .fa-headphones-simple,
.tw-perk-item .fa-bed {
    font-size: 21px;
}

.tw-perk-orange {
    color: #f28a41;
    font-size: 21px;
}

.tw-activate-btn {
    height: 62px;
    margin-top: 24px;
    border-radius: 999px;
    font-size: 20px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: .35px;
}

/* =========================
STEP 3 — CONNECT WALLET
same switch logic as Continue from step 1
========================= */

.tw-wallet-progress {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 34px 0 38px;
}

.tw-wallet-progress-item {
    height: 46px;
    padding: 0 14px;
    border: 2px solid transparent;
    border-radius: 17px;
    background: #f5f6f8;
    color: #737889;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-size: 14px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: .15px;
    white-space: nowrap;
    overflow: hidden;
}

.tw-wallet-progress-item span {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #b9bec9;
}

.tw-wallet-progress-active {
    border-color: rgba(22, 55, 255, .34);
    background: #f0f0ff;
    color: var(--tw-blue);
}

.tw-wallet-progress-active span {
    background: var(--tw-blue);
}

.tw-wallet-visual {
    position: relative;
    width: 148px;
    height: 148px;
    margin: 0 auto 22px;
    border-radius: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: twWalletZoom 2.35s ease-in-out infinite;
}

.tw-wallet-visual::before {
    content: "";
    position: absolute;
    inset: 7px;
    border: 3px solid #f2f2ff;
    border-radius: 30px;
}

.tw-wallet-card {
    position: relative;
    z-index: 1;
    width: 118px;
    height: 118px;
    border-radius: 24px;
    background: #eeeeff;
    color: var(--tw-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 16px 35px rgba(22, 55, 255, .07);
}

.tw-wallet-card i {
    font-size: 54px;
    line-height: 1;
}

.tw-wallet-signal {
    position: absolute;
    z-index: 2;
    top: 7px;
    right: 2px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: var(--tw-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 30px rgba(22, 55, 255, .22);
    animation: twSignalZoom 2.35s ease-in-out infinite;
}

.tw-wallet-signal i {
    font-size: 22px;
    line-height: 1;
}

.tw-wallet-text {
    margin: 0 auto;
    max-width: 430px;
    text-align: center;
    color: var(--tw-gray);
    font-size: 20px;
    line-height: 1.38;
    font-weight: 400;
    letter-spacing: .55px;
}

.tw-wallet-btn {
    height: 62px;
    margin-top: 58px;
    border-radius: 999px;
    font-size: 20px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: .35px;
}

.tw-wallet-note {
    margin: 26px 0 -4px;
    text-align: center;
    color: var(--tw-gray);
    font-size: 16px;
    line-height: 1.35;
    font-weight: 400;
    letter-spacing: .35px;
}

@keyframes twWalletZoom {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.055); }
}

@keyframes twSignalZoom {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(.92); }
}

@media (max-width: 640px) {
    .tw-modal-box.tw-review-mode,
    .tw-modal-box.tw-wallet-mode {
        padding: 26px 18px 20px;
    }

    .tw-review-title,
    .tw-wallet-title {
        font-size: 30px;
    }

    .tw-review-hero {
        margin: 28px 0 24px;
    }

    .tw-review-ready h3 {
        font-size: 23px;
    }

    .tw-review-hero p,
    .tw-wallet-text {
        font-size: 18px;
        letter-spacing: .25px;
    }

    .tw-review-summary {
        padding: 20px 22px;
        margin-bottom: 25px;
    }

    .tw-review-row,
    .tw-review-row strong {
        font-size: 18px;
    }

    .tw-perks-grid {
        grid-template-columns: 1fr;
    }

    .tw-perk-item {
        height: 52px;
        font-size: 18px;
    }

    .tw-wallet-progress {
        gap: 8px;
        margin: 28px 0 34px;
    }

    .tw-wallet-progress-item {
        height: 42px;
        padding: 0 10px;
        border-radius: 15px;
        font-size: 12px;
        gap: 7px;
    }

    .tw-wallet-visual {
        width: 138px;
        height: 138px;
        margin-bottom: 20px;
    }

    .tw-wallet-card {
        width: 110px;
        height: 110px;
    }

    .tw-wallet-card i {
        font-size: 50px;
    }

    .tw-wallet-signal {
        width: 50px;
        height: 50px;
    }

    .tw-wallet-btn {
        margin-top: 52px;
        font-size: 18px;
    }

    .tw-wallet-note {
        font-size: 15px;
    }
}

/* =========================
STEP 3 POLISH — reference aligned
========================= */

.tw-modal-root {
    --tw-wallet-pill-bg: #f6f6f8;
    --tw-wallet-pill-active: #f1f1ff;
    --tw-wallet-pill-border: #aaa8ff;
    --tw-wallet-muted: #727789;
    --tw-wallet-soft: #eeeefd;
}

.tw-modal-box.tw-wallet-mode {
    max-width: 580px;
    padding: 34px;
}

.tw-wallet-title {
    margin: 0;
    font-size: 34px;
    line-height: 1.12;
    font-weight: 800;
    letter-spacing: -0.4px;
}

.tw-wallet-progress {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin: 33px 0 39px;
}

.tw-wallet-progress-item {
    height: 46px;
    padding: 0 15px;
    border: 2px solid transparent;
    border-radius: 17px;
    background: var(--tw-wallet-pill-bg);
    color: var(--tw-wallet-muted);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.tw-wallet-progress-item strong {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;
    line-height: 1;
    font-weight: 600;
    letter-spacing: .1px;
}

.tw-wallet-progress-item span {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: #b9bec9;
}

.tw-wallet-progress-active {
    border-color: var(--tw-wallet-pill-border);
    background: var(--tw-wallet-pill-active);
    color: var(--tw-blue);
}

.tw-wallet-progress-active span {
    background: var(--tw-blue);
}

.tw-wallet-visual {
    position: relative;
    width: 151px;
    height: 151px;
    margin: 0 auto 23px;
    border-radius: 31px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: twWalletBreath 2.55s ease-in-out infinite;
    will-change: transform;
}

.tw-wallet-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 3px solid #f4f4ff;
    border-radius: 31px;
}

.tw-wallet-visual::after {
    content: "";
    position: absolute;
    inset: 9px;
    border: 2px solid #dedcff;
    border-radius: 27px;
    opacity: .75;
}

.tw-wallet-card {
    position: relative;
    z-index: 1;
    width: 122px;
    height: 122px;
    border-radius: 25px;
    background: var(--tw-wallet-soft);
    color: var(--tw-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.tw-wallet-card i {
    font-size: 54px;
    line-height: 1;
    transform: translateY(1px);
}

.tw-wallet-signal {
    position: absolute;
    z-index: 3;
    top: 1px;
    right: -5px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: var(--tw-blue);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 16px 30px rgba(22, 55, 255, .24);
    animation: twWalletSignal 2.55s ease-in-out infinite;
    will-change: transform;
}

.tw-wallet-signal i {
    font-size: 20px;
    line-height: 1;
    transform: translateY(-1px);
}

.tw-wallet-text {
    width: 100%;
    max-width: 445px;
    margin: 0 auto;
    text-align: center;
    color: var(--tw-wallet-muted);
    font-size: 20px;
    line-height: 1.36;
    font-weight: 400;
    letter-spacing: .55px;
}

.tw-wallet-btn {
    height: 62px;
    margin-top: 59px;
    border-radius: 999px;
    font-size: 20px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: .35px;
}

.tw-wallet-note {
    margin: 26px 0 -4px;
    text-align: center;
    color: var(--tw-wallet-muted);
    font-size: 16px;
    line-height: 1.35;
    font-weight: 400;
    letter-spacing: .35px;
}

@keyframes twWalletBreath {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.045); }
}

@keyframes twWalletSignal {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(.93); }
}

@media (max-width: 640px) {
    .tw-modal-box.tw-wallet-mode {
        padding: 26px 18px 20px;
    }

    .tw-wallet-title {
        font-size: 30px;
    }

    .tw-wallet-progress {
        gap: 8px;
        margin: 28px 0 34px;
    }

    .tw-wallet-progress-item {
        height: 42px;
        padding: 0 10px;
        border-radius: 15px;
        gap: 7px;
    }

    .tw-wallet-progress-item strong {
        font-size: 12px;
    }

    .tw-wallet-visual {
        width: 138px;
        height: 138px;
        margin-bottom: 20px;
    }

    .tw-wallet-card {
        width: 110px;
        height: 110px;
        border-radius: 23px;
    }

    .tw-wallet-card i {
        font-size: 50px;
    }

    .tw-wallet-signal {
        width: 50px;
        height: 50px;
        right: -4px;
    }

    .tw-wallet-text {
        max-width: 390px;
        font-size: 18px;
        letter-spacing: .25px;
    }

    .tw-wallet-btn {
        margin-top: 52px;
        font-size: 18px;
    }

    .tw-wallet-note {
        font-size: 15px;
    }
}

/* =========================
STEP 3 — FINAL WALLET ICON FIX
removes static outer rings and adds subtle step-outline animation
========================= */

.tw-wallet-visual {
    overflow: visible;
    animation: twWalletBreathSoft 2.7s ease-in-out infinite;
}

.tw-wallet-visual::before,
.tw-wallet-visual::after {
    display: none !important;
}

.tw-wallet-card {
    overflow: visible;
    animation: twWalletStepOutline 2.8s ease-in-out infinite;
}

.tw-wallet-signal {
    animation: twWalletSignalSoft 2.8s ease-in-out infinite;
}

@keyframes twWalletBreathSoft {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.025); }
}

@keyframes twWalletSignalSoft {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(.95); }
}

@keyframes twWalletStepOutline {
    0%, 100% {
        box-shadow:
            0 0 0 0 rgba(22, 55, 255, 0),
            0 0 0 0 rgba(22, 55, 255, 0);
    }
    18% {
        box-shadow:
            0 0 0 0 rgba(22, 55, 255, .16),
            0 0 0 0 rgba(22, 55, 255, 0);
    }
    42% {
        box-shadow:
            0 0 0 7px rgba(22, 55, 255, .10),
            0 0 0 0 rgba(22, 55, 255, 0);
    }
    66% {
        box-shadow:
            0 0 0 7px rgba(22, 55, 255, .04),
            0 0 0 15px rgba(22, 55, 255, .07);
    }
    84% {
        box-shadow:
            0 0 0 7px rgba(22, 55, 255, 0),
            0 0 0 15px rgba(22, 55, 255, 0);
    }
}

/* =========================
EQUAL HEIGHT FOR ALL STEPS — v4
Keeps step 1, step 2 and step 3 inside the same visual modal size.
========================= */

.tw-modal-root {
    --tw-modal-fixed-height: 650px;
}

.tw-modal-box,
.tw-modal-box.tw-review-mode,
.tw-modal-box.tw-wallet-mode {
    height: var(--tw-modal-fixed-height);
    max-height: calc(100vh - 40px);
    overflow: hidden;
}

.tw-modal-step.tw-modal-step-active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#twStepSelect .tw-card-list,
#twStepReview .tw-perks-grid,
#twStepWallet .tw-wallet-text {
    flex-shrink: 0;
}

#twStepSelect .tw-continue-btn,
#twStepReview .tw-activate-btn {
    margin-top: auto;
}

#twStepWallet .tw-wallet-btn {
    margin-top: auto;
}

#twStepWallet .tw-wallet-note {
    flex-shrink: 0;
}

.tw-wallet-progress {
    flex-shrink: 0;
}

.tw-wallet-visual {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .tw-modal-root {
        --tw-modal-fixed-height: 650px;
    }

    .tw-modal-box,
    .tw-modal-box.tw-review-mode,
    .tw-modal-box.tw-wallet-mode {
        height: var(--tw-modal-fixed-height);
        max-height: calc(100vh - 40px);
        overflow-y: auto;
        overflow-x: hidden;
    }
}

/* =========================
STEP 2 COMPACT FIT — v5
Keeps button size identical while making Review content fit fixed modal height.
========================= */

#twStepReview .tw-review-title {
    font-size: 32px;
    line-height: 1.08;
}

#twStepReview .tw-review-hero {
    margin: 24px 0 20px;
}

#twStepReview .tw-review-ready {
    gap: 12px;
}

#twStepReview .tw-review-check {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    border-width: 3px;
}

#twStepReview .tw-review-ready h3 {
    font-size: 24px;
    line-height: 1.1;
}

#twStepReview .tw-review-hero p {
    margin-top: 9px;
    font-size: 18px;
    line-height: 1.25;
    letter-spacing: .35px;
}

#twStepReview .tw-review-summary {
    margin-bottom: 22px;
    padding: 20px 28px;
    border-radius: 22px;
}

#twStepReview .tw-review-row {
    min-height: 31px;
    font-size: 18px;
    line-height: 1.15;
    letter-spacing: .35px;
}

#twStepReview .tw-review-row + .tw-review-row {
    margin-top: 8px;
}

#twStepReview .tw-review-row strong {
    font-size: 18px;
    line-height: 1.15;
}

#twStepReview .tw-perks-title {
    margin-bottom: 13px;
    font-size: 13px;
    letter-spacing: 4.8px;
}

#twStepReview .tw-perks-grid {
    gap: 12px 14px;
}

#twStepReview .tw-perk-item {
    height: 48px;
    padding: 0 17px;
    gap: 13px;
    border-radius: 15px;
    font-size: 17px;
    font-weight: 600;
}

#twStepReview .tw-perk-icon {
    width: 22px;
    min-width: 22px;
    height: 22px;
    font-size: 20px;
}

#twStepReview .tw-perk-item .fa-plane {
    font-size: 20px;
}

#twStepReview .tw-perk-item .fa-headphones-simple,
#twStepReview .tw-perk-item .fa-bed,
#twStepReview .tw-perk-orange {
    font-size: 19px;
}

#twStepReview .tw-activate-btn,
#twStepSelect .tw-continue-btn,
#twStepWallet .tw-wallet-btn {
    height: 62px;
    min-height: 62px;
    flex: 0 0 62px;
}

@media (max-width: 640px) {
    #twStepReview .tw-review-title {
        font-size: 30px;
    }

    #twStepReview .tw-review-hero {
        margin: 22px 0 18px;
    }

    #twStepReview .tw-review-ready h3 {
        font-size: 22px;
    }

    #twStepReview .tw-review-hero p {
        font-size: 17px;
    }

    #twStepReview .tw-review-summary {
        padding: 18px 20px;
        margin-bottom: 18px;
    }

    #twStepReview .tw-review-row,
    #twStepReview .tw-review-row strong {
        font-size: 17px;
    }

    #twStepReview .tw-perks-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    #twStepReview .tw-perk-item {
        height: 46px;
        padding: 0 12px;
        gap: 10px;
        font-size: 15px;
    }
}

/* =========================
MOBILE REFERENCE LAYOUT — v6
Desktop stays untouched. On mobile the modal uses the full viewport width,
keeps the same visual height for all steps, and matches the provided references.
========================= */

@media (max-width: 640px) {
    .tw-modal-overlay {
        padding: 0;
        align-items: center;
        justify-content: center;
    }

    .tw-modal-root {
        --tw-modal-fixed-height: 650px;
    }

    .tw-modal-box,
    .tw-modal-box.tw-review-mode,
    .tw-modal-box.tw-wallet-mode {
        width: 100vw;
        max-width: none;
        height: var(--tw-modal-fixed-height);
        max-height: calc(100vh - 24px);
        padding: 52px 26px 28px;
        border-radius: 28px;
        overflow: hidden;
        transform: translateY(18px) scale(1);
        box-shadow: 0 22px 56px rgba(0, 0, 0, .24);
    }

    .tw-modal-overlay.tw-active .tw-modal-box {
        transform: translateY(0) scale(1);
    }

    .tw-modal-step.tw-modal-step-active {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
    }

    .tw-modal-back,
    .tw-modal-close {
        top: 38px;
        width: 42px;
        height: 42px;
    }

    .tw-modal-back {
        left: 31px;
    }

    .tw-modal-close {
        right: 31px;
    }

    .tw-modal-back i,
    .tw-modal-close i {
        font-size: 27px;
    }

    .tw-modal-title,
    .tw-review-title,
    .tw-wallet-title {
        max-width: calc(100% - 118px);
        margin: 0 auto;
        font-size: 30px;
        line-height: 1.12;
        font-weight: 800;
        letter-spacing: -.45px;
        white-space: nowrap;
    }

    .tw-modal-subtitle {
        margin-top: 30px;
        margin-bottom: 29px;
        font-size: 18px;
        line-height: 1.28;
        letter-spacing: .8px;
    }

    /* Step 1 — keep horizontal cards on mobile, like the reference */
    #twStepSelect .tw-card-list {
        gap: 15px;
        flex: 0 0 auto;
    }

    #twStepSelect .tw-card-item {
        min-height: 112px;
        flex-direction: row !important;
        align-items: center !important;
        gap: 18px;
        padding: 19px 58px 19px 18px;
        border-radius: 22px;
    }

    #twStepSelect .tw-bank-card {
        width: 102px;
        height: 64px;
        border-radius: 14px;
        padding: 10px;
    }

    #twStepSelect .tw-card-info h3 {
        margin-bottom: 8px;
        font-size: 20px;
        line-height: 1.05;
    }

    #twStepSelect .tw-card-info p {
        font-size: 14px;
        line-height: 1.42;
        letter-spacing: .18px;
    }

    #twStepSelect .tw-radio {
        top: 50%;
        right: 22px;
        width: 27px;
        height: 27px;
        transform: translateY(-50%);
    }

    #twStepSelect .tw-card-item.tw-selected .tw-radio::after {
        left: 7px;
        top: 3px;
        width: 6px;
        height: 12px;
    }

    #twStepSelect .tw-continue-btn,
    #twStepReview .tw-activate-btn,
    #twStepWallet .tw-wallet-btn {
        height: 62px;
        min-height: 62px;
        flex: 0 0 62px;
        border-radius: 999px;
        font-size: 18px;
        line-height: 1;
        font-weight: 700;
        letter-spacing: .35px;
    }

    #twStepSelect .tw-continue-btn {
        margin-top: auto;
    }

    /* Step 2 — compact enough to fit the same height, without shrinking the button */
    #twStepReview .tw-review-hero {
        margin: 24px 0 20px;
    }

    #twStepReview .tw-review-ready {
        gap: 12px;
    }

    #twStepReview .tw-review-check {
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
        border-width: 3px;
    }

    #twStepReview .tw-review-check i {
        font-size: 12px;
    }

    #twStepReview .tw-review-ready h3 {
        font-size: 22px;
        line-height: 1.12;
    }

    #twStepReview .tw-review-hero p {
        margin-top: 9px;
        font-size: 17px;
        line-height: 1.28;
        letter-spacing: .35px;
    }

    #twStepReview .tw-review-summary {
        margin: 0 0 19px;
        padding: 18px 20px;
        border-radius: 22px;
    }

    #twStepReview .tw-review-row {
        min-height: 31px;
        font-size: 17px;
        line-height: 1.15;
        letter-spacing: .35px;
    }

    #twStepReview .tw-review-row + .tw-review-row {
        margin-top: 8px;
    }

    #twStepReview .tw-review-row strong {
        font-size: 17px;
        line-height: 1.15;
    }

    #twStepReview .tw-perks-title {
        margin-bottom: 13px;
        font-size: 13px;
        line-height: 1.1;
        letter-spacing: 4.8px;
    }

    #twStepReview .tw-perks-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 12px;
        flex: 0 0 auto;
    }

    #twStepReview .tw-perk-item {
        height: 46px;
        padding: 0 12px;
        gap: 10px;
        border-radius: 15px;
        font-size: 15px;
        font-weight: 600;
    }

    #twStepReview .tw-perk-icon {
        width: 22px;
        min-width: 22px;
        height: 22px;
        font-size: 20px;
    }

    #twStepReview .tw-activate-btn {
        margin-top: auto;
    }

    /* Step 3 — mobile spacing from the wallet reference */
    #twStepWallet .tw-wallet-title {
        font-size: 30px;
    }

    #twStepWallet .tw-wallet-progress {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        margin: 33px 0 47px;
        flex: 0 0 auto;
    }

    #twStepWallet .tw-wallet-progress-item {
        height: 46px;
        padding: 0 12px;
        border-radius: 16px;
        gap: 8px;
    }

    #twStepWallet .tw-wallet-progress-item span {
        width: 8px;
        height: 8px;
        flex: 0 0 8px;
    }

    #twStepWallet .tw-wallet-progress-item strong {
        font-size: 14px;
        line-height: 1;
        font-weight: 600;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #twStepWallet .tw-wallet-visual {
        width: 150px;
        height: 150px;
        margin: 0 auto 28px;
        flex: 0 0 150px;
    }

    #twStepWallet .tw-wallet-card {
        width: 122px;
        height: 122px;
        border-radius: 24px;
    }

    #twStepWallet .tw-wallet-card i {
        font-size: 54px;
    }

    #twStepWallet .tw-wallet-signal {
        top: 2px;
        right: -4px;
        width: 55px;
        height: 55px;
    }

    #twStepWallet .tw-wallet-signal i {
        font-size: 20px;
    }

    #twStepWallet .tw-wallet-text {
        max-width: 350px;
        margin: 0 auto;
        font-size: 18px;
        line-height: 1.42;
        letter-spacing: .3px;
    }

    #twStepWallet .tw-wallet-btn {
        margin-top: auto;
    }

    #twStepWallet .tw-wallet-note {
        margin: 25px 0 0;
        font-size: 15px;
        line-height: 1.35;
        letter-spacing: .25px;
        flex: 0 0 auto;
    }
}

@media (max-width: 380px) {
    .tw-modal-box,
    .tw-modal-box.tw-review-mode,
    .tw-modal-box.tw-wallet-mode {
        padding-left: 20px;
        padding-right: 20px;
    }

    .tw-modal-back {
        left: 22px;
    }

    .tw-modal-close {
        right: 22px;
    }

    #twStepSelect .tw-card-item {
        gap: 14px;
        padding-left: 15px;
        padding-right: 52px;
    }

    #twStepSelect .tw-bank-card {
        width: 94px;
        height: 60px;
    }

    #twStepSelect .tw-card-info h3 {
        font-size: 19px;
    }

    #twStepSelect .tw-card-info p {
        font-size: 13px;
    }

    #twStepReview .tw-perk-item {
        padding: 0 10px;
        gap: 8px;
        font-size: 14px;
    }

    #twStepWallet .tw-wallet-progress {
        gap: 8px;
    }

    #twStepWallet .tw-wallet-progress-item {
        padding: 0 10px;
    }
}

/* =========================
MOBILE ADAPTIVE POLISH — v7
Fixes mobile overflow/cropping while keeping desktop unchanged.
========================= */

@media (max-width: 640px) {
    .tw-modal-root {
        --tw-modal-fixed-height: min(650px, calc(100svh - 28px));
    }

    .tw-modal-overlay {
        padding: 0;
        align-items: center;
        justify-content: center;
    }

    .tw-modal-box,
    .tw-modal-box.tw-review-mode,
    .tw-modal-box.tw-wallet-mode {
        width: 100vw;
        max-width: none;
        height: var(--tw-modal-fixed-height);
        max-height: calc(100svh - 28px);
        padding: 46px 28px 24px;
        border-radius: 28px;
        overflow: hidden;
        transform: translateY(14px) scale(1);
    }

    .tw-modal-overlay.tw-active .tw-modal-box {
        transform: translateY(0) scale(1);
    }

    .tw-modal-step.tw-modal-step-active {
        display: flex;
        flex-direction: column;
        height: 100%;
        min-height: 0;
    }

    .tw-modal-back,
    .tw-modal-close {
        top: 37px;
        width: 42px;
        height: 42px;
    }

    .tw-modal-back {
        left: 28px;
    }

    .tw-modal-close {
        right: 28px;
    }

    .tw-modal-back i,
    .tw-modal-close i {
        font-size: 26px;
    }

    .tw-modal-title,
    .tw-review-title,
    .tw-wallet-title {
        max-width: calc(100% - 112px);
        margin: 0 auto;
        font-size: 30px;
        line-height: 1.1;
        font-weight: 800;
        letter-spacing: -.45px;
        white-space: nowrap;
    }

    .tw-modal-subtitle {
        max-width: 360px;
        margin: 24px auto 24px;
        font-size: 18px;
        line-height: 1.28;
        letter-spacing: .35px;
    }

    /* Step 1 */
    #twStepSelect .tw-card-list {
        gap: 14px;
        flex: 0 0 auto;
    }

    #twStepSelect .tw-card-item {
        min-height: 100px;
        flex-direction: row !important;
        align-items: center !important;
        gap: 16px;
        padding: 14px 56px 14px 16px;
        border-radius: 22px;
        border-width: 2px;
    }

    #twStepSelect .tw-bank-card {
        width: 102px;
        height: 64px;
        border-radius: 14px;
        padding: 10px;
    }

    #twStepSelect .tw-card-info {
        min-width: 0;
    }

    #twStepSelect .tw-card-info h3 {
        margin: 0 0 7px;
        font-size: 20px;
        line-height: 1.08;
    }

    #twStepSelect .tw-card-info p {
        font-size: 14px;
        line-height: 1.42;
        letter-spacing: .05px;
    }

    #twStepSelect .tw-radio {
        top: 50%;
        right: 22px;
        width: 27px;
        height: 27px;
        transform: translateY(-50%);
    }

    #twStepSelect .tw-card-item.tw-selected .tw-radio::after {
        left: 7px;
        top: 3px;
        width: 6px;
        height: 12px;
    }

    #twStepSelect .tw-continue-btn,
    #twStepReview .tw-activate-btn,
    #twStepWallet .tw-wallet-btn {
        height: 62px;
        min-height: 62px;
        flex: 0 0 62px;
        margin-top: auto;
        border-radius: 999px;
        font-size: 18px;
        line-height: 1;
        font-weight: 700;
        letter-spacing: .3px;
    }

    /* Step 2 */
    #twStepReview .tw-review-hero {
        margin: 22px 0 18px;
    }

    #twStepReview .tw-review-ready {
        gap: 12px;
    }

    #twStepReview .tw-review-check {
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
    }

    #twStepReview .tw-review-ready h3 {
        font-size: 22px;
        line-height: 1.12;
    }

    #twStepReview .tw-review-hero p {
        margin-top: 9px;
        font-size: 17px;
        line-height: 1.26;
        letter-spacing: .25px;
    }

    #twStepReview .tw-review-summary {
        margin: 0 0 18px;
        padding: 18px 20px;
        border-radius: 22px;
    }

    #twStepReview .tw-review-row {
        min-height: 30px;
        font-size: 17px;
        line-height: 1.15;
        letter-spacing: .25px;
    }

    #twStepReview .tw-review-row + .tw-review-row {
        margin-top: 7px;
    }

    #twStepReview .tw-review-row strong {
        font-size: 17px;
        line-height: 1.15;
    }

    #twStepReview .tw-perks-title {
        margin-bottom: 12px;
        font-size: 13px;
        line-height: 1.1;
        letter-spacing: 4.6px;
    }

    #twStepReview .tw-perks-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 12px;
        flex: 0 0 auto;
    }

    #twStepReview .tw-perk-item {
        height: 46px;
        padding: 0 12px;
        gap: 10px;
        border-radius: 15px;
        font-size: 15px;
        font-weight: 600;
    }

    #twStepReview .tw-perk-icon {
        width: 22px;
        min-width: 22px;
        height: 22px;
        font-size: 20px;
    }

    /* Step 3 */
    #twStepWallet .tw-wallet-progress {
        grid-template-columns: 1.18fr 1.04fr .96fr;
        gap: 10px;
        margin: 30px 0 42px;
        flex: 0 0 auto;
    }

    #twStepWallet .tw-wallet-progress-item {
        height: 46px;
        padding: 0 11px;
        border-radius: 16px;
        gap: 7px;
    }

    #twStepWallet .tw-wallet-progress-item span {
        width: 8px;
        height: 8px;
        flex: 0 0 8px;
    }

    #twStepWallet .tw-wallet-progress-item strong {
        font-size: 12px;
        line-height: 1;
        font-weight: 600;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    #twStepWallet .tw-wallet-visual {
        width: 146px;
        height: 146px;
        flex: 0 0 146px;
        margin: 0 auto 24px;
    }

    #twStepWallet .tw-wallet-card {
        width: 118px;
        height: 118px;
        border-radius: 24px;
    }

    #twStepWallet .tw-wallet-card i {
        font-size: 52px;
    }

    #twStepWallet .tw-wallet-signal {
        top: 2px;
        right: -4px;
        width: 54px;
        height: 54px;
    }

    #twStepWallet .tw-wallet-signal i {
        font-size: 20px;
    }

    #twStepWallet .tw-wallet-text {
        max-width: 355px;
        margin: 0 auto;
        font-size: 18px;
        line-height: 1.42;
        letter-spacing: .25px;
    }

    #twStepWallet .tw-wallet-note {
        margin: 24px 0 0;
        font-size: 15px;
        line-height: 1.35;
        letter-spacing: .2px;
        flex: 0 0 auto;
    }
}

@media (max-width: 640px) and (max-height: 760px) {
    .tw-modal-root {
        --tw-modal-fixed-height: calc(100svh - 24px);
    }

    .tw-modal-box,
    .tw-modal-box.tw-review-mode,
    .tw-modal-box.tw-wallet-mode {
        padding: 38px 26px 22px;
    }

    .tw-modal-back,
    .tw-modal-close {
        top: 29px;
    }

    .tw-modal-title,
    .tw-review-title,
    .tw-wallet-title {
        font-size: 28px;
    }

    .tw-modal-subtitle {
        margin-top: 20px;
        margin-bottom: 20px;
        font-size: 17px;
    }

    #twStepSelect .tw-card-list {
        gap: 12px;
    }

    #twStepSelect .tw-card-item {
        min-height: 92px;
        padding-top: 12px;
        padding-bottom: 12px;
        gap: 14px;
    }

    #twStepSelect .tw-bank-card {
        width: 94px;
        height: 58px;
        border-radius: 13px;
        padding: 9px;
    }

    #twStepSelect .tw-card-info h3 {
        font-size: 19px;
        margin-bottom: 5px;
    }

    #twStepSelect .tw-card-info p {
        font-size: 13px;
        line-height: 1.35;
    }

    #twStepReview .tw-review-hero {
        margin: 18px 0 15px;
    }

    #twStepReview .tw-review-ready h3 {
        font-size: 21px;
    }

    #twStepReview .tw-review-hero p {
        font-size: 16px;
    }

    #twStepReview .tw-review-summary {
        padding: 15px 18px;
        margin-bottom: 15px;
    }

    #twStepReview .tw-review-row,
    #twStepReview .tw-review-row strong {
        font-size: 16px;
    }

    #twStepReview .tw-perks-title {
        margin-bottom: 10px;
    }

    #twStepReview .tw-perks-grid {
        gap: 9px 10px;
    }

    #twStepReview .tw-perk-item {
        height: 42px;
        font-size: 14px;
    }

    #twStepWallet .tw-wallet-progress {
        margin: 25px 0 30px;
    }

    #twStepWallet .tw-wallet-visual {
        width: 136px;
        height: 136px;
        flex-basis: 136px;
        margin-bottom: 20px;
    }

    #twStepWallet .tw-wallet-card {
        width: 110px;
        height: 110px;
    }

    #twStepWallet .tw-wallet-card i {
        font-size: 48px;
    }

    #twStepWallet .tw-wallet-signal {
        width: 50px;
        height: 50px;
    }

    #twStepWallet .tw-wallet-text {
        font-size: 17px;
        line-height: 1.38;
    }

    #twStepWallet .tw-wallet-note {
        margin-top: 20px;
        font-size: 14px;
    }
}

@media (max-width: 380px) {
    .tw-modal-box,
    .tw-modal-box.tw-review-mode,
    .tw-modal-box.tw-wallet-mode {
        padding-left: 22px;
        padding-right: 22px;
    }

    .tw-modal-back {
        left: 22px;
    }

    .tw-modal-close {
        right: 22px;
    }

    #twStepSelect .tw-card-item {
        gap: 12px;
        padding-left: 14px;
        padding-right: 50px;
    }

    #twStepSelect .tw-bank-card {
        width: 92px;
        height: 58px;
    }

    #twStepSelect .tw-card-info h3 {
        font-size: 18px;
    }

    #twStepSelect .tw-card-info p {
        font-size: 12.5px;
    }

    #twStepReview .tw-perk-item {
        padding: 0 9px;
        gap: 8px;
        font-size: 13px;
    }

    #twStepWallet .tw-wallet-progress {
        gap: 8px;
    }

    #twStepWallet .tw-wallet-progress-item {
        padding: 0 9px;
    }

    #twStepWallet .tw-wallet-progress-item strong {
        font-size: 11px;
    }
}

/* =========================
MOBILE STEP 1 FINAL ADAPTIVE FIX — v8
Keeps desktop unchanged. The first step cards use smaller mobile visuals/text
so every card fits cleanly and the Continue button is never cropped.
========================= */

@media (max-width: 640px) {
    .tw-modal-root {
        --tw-modal-fixed-height: min(650px, calc(100svh - 20px));
    }

    .tw-modal-box,
    .tw-modal-box.tw-review-mode,
    .tw-modal-box.tw-wallet-mode {
        padding-top: 38px;
        padding-bottom: 22px;
    }

    #twStepSelect .tw-modal-subtitle {
        margin-top: 18px;
        margin-bottom: 22px;
        font-size: 17px;
        line-height: 1.25;
    }

    #twStepSelect .tw-card-list {
        gap: 12px;
    }

    #twStepSelect .tw-card-item {
        min-height: 96px;
        gap: 12px;
        padding: 12px 52px 12px 16px;
        border-radius: 21px;
    }

    #twStepSelect .tw-bank-card {
        width: 86px;
        height: 54px;
        border-radius: 12px;
        padding: 8px;
        box-shadow: 0 9px 16px rgba(0,0,0,.12);
    }

    #twStepSelect .tw-bank-top {
        font-size: 6.8px;
        letter-spacing: .45px;
    }

    #twStepSelect .tw-bank-number {
        font-size: 7px;
        letter-spacing: 1.2px;
    }

    #twStepSelect .tw-chip {
        width: 12px;
        height: 8px;
        border-radius: 2px;
    }

    #twStepSelect .tw-card-info {
        min-width: 0;
        flex: 1 1 auto;
    }

    #twStepSelect .tw-card-info h3 {
        margin-bottom: 5px;
        font-size: 19px;
        line-height: 1.05;
        letter-spacing: -.2px;
    }

    #twStepSelect .tw-card-info p {
        font-size: 12.7px;
        line-height: 1.32;
        letter-spacing: .01px;
    }

    #twStepSelect .tw-badge {
        font-size: 13px;
    }

    #twStepSelect .tw-radio {
        right: 20px;
        width: 27px;
        height: 27px;
    }

    #twStepSelect .tw-continue-btn {
        margin-top: 16px;
    }
}

@media (max-width: 640px) and (max-height: 760px) {
    #twStepSelect .tw-modal-subtitle {
        margin-top: 16px;
        margin-bottom: 18px;
        font-size: 16px;
    }

    #twStepSelect .tw-card-list {
        gap: 10px;
    }

    #twStepSelect .tw-card-item {
        min-height: 90px;
        padding-top: 10px;
        padding-bottom: 10px;
    }

    #twStepSelect .tw-bank-card {
        width: 82px;
        height: 52px;
    }

    #twStepSelect .tw-card-info h3 {
        font-size: 18px;
        margin-bottom: 4px;
    }

    #twStepSelect .tw-card-info p {
        font-size: 12.2px;
        line-height: 1.28;
    }

    #twStepSelect .tw-continue-btn {
        margin-top: 14px;
    }
}

@media (max-width: 380px) {
    #twStepSelect .tw-card-item {
        gap: 10px;
        padding-left: 14px;
        padding-right: 48px;
    }

    #twStepSelect .tw-bank-card {
        width: 78px;
        height: 50px;
        padding: 7px;
    }

    #twStepSelect .tw-bank-top {
        font-size: 6.2px;
    }

    #twStepSelect .tw-bank-number {
        font-size: 6.4px;
    }

    #twStepSelect .tw-card-info h3 {
        font-size: 17px;
    }

    #twStepSelect .tw-card-info p {
        font-size: 11.7px;
        line-height: 1.24;
    }

    #twStepSelect .tw-radio {
        right: 18px;
        width: 25px;
        height: 25px;
    }
}

/* =========================
MOBILE COMPACT HEIGHT FIX — v9
Only mobile rules. Desktop stays unchanged.
Reduces the white modal height and trims empty space on card rows.
========================= */

@media (max-width: 640px) {
    .tw-modal-root {
        --tw-modal-fixed-height: min(560px, calc(100svh - 20px));
    }

    .tw-modal-box,
    .tw-modal-box.tw-review-mode,
    .tw-modal-box.tw-wallet-mode {
        height: var(--tw-modal-fixed-height);
        max-height: calc(100svh - 20px);
        padding-top: 34px;
        padding-bottom: 18px;
    }

    .tw-modal-back,
    .tw-modal-close {
        top: 28px;
    }

    .tw-modal-title,
    .tw-review-title,
    .tw-wallet-title {
        font-size: 28px;
        line-height: 1.08;
    }

    #twStepSelect .tw-modal-subtitle {
        margin-top: 14px;
        margin-bottom: 17px;
        font-size: 16px;
        line-height: 1.22;
    }

    #twStepSelect .tw-card-list {
        gap: 10px;
    }

    #twStepSelect .tw-card-item {
        min-height: 86px;
        gap: 10px;
        padding: 9px 48px 9px 14px;
        border-radius: 20px;
    }

    #twStepSelect .tw-bank-card {
        width: 78px;
        height: 49px;
        border-radius: 11px;
        padding: 7px;
        box-shadow: 0 8px 14px rgba(0,0,0,.11);
    }

    #twStepSelect .tw-bank-top {
        font-size: 6.1px;
        letter-spacing: .35px;
    }

    #twStepSelect .tw-bank-number {
        font-size: 6.4px;
        letter-spacing: 1px;
    }

    #twStepSelect .tw-chip {
        width: 11px;
        height: 7px;
        border-radius: 2px;
    }

    #twStepSelect .tw-card-info h3 {
        margin-bottom: 3px;
        font-size: 17px;
        line-height: 1.04;
    }

    #twStepSelect .tw-card-info p {
        font-size: 11.5px;
        line-height: 1.22;
        letter-spacing: 0;
    }

    #twStepSelect .tw-badge {
        font-size: 12px;
    }

    #twStepSelect .tw-radio {
        right: 18px;
        width: 25px;
        height: 25px;
    }

    #twStepSelect .tw-card-item.tw-selected .tw-radio::after {
        left: 6px;
        top: 2px;
        width: 6px;
        height: 12px;
    }

    #twStepSelect .tw-continue-btn {
        height: 62px;
        min-height: 62px;
        flex: 0 0 62px;
        margin-top: 14px;
        font-size: 17px;
    }
}

@media (max-width: 640px) and (max-height: 760px) {
    .tw-modal-root {
        --tw-modal-fixed-height: min(540px, calc(100svh - 18px));
    }

    .tw-modal-box,
    .tw-modal-box.tw-review-mode,
    .tw-modal-box.tw-wallet-mode {
        padding-top: 30px;
        padding-bottom: 16px;
    }

    .tw-modal-back,
    .tw-modal-close {
        top: 24px;
    }

    #twStepSelect .tw-modal-subtitle {
        margin-top: 12px;
        margin-bottom: 14px;
        font-size: 15px;
    }

    #twStepSelect .tw-card-list {
        gap: 9px;
    }

    #twStepSelect .tw-card-item {
        min-height: 80px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    #twStepSelect .tw-bank-card {
        width: 74px;
        height: 46px;
    }

    #twStepSelect .tw-card-info h3 {
        font-size: 16px;
        margin-bottom: 2px;
    }

    #twStepSelect .tw-card-info p {
        font-size: 11px;
        line-height: 1.18;
    }

    #twStepSelect .tw-continue-btn {
        margin-top: 12px;
    }
}

@media (max-width: 380px) {
    .tw-modal-root {
        --tw-modal-fixed-height: min(540px, calc(100svh - 18px));
    }

    #twStepSelect .tw-card-item {
        min-height: 78px;
        gap: 9px;
        padding-left: 12px;
        padding-right: 45px;
    }

    #twStepSelect .tw-bank-card {
        width: 70px;
        height: 44px;
        padding: 6px;
    }

    #twStepSelect .tw-bank-top {
        font-size: 5.8px;
    }

    #twStepSelect .tw-bank-number {
        font-size: 6px;
    }

    #twStepSelect .tw-card-info h3 {
        font-size: 15.5px;
    }

    #twStepSelect .tw-card-info p {
        font-size: 10.6px;
        line-height: 1.15;
    }

    #twStepSelect .tw-radio {
        right: 16px;
        width: 24px;
        height: 24px;
    }
}

/* =========================
MOBILE STEP 3 TOP TEXT FIX — v10
Keeps desktop unchanged. Makes the wallet progress labels and text smaller
so all labels fit cleanly on narrow phones.
========================= */

@media (max-width: 640px) {
    #twStepWallet .tw-wallet-progress {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;
        margin: 24px 0 30px;
    }

    #twStepWallet .tw-wallet-progress-item {
        height: 32px;
        padding: 0 8px;
        border-radius: 11px;
        gap: 5px;
    }

    #twStepWallet .tw-wallet-progress-item span {
        width: 5px;
        height: 5px;
        flex: 0 0 5px;
    }

    #twStepWallet .tw-wallet-progress-item strong {
        font-size: 10px;
        line-height: 1;
        letter-spacing: 0;
        overflow: visible;
        text-overflow: clip;
        white-space: nowrap;
    }

    #twStepWallet .tw-wallet-text {
        max-width: 320px;
        font-size: 14.5px;
        line-height: 1.36;
        letter-spacing: .08px;
    }

    #twStepWallet .tw-wallet-note {
        font-size: 12.5px;
        line-height: 1.3;
    }
}

@media (max-width: 380px) {
    #twStepWallet .tw-wallet-progress {
        gap: 6px;
    }

    #twStepWallet .tw-wallet-progress-item {
        padding: 0 7px;
        gap: 4px;
    }

    #twStepWallet .tw-wallet-progress-item strong {
        font-size: 9px;
    }

    #twStepWallet .tw-wallet-text {
        max-width: 300px;
        font-size: 13.5px;
        line-height: 1.34;
    }
}

/* =========================
MOBILE ORGANIC GAP FIX — v13
Base: last good uploaded version. Keeps desktop unchanged.
The modal height stays comfortable for Review/Wallet; only step 1 distributes
its free space better so there is no heavy empty area under the Continue button.
========================= */

@media (max-width: 640px) {
    .tw-modal-root {
        --tw-modal-fixed-height: min(560px, calc(100svh - 20px));
    }

    .tw-modal-box,
    .tw-modal-box.tw-review-mode,
    .tw-modal-box.tw-wallet-mode {
        height: var(--tw-modal-fixed-height);
        max-height: calc(100svh - 20px);
    }

    #twStepSelect .tw-card-list {
        flex: 0 0 auto;
    }

    #twStepSelect .tw-continue-btn {
        margin-top: auto;
        margin-bottom: 0;
    }

    #twStepReview .tw-activate-btn,
    #twStepWallet .tw-wallet-btn {
        margin-top: auto;
        margin-bottom: 0;
    }
}

@media (max-width: 640px) and (max-height: 760px) {
    .tw-modal-root {
        --tw-modal-fixed-height: min(540px, calc(100svh - 18px));
    }

    .tw-modal-box,
    .tw-modal-box.tw-review-mode,
    .tw-modal-box.tw-wallet-mode {
        height: var(--tw-modal-fixed-height);
        max-height: calc(100svh - 18px);
    }

    #twStepReview .tw-review-hero {
        margin: 16px 0 13px;
    }

    #twStepReview .tw-review-summary {
        padding: 14px 18px;
        margin-bottom: 13px;
    }

    #twStepReview .tw-review-row {
        min-height: 27px;
    }

    #twStepReview .tw-perks-title {
        margin-bottom: 9px;
    }

    #twStepReview .tw-perks-grid {
        gap: 8px 10px;
    }

    #twStepReview .tw-perk-item {
        height: 40px;
    }
}

@media (max-width: 380px) {
    .tw-modal-root {
        --tw-modal-fixed-height: min(540px, calc(100svh - 18px));
    }
}

/* =========================
MOBILE STEP 1 EVEN DISTRIBUTION — v14
Keeps desktop unchanged. The cards area now fills the available vertical
space between subtitle and button, and distributes card options evenly.
========================= */

@media (max-width: 640px) {
    #twStepSelect {
        min-height: 0;
    }

    #twStepSelect .tw-modal-subtitle {
        flex: 0 0 auto;
    }

    #twStepSelect .tw-card-list {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        justify-content: space-evenly;
        gap: 0;
        margin: 0;
    }

    #twStepSelect .tw-card-item {
        flex: 0 0 auto;
    }

    #twStepSelect .tw-continue-btn {
        flex: 0 0 62px;
        margin-top: 14px;
        margin-bottom: 0;
    }
}

@media (max-width: 640px) and (max-height: 760px) {
    #twStepSelect .tw-continue-btn {
        margin-top: 12px;
    }
}
