:root {
  --bg: #fff8ef; --bg-soft: #fff1e4; --card: #ffffff; --ink: #33241a; --mist: #8a6a5a;
  --border: #ffe1cf; --coral: #ff6b57; --coral-dark: #e2543f; --coral-soft: #fff1ee;
  --green: #1f9d63; --green-soft: #e7f7ef; --red: #e0483a; --red-soft: #fdeceb;
  --amber: #b5541a; --amber-soft: #fdf1e2;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(51,36,26,.04), 0 10px 28px rgba(51,36,26,.06);
  --shadow-lg: 0 20px 48px rgba(51,36,26,.16);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; }
a { color: var(--coral); }
.hidden { display: none !important; }

/* ---------- Loading screen ---------- */
#loading-screen {
  position: fixed; inset: 0; background: var(--bg); display: flex; align-items: center;
  justify-content: center; z-index: 999; flex-direction: column; gap: 10px;
}
.loading-spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--coral); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Auth screens ---------- */
.auth-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 36px 32px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); }
.auth-logo { font-weight: 900; font-size: 22px; text-align: center; margin-bottom: 4px; letter-spacing: -.01em; }
.auth-logo span { color: var(--coral); }
.auth-sub { text-align: center; color: var(--mist); font-size: 13px; margin-bottom: 26px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12.5px; font-weight: 700; color: var(--mist); }
.field input, .field select {
  padding: 12px 14px; border: 2px solid var(--border); border-radius: 12px; background: var(--bg-soft);
  color: var(--ink); transition: border-color .12s ease, background .12s ease;
}
.field input:focus, .field select:focus { outline: none; border-color: var(--coral); background: #fff; }
.field-error { font-size: 12px; color: var(--red); min-height: 15px; }
.auth-switch { text-align: center; font-size: 13px; color: var(--mist); margin-top: 16px; }
.auth-switch a { font-weight: 700; text-decoration: none; }

/* ---------- Buttons ---------- */
.btn-primary {
  width: 100%; background: var(--coral); color: #fff; border: none; border-radius: 13px;
  padding: 13px 18px; font-weight: 800; font-size: 14.5px; cursor: pointer;
  box-shadow: 0 3px 0 var(--coral-dark); transition: transform .05s ease;
}
.btn-primary:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--coral-dark); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn-secondary {
  background: var(--bg-soft); color: var(--ink); border: 2px solid var(--border); border-radius: 13px;
  padding: 11px 18px; font-weight: 700; font-size: 14px; cursor: pointer;
}
.btn-secondary:hover { background: #fff; }
.btn-secondary.is-disabled { opacity: .55; cursor: not-allowed; pointer-events: none; }
.btn-danger { background: var(--red-soft); color: var(--red); border: 2px solid #f7c9c3; border-radius: 13px; padding: 10px 16px; font-weight: 700; cursor: pointer; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ---------- App shell ---------- */
#app-shell { display: none; min-height: 100vh; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; padding: 14px 20px;
  background: var(--card); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50;
}
.topbar-logo { font-weight: 900; font-size: 17px; letter-spacing: -.01em; }
.topbar-logo span { color: var(--coral); }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.wallet-pill {
  background: var(--coral); color: #fff; border-radius: 20px; padding: 8px 16px; font-weight: 800;
  font-size: 13.5px; box-shadow: 0 3px 0 var(--coral-dark); display: flex; align-items: center; gap: 6px;
  cursor: pointer; border: none;
}
.icon-btn { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; width: 36px; height: 36px; font-size: 15px; cursor: pointer; color: var(--mist); display: flex; align-items: center; justify-content: center; flex: none; }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn-logout:hover { background: #fdeceb; border-color: #f3c9c5; color: #c0392b; }

.verify-banner {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  background: var(--amber-soft); color: var(--amber); font-size: 12.5px; font-weight: 700;
  padding: 9px 16px; text-align: center;
}
.verify-banner-btn { background: var(--amber); color: #fff; border: none; border-radius: 8px; padding: 5px 12px; font-weight: 700; font-size: 12px; cursor: pointer; }
.app-nav { display: flex; gap: 4px; padding: 0 16px; background: var(--card); border-bottom: 1px solid var(--border); overflow-x: auto; }
.nav-btn {
  background: none; border: none; padding: 13px 16px; font-weight: 700; font-size: 13.5px; color: var(--mist);
  cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap;
}
.nav-btn.active { color: var(--coral-dark); border-bottom-color: var(--coral); }

main.app-main { flex: 1; max-width: 720px; margin: 0 auto; padding: 24px 18px 60px; width: 100%; }
.tab-panel { display: none; animation: fade-in .15s ease; }
.tab-panel.active { display: block; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

.page-header { margin-bottom: 18px; }
.page-header h1 { font-size: 21px; font-weight: 900; letter-spacing: -.01em; }
.page-header p { color: var(--mist); font-size: 13.5px; margin-top: 4px; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }

/* ---------- Task cards ---------- */
.task-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; margin-bottom: 12px; display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow);
}
.task-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--coral-soft); display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
.task-info { flex: 1; min-width: 0; }
.task-title { font-weight: 800; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-reward { font-size: 12.5px; color: var(--green); font-weight: 700; margin-top: 2px; }
.task-actions { display: flex; gap: 8px; flex-shrink: 0; }
.task-empty { text-align: center; padding: 50px 20px; color: var(--mist); }
.task-empty .big-icon { font-size: 36px; margin-bottom: 10px; }
.skeleton { background: linear-gradient(100deg, var(--bg-soft) 30%, #fff 50%, var(--bg-soft) 70%); background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: var(--radius); height: 72px; margin-bottom: 12px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Modals ---------- */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(51,36,26,.5); z-index: 900; align-items: center; justify-content: center; padding: 20px; backdrop-filter: blur(1px); }
.modal-overlay.active { display: flex; animation: overlay-in .12s ease; }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
.modal-box { background: #fff; border-radius: 22px; padding: 28px 26px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); animation: modal-in .15s ease; max-height: 88vh; overflow-y: auto; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-icon { width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 24px; margin-bottom: 14px; }
.modal-icon.warn { background: var(--amber-soft); }
.modal-icon.error { background: var(--red-soft); }
.modal-icon.success { background: var(--green-soft); }
.modal-title { font-size: 18px; font-weight: 900; margin-bottom: 8px; letter-spacing: -.01em; }
.modal-body { font-size: 14px; color: var(--mist); line-height: 1.6; }
.modal-body ul { margin: 10px 0 0 18px; }
.modal-body strong { color: var(--ink); }
.modal-countdown { font-size: 28px; font-weight: 900; color: var(--amber); text-align: center; margin: 16px 0; font-variant-numeric: tabular-nums; }
.modal-actions { display: flex; gap: 10px; margin-top: 20px; }
.modal-actions .btn-primary, .modal-actions .btn-secondary { flex: 1; }
.modal-close-x { position: absolute; top: 18px; right: 18px; background: none; border: none; font-size: 16px; color: var(--mist); cursor: pointer; }

/* ---------- Toasts ---------- */
#toast-container { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; align-items: center; width: 100%; max-width: 380px; padding: 0 16px; }
.toast {
  background: var(--ink); color: #fff8ef; padding: 12px 18px; border-radius: 13px; font-size: 13.5px; font-weight: 700;
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(-10px); transition: opacity .2s ease, transform .2s ease;
  width: 100%; text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.toast-success { background: var(--green); }
.toast.toast-error { background: var(--red); }

/* ---------- TikTok bind ---------- */
.bind-status-card { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 18px; background: var(--ink); color: #fff; margin-bottom: 18px; }
.bind-status-card.bound { background: var(--green); }
.bind-avatar { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; font-size: 20px; overflow: hidden; flex-shrink: 0; }
.bind-avatar img { width: 100%; height: 100%; object-fit: cover; }
.bind-status-text .bind-status-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; opacity: .75; font-weight: 800; }
.bind-status-text .bind-status-value { font-size: 15px; font-weight: 800; }

/* ---------- Promote ---------- */
.type-toggle { display: flex; gap: 8px; margin-bottom: 18px; }
.type-btn { flex: 1; padding: 13px; border-radius: 14px; border: 2px solid var(--border); background: var(--card); font-weight: 800; font-size: 14px; cursor: pointer; color: var(--mist); }
.type-btn.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.target-preview { display: none; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--green-soft); border: 1.5px solid #b8ecd6; margin-bottom: 16px; }
.target-preview.active { display: flex; }
.target-preview.is-loading { background: var(--bg-soft); border-color: var(--border); }
.target-preview.is-error { background: var(--red-soft); border-color: #f7c9c3; }
.target-preview-thumb { width: 48px; height: 48px; border-radius: 12px; object-fit: cover; background: var(--bg-soft); flex-shrink: 0; }
.target-preview-thumb.avatar { border-radius: 50%; }
.target-preview-info { flex: 1; min-width: 0; }
.target-preview-title { font-weight: 800; font-size: 13.5px; color: #1a4a32; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.target-preview-count { font-size: 12.5px; color: #3a7a58; font-weight: 700; margin-top: 2px; }

.promote-config-card { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 18px; padding: 4px 16px 2px; margin-bottom: 14px; }
.pc-row { padding: 14px 0; border-bottom: 1px solid var(--border); }
.pc-row:last-of-type { border-bottom: none; }
.pc-row-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.pc-label { font-size: 13px; font-weight: 800; }
.pc-hint { font-size: 11.5px; color: var(--mist); }
.qty-stepper { display: flex; align-items: center; gap: 10px; }
.qty-stepper-btn { width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--border); background: #fff; color: var(--coral); font-size: 18px; font-weight: 800; cursor: pointer; flex-shrink: 0; }
.qty-stepper input { flex: 1; text-align: center; border: 1.5px solid var(--border); border-radius: 10px; padding: 9px; font-weight: 800; font-size: 15px; background: #fff; }
.pc-total-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 0 12px; font-weight: 800; font-size: 14px; }
.pc-total-value { font-size: 19px; color: var(--coral); }
.confirm-sentence { background: var(--coral-soft); border-radius: 13px; padding: 12px 14px; font-size: 13.5px; text-align: center; margin-bottom: 12px; color: #5c3d2e; line-height: 1.5; }
.confirm-sentence strong { color: var(--coral-dark); }
.balance-line { font-size: 12.5px; color: var(--mist); text-align: center; margin-bottom: 14px; }

/* Promotion order cards */
.promo-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.promo-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.promo-target { font-weight: 800; font-size: 14px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-badge { font-size: 10.5px; font-weight: 800; text-transform: uppercase; padding: 3px 9px; border-radius: 7px; letter-spacing: .3px; }
.status-active { background: var(--green-soft); color: var(--green); }
.status-completed { background: #e8f0ff; color: #3b5bdb; }
.status-cancelled { background: var(--red-soft); color: var(--red); }
.promo-bar-bg { height: 8px; border-radius: 6px; background: var(--bg-soft); overflow: hidden; margin-bottom: 6px; }
.promo-bar-fill { height: 100%; background: var(--coral); border-radius: 6px; transition: width .3s ease; }
.promo-progress-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--mist); font-weight: 700; margin-bottom: 10px; }
.promo-card-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--mist); }

/* ---------- Misc ---------- */
.section-title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--mist); margin: 22px 0 10px; }
.section-title:first-child { margin-top: 0; }
.msg { font-size: 13px; color: var(--red); min-height: 16px; margin-top: 8px; }
.hint { color: var(--mist); font-size: 13px; margin-bottom: 14px; }

/* ---------- Ledger rows (transactions + withdrawals) ---------- */
.ledger-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--border); border-radius: 13px;
  padding: 12px 15px; margin-bottom: 8px;
}
.ledger-row-left { min-width: 0; }
.ledger-reason { font-weight: 700; font-size: 13.5px; }
.ledger-date { font-size: 11.5px; color: var(--mist); margin-top: 2px; }
.ledger-amount { font-weight: 800; font-size: 14px; white-space: nowrap; flex-shrink: 0; }
.ledger-amount.credit { color: var(--green); }
.ledger-amount.debit { color: var(--red); }

@media (max-width: 480px) {
  .task-card { flex-wrap: wrap; }
  main.app-main { padding: 18px 14px 50px; }
}

/* ---------- Landing page ---------- */
.landing { min-height: 100vh; display: flex; flex-direction: column; }
.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; max-width: 1040px; width: 100%; margin: 0 auto;
}
.landing-logo { font-weight: 900; font-size: 20px; letter-spacing: -.01em; }
.landing-logo span { color: var(--coral); }

.landing-hero {
  max-width: 720px; width: 100%; margin: 0 auto; text-align: center;
  padding: 40px 24px 32px;
}
.landing-badge {
  display: inline-block; background: var(--green-soft); color: var(--green);
  font-size: 12.5px; font-weight: 700; padding: 6px 14px; border-radius: 999px;
  margin-bottom: 18px;
}
.landing-hero h1 {
  font-size: clamp(28px, 5vw, 42px); line-height: 1.15; font-weight: 900;
  letter-spacing: -.02em; margin-bottom: 14px;
}
.landing-hero-sub { color: var(--mist); font-size: 15.5px; line-height: 1.6; margin-bottom: 26px; }
.landing-cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.landing-cta-row .btn-primary, .landing-cta-row .btn-secondary { width: auto; padding: 13px 26px; }

.landing-stats {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  max-width: 880px; width: 100%; margin: 0 auto; padding: 0 24px 44px;
}
.landing-stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 24px; text-align: center; flex: 1; min-width: 160px;
}
.landing-stat-num { display: block; font-size: 22px; font-weight: 900; color: var(--coral); margin-bottom: 4px; }
.landing-stat span:last-child { font-size: 12.5px; color: var(--mist); font-weight: 600; }

.landing-steps, .landing-why {
  max-width: 880px; width: 100%; margin: 0 auto; padding: 30px 24px;
}
.landing-steps h2, .landing-why h2 {
  font-size: 22px; font-weight: 900; letter-spacing: -.01em; text-align: center; margin-bottom: 26px;
}
.landing-step-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.landing-step {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 20px;
}
.landing-step-num {
  width: 30px; height: 30px; border-radius: 50%; background: var(--coral-soft); color: var(--coral);
  font-weight: 900; font-size: 14px; display: flex; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.landing-step h3 { font-size: 15px; font-weight: 800; margin-bottom: 6px; }
.landing-step p { font-size: 13.5px; color: var(--mist); line-height: 1.55; }

.landing-why { background: var(--bg-soft); border-radius: 24px; margin: 20px auto 40px; }
.landing-why-list { list-style: none; display: grid; gap: 12px; max-width: 640px; margin: 0 auto; }
.landing-why-list li {
  font-size: 14px; color: var(--ink); padding-left: 26px; position: relative; line-height: 1.5;
}
.landing-why-list li::before {
  content: "✓"; position: absolute; left: 0; top: 0; color: var(--green); font-weight: 900;
}

/* ---------- Supported Tasks ---------- */
.landing-tasks { max-width: 880px; width: 100%; margin: 0 auto; padding: 10px 24px 30px; text-align: center; }
.landing-tasks h2 { font-size: 22px; font-weight: 900; letter-spacing: -.01em; margin-bottom: 8px; }
.landing-section-sub { color: var(--mist); font-size: 13.5px; max-width: 480px; margin: 0 auto 26px; line-height: 1.55; }
.landing-task-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; text-align: left; }
.landing-task-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px 20px;
}
.landing-task-icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--coral-soft); display: flex;
  align-items: center; justify-content: center; font-size: 20px; margin-bottom: 12px;
}
.landing-task-card h3 { font-size: 15.5px; font-weight: 800; margin-bottom: 6px; }
.landing-task-card p { font-size: 13.5px; color: var(--mist); line-height: 1.55; }

