:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #d1d5db;
  /* Pro Solar brand: dark red + gold */
  --primary: #800000;
  --primary-press: #5c0000;
  --primary-soft: #f6e1e1;
  --on-primary: #ffffff;
  --gold: #d4af37;
  --danger: #b91c1c;
  --danger-soft: #fee2e2;
  --warn-bg: #fef3c7;
  --warn-text: #78350f;
  --wa: #128c4b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 24px rgba(0,0,0,.06);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f14;
    --surface: #151b22;
    --text: #f3f4f6;
    --muted: #9ca3af;
    --border: #2d3742;
    --primary: #d4af37;
    --primary-press: #b8962c;
    --primary-soft: #3a2f0d;
    --on-primary: #2a0000;
    --danger: #f87171;
    --danger-soft: #3b1414;
    --warn-bg: #3a2c0a;
    --warn-text: #fde68a;
    --wa: #25d366;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.app {
  min-height: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 24px) 20px calc(env(safe-area-inset-bottom) + 24px);
  display: flex;
  flex-direction: column;
}

/* ---------- Header / brand ---------- */
.brand { display: flex; flex-direction: column; align-items: center; text-align: center; margin: 24px 0 28px; }
.brand img { width: 64px; height: 64px; border-radius: 16px; }
.brand h1 { font-size: 26px; margin: 14px 0 4px; letter-spacing: -.01em; }
.brand p { margin: 0; color: var(--muted); }

.topbar { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.back {
  border: 0; background: none; color: var(--text); padding: 8px; margin-left: -8px;
  border-radius: 10px; cursor: pointer; display: inline-flex;
}
.back:active { background: var(--border); }

h2 { font-size: 24px; margin: 0 0 6px; letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 0 0 24px; }
.sub strong { color: var(--text); white-space: nowrap; }

/* ---------- Card & tabs ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: 20px;
}

.tabs {
  display: grid; grid-template-columns: 1fr 1fr;
  background: var(--bg); border-radius: 12px; padding: 4px; margin-bottom: 20px;
}
.tabs button {
  border: 0; background: none; padding: 10px; border-radius: 9px;
  font: inherit; font-weight: 600; color: var(--muted); cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- Form fields ---------- */
.field { margin-bottom: 16px; }
.field label, .field .label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }

.input, select.input {
  width: 100%; height: 50px; padding: 0 14px;
  font: inherit; font-size: 17px; color: var(--text);
  background: var(--surface); border: 1.5px solid var(--border); border-radius: 12px;
  outline: none; appearance: none; -webkit-appearance: none;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.field.invalid .input, .field.invalid .phone,
.field.invalid .input:focus, .field.invalid .phone:focus-within { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }

select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px;
}
select.input:invalid { color: var(--muted); }

.phone {
  display: flex; align-items: stretch; height: 50px;
  border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface);
}
.phone:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.phone .cc {
  display: flex; align-items: center; gap: 6px; padding: 0 12px;
  border-right: 1.5px solid var(--border); font-weight: 600; font-size: 17px; background: var(--bg);
}
.phone input {
  flex: 1; min-width: 0; border: 0; outline: none; background: none;
  font: inherit; font-size: 17px; padding: 0 14px; color: var(--text);
}

.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.error { font-size: 13px; color: var(--danger); margin-top: 6px; }
.error:empty { display: none; }

/* Channel picker */
.channels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.channels input { position: absolute; opacity: 0; pointer-events: none; }
.channels label {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; border: 1.5px solid var(--border); border-radius: 12px;
  font-weight: 600; font-size: 15px; cursor: pointer; margin: 0;
}
.channels input:checked + label { border-color: var(--primary); background: var(--primary-soft); }
.channels input:focus-visible + label { box-shadow: 0 0 0 3px var(--primary-soft); }
.channels .wa svg { color: var(--wa); }

