*{
    box-sizing:border-box;
}

html{
    width:100%;
    min-height:100%;
    -webkit-text-size-adjust:100%;
}

body{
    margin:0;
    background:#f2f8ff;
    font-family:Arial, sans-serif;
    color:#101828;
    min-height:100vh;
    padding-bottom:100px;
}

a{
    text-decoration:none;
    color:inherit;
}

button{
    border:none;
    border-radius:12px;
    padding:14px 18px;
    background:#1677ee;
    color:white;
    font-weight:bold;
    font-size:16px;
    cursor:pointer;
}

button:active{
    transform:scale(0.98);
}

input{
    width:100%;
    padding:16px;
    border:1px solid #d0d5dd;
    border-radius:12px;
    margin-bottom:12px;
    font-size:15px;
    background:#f9fbff;
    color:#101828;
    outline:none;
}

input:focus{
    border-color:#1677ee;
    box-shadow:0 0 0 3px rgba(22,119,238,0.12);
}

input::placeholder{
    color:#98a2b3;
}

.app{
    width:100%;
    max-width:480px;
    margin:auto;
    padding:16px;
    padding-bottom:112px;
}

.topbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:18px;
    gap:12px;
}

.topbar h2{
    margin:0;
    line-height:1.1;
    font-size:24px;
}

.topbar span{
    font-size:26px;
    color:#667085;
}

.top-subtitle{
    display:block;
    margin-top:4px;
    font-size:12px;
    line-height:1.3;
    color:#667085;
}

.top-icon{
    width:42px;
    height:42px;
    border-radius:14px;
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
}

.back-link{
    width:42px;
    height:42px;
    border-radius:14px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#f8fbff;
    border:1px solid #d8e8ff;
    color:#1677ee;
    font-size:24px;
    font-weight:bold;
    box-shadow:0 6px 14px rgba(0,0,0,0.05);
    flex-shrink:0;
}

.page-title-center{
    flex:1;
    min-width:0;
}

.profile{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:16px;
}

.avatar{
    width:55px;
    height:55px;
    border-radius:50%;
    border:3px solid #1683ff;
    display:flex;
    align-items:center;
    justify-content:center;
    color:#1683ff;
    font-weight:bold;
    flex-shrink:0;
    background:#ffffff;
}

.profile p{
    margin:0;
    color:#667085;
    font-size:13px;
}

.profile h3{
    margin:4px 0 0;
    font-size:17px;
    line-height:1.25;
    word-break:break-word;
}

.profile-text p{
    margin-bottom:3px;
    font-size:13px;
}

.profile-text h3{
    font-size:18px;
}

.earned-card{
    background:#f8fbff;
    border:1px solid #d8e8ff;
    border-radius:24px;
    padding:20px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:14px;
    box-shadow:0 8px 20px rgba(0,0,0,0.06);
    margin-bottom:16px;
}

.earned-card p{
    margin:0;
    color:#667085;
    font-weight:bold;
}

.earned-card h1{
    margin:8px 0 0;
    font-size:38px;
    line-height:1;
    word-break:break-word;
}

.earned-card small{
    display:block;
    margin-top:8px;
    color:#667085;
    font-size:12px;
    line-height:1.35;
}

.balance-content{
    min-width:0;
}

.withdraw-link{
    flex-shrink:0;
}

.withdraw-link button{
    min-height:42px;
    padding:0 16px;
    border-radius:14px;
}

.energy-card{
    background:linear-gradient(135deg,#64b5ff,#0052d9);
    color:white;
    padding:22px;
    border-radius:26px;
    margin-bottom:16px;
    box-shadow:0 12px 25px rgba(0,82,217,0.28);
}

.energy-card p{
    margin:0;
    font-weight:bold;
}

.energy-card h1{
    font-size:44px;
    line-height:1;
    margin:14px 0;
    text-align:center;
    word-break:break-word;
}

.section-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    margin-bottom:14px;
}

.section-head p{
    margin-bottom:6px;
}

.section-head h1{
    margin:0;
    text-align:left;
}

.jar-badge{
    width:44px;
    height:44px;
    border-radius:16px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:22px;
    flex-shrink:0;
    background:rgba(255,255,255,0.18);
}