/* ---------- Withdrawal methods ---------- */
.landing-withdraw { max-width: 880px; width: 100%; margin: 0 auto; padding: 10px 24px 30px; text-align: center; }
.landing-withdraw h2 { font-size: 22px; font-weight: 900; letter-spacing: -.01em; margin-bottom: 8px; }
.landing-withdraw-grid { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.landing-withdraw-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
  padding: 18px 26px; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 130px;
}
.landing-withdraw-icon { font-size: 24px; }
.landing-withdraw-card span { font-weight: 800; font-size: 13.5px; }

/* ---------- FAQ ---------- */
.landing-faq { max-width: 720px; width: 100%; margin: 0 auto; padding: 10px 24px 40px; }
.landing-faq h2 { font-size: 22px; font-weight: 900; letter-spacing: -.01em; text-align: center; margin-bottom: 20px; }
.landing-faq-list { display: flex; flex-direction: column; gap: 10px; }
.landing-faq-item {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 4px 18px;
}
.landing-faq-item summary {
  padding: 14px 0; font-weight: 700; font-size: 14px; cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center;
}
.landing-faq-item summary::-webkit-details-marker { display: none; }
.landing-faq-item summary::after { content: "+"; color: var(--coral); font-size: 18px; font-weight: 900; margin-left: 12px; }
.landing-faq-item[open] summary::after { content: "−"; }
.landing-faq-item p { color: var(--mist); font-size: 13.5px; line-height: 1.6; padding: 0 0 16px; }