/* ---------- Buttons ---------- */
.btn {
  width: 100%; height: 52px; border: 0; border-radius: 12px;
  font: inherit; font-weight: 700; font-size: 16px; cursor: pointer;
  background: var(--primary); color: var(--on-primary);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.btn:active { background: var(--primary-press); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.secondary { background: transparent; color: var(--text); border: 1.5px solid var(--border); }
.btn.secondary:active { background: var(--bg); }

.link {
  border: 0; background: none; padding: 0; font: inherit; font-weight: 600;
  color: var(--primary); cursor: pointer;
}
.link:disabled { color: var(--muted); cursor: default; }

.switch { text-align: center; margin-top: 18px; color: var(--muted); font-size: 15px; }

.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- OTP ---------- */
.otp {
  width: 100%; height: 64px; text-align: center;
  font: 600 30px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: .5em; padding-left: .5em;
  border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text);
  outline: none;
}
.otp:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.otp.shake { animation: shake .35s; border-color: var(--danger); }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.resend { text-align: center; margin-top: 18px; color: var(--muted); font-size: 15px; }

.demo {
  background: var(--warn-bg); color: var(--warn-text);
  border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 20px;
}
.demo code {
  font: 700 18px ui-monospace, Menlo, Consolas, monospace; letter-spacing: .15em;
  display: inline-block; margin-left: 4px;
}

.alert {
  background: var(--danger-soft); color: var(--danger);
  border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-bottom: 16px;
}
.alert .link { color: inherit; text-decoration: underline; }

/* ---------- Home ---------- */
.home-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  display: grid; place-items: center; font-weight: 700; font-size: 18px;
}
.hello { font-size: 14px; color: var(--muted); margin: 0; }
.name { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -.01em; }

.info { display: grid; gap: 0; }
.info div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.info div:last-child { border-bottom: 0; }
.info dt { color: var(--muted); margin: 0; }
.info dd { margin: 0; font-weight: 600; text-align: right; }

.balance { font-size: 30px; font-weight: 800; margin: 2px 0 0; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.avatar-btn { border: 0; cursor: pointer; font: inherit; font-weight: 700; font-size: 18px; }
.avatar-btn:active { transform: scale(.95); }
.avatar-btn:focus-visible { outline: 3px solid var(--primary); outline-offset: 2px; }
.avatar-lg { width: 80px; height: 80px; font-size: 28px; }
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 8px 0 24px; }

/* Pay / Receive / Earn / Withdraw */
.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 16px 8px; }
.action {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: 0; background: none; color: var(--text); font: inherit; font-size: 13px; font-weight: 600;
  padding: 6px 2px; border-radius: 12px; cursor: pointer;
}
.action:active { background: var(--bg); }
.action-icon {
  width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
}

/* Carousel */
.carousel { position: relative; overflow: hidden; border-radius: var(--radius); margin-top: 20px; touch-action: pan-y; user-select: none; }
.carousel-track { display: flex; transition: transform .45s ease; }
.slide { position: relative; flex: 0 0 100%; aspect-ratio: 2 / 1; background: var(--primary-soft); }
.slide img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.slide-text {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 16px 26px;
  background: linear-gradient(transparent, rgba(0,0,0,.65)); color: #fff;
  display: flex; flex-direction: column; font-size: 13px;
}
.slide-text strong { font-size: 17px; }
.dots { position: absolute; bottom: 8px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 4px; border: 0; padding: 0; background: rgba(255,255,255,.55); cursor: pointer; transition: width .3s; }
.dot[aria-current="true"] { width: 20px; background: #fff; }
@media (prefers-reduced-motion: reduce) { .carousel-track, .dot { transition: none; } }

.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 28px 0 10px; }

.placeholder {
  border: 1.5px dashed var(--border); border-radius: var(--radius);
  padding: 28px 20px; text-align: center; color: var(--muted);
}