.energy-stats{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:10px;
}

.energy-stats div{
    background:rgba(255,255,255,0.18);
    padding:12px 9px;
    border-radius:14px;
    text-align:center;
    min-height:72px;
}

.energy-stats small{
    display:block;
    font-size:12px;
    line-height:1.25;
}

.energy-stats b{
    display:block;
    margin-top:6px;
    font-size:16px;
    line-height:1.2;
}

.banner{
    background:linear-gradient(135deg,#00264f,#0052d9);
    color:white;
    border-radius:22px;
    padding:22px;
    margin-bottom:16px;
}

.banner p{
    margin:0;
    line-height:1.45;
}

.banner h2{
    margin:8px 0;
    line-height:1.2;
    font-size:22px;
}

.banner span{
    color:#ffcc00;
}

.card{
    background:white;
    border-radius:20px;
    padding:18px;
    margin-bottom:16px;
    box-shadow:0 8px 18px rgba(0,0,0,0.07);
}

.card h2{
    margin-top:0;
    margin-bottom:12px;
    line-height:1.2;
    font-size:20px;
}

.card p{
    line-height:1.45;
}

.card-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    margin-bottom:12px;
}

.card-head h2{
    margin:0;
}

.card-head a{
    font-size:13px;
    font-weight:700;
    color:#1677ee;
}

.card-head button{
    min-height:38px;
    padding:0 13px;
    border-radius:13px;
    font-size:14px;
}

.page-app,
.home-app{
    width:100%;
    max-width:480px;
    margin:0 auto;
    padding:16px 16px 112px;
}

.page-topbar,
.home-topbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin-bottom:16px;
}

.compact-profile,
.home-profile{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:16px;
}

.deposit-main-card,
.withdraw-balance-card,
.referral-main-card,
.home-balance-card{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    margin-bottom:16px;
}

.deposit-title{
    font-size:30px;
}

.wallet-card,
.withdraw-form-card,
.referral-code-card,
.deposit-form-card,
.tier-card,
.deposit-info-card,
.withdraw-info-card,
.referral-info-card,
.home-mining-card,
.deposit-banner,
.home-banner{
    margin-bottom:16px;
}

.wallet-box{
    margin-top:8px;
    padding:13px;
    border-radius:14px;
    font-family:monospace;
    font-size:13px;
    line-height:1.45;
    word-break:break-all;
    background:#f5f9ff;
    border:1px solid #d8e8ff;
    color:#101828;
}

.deposit-note{
    margin-top:12px;
    padding:12px;
    border-radius:14px;
    background:#fff7e6;
    border:1px solid #ffd599;
    color:#9a5b00;
}

.deposit-note p{
    font-size:13px;
    line-height:1.45;
    margin:0 0 5px;
}

.deposit-note p:last-child{
    margin-bottom:0;
}

.deposit-info-card > p,
.withdraw-info-card > p,
.referral-info-card > p{
    margin-bottom:12px;
}

.deposit-stats,
.withdraw-stats,
.referral-stats{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:10px;
}

.deposit-stats div,
.withdraw-stats div,
.referral-stats div{
    min-height:72px;
    padding:11px 9px;
    border-radius:14px;
}

.deposit-stats small,
.withdraw-stats small,
.referral-stats small{
    display:block;
    margin-bottom:6px;
    font-size:11px;
    line-height:1.2;
}

.deposit-stats b,
.withdraw-stats b,
.referral-stats b{
    display:block;
    font-size:14px;
    line-height:1.25;
}

.input-label{
    display:block;
    font-size:13px;
    margin-bottom:6px;
    color:#667085;
    font-weight:bold;
}

.withdraw-form-card input,
.deposit-form-card input{
    width:100%;
    min-height:46px;
    margin-bottom:12px;
    border-radius:14px;
    padding:0 13px;
}

.full-btn{
    width:100%;
    min-height:46px;
    border-radius:14px;
    margin-top:2px;
}

.clean-list,
.mining-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.mini-badge{
    background:#eaf4ff;
    color:#1677ee;
    border-radius:999px;
    padding:7px 10px;
    font-size:12px;
    font-weight:bold;
    white-space:nowrap;
}