.landing-footer {
  margin-top: auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  max-width: 1040px; width: 100%; margin-left: auto; margin-right: auto;
  padding: 20px 24px 30px; font-size: 12.5px; color: var(--mist);
}
.landing-footer-link {
  background: none; border: none; color: var(--coral); font-weight: 700; font-size: 12.5px; cursor: pointer;
}

.auth-back {
  background: none; border: none; color: var(--mist); font-weight: 700; font-size: 12.5px;
  cursor: pointer; margin-bottom: 14px; padding: 0;
}
.auth-back:hover { color: var(--ink); }

@media (max-width: 640px) {
  .landing-step-grid { grid-template-columns: 1fr; }
  .landing-stats { flex-direction: column; }
  .landing-task-grid { grid-template-columns: 1fr; }
  .landing-withdraw-grid { flex-direction: column; align-items: stretch; }
}

/* ---------- Legal / Contact pages (Terms, Privacy, Contact) ---------- */
.legal-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; max-width: 780px; margin: 0 auto;
}
.legal-logo { font-weight: 900; font-size: 17px; color: var(--ink); text-decoration: none; }
.legal-back { color: var(--mist); font-weight: 700; font-size: 13px; text-decoration: none; }
.legal-back:hover { color: var(--ink); }

.legal-page { max-width: 680px; margin: 0 auto; padding: 10px 24px 50px; }
.legal-page h1 { font-size: 26px; font-weight: 900; letter-spacing: -.01em; margin-bottom: 6px; }
.legal-updated { color: var(--mist); font-size: 13px; margin-bottom: 26px; }
.legal-page h2 { font-size: 16.5px; font-weight: 800; margin: 30px 0 10px; }
.legal-page p { color: var(--ink); font-size: 14.5px; line-height: 1.7; margin-bottom: 10px; }
.legal-page ul { margin: 10px 0 10px 20px; }
.legal-page li { color: var(--ink); font-size: 14.5px; line-height: 1.7; margin-bottom: 8px; }
.legal-page a { color: var(--coral); font-weight: 700; }

