  :root{
    --bg: #e6e9f3;
    --card: #ffffff;
    --primary: #5470f5;
    --primary-dark: #3a52d6;
    --primary-light: #8b9dfb;
    --text: #191f30;
    --text-muted: #4a5168;
    --green: #17a862;
    --green-bg: #e3f8ed;
    --purple-bg: #ede9fc;
    --purple: #7157e5;
    --blue-bg: #e9edfd;
    --orange-bg: #fdefe1;
    --orange: #dd8a2e;
    --border: #ebeef5;
    --shadow-sm: 0 1px 2px rgba(23, 30, 60, 0.04), 0 1px 1px rgba(23, 30, 60, 0.03);
    --shadow-md: 0 10px 24px -12px rgba(23, 30, 60, 0.14);
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 12px;
  }

  /* Dark theme — toggled via document.documentElement[data-theme] from
     script.js's applyTheme() (Menu → Theme → Light/Dark/System). Same
     variable names as :root above, so any rule already written with
     var(--card)/var(--text)/etc. picks this up automatically with no
     further change. Hardcoded colors (not using these variables) are
     patched individually elsewhere in this file as they're found. */
  [data-theme="dark"]{
    --bg: #0f1420;
    --card: #1a2035;
    --primary: #6b85ff;
    --primary-dark: #4a5fd9;
    --primary-light: #8b9dfb;
    --text: #eef1fa;
    --text-muted: #c3c9de;
    --green: #22c37a;
    --green-bg: #15301f;
    --purple-bg: #241f42;
    --purple: #9a8cf0;
    --blue-bg: #1c2440;
    --orange-bg: #3a2a16;
    --orange: #f0a552;
    --border: #2a3150;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25), 0 1px 1px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 10px 24px -12px rgba(0, 0, 0, 0.5);
  }

  /* Dark-mode-only fixes: these selectors use hardcoded (light-theme)
     hex colors in their base rule below, so they never switched with
     var(--card)/var(--*-bg). Overriding them here only for
     [data-theme="dark"] keeps the light theme pixel-identical. */
  [data-theme="dark"] .stat-icon.green{ background: linear-gradient(150deg, #1c4a30, var(--green-bg)); }
  [data-theme="dark"] .stat-icon.purple{ background: linear-gradient(150deg, #362c5e, var(--purple-bg)); }
  [data-theme="dark"] .stat-icon.blue{ background: linear-gradient(150deg, #26305c, var(--blue-bg)); }
  [data-theme="dark"] .stat-icon.orange{ background: linear-gradient(150deg, #4a3620, var(--orange-bg)); }
  [data-theme="dark"] .stat-icon.yellow{ background: linear-gradient(150deg, #4d3f12, #33290d); }
  [data-theme="dark"] .task-reward-pill.tone-purple,
  [data-theme="dark"] .task-reward-pill.tone-blue,
  [data-theme="dark"] .progress-meta .pm-value.accent,
  [data-theme="dark"] .ref-list-item .rearn,
  [data-theme="dark"] .top3-amount,
  [data-theme="dark"] .lb-row .lr-amount{ color: var(--text); }
  [data-theme="dark"] .bottom-nav{ background: rgba(26,32,53,0.92); }
  [data-theme="dark"] .mem-instruction-box{ background: color-mix(in srgb, #E2136E 14%, var(--card)); border-color: color-mix(in srgb, #E2136E 30%, var(--card)); }
  [data-theme="dark"] .input-wrap.bkash-input{ background: color-mix(in srgb, #E2136E 14%, var(--card)); }
  [data-theme="dark"] .deposit-timer{ background: color-mix(in srgb, #E2136E 14%, var(--card)); border-color: color-mix(in srgb, #E2136E 30%, var(--card)); color: #ff8fc0; }
  [data-theme="dark"] .plan-pro{ --plan-accent: #4d7cff; --plan-accent-shadow: rgba(77,124,255,0.4); }
  [data-theme="dark"] .plan-premium{ --plan-accent: #8b96ff; --plan-accent-shadow: rgba(139,150,255,0.4); }

  *{ box-sizing:border-box; margin:0; padding:0; -webkit-tap-highlight-color: transparent; }

  html{
    background: var(--bg);
    height: 100%;
  }

  body{
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100%;
    overscroll-behavior-y: none;
  }

  /* Bangla mode (html[lang="bn"] is set by applyLanguage() in script.js):
     use Hind Siliguri for all text, including buttons/inputs which don't
     inherit the body font by default. English mode is untouched. */
  html[lang="bn"] body,
  html[lang="bn"] button,
  html[lang="bn"] input,
  html[lang="bn"] textarea{
    font-family: "Hind Siliguri", "Noto Sans Bengali", "Kalpurush", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  }

  .app-loader{
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    transition: opacity .4s ease, visibility .4s ease;
  }
  .app-loader.hide{
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  .loader-dots{ display: flex; gap: 8px; margin-top: 4px; }
  .loader-dots span{ width: 12px; height: 12px; border-radius: 50%; background: var(--primary); animation: loader-bounce 0.9s infinite cubic-bezier(0.45, 0, 0.55, 1); }
  .loader-dots span:nth-child(2){ animation-delay: .15s; }
  .loader-dots span:nth-child(3){ animation-delay: .3s; }
  @keyframes loader-bounce{ 0%,80%,100%{ transform: translateY(0) scale(1); opacity:0.7; } 40%{ transform: translateY(-10px) scale(1.08); opacity:1; } }

  .maintenance-screen{
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
    background: var(--bg);
  }
  .maintenance-icon{
    width: 72px; height: 72px;
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
    border-radius: 50%;
    background: var(--blue-bg);
    margin-bottom: 20px;
  }
  .maintenance-title{
    font-size: 18px; font-weight: 800;
    color: var(--text);
    margin: 0 0 8px;
  }
  .maintenance-text{
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 280px;
    margin: 0;
  }

  /* ---------- Hide scrollbars app-wide (scrolling still works) ---------- */
  *{
    scrollbar-width: none;      /* Firefox */
    -ms-overflow-style: none;   /* IE / old Edge */
  }
  *::-webkit-scrollbar{
    display: none;              /* Chrome, Safari, new Edge */
    width: 0; height: 0;
  }

  #app{
    max-width: 460px;
    margin: 0 auto;
    min-height: 100vh;
    background:
      radial-gradient(80% 30% at 50% 0%, rgba(84,112,245,0.06), transparent 70%),
      var(--bg);
    display: flex;
    flex-direction: column;
    position: relative;
  }

  /* ---------- Top block (header + balance + actions) ---------- */
  .fixed-top{
    position: relative;
  }

  /* ---------- Header ---------- */
  .topbar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding: 16px 18px 38px;
    background: linear-gradient(160deg, #232c48 0%, #171e33 60%, #12172a 100%);
    border-radius: 0 0 26px 26px;
    box-shadow: 0 14px 26px -18px rgba(15,20,40,0.5);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    position: relative;
  }
  .topbar-actions{ display:flex; align-items:center; gap:9px; flex-shrink:0; }
  .icon-btn{
    position: relative;
    width: 40px; height:40px;
    border-radius: 50%;
    border:none;
    background: var(--card);
    color: var(--text);
    font-size: 16px;
    display:flex; align-items:center; justify-content:center;
    box-shadow: var(--shadow-sm);
    cursor:pointer;
    flex-shrink:0;
  }
  .icon-btn:active{ transform: scale(0.94); }
  .icon-btn.on-dark{
    background: rgba(255,255,255,0.14);
    color:#fff;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18), 0 2px 6px rgba(0,0,0,0.15);
    -webkit-backdrop-filter: blur(14px) saturate(150%);
    backdrop-filter: blur(14px) saturate(150%);
    transition: transform 0.15s ease, background 0.15s ease;
  }
  .icon-btn.on-dark:active{
    background: rgba(255,255,255,0.24);
  }
  .icon-btn.on-dark .notif-dot{ border-color:#1c2340; }
  .notif-dot{
    position:absolute;
    top: 8px; right: 9px;
    width: 7px; height:7px;
    border-radius:50%;
    background: #ef4444;
    border: 1.5px solid #fff;
  }


  .page-header{ padding: 6px 20px 16px; }
  .page-header h1{ font-size: 27px; font-weight: 800; letter-spacing: -0.5px; }
  .page-header p{ color: var(--text-muted); font-size: 14px; margin-top: 4px; }
  .page-header.with-gift{ display:flex; align-items:flex-start; justify-content:space-between; }
  .gift-emoji{ font-size: 36px; filter: drop-shadow(0 6px 10px rgba(221,138,46,0.25)); }

  /* ---------- Views ---------- */
  .view-viewport{ position: relative; overflow-x: hidden; }
  .view{ display:none; padding-bottom: 92px; }
  .view.active{ display:block; }

  @keyframes revealUp{
    from{ opacity:0; transform: translateY(18px); }
    to{ opacity:1; transform: none; }
  }
  .reveal-item{
    opacity:0;
    animation: revealUp 0.45s cubic-bezier(.22,.85,.32,1) forwards;
  }
  @keyframes revealSlide{
    from{ transform: translateY(-18px); }
    to{ transform: none; }
  }
  .topbar.reveal-item{
    opacity:1;
    animation: revealSlide 0.45s cubic-bezier(.22,.85,.32,1) forwards;
  }
  .page-reveal{
    opacity:0;
    animation: revealUp 0.45s cubic-bezier(.22,.85,.32,1) forwards;
  }

  /* ---------- Balance card ---------- */
  .balance-card{
    margin: -18px 18px 20px;
    padding: 24px 24px 40px;
    border-radius: var(--radius-lg);
    background: linear-gradient(120deg, #050c3d 0%, #0a1a70 20%, #123fce 55%, #1d8bf7 100%);
    color: #fff;
    position: relative;
    z-index: 1;
    overflow: hidden;
    box-shadow:
      0 26px 44px -14px rgba(24, 30, 60, 0.45),
      0 8px 18px -6px rgba(74, 95, 240, 0.4);
  }
  .balance-card::after{
    content:"";
    position:absolute;
    top:0; left:0; right:0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
  }
  .balance-card::before{
    content:"";
    position:absolute;
    top:0; left:-60%;
    width:50%; height:100%;
    background: linear-gradient(100deg, transparent, rgba(255,255,255,0.16), transparent);
    transform: skewX(-20deg);
    animation: balanceShimmer 3.2s ease-in-out infinite;
    z-index: 1;
  }
  .balance-card-logo{
    position: absolute;
    bottom: 14px;
    right: 18px;
    height: 22px;
    width: auto;
    opacity: 0.95;
    z-index: 2;
    pointer-events: none;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.35));
  }
  @keyframes balanceShimmer{
    0%{ transform: translateX(0) skewX(-20deg); }
    45%{ transform: translateX(380%) skewX(-20deg); }
    100%{ transform: translateX(380%) skewX(-20deg); }
  }
  .balance-label{
    display:flex; align-items:center; gap:6px;
    font-size: 13.5px;
    opacity: 0.82;
    font-weight: 500;
    letter-spacing: 0.1px;
    position: relative;
    z-index: 2;
  }
  .balance-label .eye-icon{ width:14px; height:14px; opacity:0.9; }
  .balance-amount{
    margin-top: 16px;
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.6px;
    position: relative;
    z-index: 2;
  }
  .balance-amount span{
    font-size: 15px;
    font-weight: 700;
    opacity: 0.78;
    margin-left: 2px;
    letter-spacing: 0.2px;
  }
  .balance-usd{ margin-top: 5px; font-size: 13px; color:#aebbf5; position: relative; z-index: 2; }
  /* Bangla mode: Hind Siliguri has tall default line metrics, which stretched
     the balance card. Pin the line heights so the card stays the same size. */
  html[lang="bn"] .balance-label,
  html[lang="bn"] .balance-amount,
  html[lang="bn"] .balance-usd{ line-height: 1.2; }
  html[lang="bn"] .balance-label{ font-size: 15.5px; }
  .balance-sparkle{
    position:absolute;
    top:-16px; right:-10px;
    width:150px; height:150px;
    pointer-events: none;
    z-index: 1;
  }
  .balance-sparkle .ring{
    position:absolute;
    top:50%; left:50%;
    transform:translate(-50%,-50%);
    border:1px solid rgba(255,255,255,0.12);
    border-radius:50%;
  }
  .balance-sparkle .ring2{ width:100px; height:100px; }
  .balance-sparkle .star-main{
    position:absolute;
    top:50%; left:50%;
    transform:translate(-50%,-50%);
    width:65px; height:65px;
    filter: drop-shadow(0 0 12px rgba(80,140,255,0.6));
  }
  .balance-sparkle .dot{ position:absolute; }

  /* ---------- Action buttons ---------- */
  .actions-row{ display:flex; gap: 12px; margin: 0 18px 28px; }
  .btn{
    flex:1;
    display:flex; align-items:center; justify-content:center; gap:8px;
    height: 52px;
    border-radius: var(--radius-md);
    font-size: 15.5px;
    font-weight: 700;
    border: none;
    cursor:pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
  }
  .btn:active{ transform: scale(0.97); }
  .btn-send{
    background: linear-gradient(135deg, #1c3a8f 0%, #1e88e5 100%);
    color:#fff;
    box-shadow: 0 12px 22px -10px rgba(30, 136, 229, 0.55);
  }
  .btn-withdraw{
    background: #fff;
    color: #1c3a8f;
    border: 1px solid #cfdcf5;
    box-shadow: var(--shadow-sm);
  }

  /* ---------- Overview ---------- */
  .section-row{ display:flex; align-items:center; justify-content:space-between; margin: 0 18px 14px; }
  .section-row h2{ font-size: 18.5px; font-weight: 800; letter-spacing: -0.2px; }
  .view-all{
    font-size: 13.5px; font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display:flex; align-items:center; gap:2px;
  }

  .stat-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0 18px; }
  .stat-card{
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 12px;
    display:flex; flex-direction:row; align-items:center; gap: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  .stat-text{ display:flex; flex-direction:column; gap: 3px; }
  .stat-icon{
    width: 34px; height:34px;
    border-radius: 11px;
    display:flex; align-items:center; justify-content:center;
    font-size: 15px;
    font-weight: 700;
    flex-shrink: 0;
  }
  .stat-icon.green{ background: linear-gradient(150deg, #d5f5e3, var(--green-bg)); color: var(--green); }
  .stat-icon.purple{ background: linear-gradient(150deg, #e2dcfb, var(--purple-bg)); color: var(--purple); }
  .stat-icon.blue{ background: linear-gradient(150deg, #dde5fc, var(--blue-bg)); color: var(--primary); }
  .stat-icon.orange{ background: linear-gradient(150deg, #fce3cc, var(--orange-bg)); color: var(--orange); }
  .stat-icon.yellow{ background: linear-gradient(150deg, #fff1b8, #fff8dc); color: #f5b301; }
  .stat-label{ font-size: 12px; color: var(--text-muted); font-weight: 500; }
  .stat-value{ font-size: 17px; font-weight: 800; letter-spacing: -0.3px; }
  .stat-value small{ font-size: 11px; font-weight: 600; color: var(--text-muted); margin-left:2px; }

  /* ---------- Tasks ---------- */
  .task-list{ padding: 0 18px; display:flex; flex-direction:column; gap: 9px; }
  .task-tabs{ display:grid; grid-template-columns: 1fr 1fr; gap:8px; margin: 0 18px 16px; }
  .task-tab{
    padding: 10px 0; border-radius: 12px; border:1px solid var(--border);
    background: var(--card); font-size:13.5px; font-weight:700; color: var(--text-muted);
    cursor:pointer; text-align:center; display:flex; align-items:center; justify-content:center; gap:6px;
  }
  .task-tab.active{ background: linear-gradient(135deg, #1e88e5, #1c3a8f); color:#fff; border-color: #1c3a8f; }
  .task-tab .tt-count{
    font-size:10.5px; font-weight:800; padding: 1px 7px; border-radius: 8px;
    background: rgba(255,255,255,0.25);
  }
  .task-tab:not(.active) .tt-count{ background: var(--blue-bg); color: var(--primary); }
  .task-card{
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    display:flex; flex-direction:column; gap: 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform 0.12s ease;
  }
  .task-card[onclick]{ cursor:pointer; }
  .task-card[onclick]:active{ transform: scale(0.98); }
  .task-top{ display:flex; align-items:center; gap: 12px; }
  .task-icon{
    width: 40px; height:40px;
    border-radius: 50%;
    display:flex; align-items:center; justify-content:center;
    font-size: 17px;
    flex-shrink:0;
    box-shadow: 0 6px 14px -8px rgba(23,30,60,0.35);
  }
  .task-icon.channel{ background: linear-gradient(135deg, #1e88e5, #1c3a8f); }
  .task-icon.tone-orange{ background: linear-gradient(135deg, var(--primary-light), var(--primary)); }
  .task-icon.tone-purple{ background: linear-gradient(135deg, #1c3a8f, #131b3d); }
  .task-icon.tone-blue{ background: linear-gradient(135deg, #1e88e5, #1c3a8f); }
  .task-body{ flex:1; min-width:0; }
  .task-title{ font-size: 13.5px; font-weight: 800; letter-spacing: -0.1px; }
  .task-right{ display:flex; flex-direction:column; align-items:flex-end; gap: 6px; flex-shrink:0; }
  .task-reward-pill{
    font-size: 11px; font-weight: 800;
    padding: 4px 10px; border-radius: 20px;
    display:inline-flex; align-items:center; gap:3px;
    width: fit-content;
  }
  .task-reward-pill.tone-orange{ color: var(--primary-dark); background: var(--blue-bg); }
  .task-reward-pill.tone-purple{ color: #1c3a8f; background: var(--blue-bg); }
  .task-reward-pill.tone-blue{ color: #1c3a8f; background: var(--blue-bg); }
  .task-action-btn{
    padding: 8px 22px;
    border-radius: 20px;
    border: none;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: #fff;
    font-size: 12.5px; font-weight: 800;
    cursor: pointer;
    box-shadow: 0 6px 14px -6px rgba(84,112,245,0.55);
    transition: transform 0.12s ease;
  }
  .task-action-btn:active{ transform: scale(0.94); }
  .task-action-btn.loading{ opacity:0.6; pointer-events:none; }
  .done-check{
    width: 26px; height:26px; border-radius: 50%;
    background: var(--green-bg); color: var(--green);
    display:flex; align-items:center; justify-content:center;
    font-size: 13px; font-weight: 800;
  }
  .task-progress-row{ display:flex; align-items:center; gap: 9px; padding-left: 52px; }
  .task-progress-track{ flex:1; height: 5px; border-radius: 5px; background: var(--border); overflow:hidden; }
  .task-progress-fill{ height:100%; border-radius:5px; }
  .task-progress-fill.tone-orange{ background: linear-gradient(90deg, var(--primary-light), var(--primary)); }
  .task-progress-fill.tone-purple{ background: linear-gradient(90deg, #1c3a8f, #131b3d); }
  .task-progress-fill.tone-blue{ background: linear-gradient(90deg, #1e88e5, #1c3a8f); }
  .task-progress-count{ font-size: 10px; font-weight: 700; color: var(--text-muted); flex-shrink:0; }


  /* ---------- Profile hero card ---------- */
  .profile-hero{
    margin: 6px 18px 18px;
    padding: 16px 20px 16px;
    border-radius: var(--radius-lg);
    background:
      radial-gradient(120% 90% at 100% 0%, rgba(255,255,255,0.22), transparent 55%),
      linear-gradient(150deg, #131b3d 0%, #1c3a8f 55%, #1e88e5 100%);
    box-shadow:
      0 26px 44px -14px rgba(24, 30, 60, 0.45),
      0 8px 18px -6px rgba(74, 95, 240, 0.4);
    display:flex;
    flex-direction:column;
    align-items:center;
    text-align:center;
    position:relative;
  }
  .profile-tier-badge{
    position:absolute;
    top:12px; left:14px;
    padding:3px 10px;
    border-radius:999px;
    font-size:11px;
    font-weight:700;
    letter-spacing:0.3px;
    color:#fff;
    background:rgba(255,255,255,0.18);
    border:1px solid rgba(255,255,255,0.3);
    backdrop-filter:blur(2px);
  }
  .profile-tier-badge.tier-basic{ background:rgba(255,255,255,0.18); border-color:rgba(255,255,255,0.3); }
  .profile-tier-badge.tier-pro{ background:linear-gradient(135deg,#a855f7,#7c3aed); border-color:rgba(255,255,255,0.4); box-shadow:0 2px 8px rgba(124,58,237,0.5); }
  .profile-tier-badge.tier-premium{ background:linear-gradient(135deg,#ffb347,#ff7a18); border-color:rgba(255,255,255,0.4); }
  .profile-hero-avatar{
    position:relative;
    width: 68px; height:68px;
    border-radius:50%;
    background:#fff;
    display:flex; align-items:center; justify-content:center;
    font-size: 30px;
    margin-bottom: 9px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.15);
  }
  .profile-hero-avatar img{ width:100%; height:100%; border-radius:50%; object-fit:cover; }
  .avatar-ring{
    position:absolute; inset:-4px;
    border-radius:50%;
    border:3px solid transparent;
    pointer-events:none;
  }
  .profile-hero-avatar.avatar-tier-basic .avatar-ring{ border-color:#3d8bff; }
  .profile-hero-avatar.avatar-tier-pro .avatar-ring{ border-color:#a855f7; }
  .profile-hero-avatar.avatar-tier-premium .avatar-ring{ border-color:#f2b90c; }
  .profile-hero-name{ color:#fff; font-size:19px; font-weight:800; position:relative; display:inline-block; }
  .verified-badge{ display:inline-flex; vertical-align:middle; margin-left:5px; }
  .profile-hero-name .verified-badge{
    position:absolute; top:50%; left:100%; transform:translateY(-50%); margin-left:5px;
  }
  .profile-hero-id{ color: rgba(255,255,255,0.85); font-size: 13px; margin-top: 3px; font-weight:500; }
  .profile-level-box{ width:100%; margin-top:10px; }
  .profile-level-row{ display:flex; align-items:center; justify-content:space-between; margin-bottom:6px; }
  .profile-level-pill{ display:inline-flex; align-items:center; justify-content:center; min-width:26px; height:22px; padding:0 8px; border-radius:999px; background:linear-gradient(135deg,#ffd54a,#ff9f1c); color:#3a2300; font-size:12px; font-weight:800; }
  .profile-level-count{ color:rgba(255,255,255,0.9); font-size:12px; font-weight:600; }
  .profile-xp-track{ height:9px; border-radius:999px; background:rgba(255,255,255,0.18); overflow:hidden; }
  .profile-xp-fill{ width:0%; height:100%; border-radius:999px; background:linear-gradient(90deg,#ffd54a,#ff9f1c); transition:width .5s ease; }

  /* ---------- Menu list ---------- */
  .menu-list{
    margin: 0 18px;
    background: var(--card);
    border-radius: var(--radius-md);
    overflow:hidden;
  }
  .menu-item{
    width:100%;
    display:flex;
    align-items:center;
    gap: 14px;
    padding: 15px 16px;
    background:none;
    border:none;
    border-bottom: 1px solid var(--border);
    cursor:pointer;
    text-align:left;
  }
  .menu-item:last-child{ border-bottom:none; }
  .menu-item:active{ background: #f7f8fb; }
  .menu-icon{ font-size: 17px; width:22px; text-align:center; color: var(--text); }
  .menu-icon svg{ width:18px; height:18px; vertical-align:middle; }
  .menu-label{ flex:1; font-size: 15px; font-weight: 600; color: var(--text); }
  .menu-chevron{ color: var(--text-muted); font-size: 18px; }

  /* ---------- Placeholder views ---------- */
  .placeholder{ margin: 48px 18px; text-align:center; color: var(--text-muted); }
  .placeholder .emoji{ font-size: 46px; display:block; margin-bottom: 14px; }
  .placeholder p{ font-size: 14px; }

  /* ---------- Bottom nav ---------- */
  .bottom-nav{
    position: fixed;
    bottom: 0; left: 50%;
    transform: translateX(-50%);
    width: 100%; max-width: 460px;
    z-index: 20;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
    border-radius: 20px 20px 0 0;
    display:flex;
    padding: 9px 4px calc(9px + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px -16px rgba(23,30,60,0.15);
  }
  .nav-item{
    flex:1;
    display:flex; flex-direction:column; align-items:center; gap: 4px;
    background:none; border:none;
    padding: 6px 4px;
    margin: 0 3px;
    border-radius: 14px;
    color: var(--text-muted);
    font-size: 11px; font-weight: 600;
    cursor:pointer;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    -webkit-user-select: none; user-select: none;
    transition: color 0.15s ease, transform 0.15s ease, background 0.15s ease;
  }
  .nav-item svg{ width:22px; height:22px; }
  .nav-item .icon-filled{ display:none; }
  .nav-item.active .icon-outline{ display:none; }
  .nav-item.active .icon-filled{ display:block; }
  .nav-item:active{ transform: scale(0.94); }
  .nav-item.active{ color: var(--primary); transform: translateY(-2px); }

  /* ---------- Overlay (shared by drawer / sheet / notif) ---------- */
  .overlay{
    position: fixed; inset: 0;
    background: rgba(15, 20, 40, 0.42);
    z-index: 90;
    opacity: 0; pointer-events: none;
    transition: opacity 0.22s ease;
  }
  .overlay.show{ opacity: 1; pointer-events: auto; }

  /* ---------- Bottom sheet (Send / Withdraw) ---------- */
  .sheet{
    position: fixed;
    left: 50%; bottom: 0;
    transform: translate(-50%, 100%);
    width: 100%; max-width: 460px;
    background: var(--card);
    border-radius: 26px 26px 0 0;
    padding: 10px 20px calc(22px + env(safe-area-inset-bottom));
    z-index: 95;
    box-shadow: 0 -20px 50px -20px rgba(23,30,60,0.35);
    transition: transform 0.28s cubic-bezier(.32,.72,0,1);
    max-height: 86vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sheet.show{ transform: translate(-50%, 0); }
  .sheet-handle{ width: 38px; height: 4px; background: var(--border); border-radius: 4px; margin: 8px auto 14px; }
  /* The top bar takes exactly the same height the handle always did, so no
     sheet content moves down. The Back button floats on the right, level
     with the first row (header text) of every sheet. */
  .sheet-topbar{ position: relative; display: flow-root; }
  .sheet-back-btn{
    position:absolute; right:0; top:22px;
    width:32px; height:32px; border-radius:50%; border:none;
    background: var(--bg); color: var(--text);
    display:flex; align-items:center; justify-content:center; cursor:pointer;
  }
  .sheet-back-btn:active{ transform: scale(0.94); }
  /* keep the first row's text clear of the floating Back button */
  #sheetContent .sheet-title{ padding-right: 40px; }
  /* Screens that already have their own left-side Back button (membership
     number / checkout) don't get the floating right-side one. */
  #sheet.has-inline-back .sheet-back-btn{ display:none; }
  .verify-big-icon{ display:flex; justify-content:center; margin-bottom:14px; }
  .sheet-title{ font-size: 19px; font-weight: 800; letter-spacing: -0.3px; margin-bottom: 4px; }
  .sheet-sub{ font-size: 13px; color: var(--text); margin-bottom: 18px; }
  .streak-label{ font-size:11.5px; color: var(--text-muted); font-weight:600; margin-top:14px; }
  .streak-countdown{ font-size:15px; font-weight:800; color: var(--text); margin-top:3px; margin-bottom:18px; }
  .field-label{ font-size: 13px; font-weight: 700; color: var(--text); margin: 14px 0 8px; }
  .field-label:first-of-type{ margin-top: 0; }
  .input-wrap{
    display:flex; align-items:center; gap: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 15px;
  }
  .input-wrap input, .input-wrap select{
    border:none; background:none; outline:none;
    font-size: 15.5px; font-weight: 600; color: var(--text);
    flex:1; min-width:0; font-family: inherit;
  }
  .input-wrap .unit{ font-size: 13px; font-weight: 700; color: var(--text-muted); }
  #withdrawAmount{ font-size: 18px !important; font-weight: 700 !important; }
  .max-btn{
    background: var(--blue-bg); color: var(--primary);
    border:none; padding: 6px 12px; border-radius: 10px;
    font-size: 12px; font-weight: 700; cursor:pointer;
    flex-shrink:0; white-space:nowrap;
  }
  .wallet-del-btn{
    background:none; border:none; padding:4px; cursor:pointer;
    display:flex; align-items:center; justify-content:center;
    flex-shrink:0; color: var(--text-muted);
  }
  .wallet-del-btn:active{ color:#e5484d; }
  .quick-amounts{ display:flex; gap: 8px; margin-top: 10px; }
  .quick-amounts button{
    flex:1; padding: 9px 0; border-radius: 12px; border:1px solid var(--border);
    background: var(--bg); font-size: 13px; font-weight: 700; color: var(--text);
    cursor:pointer;
  }
  .quick-amounts button:active{ background: var(--blue-bg); border-color: var(--primary-light); }
  .method-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .method-card{
    display:flex; align-items:center; gap: 10px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 12px; cursor:pointer; background: var(--bg);
  }
  .method-card.selected{ border-color: var(--primary); background: var(--blue-bg); }
  .method-card .m-icon{ font-size: 18px; }
  .method-card .m-name{ font-size: 13.5px; font-weight: 700; }
  .sheet-summary{
    display:flex; justify-content:space-between; align-items:center;
    font-size: 13px; color: var(--text); margin-top: 16px;
    padding-top: 14px; border-top: 1px dashed var(--border);
  }
  .sheet-summary b{ color: var(--text); font-weight: 800; }
  /* bKash-branded styling — used by membership checkout */
  .input-wrap.bkash-input{ background:#fdf0f5; border: 1.5px solid #E2136E40; }
  .input-wrap.bkash-input .unit{ color:#E2136E; }
  .sheet-btn.bkash-btn{ background: linear-gradient(135deg, #E2136E, #a80f56); box-shadow: 0 10px 22px rgba(226,19,110,0.32); }
  .sheet-btn.bkash-btn:disabled{ opacity:0.5; cursor:not-allowed; box-shadow:none; }
  /* Membership checkout (bKash) */
  .mem-checkout-head{
    display:flex; align-items:flex-start; justify-content:space-between;
    gap:10px; margin-bottom:16px;
  }
  .mem-back-btn{
    width:32px; height:32px; border-radius:50%; border:none;
    background: var(--bg); color: var(--text); flex-shrink:0;
    display:flex; align-items:center; justify-content:center; cursor:pointer;
  }
  .mem-checkout-head-info{ flex:1; margin-left:10px; }
  .mem-checkout-label{ font-size:10.5px; font-weight:700; letter-spacing:0.4px; color:var(--text-muted); text-transform:uppercase; }
  .mem-checkout-method{ font-size:16px; font-weight:800; color:var(--text); margin-top:2px; }
  .mem-checkout-due{ text-align:right; }
  .mem-checkout-amount{ font-size:17px; font-weight:800; color:var(--text); margin-top:2px; }
  .mem-instruction-box{
    background:#fdf0f5; border:1px solid #E2136E30; border-radius: var(--radius-md);
    padding:14px 16px; font-size:13.5px; line-height:1.5; color:var(--text); margin-bottom:14px;
  }
  .mem-instruction-box b{ color:#E2136E; }
  .mem-copy-row{
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    border:1px solid var(--border); border-radius: var(--radius-sm);
    padding:12px 14px; margin-bottom:10px;
  }
  .mem-copy-label{ font-size:10.5px; font-weight:700; letter-spacing:0.3px; color:var(--text-muted); text-transform:uppercase; }
  .mem-copy-value{ font-size:15.5px; font-weight:800; color:var(--text); margin-top:3px; }
  .mem-copy-amount{ color:#E2136E; }
  .mem-trx-link-wrap{ text-align:center; font-size:13px; color:var(--text-muted); }
  .mem-trx-link-wrap a{ color:#E2136E; font-weight:700; text-decoration:underline; cursor:pointer; }

  .mem-success-card{
    width:100%; margin-top:18px; text-align:left;
    border:1px solid var(--border); border-radius: var(--radius-md);
    overflow:hidden;
  }
  .mem-success-card.plan-basic, .mem-success-card.plan-pro, .mem-success-card.plan-premium{
    background: color-mix(in srgb, var(--plan-accent) 6%, var(--card));
    border-color: color-mix(in srgb, var(--plan-accent) 28%, var(--border));
  }
  .mem-success-row{
    display:flex; justify-content:space-between; align-items:center;
    padding:12px 16px; font-size:13px; color:var(--text-muted);
    border-bottom:1px solid var(--border);
  }
  .mem-success-card.plan-basic .mem-success-row, .mem-success-card.plan-pro .mem-success-row, .mem-success-card.plan-premium .mem-success-row{
    border-bottom-color: color-mix(in srgb, var(--plan-accent) 18%, var(--border));
  }
  .mem-success-row:last-child{ border-bottom:none; }
  .mem-success-row b{ color:var(--text); font-weight:800; font-size:13.5px; }
  .mem-success-row b.mem-check{
    width:20px; height:20px; border-radius:50%; flex-shrink:0;
    background:var(--green); position:relative;
  }
  .mem-success-row b.mem-check::after{
    content:""; position:absolute; left:50%; top:45%;
    width:5px; height:9px; border:solid #fff; border-width:0 2px 2px 0;
    transform:translate(-50%,-50%) rotate(45deg);
  }
  .mem-success-row b.mem-cross{
    width:20px; height:20px; border-radius:50%; flex-shrink:0;
    background:#ef4444; position:relative;
  }
  .mem-success-row b.mem-cross::before, .mem-success-row b.mem-cross::after{
    content:""; position:absolute; left:50%; top:50%;
    width:10px; height:2px; background:#fff; border-radius:1px;
  }
  .mem-success-row b.mem-cross::before{ transform:translate(-50%,-50%) rotate(45deg); }
  .mem-success-row b.mem-cross::after{ transform:translate(-50%,-50%) rotate(-45deg); }

  .deposit-timer{
    display:flex; justify-content:space-between; align-items:center;
    background:#fdf0f5; border:1.5px solid #E2136E40; border-radius: var(--radius-md);
    padding:10px 14px; margin: 16px 0 4px; font-size:13px; color:#a80f56; font-weight:700;
  }
  .deposit-timer b{ font-size:16px; font-weight:800; color:#E2136E; }
  .deposit-timer.expired{ background:var(--bg); border-color:var(--border); }
  .deposit-timer.expired b{ color: var(--text-muted); }
  .rules-box{ background:var(--card); border:1.5px solid var(--border); border-radius:16px; padding:16px; margin-bottom:14px; }
  .rules-box.rules-do{ border-color: var(--green-bg); }
  .rules-box-head{ display:flex; align-items:center; gap:6px; font-weight:800; font-size:15px; margin-bottom:10px; }
  .rules-box.rules-do .rules-box-head{ color: var(--green); }
  .rules-box ul{ margin:0; padding-left:18px; display:flex; flex-direction:column; gap:10px; }
  .rules-box li{ font-size:13.5px; line-height:1.5; color: var(--text); }
  .captcha-box{
    position:relative; overflow:hidden;
    background: var(--bg); border: 1.5px dashed var(--border); border-radius: var(--radius-md);
    padding: 18px 0; text-align:center; font-size: 26px; font-weight: 800; letter-spacing: 6px;
    color: var(--text); user-select:none; margin-bottom: 14px;
  }
  .captcha-noise{ position:absolute; inset:0; width:100%; height:100%; color: var(--text-muted); }
  .captcha-chars{ position:relative; z-index:1; }
  .captcha-input{
    width:100%; height: 48px; border-radius: var(--radius-md); border: 1.5px solid var(--border);
    background: var(--card); color: var(--text); font-size: 16px; font-weight: 700;
    letter-spacing: 3px; text-align:center; text-transform: uppercase;
  }
  .sheet-btn{
    width:100%; height: 52px; margin-top: 18px;
    border-radius: var(--radius-md); border:none;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color:#fff; font-size: 15.5px; font-weight: 800;
    box-shadow: 0 12px 22px -10px rgba(74,95,240,0.6);
    cursor:pointer;
  }
  .sheet-btn:active{ transform: scale(0.98); }
  .sheet-btn.plan-btn.plan-basic, .sheet-btn.plan-btn.plan-pro, .sheet-btn.plan-btn.plan-premium{
    background: linear-gradient(135deg, var(--plan-accent), color-mix(in srgb, var(--plan-accent) 65%, #000));
    box-shadow: 0 12px 22px -10px var(--plan-accent-shadow, rgba(74,95,240,0.6));
  }

  /* success state inside sheet */
  .success-box{ text-align:center; padding: 18px 0 6px; }
  .success-box .tick{
    width:64px; height:64px; border-radius:50%;
    background: var(--green-bg); color: var(--green);
    display:flex; align-items:center; justify-content:center;
    font-size: 30px; margin: 0 auto 14px;
  }
  .success-box .tick.plan-basic,
  .success-box .tick.plan-pro,
  .success-box .tick.plan-premium{
    background: var(--plan-accent); color:#fff;
    box-shadow: 0 8px 20px var(--plan-accent-shadow);
  }
  .success-box .tick svg{ width:32px; height:32px; }
  .success-box .tick.pending{
    background: #fff4e0; color: #d68a00;
  }
  .mem-success-row .pending-status{ color: #d68a00; }
  .success-box h3{ font-size: 17px; font-weight: 800; }
  .success-box p{ font-size: 13px; color: var(--text-muted); margin-top: 6px; }

  /* ---------- Notification panel ---------- */
  .notif-panel{
    position: fixed;
    top: 92px; right: 14px;
    width: min(340px, calc(100% - 28px));
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    z-index: 95;
    opacity: 0; transform: translateY(-8px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
  }
  .notif-panel.show{ opacity:1; transform: translateY(0) scale(1); pointer-events:auto; }
  .notif-panel-head{
    display:flex; justify-content:space-between; align-items:center;
    padding: 14px 16px 10px; font-size: 14.5px; font-weight: 800;
  }
  .notif-panel-head span.clear{ font-size:12px; font-weight:700; color: var(--primary); cursor:pointer; }
  .notif-item{
    display:flex; gap:11px; padding: 11px 16px; border-top: 1px solid var(--border);
  }
  .notif-item .n-icon{
    width:36px; height:36px; border-radius:11px; flex-shrink:0;
    display:flex; align-items:center; justify-content:center; font-size:15px;
    background: var(--blue-bg);
  }
  .notif-item .n-body{ flex:1; min-width:0; }
  .notif-item .n-title{ font-size:13px; font-weight:700; }
  .notif-item .n-sub{ font-size:12px; color: var(--text-muted); margin-top:2px; line-height:1.4; }
  .notif-item .n-time{ font-size:10.5px; color: var(--text-muted); margin-top:4px; }
  .notif-item.unread{ background: rgba(84,112,245,0.04); }

  /* ---------- Menu drawer ---------- */
  .drawer{
    position: fixed; left:0; right:0; bottom:0;
    width: 100%; max-width: 460px;
    margin: 0 auto;
    background: var(--card);
    z-index: 96;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(.32,.72,0,1);
    border-radius: 26px 26px 0 0;
    padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
    box-shadow: 0 -20px 50px -20px rgba(23,30,60,0.35);
    display:flex; flex-direction:column;
    max-height: 86vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .drawer.show{ transform: translateY(0); }
  .drawer-handle{ position:relative; z-index:1; width: 38px; height: 4px; background: var(--border); border-radius: 4px; margin: 8px auto 14px; }
  .drawer-head{
    position: relative;
    padding: 18px 18px 18px;
    margin: -10px -18px 10px;
    border-bottom:1px solid var(--border);
    border-radius: 26px 26px 0 0;
    background:
      radial-gradient(130% 100% at 100% 0%, rgba(255,255,255,0.18), transparent 55%),
      linear-gradient(155deg, #1e88e5 0%, #1c3a8f 55%, #0a0e1f 100%);
  }
  /* Back button in the profile drawer header (closes the drawer). */
  .drawer-back-btn{
    position:absolute; right:18px; top:50%; transform: translateY(-50%);
    width:34px; height:34px; border-radius:50%; border:none;
    background: rgba(255,255,255,0.18); color:#fff;
    display:flex; align-items:center; justify-content:center; cursor:pointer;
  }
  .drawer-back-btn:active{ transform: translateY(-50%) scale(0.94); }
  .drawer-head .profile-pill{ max-width: calc(100% - 48px); }
  .profile-pill{
    display:inline-flex; align-items:center; gap:10px;
    background: linear-gradient(135deg, #232c48, #171e33);
    border-radius: 999px;
    padding: 6px 16px 6px 6px;
    max-width: 100%;
    cursor: pointer;
  }
  .profile-pill.on-dark{
    background: rgba(255,255,255,0.09);
    border: 1px solid rgba(255,255,255,0.14);
  }
  .profile-pill .pp-avatar-wrap{ position:relative; width:44px; height:44px; flex-shrink:0; }
  .profile-pill .pp-avatar{
    width:44px; height:44px; border-radius:50%; object-fit:cover;
    background: var(--blue-bg); color: var(--primary);
    display:flex; align-items:center; justify-content:center; font-size:18px; font-weight:800;
  }
  .profile-pill .pp-dot{
    position:absolute; bottom:-1px; right:-1px;
    width:11px; height:11px; border-radius:50%;
    background:#3ddc84; border:2px solid #171e33;
  }
  .profile-pill .pp-text{ min-width:0; }
  .profile-pill .pp-name{
    font-size:12.5px; font-weight:800; color:#fff; line-height:1.25;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:180px;
  }
  .profile-pill .pp-id{
    font-size:10.5px; color: rgba(255,255,255,0.62); font-weight:600; margin-top:1px;
    white-space:nowrap;
  }
  .drawer-list{ display:flex; flex-direction:column; gap:2px; margin-top:6px; }
  .drawer-item{
    display:flex; align-items:center; gap:13px;
    padding: 12px 6px; border-radius: 12px;
    background:none; border:none; text-align:left; cursor:pointer;
    font-size: 14px; font-weight: 600; color: var(--text);
  }
  .drawer-item:active{ background: var(--bg); }
  .drawer-item .d-icon{ width:22px; height:22px; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; }
  .drawer-item.danger{ color:#e0483e; }
  .drawer-footer{ margin-top:auto; text-align:center; font-size:11px; color:var(--text-muted); padding-top:14px; }

  /* ---------- Farm view ---------- */
  .farm-hero{
    margin: 4px 18px 18px;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    height: 190px;
    background:
      linear-gradient(180deg, #131b3d 0%, #1c3a8f 55%, #1e88e5 100%);
    box-shadow: var(--shadow-md);
  }
  .farm-hero .fh-starfield{
    position:absolute; inset:0;
    background-image:
      radial-gradient(1.6px 1.6px at 15% 22%, #fff 100%, transparent),
      radial-gradient(1.2px 1.2px at 38% 12%, #fff 100%, transparent),
      radial-gradient(1.8px 1.8px at 62% 28%, #fff 100%, transparent),
      radial-gradient(1.2px 1.2px at 78% 15%, #fff 100%, transparent),
      radial-gradient(1.4px 1.4px at 88% 38%, #fff 100%, transparent),
      radial-gradient(1.2px 1.2px at 25% 45%, #fff 100%, transparent),
      radial-gradient(1.6px 1.6px at 50% 50%, #fff 100%, transparent),
      radial-gradient(1.2px 1.2px at 8% 60%, #fff 100%, transparent);
    opacity:0.85;
  }
  .farm-hero .fh-shooting-star{
    position:absolute;
    top: 16px; left: 8%;
    width: 3px; height: 3px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 6px 2px rgba(255,255,255,0.8);
    transform: rotate(35deg);
    opacity: 0;
  }
  .farm-hero .fh-shooting-star.running{
    animation: shootingStar 5s linear infinite;
    animation-delay: 1.2s;
  }
  .farm-hero .fh-star-2{ top: 36px; left: 20%; }
  .farm-hero .fh-star-3{ top: 56px; left: 32%; }
  .farm-hero .fh-shooting-star::before{
    content:"";
    position:absolute;
    top:50%; right:0;
    width:64px; height:1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.75));
    transform: translateY(-50%);
  }
  @keyframes shootingStar{
    0%{ transform: translate(0,0) rotate(35deg); opacity:0; }
    4%{ opacity:1; }
    18%{ transform: translate(210px,130px) rotate(35deg); opacity:0; }
    100%{ transform: translate(210px,130px) rotate(35deg); opacity:0; }
  }
  .farm-hero .farm-moon{
    position:absolute;
    top: -26px; right: -26px;
    width: 150px; height: 150px;
    opacity: 0.9;
    pointer-events: none;
    z-index: 1;
  }
  .farm-hero-top{
    position:relative; z-index:2;
    display:flex; align-items:flex-start; justify-content:space-between;
    padding: 16px 18px 0;
  }
  .farm-hero-top h1{ font-size:21px; font-weight:800; color:#fff; letter-spacing:-0.3px; }
  .farm-hero-top p{ font-size:12px; color:#aebbe0; margin-top:2px; font-weight:600; }
  .farm-level-badge{
    display:inline-block;
    background: rgba(255,255,255,0.88);
    border-radius: 10px;
    padding: 3px 9px;
    text-align:center;
    box-shadow: 0 6px 14px -6px rgba(0,0,0,0.2);
    margin-top: 8px;
    cursor: pointer;
  }
  .farm-level-badge:active{ transform: scale(0.96); }
  .farm-level-badge .lv-num{ font-size:9px; font-weight:800; color: var(--green); }
  .farm-level-badge .lv-name{ font-size:8px; font-weight:700; color:#3d6488; margin-top:0; }

  .ref-list-item.current{ border-color: var(--primary); background: var(--blue-bg); }
  .ref-list-item.purchased{ opacity: 0.65; }
  .rearn.purchased{ color: var(--text-muted); }

  .progress-card{
    margin: -34px 18px 18px;
    position: relative; z-index: 3;
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 18px 20px 20px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
  }
  .progress-card-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
  .progress-card-head h3{ font-size:15px; font-weight:800; }
  .progress-card-head span{ font-size:12.5px; color: var(--text-muted); font-weight:700; }
  .progress-bar-track{
    height: 9px; border-radius: 9px; overflow:hidden;
    background: var(--border);
  }
  .progress-bar-fill{
    height:100%; border-radius:9px;
    background: linear-gradient(90deg, #131b3d 0%, #1c3a8f 55%, #1e88e5 100%);
    transition: width 0.4s ease;
  }
  .progress-meta-row{
    display:flex; justify-content:space-between; margin-top:16px;
  }
  .progress-meta{ }
  .progress-meta.right{ text-align:right; }
  .progress-meta .pm-label{ font-size:11.5px; color: var(--text-muted); font-weight:600; }
  .progress-meta .pm-value{ font-size:15px; font-weight:800; margin-top:3px; }
  .progress-meta .pm-value.accent{ color: #1c3a8f; }
  .progress-meta .pm-value small{ font-size:10.5px; font-weight:700; color: var(--text-muted); margin-left:3px; }

  .claim-btn{
    width:100%; margin-top:16px; height:50px;
    border-radius: var(--radius-md); border:none;
    background: var(--bg); color: var(--text-muted);
    font-size: 14px; font-weight: 800;
    display:flex; align-items:center; justify-content:center; gap:8px;
    cursor: default;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  }
  .claim-btn.ready{
    background: linear-gradient(135deg, var(--green), #0f8a52);
    color:#fff; cursor:pointer;
    box-shadow: 0 12px 22px -10px rgba(23,168,98,0.6);
  }
  .claim-btn.ready:active{ transform: scale(0.98); }
  .claim-btn.start{
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color:#fff; cursor:pointer;
    box-shadow: 0 12px 22px -10px rgba(84,112,245,0.55);
  }
  .claim-btn.start:active{ transform: scale(0.98); }

  .farm-section-title{ margin: 0 18px 12px; font-size: 15px; font-weight:800; }
  .boost-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 0 18px 20px; }
  .boost-card{
    background: var(--card);
    border-radius: var(--radius-md);
    padding: 14px 10px 13px;
    text-align:center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    position: relative;
    cursor: pointer;
  }
  .boost-card.locked{ cursor:default; }
  .boost-card .b-tag{
    position:absolute; top:8px; right:8px;
    font-size: 9px; font-weight:800;
    padding: 2px 7px; border-radius: 8px;
    background: var(--border); color: var(--text-muted);
  }
  .boost-card .b-tag.active{ background: var(--green-bg); color: var(--green); }
  .boost-card .b-icon{
    width:44px; height:44px; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    font-size:19px; margin: 4px auto 10px;
  }
  .boost-card .b-icon.blue{ background: var(--blue-bg); }
  .boost-card .b-icon.green{ background: var(--green-bg); }
  .boost-card .b-icon.orange{ background: var(--orange-bg); }
  .boost-card .b-name{ font-size:12.5px; font-weight:800; }
  .boost-card .b-sub{ font-size:10.5px; color: var(--text-muted); margin-top:3px; font-weight:600; }

  /* ---------- Referrals view ---------- */

  .ref-header{
    display:flex; flex-direction:column; align-items:flex-start;
    padding: 6px 20px 16px;
  }
  .ref-header.with-gift{ flex-direction:row; align-items:flex-start; justify-content:space-between; }
  .ref-header h1{ font-size: 27px; font-weight: 800; letter-spacing: -0.5px; }
  .ref-header p{ color: var(--text-muted); font-size: 14px; margin-top: 4px; }

  .ref-hero{
    margin: 0 18px 0;
    padding: 24px 24px 40px;
    border-radius: var(--radius-lg);
    background: radial-gradient(120% 90% at 100% 0%, rgba(255,255,255,0.22), transparent 55%), linear-gradient(150deg, #131b3d 0%, #1c3a8f 55%, #1e88e5 100%);
    color:#fff;
    box-shadow: 0 26px 44px -14px rgba(24, 30, 60, 0.45), 0 8px 18px -6px rgba(74, 95, 240, 0.4);
    display:flex; align-items:center; justify-content:space-between; gap:12px;
    overflow:hidden; position:relative;
  }
  .ref-hero .rh-text{ flex:1; min-width:0; }
  .ref-hero .rh-text h2{ font-size:19px; font-weight:800; letter-spacing:-0.2px; }
  .ref-hero .rh-text p{ font-size:12.5px; opacity:0.9; margin-top:6px; line-height:1.5; }
  .ref-hero .rh-text p b{ font-weight:800; }
  .ref-hero .rh-art{
    position:absolute;
    top: -14px; right: -14px;
    width: 130px; height: 130px;
    pointer-events:none;
  }
  .ref-hero .rh-art .rh-scene{ width:100%; height:100%; overflow:visible; }

  .ref-link-card{
    margin: -14px 18px 16px;
    position: relative; z-index: 1;
    background: var(--card); border-radius: var(--radius-lg);
    padding: 18px 20px; box-shadow: var(--shadow-sm); border:1px solid var(--border);
  }
  .ref-link-card .rl-label{ font-size:14.5px; font-weight:800; margin-bottom:12px; }
  .ref-link-row{
    display:flex; align-items:center; gap:10px;
    background: var(--bg); border-radius: 12px; padding: 12px 14px;
  }
  .ref-link-row .rl-link{
    flex:1; min-width:0; font-size:13px; color: var(--text-muted); font-weight:600;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  }
  .ref-link-row .rl-copy{
    flex-shrink:0; width:34px; height:34px; border-radius:10px;
    background: var(--blue-bg); color: var(--primary); border:none;
    display:flex; align-items:center; justify-content:center; font-size:15px; cursor:pointer;
  }
  .ref-link-row .rl-copy:active{ transform: scale(0.94); }

  .ref-stat-row{
    margin: 0 18px 18px;
    background: var(--card); border-radius: var(--radius-lg);
    padding: 18px 8px; box-shadow: var(--shadow-sm); border:1px solid var(--border);
    display:flex; align-items:center;
  }
  .ref-stat-row .ref-stat{ flex:1; text-align:center; }
  .ref-stat-row .ref-stat .rs-val{ font-size:18px; font-weight:800; }
  .ref-stat-row .ref-stat .rs-val small{ font-size:11px; font-weight:700; color: var(--text-muted); margin-left:2px; }
  .ref-stat-row .ref-stat .rs-label{ font-size:11px; color: var(--text-muted); margin-top:4px; font-weight:600; }
  .ref-stat-row .ref-divider{ width:1px; height:34px; background: var(--border); }

  .ref-share-btn{
    margin: 0 18px 20px; width: calc(100% - 36px); height:52px; border-radius: var(--radius-md); border:none;
    background: linear-gradient(150deg, #131b3d 0%, #1c3a8f 55%, #1e88e5 100%); color:#fff; font-weight:800; font-size:14.5px; cursor:pointer;
    display:flex; align-items:center; justify-content:center; gap:8px;
    box-shadow: 0 14px 26px -12px rgba(24, 30, 60, 0.45);
  }
  .ref-share-btn:active{ transform: scale(0.98); }

  .ref-list{ margin: 0 18px; display:flex; flex-direction:column; gap:10px; }
  .ref-list-item{
    display:flex; align-items:center; gap:12px;
    background: var(--card); border-radius: var(--radius-md); padding: 13px 15px;
    box-shadow: var(--shadow-sm); border:1px solid var(--border);
  }
  .ref-list-item .ra{ width:38px;height:38px;border-radius:50%; background: var(--purple-bg); color:var(--purple); display:flex;align-items:center;justify-content:center; font-weight:800; font-size:13px; flex-shrink:0; }
  .ref-list-item .rn{ flex:1; min-width:0; }
  .ref-list-item .rn .rname{ font-size:13.5px; font-weight:700; }
  .ref-list-item .rn .rdate{ font-size:11px; color: var(--text-muted); margin-top:1px; }
  .ref-list-item .rearn{ font-size:12.5px; font-weight:800; color: #0e7a44; flex-shrink:0; }
  .ref-list-item .rearn{ text-align:right; }
  .ref-list-item .rcomm{ margin-top:3px; font-size:10.5px; font-weight:800; color: var(--green); }
  .ref-hero .rh-comm{ display:inline-flex; align-items:center; gap:6px; margin-top:10px; padding:5px 11px; border-radius:999px; background: rgba(34,195,122,0.22); border:1px solid rgba(110,231,168,0.5); font-size:11.5px; line-height:1.4; }
  .ref-hero .rh-comm b{ font-weight:800; }
  .ref-split{ margin: 0 18px 18px; background: var(--card); border:1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; box-shadow: var(--shadow-sm); }
  .ref-split .rsp-bar{ display:flex; height:10px; border-radius:999px; overflow:hidden; background: var(--border); }
  .ref-split .rsp-bar i{ display:block; height:100%; transition: width .4s; }
  .ref-split .rsp-bar .inv{ background: var(--primary); }
  .ref-split .rsp-bar .com{ background: var(--green); }
  .ref-split .rsp-leg{ display:flex; justify-content:space-between; margin-top:9px; font-size:11.5px; color: var(--text-muted); font-weight:600; }
  .ref-split .rsp-leg em{ font-style:normal; color: var(--text); font-weight:800; }
  .ref-split .rsp-dot{ display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:6px; }
  .ref-stat-row.rich{ display:block; padding:18px 14px 16px; }
  .ref-stat-row.rich .rs-cols{ display:flex; align-items:flex-start; }
  .ref-stat-row .ref-stat .rs-ic{ width:38px; height:38px; border-radius:12px; margin:0 auto 9px; display:flex; align-items:center; justify-content:center; }
  .ref-stat-row .ref-stat .rs-ic.amber{ background: rgba(245,166,35,0.16); color:#f5a623; }
  .ref-stat-row .ref-stat .rs-ic.blue{ background: rgba(59,130,246,0.16); color: var(--primary); }
  .ref-stat-row .ref-stat .rs-ic.green{ background: rgba(34,195,122,0.16); color: var(--green); }
  .ref-stat-row .ref-stat .rs-tag{ display:inline-block; margin-top:6px; padding:1px 9px; border-radius:999px; font-size:10.5px; font-weight:800; color:#0e7a44; background: var(--green-bg); }
  .ref-stat-row.rich .ref-split{ margin:16px 0 0; padding:14px 0 0; background:none; border:0; border-top:1px solid var(--border); border-radius:0; box-shadow:none; }

  /* ---------- Leaderboard view ---------- */
  .lb-tabs{ display:flex; gap:8px; margin: 4px 18px 18px; }
  .lb-tab{
    flex:1; padding: 10px 0; border-radius: 12px; border:1px solid var(--border);
    background: var(--card); font-size:13px; font-weight:700; color: var(--text-muted);
    cursor:pointer; text-align:center;
  }
  .lb-tab.active{ background: var(--primary); color:#fff; border-color: var(--primary); }

  /* ---------- History view ---------- */
  
  .history-tabs{ display:flex; gap:7px; margin: 0 18px 16px; overflow-x:auto; -webkit-overflow-scrolling: touch; }
  .history-tab{
    flex-shrink:0; padding: 8px 14px; border-radius: 12px; border:1px solid var(--border);
    background: var(--card); font-size:12.5px; font-weight:700; color: var(--text-muted);
    cursor:pointer; white-space:nowrap;
  }
  .history-tab.active{ background: var(--primary); color:#fff; border-color: var(--primary); }
  .history-list{ padding: 0 18px 20px; display:flex; flex-direction:column; gap:10px; }
  .history-item{
    display:flex; align-items:center; gap:12px; padding: 13px 14px;
    background: var(--card); border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  }
  .history-item .hi-icon{
    width:40px; height:40px; border-radius:50%; flex-shrink:0;
    display:flex; align-items:center; justify-content:center; font-size:16px;
  }
  .history-item .hi-icon.green{ background: linear-gradient(150deg, #d5f5e3, var(--green-bg)); color: var(--green); }
  .history-item .hi-icon.red{ background: #fde3e2; color:#e0483e; }
  .history-item .hi-icon.purple{ background: linear-gradient(150deg, #e2dcfb, var(--purple-bg)); color: var(--purple); }
  .history-item .hi-icon.blue{ background: linear-gradient(150deg, #dde5fc, var(--blue-bg)); color: var(--primary); }
  .history-item .hi-icon.orange{ background: linear-gradient(150deg, #fce3cc, var(--orange-bg)); color: var(--orange); }
  .history-item .hi-body{ flex:1; min-width:0; }
  .history-item .hi-title{ font-size:13.5px; font-weight:800; }
  .history-item .hi-sub{ font-size:11.5px; color: var(--text-muted); margin-top:1px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .history-item .hi-right{ text-align:right; flex-shrink:0; }
  .history-item .hi-amount{ font-size:13px; font-weight:800; }
  .history-item .hi-amount.pos{ color: var(--green); }
  .history-item .hi-amount.neg{ color:#e0483e; }
  .history-item .hi-time{ font-size:10px; color: var(--text-muted); margin-top:2px; }
  .history-item .hi-status{ display:inline-block; margin-top:4px; padding:2px 8px; border-radius:99px; font-size:10px; font-weight:700; }
  .history-item .hi-status-pending{ background:#fde3e2; color:#e0483e; }
  .history-item .hi-status-approved{ background:#e2e8fc; color:#4f5bd5; }
  .history-item .hi-status-done{ background: var(--green-bg); color: var(--green); }
  .history-item .hi-status-reject, .history-item .hi-status-rejected{ background:#fde3e2; color:#e0483e; }

  .podium{ display:flex; gap:10px; padding: 18px 8px 0; }
  .top3-card{
    flex:1; min-width:0; background: var(--card); border-radius: var(--radius-md);
    padding: 16px 10px 14px; text-align:center; position:relative;
    box-shadow: var(--shadow-sm); border: 1px solid var(--border);
  }
  .top3-card.rank-1{
    border: 1.5px solid #f2b544;
    box-shadow: 0 8px 20px -10px rgba(242,181,68,0.45);
  }
  .top3-badge{
    position:absolute; top:-9px; left:50%; transform:translateX(-50%);
    width:22px; height:22px; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    font-size:11px; font-weight:800; color:#fff;
  }
  .rank-1 .top3-badge{ background: linear-gradient(135deg,#ffd76a,#f2941a); }
  .rank-2 .top3-badge{ background: linear-gradient(135deg,#cfd8e6,#9aa9c1); }
  .rank-3 .top3-badge{ background: linear-gradient(135deg,#f0b088,#c06f3c); }
  .avatar-wrap{ position:relative; width:52px; height:52px; margin: 6px auto 8px; }
  .rank-1 .avatar-wrap{ width:60px; height:60px; }
  .top3-avatar{
    width:100%; height:100%; border-radius:50%;
    display:flex; align-items:center; justify-content:center;
    font-weight:800; font-size:16px; color:#fff; overflow:hidden;
    border: 2px solid rgba(23,30,60,0.12);
  }
  .rank-1 .top3-avatar{ font-size:18px; background: linear-gradient(135deg,#ffd76a,#ffab3d); }
  .rank-2 .top3-avatar{ background: linear-gradient(135deg,#cfd8e6,#9aa9c1); }
  .rank-3 .top3-avatar{ background: linear-gradient(135deg,#f0b088,#d98a55); }
  .top3-name{ font-size:12.5px; font-weight:800; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .flag-badge{
    position:absolute; bottom:-2px; right:-2px; width:15px; height:15px;
    border-radius:50%; overflow:hidden; border:2.5px solid var(--card);
    display:flex; box-shadow: var(--shadow-sm);
  }
  .flag-badge svg{ width:100%; height:100%; display:block; }
  .profile-hero-avatar .flag-badge{
    width:20px; height:20px;
    right:-8px; bottom:6px;
    border:none;
  }
  .top3-amount{ font-size:15px; font-weight:800; color: #1c3a8f; margin-top:6px; display:flex; align-items:center; justify-content:center; gap:4px; }
  .lb-ref-icon{ width:15px; height:15px; flex-shrink:0; }
  .lb-star-emoji{ font-size:14px; line-height:1; }

  .lb-card{
    margin: 0 18px 16px;
    background: var(--card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow: hidden;
  }
  .lb-list{ padding: 14px 15px 15px; display:flex; flex-direction:column; gap:9px; }
  .lb-row{
    display:flex; align-items:center; gap:12px;
    background: var(--card); border-radius: var(--radius-md); padding: 11px 14px;
    box-shadow: var(--shadow-sm); border:1px solid var(--border);
  }
  .lb-row.me{ border-color: var(--primary); background: var(--blue-bg); }
  .lb-row .lr-rank{ width:22px; text-align:center; font-size:13px; font-weight:800; color: var(--text-muted); flex-shrink:0; }
  .lb-row .avatar-wrap{ position:relative; width:36px; height:36px; flex-shrink:0; }
  .lb-row .lr-avatar{
    width:100%; height:100%; border-radius:50%;
    background: var(--purple-bg); color: var(--purple);
    display:flex; align-items:center; justify-content:center; font-weight:800; font-size:12.5px;
    overflow:hidden;
    border: 1.5px solid var(--card);
  }
  .lb-row .lr-name{ flex:1; min-width:0; font-size:13.5px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .lb-row .lr-amount{ font-size:14px; font-weight:800; color: #1c3a8f; flex-shrink:0; display:flex; align-items:center; gap:3px; }

  /* ---------- Toast ---------- */
  .toast{
    position: fixed; left:50%; bottom: 100px;
    transform: translate(-50%, 12px);
    background: #191f30; color:#fff;
    padding: 11px 18px; border-radius: 30px;
    font-size: 13px; font-weight: 600;
    box-shadow: 0 10px 26px -10px rgba(0,0,0,0.5);
    z-index: 120;
    opacity: 0; pointer-events:none;
    transition: opacity 0.22s ease, transform 0.22s ease;
    max-width: calc(100% - 60px);
    text-align:center;
  }
  .toast.show{ opacity:1; transform: translate(-50%, 0); }

  /* ================= Membership plan cards ================= */
  .plan-list{ display:flex; flex-direction:column; gap:14px; padding-top:2px; }

  .plan-card{
    position: relative;
    background: var(--card);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 18px 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  .plan-card::before{
    content:''; position:absolute; top:0; left:0; right:0; height:4px;
    background: var(--plan-accent, var(--primary));
  }
  .plan-card.plan-popular{
    border-color: var(--plan-accent, var(--primary));
    box-shadow: 0 14px 30px -14px var(--plan-accent-shadow, rgba(84,112,245,0.45));
  }
  /* "Popular" tab hanging from the top edge of the card (Pro plan). */
  .plan-popular-tab{
    position:absolute; top:4px; left:50%; transform: translateX(-50%);
    background: var(--plan-accent, var(--primary)); color:#fff;
    font-size:11px; font-weight:800; line-height:1.3;
    padding:3px 12px; border-radius: 0 0 9px 9px;
  }
  .plan-popular-tab ~ .plan-card-head{ margin-top:6px; }

  /* Tier accents — matched to the main balance card's navy→blue gradient */
  .plan-free{ --plan-accent: #22c55e; --plan-accent-shadow: rgba(34,197,94,0.35); }
  .plan-basic{ --plan-accent: #1d8bf7; --plan-accent-shadow: rgba(29,139,247,0.35); }
  .plan-pro{ --plan-accent: #123fce; --plan-accent-shadow: rgba(18,63,206,0.4); }
  .plan-premium{ --plan-accent: #5b21b6; --plan-accent-shadow: rgba(91,33,182,0.4); }

  .plan-card-head{
    display:flex; align-items:flex-start; justify-content:space-between;
    margin-bottom: 12px; gap:10px;
  }
  .plan-name-row{ display:flex; align-items:center; gap:9px; }
  .plan-icon{
    width:34px; height:34px; flex:none;
    display:flex; align-items:center; justify-content:center;
    border-radius:11px;
    background: color-mix(in srgb, var(--plan-accent) 16%, white);
    color: var(--plan-accent);
  }
  .plan-icon svg{ width:18px; height:18px; }
  .plan-name{ font-size:15.5px; font-weight:800; color:var(--text); letter-spacing:-0.2px; }
  .plan-price{ font-size:12px; font-weight:600; color:var(--text-muted); text-align:right; white-space:nowrap; }
  .plan-price-num{ font-size:19px; font-weight:800; color:var(--plan-accent); }
  .plan-price small{ font-size:11px; font-weight:600; color:var(--text-muted); }

  .plan-benefit{
    display:flex; align-items:center; gap:8px;
    font-size:13px; color:var(--text-muted);
    background: color-mix(in srgb, var(--plan-accent) 8%, var(--bg));
    border-radius: 12px;
    padding: 9px 12px;
    margin-bottom:14px;
  }
  .plan-benefit-icon{
    width:22px; height:22px; flex:none; border-radius:7px;
    display:flex; align-items:center; justify-content:center;
  }
  .plan-benefit-icon svg{ width:14px; height:14px; }
  .plan-benefit-icon.pbi-ads{ background:#7b61ff; }
  .plan-benefit-icon.pbi-star{ background:#ffb020; }
  .plan-benefit-icon.pbi-income{ background:#34c759; }
  .plan-benefit b{ color:var(--text); font-weight:800; }

  .plan-select-btn{
    width:100%; border:none; border-radius:14px;
    background: linear-gradient(135deg, var(--plan-accent), var(--plan-accent));
    filter: brightness(1);
    color:#fff; font-size:14px; font-weight:800;
    padding:12px 0;
    box-shadow: 0 10px 20px -8px var(--plan-accent-shadow, rgba(84,112,245,0.4));
    cursor:pointer;
  }
  .plan-select-btn:active{ transform: scale(0.97); filter: brightness(0.94); }

  .plan-benefit.plan-benefit-crossed{ text-decoration: line-through; opacity:.55; }

  .plan-current-badge{
    width:100%; text-align:center; border-radius:14px;
    padding:12px 0; font-size:14px; font-weight:800;
    color:#fff;
    background: var(--plan-accent);
    /* "already purchased" look: pressed-in, slightly greyed green */
    border:none;
    filter: saturate(0.55) brightness(0.9);
    box-shadow: inset 0 4px 10px rgba(0,0,0,0.32), inset 0 -1px 0 rgba(255,255,255,0.14);
    transform: translateY(1px) scale(0.985);
    cursor: default;
  }
