:root {
    --pl-bg: #ECFCCB;
    --pl-card: #FFFFFF;
    --pl-primary: #65A30D;
    --pl-primary-2: #84CC16;
    --pl-pink: #CA8A04;
    --pl-deep: #3F6212;
    --pl-text: #14532D;
    --pl-text-sec: #4D7C0F;
    --pl-border: #BBF7D0;
    --pl-radius: 22px;
    --pl-grad: linear-gradient(135deg, #4D7C0F 0%, #65A30D 45%, #84CC16 100%);
    --pl-surface: linear-gradient(145deg, #14532D 0%, #365314 42%, #4D7C0F 78%, #52730F 100%);
    --pl-surface-text: #F7FEE7;
    --pl-surface-muted: #D9F99D;
    --pl-card-bg: linear-gradient(165deg, #F7FEE7 0%, #FFFFFF 45%, #ECFCCB 100%);
    --pl-icon-lime: linear-gradient(145deg, #3F6212 0%, #4D7C0F 50%, #65A30D 100%);
    --pl-tile-bg: linear-gradient(145deg, #F0FDF4 0%, #DCFCE7 55%, #BBF7D0 100%);
    --pl-tile-border: #86EFAC;
    --pl-tile-lbl: #4D7C0F;
    --pl-tile-val: #14532D;
}
*, *::before, *::after { box-sizing: border-box; }
body:has(.plan-wrap) {
    background: var(--pl-bg) !important;
    overflow-x: hidden;
    overflow-y: auto !important;
    height: auto !important;
    background-image:
        radial-gradient(circle at 0% 0%, rgba(163, 230, 53, .28), transparent 42%),
        radial-gradient(circle at 100% 100%, rgba(101, 163, 13, .16), transparent 45%) !important;
    background-attachment: fixed !important;
}
body:has(.plan-wrap)::-webkit-scrollbar { width: 6px; }
body:has(.plan-wrap)::-webkit-scrollbar-track { background: #F7FEE7; }
body:has(.plan-wrap)::-webkit-scrollbar-thumb { background: #A3E635; border-radius: 10px; }

.plan-wrap {
    background: transparent;
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh; padding: 18px 14px 44px;
    max-width: 1180px; margin: 0 auto;
}

.plan-back-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 9px 16px; border-radius: 12px; font-size: 13px; font-weight: 700;
    color: var(--pl-deep); background: var(--pl-card); border: 1px solid var(--pl-border);
    text-decoration: none; transition: all .2s; margin-bottom: 16px;
    box-shadow: 0 4px 10px rgba(101, 163, 13, .08);
}
.plan-back-btn:hover {
    color: #fff; border-color: transparent;
    background: var(--pl-grad);
    transform: translateX(-2px);
    box-shadow: 0 8px 20px rgba(101, 163, 13, .25);
}

/* ===== Header ===== */
.plan-header { text-align: center; margin: 4px 0 28px; }
.plan-page-title {
    margin: 0 0 8px;
    font-size: clamp(26px, 5vw, 36px);
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--pl-text);
    line-height: 1.1;
}
.plan-header p {
    font-size: 13px; color: var(--pl-text-sec); margin: 0 auto;
    max-width: 480px; line-height: 1.55; font-weight: 500;
}

/* ===== Stats strip ===== */
.plan-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
    margin: 0 auto 20px; max-width: 540px;
}
.plan-stat {
    background: var(--pl-card); border: 1px solid var(--pl-border);
    border-radius: 16px; padding: 11px 8px;
    text-align: center;
    box-shadow: 0 4px 14px rgba(101, 163, 13, .08);
}
.plan-stat .lbl { font-size: 9.5px; color: var(--pl-text-sec); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.plan-stat .val {
    font-size: 16px; font-weight: 800; margin-top: 2px;
    background: linear-gradient(135deg, #4D7C0F, #65A30D);
    -webkit-background-clip: text; background-clip: text; color: transparent;
    letter-spacing: -.01em;
}

/* ===== Plan Grid — mobile: 1 card per row; tablet+: 2 per row ===== */
.plan-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 0 auto;
    max-width: 420px;
    align-items: stretch;
}

.plan-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    border: none;
    box-shadow: 0 8px 24px -10px rgba(20, 83, 45, .2);
    transition: transform .28s ease, box-shadow .28s ease;
}
.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 36px -12px rgba(20, 83, 45, .28);
}

/* Diagonal-cut header (lime gradient) */
.plan-card-head {
    position: relative;
    padding: 18px 16px 38px;
    background: var(--pl-grad);
    color: #fff;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), 0 100%);
}
.plan-card-pill {
    display: none;
}
.plan-card-name {
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    opacity: .95;
    margin-bottom: 8px;
}
.plan-card-price-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2px 6px;
    line-height: 1;
}
.plan-card-price-main {
    font-size: 30px;
    font-weight: 900;
    letter-spacing: -.03em;
    font-feature-settings: 'tnum';
    line-height: 1.05;
}
.plan-card-price-suffix {
    font-size: 13px;
    font-weight: 700;
    opacity: .88;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.plan-card-price-note {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-weight: 600;
    opacity: .85;
    line-height: 1.25;
}

.plan-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 4px 16px 18px;
    margin-top: -6px;
    background: #fff;
}

/* Data rows — lime dot + label / value (reference layout) */
.plan-features {
    list-style: none;
    margin: 0;
    padding: 10px 0 6px;
    flex: 1;
}
.plan-feature-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid #E8ECF0;
    list-style: none;
}
.plan-feature-row .plan-feature--pair {
    flex: 1;
    min-width: 0;
    padding: 0;
    border-bottom: none;
}
.plan-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid #E8ECF0;
}
.plan-features > .plan-feature:last-child,
.plan-features > .plan-feature-row:last-child {
    border-bottom: none;
}
.plan-feature-text--inline {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 6px;
}
.plan-feature-text--inline strong,
.plan-feature-text--inline em {
    display: inline;
}
.plan-feature-dot {
    flex-shrink: 0;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #D9F99D;
    border: 2px solid #ECFCCB;
    box-shadow: 0 0 0 1px #BBF7D0;
}
.plan-feature-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}
.plan-feature-text strong {
    font-size: 13px;
    font-weight: 800;
    color: var(--pl-text);
    line-height: 1.25;
}
.plan-feature-text em {
    font-style: normal;
    font-size: 13px;
    font-weight: 800;
    color: var(--pl-text-sec);
    letter-spacing: -.01em;
    line-height: 1.25;
}