.contact-card {
  display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin: 20px 0 28px;
}
.contact-card-icon {
  width: 44px; height: 44px; border-radius: 12px; background: var(--coral-soft); display: flex;
  align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0;
}
.contact-card-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--mist); }
.contact-card-value { font-size: 15.5px; font-weight: 800; color: var(--coral-dark); text-decoration: none; }

.legal-footer {
  max-width: 1040px; margin: 30px auto 0; padding: 20px 24px 30px; display: flex;
  justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  font-size: 12.5px; color: var(--mist);
}
.legal-footer-links { display: flex; gap: 18px; }
.legal-footer-links a { color: var(--mist); text-decoration: none; font-weight: 700; }
.legal-footer-links a:hover { color: var(--coral); }

@media (max-width: 480px) {
  .legal-footer { flex-direction: column; text-align: center; }
}


/* ---------- Google Sign-In ---------- */
#google-signin-container {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  overflow: hidden;
  width: 100%;
}
/* Force Google's iframe/button to stay within card width */
#google-signin-container > div,
#google-signin-container iframe {
  max-width: 100% !important;
  width: 100% !important;
}
.auth-divider {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  color: var(--mist); font-size: 12px; font-weight: 700; text-transform: uppercase;
}
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* ============================================================
   MOBILE RESPONSIVE — site
   ============================================================ */