.tier-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.tier-row{
    display:grid;
    grid-template-columns:42px 1fr 70px;
    align-items:center;
    gap:12px;
    background:#f5f9ff;
    border:1px solid #d8e8ff;
    border-radius:16px;
    padding:13px;
}

.tier-no{
    width:36px;
    height:36px;
    border-radius:50%;
    background:#1677ee;
    color:white;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:bold;
}

.tier-info small{
    display:block;
    color:#667085;
    font-size:12px;
    margin-bottom:4px;
}

.tier-info b{
    display:block;
    color:#101828;
    font-size:15px;
}

.tier-rate{
    text-align:right;
    color:#1677ee;
    font-size:18px;
    font-weight:bold;
}

.history-item{
    padding:12px;
    background:#f5f9ff;
    border-radius:14px;
    margin-bottom:10px;
    line-height:1.45;
}

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

.history-item b{
    color:#101828;
}

.history-item small,
.history-item p{
    color:#667085;
}

/* AI mining agent package UI */

.package-card{
    background:linear-gradient(180deg,#ffffff,#f3f8ff);
    border:1px solid #d8e8ff;
    border-radius:24px;
    padding:18px;
    margin-bottom:18px;
    box-shadow:0 10px 22px rgba(0,82,217,0.10);
}

.package-head{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    margin-bottom:14px;
}

.package-title{
    font-size:18px;
    font-weight:bold;
}

.package-status{
    padding:7px 10px;
    border-radius:999px;
    background:#e7f8ef;
    color:#067647;
    font-size:12px;
    font-weight:bold;
    white-space:nowrap;
}

.package-status.expired{
    background:#fff1f0;
    color:#d92d20;
}

.jar-wrap{
    display:flex;
    gap:16px;
    align-items:center;
}

.jar{
    width:86px;
    height:145px;
    border:4px solid #1677ee;
    border-radius:18px 18px 26px 26px;
    position:relative;
    overflow:hidden;
    background:#ffffff;
    box-shadow:inset 0 0 18px rgba(22,119,238,0.15);
    flex-shrink:0;
}

.jar::before{
    content:"";
    position:absolute;
    top:-10px;
    left:18px;
    width:42px;
    height:16px;
    border:4px solid #1677ee;
    border-bottom:none;
    border-radius:12px 12px 0 0;
    background:#ffffff;
    z-index:3;
}

.jar-fill{
    position:absolute;
    bottom:0;
    left:0;
    width:100%;
    height:0%;
    background:linear-gradient(180deg,#7ed7ff,#1677ee);
    animation:jarWave 2.2s infinite ease-in-out;
    transition:height 0.8s ease;
}

.jar-fill::before{
    content:"";
    position:absolute;
    top:-8px;
    left:-20%;
    width:140%;
    height:18px;
    border-radius:50%;
    background:rgba(255,255,255,0.65);
    animation:waveMove 2.5s infinite linear;
}

@keyframes jarWave{
    0%,100%{ filter:brightness(1); }
    50%{ filter:brightness(1.15); }
}

@keyframes waveMove{
    0%{ transform:translateX(0); }
    100%{ transform:translateX(20%); }
}

.jar-empty{
    position:absolute;
    top:8px;
    left:0;
    right:0;
    text-align:center;
    font-size:20px;
    opacity:0.35;
    z-index:2;
}

.package-info{
    flex:1;
    min-width:0;
}

.package-info p{
    margin:6px 0;
    color:#344054;
    font-size:14px;
    line-height:1.35;
}

.package-info b{
    color:#101828;
}

.progress-bar{
    width:100%;
    height:13px;
    background:#e5efff;
    border-radius:999px;
    overflow:hidden;
    margin:14px 0 8px;
}

.progress-fill{
    height:100%;
    width:0%;
    border-radius:999px;
    background:linear-gradient(90deg,#64b5ff,#0052d9);
    transition:width 0.8s ease;
}

.loss-warning{
    background:#fff7e6;
    border:1px solid #ffd599;
    color:#9a5b00;
    padding:12px;
    border-radius:14px;
    font-size:13px;
    font-weight:bold;
    margin-top:12px;
    line-height:1.45;
}

.loss-warning.danger{
    background:#fff1f0;
    border-color:#ffb3b3;
    color:#b42318;
}

.package-footer{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    margin-top:12px;
}

.package-mini{
    background:#eef6ff;
    border-radius:14px;
    padding:12px;
    text-align:center;
}

.package-mini small{
    display:block;
    color:#667085;
    margin-bottom:4px;
}

.package-mini b{
    color:#1677ee;
}

/* Referral UI */

.level-row{
    display:grid;
    grid-template-columns:50px 1fr 80px;
    align-items:center;
    gap:8px;
    background:white;
    border-radius:16px;
    padding:14px;
    margin-bottom:12px;
    box-shadow:0 6px 15px rgba(0,0,0,0.06);
}

.level-row b{
    color:#1677ee;
}

.ref-hero{
    background:linear-gradient(135deg,#081f4d,#1677ee);
    color:white;
    border-radius:28px;
    padding:24px;
    margin-bottom:18px;
    box-shadow:0 14px 30px rgba(0,82,217,0.28);
}

.ref-hero p{
    margin:0 0 8px;
    font-weight:bold;
    color:#ffcc00;
}

.ref-hero h1{
    margin:0;
    font-size:34px;
    line-height:1;
    word-break:break-word;
}

.ref-hero span{
    display:block;
    margin-top:8px;
    color:#d9eaff;
    font-size:14px;
    line-height:1.45;
}

.ref-link-box{
    background:rgba(255,255,255,0.15);
    border:1px solid rgba(255,255,255,0.25);
    border-radius:18px;
    padding:12px;
    margin-top:18px;
}

.ref-link-box input{
    background:white;
    margin-bottom:10px;
}

.ref-link-box button{
    width:100%;
    background:#ffcc00;
    color:#101828;
}

.ref-stats-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:12px;
    margin-bottom:18px;
}

.ref-stat-card{
    background:white;
    border-radius:20px;
    padding:18px;
    box-shadow:0 8px 18px rgba(0,0,0,0.07);
}

.ref-stat-card.wide{
    grid-column:1 / 3;
    background:linear-gradient(135deg,#fff7e6,#ffffff);
    border:1px solid #ffd599;
}

.ref-stat-card small{
    display:block;
    color:#667085;
    margin-bottom:8px;
    font-weight:bold;
}

.ref-stat-card b{
    font-size:28px;
    color:#1677ee;
    word-break:break-word;
}

.muted{
    color:#667085;
    font-size:14px;
    margin-top:-8px;
}

.ref-level-card{
    background:linear-gradient(180deg,#ffffff,#f5f9ff);
    border:1px solid #e1edff;
    border-radius:18px;
    padding:14px;
    margin-bottom:12px;
    box-shadow:0 6px 15px rgba(0,0,0,0.05);
}

.ref-level-top{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    margin-bottom:10px;
}

.ref-level-badge{
    width:42px;
    height:42px;
    border-radius:50%;
    background:#1677ee;
    color:white;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:bold;
    flex-shrink:0;
}

.ref-level-rate{
    background:#eaf4ff;
    color:#1677ee;
    border-radius:999px;
    padding:7px 10px;
    font-size:12px;
    font-weight:bold;
    white-space:nowrap;
}

.ref-level-bar{
    height:10px;
    background:#e5efff;
    border-radius:999px;
    overflow:hidden;
    margin:8px 0;
}

.ref-level-fill{
    height:100%;
    width:0%;
    background:linear-gradient(90deg,#64b5ff,#0052d9);
    border-radius:999px;
    transition:width 0.8s ease;
}

.ref-level-meta{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:10px;
    margin-top:10px;
}

.ref-level-meta div{
    background:#eef6ff;
    border-radius:12px;
    padding:10px;
    text-align:center;
}

.ref-level-meta small{
    display:block;
    color:#667085;
    margin-bottom:4px;
}

.ref-level-meta b{
    color:#101828;
}

.team-card{
    display:flex;
    align-items:center;
    gap:12px;
    background:#f5f9ff;
    border-radius:16px;
    padding:14px;
    margin-bottom:10px;
}

.team-avatar{
    width:44px;
    height:44px;
    border-radius:50%;
    background:#1677ee;
    color:white;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:bold;
    flex-shrink:0;
}

.team-card p{
    margin:0;
    color:#667085;
    font-size:13px;
    line-height:1.4;
}

.team-card b{
    display:block;
    margin-bottom:4px;
}

.commission-card{
    background:#fffdf5;
    border:1px solid #ffe2a8;
    border-radius:16px;
    padding:14px;
    margin-bottom:10px;
}

.commission-card h3{
    margin:0 0 8px;
    color:#9a5b00;
    font-size:16px;
}

.commission-card p{
    margin:5px 0;
    color:#344054;
    font-size:14px;
    line-height:1.4;
}

/* Profile helpers */

.profile-info-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.profile-info-item{
    background:#f5f9ff;
    border:1px solid #d8e8ff;
    border-radius:14px;
    padding:12px;
}

.profile-info-item small{
    display:block;
    color:#667085;
    margin-bottom:4px;
    font-weight:bold;
}

.profile-info-item b{
    color:#101828;
    word-break:break-word;
}

.copy-input-row{
    display:grid;
    grid-template-columns:1fr auto;
    gap:10px;
    align-items:center;
}

.copy-input-row input{
    margin-bottom:0;
}

/* Bottom navigation */

.bottom-nav{
    position:fixed;
    left:50%;
    bottom:12px;
    transform:translateX(-50%);
    width:calc(100% - 24px);
    max-width:480px;
    margin:auto;
    background:white;
    display:grid;
    grid-template-columns:repeat(5,1fr);
    padding:8px 0;
    border:1px solid #e5e7eb;
    border-radius:22px;
    box-shadow:0 -8px 20px rgba(0,0,0,0.08);
    z-index:50;
}

.bottom-nav a{
    min-height:48px;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    line-height:1.25;
    text-align:center;
    color:#667085;
    font-size:12px;
    border-radius:16px;
}

.bottom-nav a.active{
    color:#1677ee;
    font-weight:bold;
}

/* Desktop preview comfort */

@media (min-width:520px){
    body{
        padding-top:12px;
    }
}

/* Small mobile */

@media (max-width:420px){
    .app,
    .page-app,
    .home-app{
        padding-left:14px;
        padding-right:14px;
    }

    .earned-card{
        padding:18px;
    }

    .earned-card h1{
        font-size:34px;
    }

    .energy-card{
        padding:20px;
    }

    .energy-card h1{
        font-size:40px;
    }

    .energy-stats{
        gap:8px;
    }

    .energy-stats div{
        padding:11px 7px;
    }

    .energy-stats b{
        font-size:15px;
    }

    .card{
        padding:16px;
    }

    .jar-wrap{
        gap:12px;
    }

    .jar{
        width:78px;
        height:132px;
    }

    .jar::before{
        left:16px;
        width:38px;
    }
}

@media (max-width:380px){
    .app,
    .page-app,
    .home-app{
        padding-left:12px;
        padding-right:12px;
    }

    .topbar{
        margin-bottom:16px;
    }

    .profile{
        margin-bottom:16px;
    }

    .earned-card{
        align-items:flex-start;
    }

    .earned-card h1,
    .deposit-main-card h1,
    .withdraw-balance-card h1,
    .referral-main-card h1,
    .home-balance-card h1{
        font-size:30px;
    }

    .deposit-stats,
    .withdraw-stats,
    .referral-stats,
    .energy-stats{
        gap:8px;
    }

    .deposit-stats div,
    .withdraw-stats div,
    .referral-stats div,
    .energy-stats div{
        padding:10px 7px;
    }

    .deposit-stats b,
    .withdraw-stats b,
    .referral-stats b,
    .energy-stats b{
        font-size:13px;
    }

    .tier-row{
        grid-template-columns:38px 1fr 64px;
        gap:9px;
        padding:12px;
    }

    .tier-no{
        width:34px;
        height:34px;
    }

    .tier-rate{
        font-size:16px;
    }

    .package-head{
        align-items:flex-start;
    }

    .jar-wrap{
        align-items:flex-start;
    }

    .package-footer,
    .ref-level-meta,
    .ref-stats-grid{
        grid-template-columns:1fr;
    }

    .ref-stat-card.wide{
        grid-column:auto;
    }

    .level-row{
        grid-template-columns:44px 1fr;
    }

    .level-row > :last-child{
        grid-column:1 / 3;
    }

    .copy-input-row{
        grid-template-columns:1fr;
    }

    .bottom-nav{
        width:calc(100% - 16px);
        bottom:8px;
    }
}


/* =========================
   Home Dashboard Balance Polish
   ========================= */

.home-wallet-card{
    position:relative;
    overflow:hidden;
    background:linear-gradient(180deg,#ffffff,#f5f9ff);
    border:1px solid #cfe4ff;
    align-items:stretch;
}

.home-wallet-card::before{
    content:"";
    position:absolute;
    width:150px;
    height:150px;
    right:-70px;
    top:-70px;
    border-radius:50%;
    background:rgba(22,119,238,0.10);
}

.home-wallet-card::after{
    content:"";
    position:absolute;
    width:96px;
    height:96px;
    left:-45px;
    bottom:-45px;
    border-radius:50%;
    background:rgba(255,204,0,0.16);
}

.home-wallet-card .balance-content{
    position:relative;
    z-index:2;
    flex:1;
}

.balance-label-row{
    display:flex;
    align-items:center;
    gap:8px;
    flex-wrap:wrap;
}

.balance-label-row p{
    margin:0;
}

.balance-pill{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:24px;
    padding:4px 9px;
    border-radius:999px;
    background:#eaf4ff;
    color:#1677ee;
    font-size:11px;
    font-weight:800;
    letter-spacing:0.3px;
}

.home-wallet-card h1{
    font-size:42px;
    margin:10px 0 0;
    letter-spacing:-1px;
}

.balance-meta-row{
    display:flex;
    align-items:center;
    gap:8px;
    margin-top:8px;
}

.balance-meta-row small{
    margin:0;
}

.balance-spark{
    width:24px;
    height:24px;
    border-radius:50%;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:#fff7e6;
    color:#9a5b00;
    font-size:13px;
    flex-shrink:0;
}

.deposit-home-link{
    position:relative;
    z-index:2;
    display:flex;
    align-items:center;
}

.deposit-home-link button{
    min-width:94px;
    min-height:46px;
    border-radius:16px;
    box-shadow:0 8px 18px rgba(22,119,238,0.22);
}

@media (max-width:420px){
    .home-wallet-card{
        padding:18px;
    }

    .home-wallet-card h1{
        font-size:36px;
    }

    .deposit-home-link button{
        min-width:86px;
        padding:0 14px;
    }
}

@media (max-width:360px){
    .home-wallet-card{
        flex-direction:column;
        align-items:flex-start;
    }

    .deposit-home-link{
        width:100%;
    }

    .deposit-home-link button{
        width:100%;
    }
}


/* =========================
   Frontend polish + mobile fixes
   Safe overrides only: no API/backend flow changes
   ========================= */

:root{
    --nav-height: 76px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body{
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 28px);
    overflow-x:hidden;
}

.app,
.page-app,
.home-app{
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 36px);
}

.card,
.earned-card,
.energy-card,
.banner,
.package-card{
    transform: translateZ(0);
}

.bottom-nav{
    grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
    bottom: calc(8px + var(--safe-bottom));
    padding: 7px 5px;
    min-height: var(--nav-height);
}

.bottom-nav a{
    min-width:0;
    font-size:11px;
    gap:2px;
}

.bottom-nav a.active{
    background:#eaf4ff;
}

/* Home: make packages/agents less bulky and keep deposit as the main action */
.home-profile{
    margin-bottom:12px;
}

.home-wallet-card{
    margin-bottom:14px;
}

.home-wallet-card .deposit-home-link button{
    background:linear-gradient(135deg,#12b76a,#1677ee);
    min-width:104px;
}

.home-mining-card{
    padding:18px;
    border-radius:24px;
}

.home-mining-card h1{
    font-size:34px;
}

.home-banner{
    padding:16px;
    border-radius:20px;
}

.home-banner h2{
    font-size:19px;
    margin:6px 0;
}

.home-app .mining-card{
    padding:15px;
}

.home-app .package-card{
    padding:13px;
    border-radius:18px;
    margin-bottom:10px;
}

.home-app .package-head{
    margin-bottom:10px;
}

.home-app .package-title{
    font-size:15px;
}

.home-app .jar-wrap{
    gap:10px;
}

.home-app .jar{
    width:54px;
    height:86px;
    border-width:3px;
    border-radius:14px 14px 18px 18px;
}

.home-app .jar::before{
    left:12px;
    width:25px;
    height:11px;
    border-width:3px;
}

.home-app .jar-empty{
    font-size:15px;
}

.home-app .package-info p{
    margin:3px 0;
    font-size:12px;
}

.home-app .progress-bar{
    height:9px;
    margin:10px 0 7px;
}

.home-app .package-footer{
    gap:7px;
    margin-top:8px;
}

.home-app .package-mini{
    padding:8px;
    border-radius:12px;
}

.home-app .loss-warning{
    padding:9px;
    border-radius:12px;
    font-size:12px;
    margin-top:8px;
}

/* Deposit: keep CTA usable when keyboard opens */
.deposit-page-space{
    padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 58px);
}

.deposit-amount-row input{
    -webkit-user-select:text;
    user-select:text;
}

body.keyboard-open{
    padding-bottom: calc(180px + var(--safe-bottom));
}

body.keyboard-open .deposit-page-space{
    padding-bottom: calc(240px + var(--safe-bottom));
}

body.keyboard-open .bottom-nav{
    transform:translate(-50%, 120%);
}

.keyboard-deposit-bar{
    max-width:456px;
    margin:0 auto;
}

@media (max-width:420px){
    .topbar h2{ font-size:22px; }
    .earned-card h1{ font-size:32px; }
    .home-wallet-card h1{ font-size:34px; }
    .energy-card h1{ font-size:34px; }
    .energy-stats div{ min-height:64px; }
    .bottom-nav{ width:calc(100% - 14px); }
}

@media (max-width:360px){
    .bottom-nav a{ font-size:10.5px; }
    .home-wallet-card h1{ font-size:30px; }
    .home-app .jar{ width:48px; height:78px; }
}


/* Home: Active Agent balance card polish */
.agent-balance-card{
    position:relative;
    overflow:hidden;
    text-align:center;
    padding:24px 18px;
    border-radius:28px;
    background:linear-gradient(135deg,#1167f1,#004bd6);
}

.agent-balance-card::before{
    content:"";
    position:absolute;
    inset:-60px auto auto -40px;
    width:160px;
    height:160px;
    border-radius:999px;
    background:rgba(255,255,255,0.12);
}

.agent-balance-icon{
    width:54px;
    height:54px;
    border-radius:20px;
    margin:0 auto 12px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:26px;
    background:rgba(255,255,255,0.18);
    box-shadow:inset 0 1px 0 rgba(255,255,255,0.22);
}

.agent-balance-card p{
    font-size:17px;
    letter-spacing:.2px;
    opacity:.95;
}

.agent-balance-card h1{
    font-size:48px;
    line-height:1;
    margin:10px 0 8px;
    text-align:center;
}

.agent-balance-card span{
    display:block;
    color:rgba(255,255,255,0.82);
    font-size:14px;
    font-weight:700;
}

.agent-activate-link{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:44px;
    margin-top:16px;
    padding:0 20px;
    border-radius:999px;
    background:rgba(255,255,255,0.95);
    color:#075fe4;
    font-size:14px;
    font-weight:900;
    text-decoration:none;
    box-shadow:0 10px 22px rgba(0,0,0,0.12);
}

.agent-banner{
    background:linear-gradient(135deg,#021f54,#0054d8);
}

.agent-banner h2{
    max-width:560px;
}

@media(max-width:420px){
    .agent-balance-card{
        padding:22px 16px;
    }
    .agent-balance-card h1{
        font-size:44px;
    }
    .agent-activate-link{
        width:100%;
    }
}