.plan-card-actions {
    margin-top: auto;
    padding-top: 12px;
}

/* Referral commission grid (multiple levels) */
.plan-ref {
    margin: 0 0 14px;
    text-align: left;
}
.plan-ref-head {
    display: flex; align-items: center; gap: 7px;
    font-size: 11px; font-weight: 800;
    color: var(--pl-deep);
    text-transform: uppercase; letter-spacing: .10em;
    margin: 0 0 8px;
}
.plan-ref-head i {
    width: 22px; height: 22px; border-radius: 7px;
    background: linear-gradient(135deg, #ECFCCB, #D9F99D);
    color: var(--pl-deep);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 9px;
}
.plan-ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 8px;
}
.plan-ref-box {
    position: relative;
    background: #fff;
    border: 1.5px solid var(--pl-border);
    border-radius: 12px;
    padding: 10px 8px 8px;
    text-align: center;
    transition: all .2s;
}
.plan-ref-box::before {
    content: ''; position: absolute;
    top: 0; left: 50%; transform: translateX(-50%);
    width: 30px; height: 3px; border-radius: 0 0 999px 999px;
    background: #4D7C0F;
}
.plan-ref-box .lvl {
    font-size: 9.5px; font-weight: 800;
    color: var(--pl-text-sec);
    text-transform: uppercase; letter-spacing: .10em;
    margin-bottom: 2px;
}
.plan-ref-box .pct {
    font-size: 18px; font-weight: 900;
    color: #14532D;
    letter-spacing: -.02em;
    line-height: 1.1;
}
.plan-ref-empty {
    background: #fff;
    border: 1.5px dashed var(--pl-border);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    font-size: 11.5px; font-weight: 600;
    color: var(--pl-text-sec);
}