/* Google Sign-In button must never overflow the auth card */
#google-signin-container {
  overflow: hidden;
  width: 100%;
}
#google-signin-container iframe,
#google-signin-container > div {
  max-width: 100% !important;
  width: 100% !important;
}

@media (max-width: 480px) {
  /* Auth card — tighter on small screens */
  .auth-screen { padding: 16px; align-items: flex-start; padding-top: 32px; }
  .auth-card {
    padding: 24px 18px;
    border-radius: 18px;
    overflow: hidden;
  }

  /* App shell — hide sidebar */
  .app-sidebar { display: none !important; }
  .app-main { margin-left: 0 !important; padding: 16px 14px 72px !important; }

  /* Bottom nav: JS controls display, CSS just makes it flex when visible */
  .mobile-bottom-nav[style*="display: flex"],
  .mobile-bottom-nav[style*="display:flex"] {
    display: flex !important;
  }

  /* Task cards stack on tiny screens */
  .task-card { flex-wrap: wrap; gap: 10px; }
  .task-card-actions { width: 100%; display: flex; gap: 8px; }
  .task-card-actions .btn-secondary,
  .task-card-actions .btn-primary { flex: 1; text-align: center; }

  /* Landing hero */
  .landing-hero h1 { font-size: 1.6rem; }
  .landing-cta-row { flex-direction: column; }
  .landing-step-grid { grid-template-columns: 1fr; }
  .landing-stats { flex-direction: column; gap: 16px; }
}

