:root{
  --ink:#111827;
  --paper:#F5F6FB;
  --emerald:#4F46E5;
  --emerald-deep:#1E1B4B;
  --gold:#F59E0B;
  --gold-soft:#FDE68A;
  --card:#FFFFFF;
  --line:#E5E7F0;
  --muted:#6B7280;
}
*{box-sizing:border-box; margin:0; padding:0;}
html{ -webkit-text-size-adjust:100%; }
body{
  font-family:'Poppins',sans-serif;
  background:var(--paper);
  color:var(--ink);
  max-width:480px;
  margin:0 auto;
  min-height:100vh;
  position:relative;
  padding-bottom:88px;
  font-size:15px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased;
}
body.has-mini-player{ padding-bottom:190px; }

/* ================= HEADER ================= */
.app-header{ background:linear-gradient(135deg,var(--emerald-deep) 0%,#312E81 60%,var(--emerald) 100%); padding:20px 16px 18px; position:relative; }
.app-title{ font-family:'Poppins',sans-serif; color:#fff; font-size:24px; font-weight:800; letter-spacing:.3px; text-align:center; }
.app-sub{ color:#C7D2FE; text-align:center; font-size:13px; margin-top:4px; }
.search-pill{
  margin-top:16px; background:rgba(255,255,255,.12); border:1px solid rgba(253,230,138,.35);
  border-radius:14px; padding:0 16px; color:#E0E7FF; font-size:14px;
  height:48px; display:flex; align-items:center; gap:8px;
}
.account-bar{ display:flex; justify-content:center; align-items:center; margin-top:14px; gap:6px; flex-wrap:wrap; }
.account-bar a, .account-bar .acc-username{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  color:#C7D2FE; text-decoration:none; font-size:11px; font-weight:600;
  min-width:58px; padding:6px 4px; border-radius:10px;
}
.account-bar a:active{ background:rgba(255,255,255,.08); }
.account-bar a span.acc-ic, .account-bar .acc-username span.acc-ic{ font-size:19px; }
.account-bar .acc-username{ color:var(--gold-soft); font-weight:700; }
.account-bar .acc-wallet span.acc-ic{ color:var(--gold); }

/* dua scrolling ticker */
.dua-ticker{ background:var(--emerald); overflow:hidden; padding:10px 0; border-bottom:2px solid var(--gold); }
.dua-ticker-track{ display:flex; white-space:nowrap; animation:duaScroll 28s linear infinite; }
.dua-ticker-track span{ color:#fff; font-size:13.5px; font-weight:500; padding:0 24px; flex-shrink:0; }
@keyframes duaScroll{ from{ transform:translateX(0); } to{ transform:translateX(-50%); } }

/* hero banner */
.hero-wrap{ padding:16px 16px 4px; }
.hero-card{ position:relative; border-radius:20px; overflow:hidden; height:238px; box-shadow:0 6px 20px rgba(30,27,75,.2); }
.hero-bg{ position:absolute; inset:0; width:100%; height:100%; }
.hero-overlay{ position:relative; height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:16px; }
.hero-title{ color:#fff; font-size:21px; font-weight:700; line-height:1.5; margin-bottom:16px; text-shadow:0 2px 8px rgba(0,0,0,.4); }
.hero-btn{ background:var(--gold); color:var(--emerald-deep); font-size:15px; font-weight:700; padding:10px 22px; border-radius:24px; text-decoration:none; }
.hero-whatsapp{
  display:flex; align-items:center; justify-content:center; gap:8px;
  margin-top:14px; color:#fff; text-decoration:none; font-size:16px; font-weight:700;
  background:rgba(255,255,255,.14); padding:11px 20px; border-radius:30px;
  border:1px solid rgba(255,255,255,.25);
}
.hero-whatsapp .wa-ic{ font-size:19px; }
.hero-dots{ display:flex; justify-content:center; gap:6px; padding:10px 0 2px; }
.hero-dots .dot{ width:6px; height:6px; border-radius:50%; background:var(--line); }
.hero-dots .dot.active{ background:var(--emerald); width:18px; border-radius:4px; }

/* announcement banner */
.ann-banner{ display:flex; align-items:center; gap:10px; background:#fdf3e3; border-bottom:1px solid #f0d59a; padding:12px 16px; position:relative; }
.ann-banner img{ width:40px; height:40px; border-radius:8px; object-fit:cover; flex-shrink:0; }
.ann-banner-text{ flex:1; display:flex; flex-direction:column; font-size:13.5px; color:#8a5a00; }
.ann-banner-text b{ font-size:14px; }
.ann-banner-link{ background:var(--emerald); color:#fff; font-size:13px; font-weight:700; padding:7px 12px; border-radius:8px; text-decoration:none; white-space:nowrap; }
.ann-close{ cursor:pointer; color:#8a5a00; font-size:16px; padding:0 4px; }

.scroll{ padding:18px 16px 20px; }
.section-label{ font-size:14px; color:var(--emerald); font-weight:700; margin:8px 2px 14px; }

/* ================= SCHOLAR GRID ================= */
.aalim-grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
@media (max-width:360px){ .aalim-grid{ grid-template-columns:1fr; } }
.aalim-card{
  background:var(--card); border-radius:20px; padding:22px 14px 18px; text-align:center;
  border:1px solid var(--line); text-decoration:none; color:inherit;
  display:flex; flex-direction:column; align-items:center; justify-content:flex-start;
  min-height:260px; box-shadow:0 3px 14px rgba(30,27,75,.07);
}
.aalim-photo{
  width:100px; height:100px; border-radius:50%; margin:0 auto 14px; overflow:hidden;
  background:linear-gradient(135deg,#E0E7FF,#C7D2FE); border:3px solid var(--gold);
}
.aalim-photo img{ width:100%; height:100%; object-fit:cover; }
.aalim-name{ font-family:'Poppins',sans-serif; font-size:16px; font-weight:700; line-height:1.4; color:var(--emerald-deep); }
.aalim-tag{ font-size:13px; color:var(--muted); margin-top:4px; }
.aalim-count{ margin-top:auto; padding-top:16px; width:100%; }
.aalim-count span{
  width:100%; box-sizing:border-box; background:var(--emerald); color:#fff;
  font-size:14.5px; font-weight:600; padding:11px 14px; border-radius:12px;
  display:flex; align-items:center; justify-content:center; min-height:44px;
}

/* ================= SCHOLAR DETAIL ================= */
.detail-header{ background:linear-gradient(135deg,var(--emerald-deep) 0%,#312E81 60%,var(--emerald) 100%); padding:20px 16px 24px; text-align:center; position:relative; }
.back-btn{ position:absolute; top:22px; left:16px; color:var(--gold-soft); font-size:24px; text-decoration:none;
  width:44px; height:44px; display:flex; align-items:center; justify-content:center; }
.detail-photo{ width:100px; height:100px; border-radius:50%; margin:0 auto 12px; overflow:hidden;
  background:linear-gradient(135deg,#E0E7FF,#C7D2FE); border:3px solid var(--gold); }
.detail-photo img{ width:100%; height:100%; object-fit:cover; }
.detail-name{ font-family:'Poppins',sans-serif; color:#fff; font-size:20px; font-weight:700; }
.detail-tag{ color:#C7D2FE; font-size:13.5px; margin-top:4px; }

/* tabs */
.tabs{ display:flex; margin:16px 16px 10px; background:var(--card); border-radius:14px; border:1px solid var(--line); overflow:hidden; cursor:pointer; }
.tab{ flex:1; text-align:center; padding:13px 0; font-size:14px; font-weight:600; color:var(--muted); min-height:46px; }
.tab.active{ background:var(--emerald); color:#fff; }

/* media list */
.media-list{ padding:6px 16px 20px; display:flex; flex-direction:column; gap:12px; }
.media-item{ background:var(--card); border:1px solid var(--line); border-radius:22px; padding:12px 16px; display:flex; align-items:center; gap:14px; }
.play-circle{ width:50px; height:50px; border-radius:50%; background:var(--emerald); color:#fff; flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:19px; cursor:pointer; border:none; }
.media-info{ flex:1; min-width:0; }
.media-title{ font-size:15px; font-weight:600; font-family:'Poppins',sans-serif; line-height:1.4; }
.media-meta{ font-size:12.5px; color:var(--muted); margin-top:3px; }
.dl-btn{
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  min-width:58px; height:50px; padding:6px 10px; border-radius:14px;
  background:var(--gold-soft); color:var(--emerald-deep); flex-shrink:0; text-decoration:none;
}
.dl-btn .dl-ic{ font-size:18px; line-height:1; }
.dl-btn .dl-label{ font-size:10.5px; font-weight:700; white-space:nowrap; }
.video-badge{ font-size:13px; color:var(--muted); border:1px solid var(--line); border-radius:8px; padding:4px 10px; flex-shrink:0; white-space:nowrap; }
.video-embed{ width:100%; aspect-ratio:16/9; border:none; border-radius:12px; margin-top:8px; }

/* ================= INLINE PROGRESS (within card) ================= */
body.has-mini-player{ padding-bottom:88px; }
.inline-progress{ display:flex; align-items:center; gap:8px; margin-top:10px; padding-top:10px; border-top:1px solid #F0F1F5; }
.ip-time{ color:var(--muted); font-size:11px; min-width:32px; font-family:-apple-system,Segoe UI,Roboto,sans-serif; }
.inline-progress{ direction:ltr; }
.ip-bar{ flex:1; height:20px; background:transparent; position:relative; cursor:pointer; touch-action:none; }
.ip-bar::before{ content:''; position:absolute; top:50%; left:0; right:0; height:5px; margin-top:-2.5px; background:#ECEEF4; border-radius:4px; }
.ip-fill{ height:5px; background:var(--emerald); width:0%; border-radius:4px; position:absolute; top:50%; left:0; margin-top:-2.5px; pointer-events:none; }
.ip-thumb{ position:absolute; top:50%; left:0%; width:13px; height:13px; margin-top:-6.5px; margin-left:-6.5px;
  background:var(--emerald); border:2px solid #fff; border-radius:50%; box-shadow:0 1px 4px rgba(0,0,0,.35); pointer-events:none; }

/* ================= BOTTOM NAV ================= */
.bottom-nav{ position:fixed; bottom:0; left:50%; transform:translateX(-50%); width:100%; max-width:480px;
  background:var(--card); border-top:1px solid var(--line); display:flex; padding:8px 4px calc(10px + env(safe-area-inset-bottom)); z-index:40; }
.nav-item{ flex:1; text-align:center; font-size:11.5px; color:var(--muted); text-decoration:none;
  display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:48px; gap:2px; }
.nav-item.active{ color:var(--emerald); font-weight:700; }
.nav-ic{ font-size:24px; display:block; position:relative; }
.nav-badge{
  position:absolute; top:-6px; right:-10px; background:#c0392b; color:#fff;
  font-size:10px; font-weight:700; min-width:16px; height:16px; border-radius:8px;
  display:flex; align-items:center; justify-content:center; padding:0 3px; line-height:1;
  font-family:-apple-system,Segoe UI,Roboto,sans-serif; box-shadow:0 0 0 2px var(--card);
}

/* ================= FORMS (shared across login/signup/payment/dashboard/referral) ================= */
.field, .auth-field{ margin-bottom:16px; }
.field label, .auth-field label{ display:block; font-size:14px; color:var(--muted); margin-bottom:7px; font-weight:600; }
.field input, .field select, .field textarea,
.auth-field input, .auth-field select, .auth-field textarea{
  width:100%; padding:0 14px; border:1px solid var(--line); border-radius:12px;
  font-family:'Poppins',sans-serif; font-size:15px; box-sizing:border-box;
  height:50px; background:#fff;
}
.field textarea, .auth-field textarea{ height:auto; min-height:100px; padding:12px 14px; }
.field input[type=file], .auth-field input[type=file]{
  height:auto; padding:16px 14px; text-align:center; cursor:pointer;
  border:2px dashed var(--line); background:#fafaf7;
}
.field input[type=file]::file-selector-button{
  background:var(--emerald); color:#fff; border:none; border-radius:8px;
  padding:9px 16px; font-size:14px; font-weight:700; cursor:pointer; margin-inline-end:10px;
}

button, .btn, .pay-btn, .auth-btn, .w-btn, .lr-btn, a.plan-btn{
  min-height:50px; padding:14px 16px; border-radius:12px; font-size:15.5px; font-weight:600;
  border:none; cursor:pointer; font-family:'Poppins',sans-serif;
}
.pay-btn, .auth-btn, .w-btn, .lr-btn{ width:100%; background:var(--emerald); color:#fff; }
a.plan-btn{ display:block; text-align:center; text-decoration:none; background:var(--emerald); color:#fff; }

/* auth pages (login/signup) */
.auth-wrap{ padding:28px 16px; }
.auth-title{ font-size:22px; font-weight:700; color:var(--emerald); text-align:center; margin-bottom:8px; }
.auth-sub{ font-size:14px; color:var(--muted); text-align:center; margin-bottom:26px; line-height:1.6; }
.auth-error{ background:#fdeeee; color:#a3302f; border:1px solid #f0c9c8; padding:12px 16px; border-radius:10px; font-size:14px; margin-bottom:18px; }
.auth-switch{ text-align:center; margin-top:20px; font-size:14px; color:var(--muted); }
.auth-switch a{ color:var(--emerald); font-weight:700; text-decoration:none; }

.msg{ background:#EEF2FF; border:1px solid #C7D2FE; color:#312E81; padding:13px 16px;
  border-radius:10px; margin-bottom:18px; font-size:14.5px; text-align:center; }
.msg.warn{ background:#fdf3e3; border-color:#f0d59a; color:#8a5a00; }

/* generic content card used on dashboard/referral/plans etc */
.ref-card, .dash-card, .plan-card{ background:var(--card); border:1px solid var(--line); border-radius:18px; padding:20px; margin-bottom:16px; }

/* page wrappers — consistent side padding for every sub-page */
.ref-wrap, .dash-wrap, .pay-wrap, .plans-wrap, .lr-wrap{ padding:20px 16px 40px; }
.ref-title{ font-size:20px; font-weight:700; color:var(--emerald); text-align:center; margin-bottom:20px; }

/* copy / share row buttons */
.ref-link-box{ display:flex; gap:10px; align-items:center; background:#F3F4F8; border-radius:12px; padding:12px 14px; }
.ref-link-box input{ flex:1; border:none; background:transparent; font-size:13.5px; color:var(--muted); direction:ltr; text-align:left; min-width:0; }
.ref-copy{ background:var(--emerald); color:#fff; border:none; border-radius:10px; padding:10px 16px; font-size:14px; font-weight:700; cursor:pointer; white-space:nowrap; min-height:44px; }
.share-row{ display:flex; gap:10px; margin-top:14px; }
.share-btn{ flex:1; display:flex; align-items:center; justify-content:center; gap:7px; padding:12px; border-radius:12px;
  text-decoration:none; font-size:14px; font-weight:700; min-height:46px; }
.share-btn.wa{ background:#e7f8ee; color:#15803D; }
.share-btn.fb{ background:#e8f0fe; color:#1454b8; }

.ref-stats{ display:flex; gap:12px; margin-top:16px; }
.ref-stat{ flex:1; text-align:center; background:#F3F4F8; border-radius:12px; padding:16px; }
.ref-stat b{ display:block; font-size:24px; color:var(--emerald); }
.ref-stat span{ font-size:13px; color:var(--muted); }

.balance-box{ text-align:center; padding:22px; }
.balance-box .amt{ font-size:30px; font-weight:700; color:var(--gold); }
.balance-box .lbl{ font-size:13.5px; color:var(--muted); margin-top:6px; line-height:1.6; }
.lock-note{ text-align:center; color:var(--muted); font-size:14px; padding:12px; line-height:1.6; }

/* dashboard */
.dash-title{ font-size:20px; font-weight:700; color:var(--emerald); text-align:center; margin-bottom:20px; }
.dash-card h3{ font-size:16px; color:var(--emerald); margin:0 0 14px; text-align:center; }
.info-row{ display:flex; justify-content:space-between; font-size:14.5px; padding:9px 0; border-bottom:1px solid #F0F1F5; }
.info-row:last-child{ border-bottom:none; }
.info-row span:first-child{ color:var(--muted); }
.info-row span:last-child{ font-weight:600; color:var(--ink); }
.quick-links{ display:flex; gap:10px; }
.quick-links a{ flex:1; text-align:center; background:#F3F4F8; border-radius:14px; padding:14px 6px;
  text-decoration:none; color:var(--emerald-deep); font-size:13.5px; font-weight:600; min-height:72px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; }
.quick-links a .ql-ic{ font-size:26px; line-height:1; }
.hist-item{ display:flex; justify-content:space-between; gap:10px; font-size:14px; padding:10px 0; border-bottom:1px solid #F0F1F5; }
.hist-item:last-child{ border-bottom:none; }
.hist-item .d{ color:var(--muted); font-size:12.5px; }

/* plans page */
.plans-title{ font-size:22px; font-weight:700; color:var(--emerald); text-align:center; margin-bottom:8px; }
.plans-sub{ font-size:14px; color:var(--muted); text-align:center; margin-bottom:26px; line-height:1.6; }
.plans-highlight{ background:linear-gradient(135deg,var(--emerald-deep),var(--emerald)); color:#fff; font-size:14.5px; font-weight:700; text-align:center;
  line-height:1.7; padding:16px 18px; border-radius:16px; margin-bottom:22px; }
.plan-card{ text-align:center; }
.plan-name{ font-size:19px; font-weight:700; color:var(--emerald-deep); }
.plan-price{ font-size:34px; font-weight:700; color:var(--gold); line-height:1.2; margin-top:6px; }
.plan-duration{ font-size:15px; color:var(--muted); margin-top:10px; }
.plan-limit{ font-size:15px; color:var(--muted); margin:14px 0 20px; line-height:1.6; }

/* payment page */
.pay-title{ font-size:20px; font-weight:700; color:var(--emerald); text-align:center; margin-bottom:6px; }
.pay-plan{ font-size:14.5px; color:var(--muted); text-align:center; margin-bottom:22px; }
.method-tabs{ display:flex; gap:10px; margin-bottom:18px; }
.method-tab{ flex:1; border:2px solid var(--line); border-radius:16px; padding:14px 8px; text-align:center; cursor:pointer; background:#fff; }
.method-tab.active{ border-color:var(--emerald); background:#EEF2FF; }
.method-tab img{ height:52px; margin-bottom:8px; }
.method-tab div{ font-size:14px; font-weight:600; color:var(--ink); text-align:center; }
.account-box{ background:#fff; border:1px solid var(--line); border-radius:16px; padding:22px 16px; margin-bottom:18px; display:none; text-align:center; }
.account-box.active{ display:block; }
.acc-label{ font-size:14px; color:var(--muted); font-weight:600; margin-bottom:8px; text-align:center; }
.acc-value{ font-size:24px; font-weight:700; color:var(--emerald-deep); direction:ltr;
  display:flex; align-items:center; justify-content:center; gap:10px; flex-wrap:wrap; text-align:center; }
.acc-name{ font-size:16px; font-weight:700; color:var(--ink); margin-top:16px; padding-top:16px; border-top:1px dashed var(--line); text-align:center; }
.account-row{ display:flex; justify-content:center; align-items:center; font-size:17px; padding:7px 0; flex-wrap:wrap; gap:8px; text-align:center; }
.account-row b{ color:var(--emerald-deep); font-size:19px; }
.copy-btn{ background:var(--gold-soft); color:var(--emerald-deep); border:none; border-radius:8px; padding:8px 14px; font-size:14px; font-weight:700; cursor:pointer; min-height:38px; }
.copy-btn.copied{ background:var(--emerald); color:#fff; }
.pay-error{ background:#fdeeee; color:#a3302f; border:1px solid #f0c9c8; padding:13px 16px; border-radius:10px; font-size:15px; margin-bottom:18px; text-align:center; }
.pay-success{ text-align:center; padding:36px 12px; }
.pay-success .icon{ font-size:48px; margin-bottom:12px; }
.pay-success .msg{ font-size:18px; font-weight:700; color:var(--emerald); margin-bottom:10px; }
.pay-success .sub{ font-size:14.5px; color:var(--muted); margin-bottom:24px; line-height:1.6; }

/* limit-request page */
.lr-title{ font-size:20px; font-weight:700; color:var(--emerald); text-align:center; margin-bottom:22px; }
.lr-status{ font-size:14.5px; color:var(--muted); text-align:center; line-height:1.6; }
.lr-status b{ color:var(--emerald-deep); }
/* dashboard helpers (were unstyled) */
.no-plan{ text-align:center; color:var(--muted); font-size:14px; padding:6px 0 12px; }
.plan-link{ display:block; text-align:center; background:var(--emerald); color:#fff; text-decoration:none; font-weight:600; padding:12px; border-radius:12px; }

/* back button — clear round button on every sub-page header */
.app-header > a[style*="left:14px"], .back-btn{
  background:rgba(255,255,255,.16) !important; color:#fff !important; border-radius:50% !important;
  width:42px !important; height:42px !important; font-size:22px !important; font-weight:700;
  border:1px solid rgba(255,255,255,.25); line-height:1;
}
.app-header > a[style*="left:14px"]:active, .back-btn:active{ background:rgba(255,255,255,.3) !important; }