/* CTA row */
.plan-cta-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: center;
    margin-top: 6px;
}
.plan-roi {
    background: linear-gradient(135deg, rgba(34,197,94,.12), rgba(22,163,74,.12));
    border: 1px solid rgba(34,197,94,.25);
    border-radius: 12px; padding: 8px 12px;
    display: flex; flex-direction: column;
    color: #166534;
    text-align: left;
}
.plan-roi .lbl { font-size: 9.5px; font-weight: 800; letter-spacing: .10em; text-transform: uppercase; opacity: .85; }
.plan-roi .val { font-size: 13.5px; font-weight: 800; letter-spacing: -.01em; }
.plan-buy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 13px 20px;
    border: none;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .08em;
    background: var(--pl-grad);
    box-shadow: 0 8px 22px -8px rgba(20, 83, 45, .32);
    transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
    font-family: inherit;
}
.plan-buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px -8px rgba(20, 83, 45, .42);
    filter: brightness(1.05);
    color: #fff;
}

/* ===== Modal — simple compact bottom-sheet (mobile) / centered (desktop) ===== */
.plan-modal .modal-backdrop { background: rgba(20, 83, 45, .45); backdrop-filter: blur(4px); }
.plan-modal .modal-dialog {
    max-width: 460px; margin: 16px auto;
}
.plan-modal .modal-content {
    background: var(--pl-card) !important;
    border-radius: 22px !important;
    border: none !important;
    box-shadow: 0 30px 80px rgba(20, 83, 45, .28) !important;
    padding: 0 !important; overflow: hidden;
}
.plan-modal .modal-header { display: none; }

.pm-head {
    background: var(--pl-grad);
    color: #fff; padding: 18px 18px 16px;
    position: relative; overflow: hidden;
}
.pm-head::after {
    content: ''; position: absolute;
    top: -40px; right: -40px;
    width: 140px; height: 140px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.25), transparent 60%);
}
.pm-head-row {
    display: flex; align-items: center; gap: 12px;
    position: relative; z-index: 2;
}
.pm-head-icon {
    width: 42px; height: 42px; border-radius: 13px;
    background: rgba(255,255,255,.20); backdrop-filter: blur(8px);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
    border: 1px solid rgba(255,255,255,.25);
}
.pm-head-info { flex: 1; min-width: 0; }
.pm-head-info .lbl {
    font-size: 10px; font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; opacity: .85;
}
.pm-head-info h4 {
    margin: 0; font-size: 16px; font-weight: 800;
    letter-spacing: -.01em; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pm-close {
    width: 34px; height: 34px; border-radius: 11px;
    background: rgba(255,255,255,.20); color: #fff;
    border: 1px solid rgba(255,255,255,.25);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .2s; flex-shrink: 0;
    font-size: 13px; backdrop-filter: blur(8px);
    position: relative; z-index: 2;
}
.pm-close:hover { background: rgba(255,255,255,.32); transform: rotate(90deg); }

.pm-body { padding: 18px; }
.pm-body .form-group { margin-bottom: 14px; }
.pm-body label {
    display: block; font-size: 11px; font-weight: 800;
    color: var(--pl-deep); margin-bottom: 7px;
    letter-spacing: .06em; text-transform: uppercase;
}

.pm-body .form-control {
    width: 100%; padding: 13px 16px;
    border: 1.5px solid var(--pl-border);
    border-radius: 13px; font-size: 14px; font-family: inherit;
    color: var(--pl-text); background: var(--pl-bg); outline: none;
    box-sizing: border-box; transition: all .25s; font-weight: 600;
}
.pm-body .form-control:focus {
    border-color: var(--pl-primary); background: #fff;
    box-shadow: 0 0 0 4px rgba(101, 163, 13, .12);
}
.pm-body .input-group {
    display: flex; gap: 0;
    border: 1.5px solid var(--pl-border); border-radius: 13px;
    background: var(--pl-bg); transition: all .25s;
    overflow: hidden;
}
.pm-body .input-group:focus-within {
    border-color: var(--pl-primary); background: #fff;
    box-shadow: 0 0 0 4px rgba(101, 163, 13, .12);
}
.pm-body .input-group .form-control {
    border: none; background: transparent;
    border-radius: 0;
}
.pm-body .input-group .form-control:focus { box-shadow: none; }
.pm-body .input-group-text {
    background: var(--pl-grad) !important;
    color: #fff !important; border: none;
    padding: 12px 16px;
    font-size: 12px; font-weight: 800;
    display: flex; align-items: center;
    letter-spacing: .04em;
}

/* Range hint */
.pm-range-hint {
    margin-top: 6px; font-size: 11px; color: var(--pl-text-sec);
    font-weight: 600; display: flex; justify-content: space-between;
}
.pm-range-hint b { color: var(--pl-deep); font-weight: 800; }

/* Gateway tiles (large, centered) */
.gateway-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    padding: 6px 0 4px;
}
.gateway-tile {
    aspect-ratio: 1.25 / 1;
    min-height: 130px;
    border-radius: 22px;
    border: 2px solid var(--pl-border); background: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; padding: 14px 18px; transition: all .25s ease;
    position: relative;
    box-shadow: 0 6px 16px rgba(101, 163, 13, .08);
    width: 100%;
}
.gateway-tile img {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
.gateway-tile span {
    font-size: 13px; font-weight: 800; color: var(--pl-deep);
    text-align: center; line-height: 1.25;
    overflow: hidden; text-overflow: ellipsis;
    padding: 0 4px;
}
.gateway-tile:hover {
    transform: translateY(-3px);
    border-color: var(--pl-primary);
    box-shadow: 0 14px 28px rgba(101, 163, 13, .18);
}
.gateway-tile.active {
    box-shadow: 0 16px 32px rgba(101, 163, 13, .32);
    border-color: var(--pl-primary);
    background: linear-gradient(135deg, rgba(190,242,100,.35), rgba(163,230,53,.2));
    transform: translateY(-3px);
}
.gateway-tile.active::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free'; font-weight: 900;
    position: absolute; top: -8px; right: -8px;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--pl-grad); color: #fff;
    font-size: 12px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 14px rgba(101, 163, 13, .45);
    border: 2px solid #fff;
}
.gateway-tile:focus { outline: none; }