/* Mobile bottom navigation bar */
.mobile-bottom-nav {
  display: none; /* JS sets display:'' when inside app, always hidden on auth/landing */
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  z-index: 200;
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
}
.mobile-nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--mist);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 4px;
  transition: color .15s;
}
.mobile-nav-btn .mni { font-size: 20px; line-height: 1; }
.mobile-nav-btn.active { color: var(--coral); }

/* Wallet — stack on mobile */
@media (max-width: 480px) {
  .wallet-actions { flex-direction: column; }
  .ledger-table th:nth-child(3),
  .ledger-table td:nth-child(3) { display: none; } /* hide "Balance after" column */
}

/* Bottom nav — hidden on desktop (>480px), JS sets flex on mobile */
@media (min-width: 481px) {
  .mobile-bottom-nav { display: none !important; }
}

/* Top tab bar (.app-nav) duplicates the bottom nav's job on mobile — the
   bottom nav already covers Tasks/TikTok Account/Wallet, so showing both
   at once is redundant and just eats vertical space on a small screen. */
@media (max-width: 480px) {
  .app-nav { display: none !important; }
}

/* ============================================================
   WALLET PAGE REDESIGN
   ============================================================ */

/* Hero balance card */
/* ---------- Reusable stat-highlight card (secondary numbers — referral
   bonus, counts, etc.) — lighter than .wallet-hero-card, which is
   reserved for the actual money balance so real PKR always reads as the
   single most important number on screen. ---------- */
.stat-hero-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 18px;
  padding: 22px 20px; margin-bottom: 16px; text-align: center; box-shadow: var(--shadow);
}
.stat-hero-label { font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--mist); }
.stat-hero-value { font-size: 26px; font-weight: 900; margin-top: 6px; color: var(--ink); }

/* Input + adjacent action button on one row (e.g. copy-a-link) */
.inline-input-row { display: flex; gap: 8px; }
.inline-input-row input { flex: 1; min-width: 0; }
.inline-input-row .btn-secondary, .inline-input-row .btn-primary { width: auto; padding-left: 16px; padding-right: 16px; flex-shrink: 0; }