.spacer { flex: 1; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 88px);
  transform: translateX(-50%); max-width: calc(100% - 32px);
  background: var(--text); color: var(--bg);
  padding: 12px 18px; border-radius: 12px; font-size: 15px; box-shadow: var(--shadow);
  z-index: 10;
}

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Bottom tab bar ---------- */
.tabbar-space { flex: none; height: 72px; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-inner { display: grid; grid-template-columns: repeat(4, 1fr); max-width: 480px; margin: 0 auto; }
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 60px; padding: 8px 2px; text-align: center;
  color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 600;
}
.tab[aria-current="page"] { color: var(--primary); }
.tab:active { background: var(--primary-soft); }

.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding: 48px 16px; }
.empty-icon { width: 72px; height: 72px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; margin-bottom: 10px; }
.empty p { margin: 0; color: var(--muted); }

/* ---------- Transactions ---------- */
:root { --tx-in: #1565c0; }
@media (prefers-color-scheme: dark) { :root { --tx-in: #6cb0ff; } }
.tx-list { margin-top: 8px; background: var(--surface); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.tx-group .tx:last-child { border-bottom: 0; }
.tx-month { margin: 0; padding: 12px 20px; background: var(--bg); color: var(--muted); font-size: 14px; font-weight: 500; letter-spacing: .04em; }
.tx-group { list-style: none; margin: 0; padding: 0 20px; }
.tx { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--border); }
.tx-main { display: flex; flex-direction: column; min-width: 0; }
.tx-date, .tx-type { font-size: 13px; color: var(--muted); }
.tx-title { font-weight: 500; overflow-wrap: anywhere; }
.tx-amount { flex: none; margin-top: 20px; font-weight: 500; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tx-amount.in { color: var(--tx-in); }

/* ---------- Referral ---------- */
.banner { position: relative; border-radius: 16px; overflow: hidden; margin-bottom: 20px; aspect-ratio: 2 / 1; background: var(--primary); }
.banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
textarea.input { resize: vertical; min-height: 88px; font: inherit; line-height: 1.4; padding-top: 12px; padding-bottom: 12px; height: auto; }

/* ---------- Receive (QR code) and Pay (scanner) ---------- */
.qr-card { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.qr-name { font-size: 22px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.qr { width: min(260px, 100%); background: #fff; color: #111; padding: 12px; border-radius: 12px; border: 1px solid var(--border); }
.qr svg { display: block; width: 100%; height: auto; }
.scanner { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: #000; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 14%; border: 3px solid #fff; border-radius: 16px; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); }

/* ---------- Withdraw ---------- */
.input[readonly] { background: var(--bg); color: var(--muted); cursor: default; }
.notice { margin: 0 0 16px; padding: 12px 14px; border-radius: 12px; background: var(--primary-soft); color: var(--text); font-size: 14px; }

/* ---------- Reload ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chip { border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; font-weight: 600; padding: 8px 14px; border-radius: 999px; cursor: pointer; }
.chip:active { background: var(--primary-soft); }
.result { text-align: center; padding: 32px 20px; }
.result h3 { margin: 12px 0 6px; font-size: 20px; }
.result p { margin: 0; color: var(--muted); overflow-wrap: anywhere; }
.result-icon { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 30px; font-weight: 700; background: var(--border); color: var(--muted); }
.result.ok .result-icon { background: #dcfce7; color: #15803d; }
.result.bad .result-icon { background: var(--danger-soft); color: var(--danger); }

/* ---------- Referral: sub tabs and progress line ---------- */
:root { --done: #15803d; --done-soft: #dcfce7; --todo: #9ca3af; }
@media (prefers-color-scheme: dark) { :root { --done: #4ade80; --done-soft: #14532d; --todo: #6b7280; } }
.subtabs { margin-bottom: 20px; }
.ref-card { margin-bottom: 14px; padding: 0; }
.ref-card summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; cursor: pointer; list-style: none; }
.ref-card summary::-webkit-details-marker { display: none; }
.ref-who { display: flex; flex-direction: column; min-width: 0; }
.ref-who strong { overflow-wrap: anywhere; }
.ref-who .hint { margin: 0; }
.ref-count { flex: none; font-size: 13px; font-weight: 600; color: var(--muted); background: var(--bg); padding: 4px 10px; border-radius: 999px; }
.ref-count.all { color: var(--done); background: var(--done-soft); }
.steps { list-style: none; margin: 0; padding: 4px 18px 18px; }
.steps li { position: relative; display: flex; align-items: center; gap: 12px; min-height: 44px; color: var(--todo); }
.steps li + li::before { /* the line joining this step to the one above */
  content: ''; position: absolute; left: 13px; bottom: calc(50% + 14px); height: calc(100% - 28px); width: 2px; background: var(--border);
}
.step-dot { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 700; border: 2px solid var(--border); color: var(--todo); background: var(--surface); }
.steps li.done { color: var(--done); font-weight: 600; }
.steps li.done .step-dot { background: var(--done); border-color: var(--done); color: #fff; }
.steps li.done + li.done::before { background: var(--done); }

/* ---------- Home call-to-action cards ---------- */
.cta { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; margin-bottom: 14px; padding: 16px 18px; border: 0; text-align: left; font: inherit; cursor: pointer; background: var(--primary); color: var(--on-primary, #fff); }
.cta-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cta-text strong { font-size: 17px; }
.cta-text span { font-size: 13px; opacity: .9; }
.cta-arrow { flex: none; font-size: 28px; line-height: 1; }
.cta-alt { background: var(--surface); color: var(--text); border: 1.5px solid var(--gold); }
.cta-alt .cta-text span { color: var(--muted); opacity: 1; }
.cta-alt .cta-arrow { color: var(--gold); }
.cta:active { opacity: .9; }

/* ---------- Savings estimate ---------- */
.est { border-radius: 14px; padding: 16px; background: var(--done-soft); color: var(--text); }
.est-empty { background: var(--bg); color: var(--muted); font-size: 14px; text-align: center; }
.est-main { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; margin-bottom: 14px; }
.est-main span { font-size: 13px; color: var(--muted); }
.est-main strong { font-size: 28px; color: var(--done); letter-spacing: -.01em; }
.est-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.est-grid div { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border-radius: 10px; padding: 10px 4px; }
.est-grid span { font-size: 11px; color: var(--muted); }
.est-grid strong { font-size: 14px; }

/* ---------- Share link ---------- */
.subtabs button { padding-left: 4px; padding-right: 4px; }
.share-card { display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center; }
.share-card h3 { margin: 0; font-size: 18px; }
.share-card .qr { margin: 4px auto 0; }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
a.btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; box-sizing: border-box; }
.btn.wa { background: #1da851; color: #fff; }

/* ---------- Admin leads ---------- */
.lead-info { padding: 0 18px; }
.lead-info dd { font-weight: 500; overflow-wrap: anywhere; }
.lead-info a { color: var(--primary); }
.checks { display: grid; gap: 2px; padding: 8px 18px 16px; }
.check { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--done); flex: none; }
.check input:checked + span { color: var(--done); font-weight: 600; }
.actions + .cta { margin-top: 14px; }
.subtabs { display: grid; grid-template-columns: repeat(3, 1fr); }
.subtabs button { font-size: 14px; white-space: nowrap; }

/* ---------- Home page (v2.6): offer first, earning second, wallet third ---------- */
.home-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.home-name { font-size: 24px; font-weight: 700; margin: 0; letter-spacing: -.01em; }
.home-logo { width: 44px; height: 44px; border-radius: 12px; }

.hero {
  position: relative; overflow: hidden; border-radius: 20px; padding: 22px 20px 18px; margin-bottom: 16px; color: #fff;
  background: radial-gradient(circle at 100% 0, rgba(212, 175, 55, .55), rgba(212, 175, 55, 0) 55%), linear-gradient(140deg, #8f0a0a, #4a0000);
  box-shadow: 0 10px 24px rgba(74, 0, 0, .28);
}
.hero-kicker { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #f1d98a; }
.hero-title { margin: 0 0 16px; font-size: 26px; line-height: 1.15; letter-spacing: -.02em; color: #fff; max-width: 14em; }
.hero-form { display: grid; gap: 10px; }
.hero-input { display: flex; align-items: center; background: #fff; border-radius: 12px; height: 52px; padding: 0 14px; gap: 10px; }
.hero-input span { font-weight: 700; color: #4a0000; }
.hero-input input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: inherit; font-size: 17px; color: #1a1a1a; }
.hero-input:focus-within { box-shadow: 0 0 0 3px rgba(212, 175, 55, .7); }
.hero-btn { height: 52px; border: 0; border-radius: 12px; font: inherit; font-size: 16px; font-weight: 800; cursor: pointer; background: #d4af37; color: #2a0000; }
.hero-btn:active { background: #c09a26; }
.hero-note { margin: 10px 0 0; font-size: 13px; color: rgba(255, 255, 255, .85); }

.eyebrow { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.earn { margin-bottom: 16px; }
.earn h3 { margin: 0 0 14px; font-size: 19px; line-height: 1.25; letter-spacing: -.01em; }
.earn-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; text-align: center; }
.earn-stats div { display: flex; flex-direction: column; gap: 2px; background: var(--bg); border-radius: 12px; padding: 10px 4px; }
.earn-stats strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.earn-stats span { font-size: 12px; color: var(--muted); }
.earn .btn { font-size: 15px; }

.wallet { margin-bottom: 20px; }
.wallet .balance { margin-bottom: 4px; }
.wallet .actions { padding: 12px 0 0; }

.how { margin-bottom: 20px; }
.how h3 { margin: 0 0 10px; font-size: 17px; }
.how ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.how li { display: flex; flex-direction: column; gap: 4px; background: var(--surface); border-radius: 14px; padding: 12px 10px; box-shadow: var(--shadow); }
.how li strong { font-size: 13px; line-height: 1.25; }
.how li span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.how .how-n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--gold); color: #2a0000; }
.earn .share-row { grid-template-columns: 1fr; }

/* Wallet block (v2.7): balance on the left, one Withdraw button on the right */
.wallet { display: flex; align-items: center; justify-content: space-between; gap: 14px; border-left: 4px solid var(--gold); }
.wallet-info { min-width: 0; }
.wallet .balance { margin: 0; font-size: 26px; }
.wallet-btn {
  flex: none; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 16px;
  border: 0; border-radius: 12px; font: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  background: var(--primary); color: var(--on-primary);
}
.wallet-btn:active { background: var(--primary-press); }

/* Hero fix (v2.9): the bill box and button could push past the right edge on phones.
   A grid column sizes to its content by default, and a text input has a wide built-in width. */
.hero { box-sizing: border-box; }
.hero-form { grid-template-columns: minmax(0, 1fr); }
.hero-input, .hero-btn { width: 100%; min-width: 0; box-sizing: border-box; }
.hero-input input { width: 100%; }

/* Referral fee line (v3.0) */
.earn h3 { margin-bottom: 6px; }
.earn-fee { margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.earn h3 { margin-bottom: 14px; }

/* Admin: number of panels (v3.1) */
.panels-row { padding: 12px 18px 4px; border-top: 1px solid var(--border); }
.panels-row label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.panels-edit { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 10px; }
.panels-edit .input, .panels-edit .btn { height: 46px; }
.panels-row .hint { margin: 8px 0 0; }

/* Carousel of Facebook posts (v3.4): photo on top, the post's words underneath */
.carousel-posts { background: var(--surface); box-shadow: var(--shadow); }
.carousel-posts .slide.post { display: flex; flex-direction: column; aspect-ratio: auto; background: var(--surface); color: var(--text); text-decoration: none; }
.carousel-posts .slide.post img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.post-text { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px 4px; }
.post-caption {
  margin: 0; font-size: 14px; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; min-height: 5.6em;
}
.post-more { font-size: 13px; font-weight: 700; color: var(--primary); }
.carousel-posts .dots { position: static; display: flex; justify-content: center; gap: 6px; padding: 10px 0 14px; }
.carousel-posts .dot { background: var(--border); }
.carousel-posts .dot[aria-current="true"] { background: var(--primary); }

/* ---------- Project calendar (v3.5) ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal-head strong { font-size: 18px; }
.cal-nav { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; }
.cal-card { padding: 12px; margin-bottom: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 0; }
.cal-day { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 46px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: 15px; cursor: pointer; }
.cal-day.today { font-weight: 800; box-shadow: inset 0 0 0 1.5px var(--gold); }
.cal-day.sel { background: var(--primary); color: var(--on-primary); }
.mks { display: flex; gap: 3px; height: 6px; }
.mk { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.mk-proj { background: var(--gold); }
.mk-off { background: var(--danger); }
.cal-day.sel .mk-off { background: #ffd0d0; }
.cal-legend { display: flex; align-items: center; gap: 6px; margin: 10px 4px 0; font-size: 12px; color: var(--muted); }
.cal-legend .mk-off { margin-left: 10px; }
.day-card { margin-bottom: 16px; }
.day-card h3 { margin: 0 0 12px; font-size: 18px; }
.day-card h4 { margin: 0 0 12px; font-size: 15px; }
.off-line { display: flex; justify-content: space-between; gap: 12px; margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); }
.proj { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 12px; margin-bottom: 10px; border-radius: 10px; background: var(--bg); border-left: 4px solid var(--gold); }
.proj p { margin: 4px 0 0; font-size: 14px; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.day-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.section-title { margin: 4px 0 10px; font-size: 17px; }
.req { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; padding: 14px 16px; }
.req > div:first-child { display: flex; flex-direction: column; min-width: 0; }
.req .hint { margin: 0; overflow-wrap: anywhere; }
.req-actions { display: flex; gap: 8px; flex: none; }
.req-actions .btn { width: auto; height: 40px; padding: 0 14px; font-size: 14px; }

/* Leave days (v3.6) */
.leave-balance { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; border-left: 4px solid var(--done); }
.leave-balance > div { display: flex; flex-direction: column; }
.leave-balance strong { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.leave-balance small { font-size: 15px; font-weight: 600; color: var(--muted); }
.leave-balance .hint { margin: 0; text-align: right; }
.inst { margin-bottom: 12px; }
.inst-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.inst-head > div { display: flex; flex-direction: column; min-width: 0; }
.inst-head .hint { margin: 0; }
.inst label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }

/* Notifications and project editing (v3.8) */
.notify-card { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; border-left: 4px solid var(--gold); font-weight: 600; }
.notify-on { margin: 0 0 12px; }
.proj-links { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }

/* Accounts and frozen state (v3.11) */
.acct-btn { width: auto; height: 40px; padding: 0 16px; font-size: 14px; flex: none; }
.frozen-tag { align-self: flex-start; margin-top: 4px; font-size: 12px; font-weight: 700; color: var(--danger); background: var(--danger-soft); padding: 2px 8px; border-radius: 999px; }

/* Withdrawal requests for admins (v3.14) */
.wd { margin-bottom: 14px; }
.wd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.wd-head > div { display: flex; flex-direction: column; min-width: 0; }
.wd-head .hint { margin: 0; }
.wd-amount { font-size: 20px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.wd-info { margin: 8px 0 14px; }
.wd-info dd { font-weight: 500; overflow-wrap: anywhere; }
.wd-status { margin: 0; font-weight: 700; }
.wd-status.ok { color: var(--done); }
.wd-status.bad { color: var(--danger); }