/* Reveal details only after gateway selection */
.pm-details { display: none; animation: pmFadeIn .3s ease; }
.pm-details.is-visible { display: block; }
@keyframes pmFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    .gateway-tiles { gap: 12px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
    .gateway-tile { min-height: 110px; padding: 12px 14px; border-radius: 20px; }
}

.pm-body select[name="wallet_type"] { display: none; }
#selectedWalletLogo { display: none !important; }

/* Total summary box */
.pm-total {
    background: linear-gradient(135deg, rgba(190,242,100,.25), rgba(163,230,53,.12));
    border: 1px solid #BBF7D0;
    border-radius: 13px; padding: 11px 14px;
    margin: 4px 0 14px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.pm-total .cell { display: flex; flex-direction: column; min-width: 0; }
.pm-total .cell .lbl {
    font-size: 9.5px; color: var(--pl-text-sec); font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase;
}
.pm-total .cell .val {
    font-size: 14px; font-weight: 800; color: var(--pl-deep);
    margin-top: 1px; letter-spacing: -.01em;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pm-total .cell.total .val {
    background: var(--pl-grad);
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* Rate hint */
.pm-rate {
    margin: 0 0 14px; padding: 9px 12px;
    background: linear-gradient(135deg, rgba(190,242,100,.22), rgba(163,230,53,.1));
    border: 1px solid #BBF7D0;
    border-radius: 11px; font-size: 11.5px; color: var(--pl-deep);
    font-weight: 700;
}

/* Footer buttons */
.pm-footer {
    display: flex; gap: 8px; align-items: center;
}
.pm-btn {
    padding: 13px 18px; border-radius: 13px; font-size: 14px;
    font-weight: 800; font-family: inherit; border: none; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    transition: all .25s;
    letter-spacing: .01em;
}
.pm-btn-cancel {
    background: var(--pl-bg); color: var(--pl-text-sec);
    border: 1px solid var(--pl-border);
    flex: 0 0 auto;
    padding: 13px 16px;
}
.pm-btn-cancel:hover { background: var(--pl-border); color: var(--pl-text); }
.pm-btn-submit {
    background: var(--pl-grad); color: #fff;
    box-shadow: 0 8px 22px rgba(101, 163, 13, .32);
    flex: 1;
}
.pm-btn-submit:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(101, 163, 13, .40); }
.pm-btn-login {
    background: var(--pl-grad); color: #fff;
    box-shadow: 0 8px 22px rgba(101, 163, 13, .32);
    width: 100%; text-decoration: none;
    padding: 14px;
}

.gateway-info.d-none { display: none !important; }

/* ===== Mobile — 1 plan per row, readable data list ===== */
@media (max-width: 767px) {
    .plan-wrap {
        padding: 14px 12px 40px;
    }
    .plan-grid {
        grid-template-columns: 1fr;
        gap: 14px;
        max-width: 100%;
        width: 100%;
    }
    .plan-card {
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
        width: 100%;
    }
    .plan-card:hover {
        transform: none;
    }
}

@media (max-width: 360px) {
    .plan-card-head { padding: 16px 14px 34px; }
    .plan-card-price-main { font-size: 26px; }
    .plan-feature-text strong,
    .plan-feature-text em { font-size: 12px; }
}

/* ===== Tablet / desktop — 2 plans per row ===== */
@media (min-width: 768px) {
    .plan-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
        max-width: 780px;
    }
    .plan-card { border-radius: 20px; }
    .plan-card-pill {
        display: block;
        position: absolute;
        top: 16px;
        right: 18px;
        width: 48px;
        height: 8px;
    }
    .plan-card-head {
        padding: 20px 20px 40px;
        clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), 0 100%);
    }
    .plan-card-name { font-size: 11px; margin-bottom: 8px; }
    .plan-card-price-main { font-size: 34px; }
    .plan-card-price-suffix { font-size: 13px; }
    .plan-card-price-note { font-size: 11px; margin-top: 6px; }
    .plan-card-body { padding: 6px 20px 22px; margin-top: -8px; }
    .plan-features { padding: 10px 0 6px; }
    .plan-feature { gap: 10px; padding: 10px 0; }
    .plan-feature-dot { width: 11px; height: 11px; }
    .plan-feature-text strong { font-size: 12px; }
    .plan-feature-text em { font-size: 12px; }
    .plan-card-actions { padding-top: 12px; }
    .plan-buy-btn {
        padding: 12px 20px;
        font-size: 12px;
    }
}