/* A row of small equal-width stat tiles (friends joined / total earned, etc.) */
.stat-tile-row { display: flex; gap: 12px; margin: 18px 0; }
.stat-tile {
  flex: 1; text-align: center; padding: 16px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.stat-tile-value { font-size: 22px; font-weight: 900; color: var(--ink); }

.wallet-hero-card {
  background: linear-gradient(135deg, #e8401a 0%, #c93212 100%);
  border-radius: 20px;
  padding: 28px 24px 24px;
  margin-bottom: 16px;
  color: #fff;
  box-shadow: 0 8px 32px rgba(224,92,58,.35);
}
.wallet-hero-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  opacity: .75;
  margin-bottom: 6px;
}
.wallet-hero-amount {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: -1px;
  margin-bottom: 22px;
  line-height: 1;
}

/* Progress bar */
.wallet-progress-section { margin-bottom: 20px; }
.wallet-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.wallet-progress-label { font-size: 12px; opacity: .8; font-weight: 600; }
.wallet-progress-pct   { font-size: 13px; font-weight: 800; }
.wallet-progress-bar {
  height: 8px;
  background: rgba(255,255,255,.25);
  border-radius: 99px;
  overflow: hidden;
  margin-bottom: 7px;
}
.wallet-progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 99px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
  min-width: 3px;
}
.wallet-progress-footer {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  opacity: .7;
}

/* Withdraw button */
.wallet-withdraw-btn {
  display: block;
  width: 100%;
  padding: 13px;
  background: #fff;
  color: #c93212;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  font-family: inherit;
  letter-spacing: .2px;
}
.wallet-withdraw-btn:hover   { opacity: .92; }
.wallet-withdraw-btn:active  { transform: scale(.97); }
.wallet-withdraw-btn:disabled {
  background: rgba(255,255,255,.4);
  color: rgba(255,255,255,.7);
  cursor: default;
}

/* Payout methods */
.wallet-methods-section { margin-bottom: 14px; }
.wallet-methods-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--mist);
  margin-bottom: 10px;
}
.wallet-methods-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.wallet-method-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 10px;
  text-align: center;
  transition: border-color .15s, transform .1s;
}
.wallet-method-card:hover { border-color: var(--coral); transform: translateY(-1px); }
.wallet-method-logo {
  width: 100%;
  max-width: 90px;
  height: 40px;
  margin: 0 auto 8px;
  display: block;
  object-fit: contain;
  border-radius: 0;
}
.wallet-method-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
}
.wallet-method-time {
  font-size: 10px;
  color: var(--mist);
  font-weight: 600;
}

/* Notice box */
.wallet-notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fff8f0;
  border: 1.5px solid #fce8d5;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 4px;
}
.wallet-notice-icon { font-size: 20px; flex-shrink: 0; margin-top: 1px; }
.wallet-notice-title { font-size: 13px; font-weight: 800; color: var(--ink); margin-bottom: 4px; }
.wallet-notice-body  { font-size: 12px; color: var(--mist); line-height: 1.6; }

/* Withdrawal request cards */
.withdrawal-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.withdrawal-card-left { flex: 1; }
.withdrawal-card-amount { font-size: 16px; font-weight: 800; color: var(--ink); }
.withdrawal-card-meta   { font-size: 12px; color: var(--mist); margin-top: 3px; }
.withdrawal-status-pending   { background: #fff8e6; color: #c8890a; border: 1px solid #f5d87a; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.withdrawal-status-approved  { background: #edfaf3; color: #1a8a50; border: 1px solid #a8e6c4; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.withdrawal-status-rejected  { background: #fef0f0; color: #c0392b; border: 1px solid #f5b7b1; padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }

@media (max-width: 480px) {
  .wallet-hero-amount { font-size: 34px; }
  .wallet-methods-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .wallet-method-logo { max-width: 70px; height: 24px; }
  .wallet-method-name { font-size: 11px; }
}