@media (min-width: 1024px) {
    .plan-wrap { padding: 22px 16px 50px; }
    .plan-grid { gap: 22px; max-width: 820px; }
    .plan-card-head { padding: 22px 22px 44px; }
    .plan-card-price-main { font-size: 38px; }
    .plan-card-body { padding: 8px 22px 24px; }
    .plan-feature-text strong,
    .plan-feature-text em { font-size: 13px; }
}

@media (max-width: 640px) {
    .plan-stats { gap: 6px; }
    .plan-stat .val { font-size: 14px; }
    .plan-stat .lbl { font-size: 9px; }
}

@media (max-width: 767px) {
    .pm-head { padding: 16px 14px 14px; }
    .pm-body { padding: 14px; }
    .pm-total { grid-template-columns: 1fr; gap: 6px; padding: 10px 12px; }
    .pm-head-info h4 { font-size: 15px; }
    .pm-head-icon { width: 38px; height: 38px; font-size: 14px; }
    .pm-btn { font-size: 13px; padding: 12px 14px; }
}

.plan-grid,
.plan-modal .modal-content {
    content-visibility: auto;
    contain-intrinsic-size: 1px 280px;
}

@media (min-width: 768px) {
    .plan-grid,
    .plan-modal .modal-content {
        contain-intrinsic-size: 1px 480px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .plan-card,
    .plan-stat-box,
    .plan-buy-btn,
    .gateway-tile {
        transition: none !important;
    }
    .pm-details { animation: none !important; }
}