/* TaskTree — design system */
:root {
    --bg: #05080f;
    --bg-2: #0a0f1c;
    --surface: #0e1424;
    --surface-2: #131a2e;
    --line: rgba(148, 163, 184, .12);
    --line-2: rgba(148, 163, 184, .2);
    --text: #eef2fa;
    --muted: #8a94ab;
    --dim: #5c667d;
    --green: #2ee59d;
    --green-2: #10b981;
    --teal: #22d3ee;
    --gold: #fbbf24;
    --gold-2: #f59e0b;
    --red: #f87171;
    --blue: #60a5fa;
    --violet: #a78bfa;
    --grad: linear-gradient(135deg, #2ee59d 0%, #22d3ee 100%);
    --grad-gold: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%);
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 20px 50px -20px rgba(0, 0, 0, .6);
    --sidebar: 264px;
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -.02em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: rgba(46, 229, 157, .3); }

/* ---------- Background glow ---------- */
.glow-bg { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.glow-bg::before, .glow-bg::after {
    content: ""; position: absolute; width: 640px; height: 640px; border-radius: 50%;
    filter: blur(120px); opacity: .16;
}
.glow-bg::before { background: #2ee59d; top: -260px; right: -160px; }
.glow-bg::after { background: #6366f1; bottom: -300px; left: -200px; opacity: .12; }

/* ---------- Utilities ---------- */
.muted { color: var(--muted); }
.dim { color: var(--dim); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: ui-monospace, 'SF Mono', Menlo, monospace; }
.text-green { color: var(--green); }
.text-gold { color: var(--gold); }
.text-red { color: var(--red); }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gold-text { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid { display: grid; gap: 16px; }
.mt-1 { margin-top: 6px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 32px; }
.mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; }
.w-full { width: 100%; }
.right { text-align: right; }
.center { text-align: center; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
@media (max-width: 767px) { .hide-mobile { display: none !important; } }
@media (min-width: 768px) { .hide-desktop { display: none !important; } }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent;
    font-weight: 600; font-size: 14.5px; cursor: pointer; white-space: nowrap;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease, opacity .2s;
    -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--grad); color: #042018; box-shadow: 0 10px 30px -10px rgba(46, 229, 157, .55); }
.btn-primary:hover { box-shadow: 0 14px 36px -10px rgba(46, 229, 157, .75); }
.btn-gold { background: var(--grad-gold); color: #3a2400; box-shadow: 0 10px 30px -12px rgba(245, 158, 11, .6); }
.btn-ghost { background: rgba(255, 255, 255, .04); border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: rgba(255, 255, 255, .08); }
.btn-danger { background: rgba(248, 113, 113, .12); border-color: rgba(248, 113, 113, .3); color: var(--red); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13.5px; border-radius: 10px; }
.btn-lg { height: 54px; padding: 0 28px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }

/* ---------- Cards ---------- */
.card {
    position: relative; background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.015));
    border: 1px solid var(--line); border-radius: var(--radius); padding: 20px;
    backdrop-filter: blur(10px);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-title { font-size: 16px; font-weight: 700; }
.card-link { font-size: 13px; color: var(--green); font-weight: 600; }
.card.glow { border-color: rgba(46, 229, 157, .25); box-shadow: 0 0 0 1px rgba(46,229,157,.06), 0 30px 60px -30px rgba(46, 229, 157, .3); }

/* Gradient hero card */
.hero-card {
    position: relative; overflow: hidden; border-radius: 22px; padding: 22px;
    background:
        radial-gradient(120% 140% at 100% 0%, rgba(34, 211, 238, .28) 0%, transparent 50%),
        radial-gradient(120% 140% at 0% 100%, rgba(46, 229, 157, .25) 0%, transparent 50%),
        linear-gradient(135deg, #0f1d2b 0%, #0b1424 100%);
    border: 1px solid rgba(46, 229, 157, .22);
}
.hero-card::after {
    content: ""; position: absolute; right: -40px; top: -40px; width: 200px; height: 200px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%232ee59d' stroke-opacity='.18'%3E%3Ccircle cx='50' cy='50' r='48'/%3E%3Ccircle cx='50' cy='50' r='36'/%3E%3Ccircle cx='50' cy='50' r='24'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat;
}

/* ---------- Badges & pills ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
    border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
    background: rgba(255,255,255,.06); color: var(--muted); border: 1px solid var(--line);
}
.badge-green { background: rgba(46, 229, 157, .12); color: var(--green); border-color: rgba(46, 229, 157, .25); }
.badge-gold { background: rgba(251, 191, 36, .12); color: var(--gold); border-color: rgba(251, 191, 36, .25); }
.badge-red { background: rgba(248, 113, 113, .12); color: var(--red); border-color: rgba(248, 113, 113, .25); }
.badge-blue { background: rgba(96, 165, 250, .12); color: var(--blue); border-color: rgba(96, 165, 250, .25); }
.badge-violet { background: rgba(167, 139, 250, .12); color: var(--violet); border-color: rgba(167, 139, 250, .25); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.coin {
    display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
    background: var(--grad-gold); color: #6b3d00; font-size: 11px; font-weight: 800; flex: none;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,.18), 0 2px 8px -2px rgba(245,158,11,.6);
}
/* TaskCoin mark: a T with dollar bars, stamped into the coin */
.coin::before {
    content: ""; width: 70%; height: 70%; background: currentColor;
    -webkit-mask: var(--coin-mark) center / contain no-repeat; mask: var(--coin-mark) center / contain no-repeat;
    filter: drop-shadow(0 1px 0 rgba(255,236,170,.55));
}
:root { --coin-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2.2 4.6H21.8V10.6L19.7 9H4.3L2.2 10.6Z'/%3E%3Cpath d='M8.4 8.8C9.6 9.4 9.9 10.1 9.9 11.2V16.4C9.9 17.5 9.2 18.3 7.6 19H16.4C14.8 18.3 14.1 17.5 14.1 16.4V11.2C14.1 10.1 14.4 9.4 15.6 8.8Z'/%3E%3Crect x='9.9' y='1.2' width='1.8' height='4' rx='.4'/%3E%3Crect x='12.3' y='1.2' width='1.8' height='4' rx='.4'/%3E%3Crect x='9.9' y='18.6' width='1.8' height='4.1' rx='.4'/%3E%3Crect x='12.3' y='18.6' width='1.8' height='4.1' rx='.4'/%3E%3C/svg%3E"); }
.coin-lg { width: 44px; height: 44px; font-size: 20px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.label { font-size: 13px; font-weight: 600; color: #c8d0e0; }
.input, .select, .textarea {
    width: 100%; height: 48px; padding: 0 14px; border-radius: 12px;
    background: rgba(255,255,255,.035); border: 1px solid var(--line-2); color: var(--text);
    outline: none; transition: border-color .2s, box-shadow .2s, background .2s; font-size: 16px;
}
@media (min-width: 768px) { .input, .select, .textarea { font-size: 15px; } }
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a94ab' stroke-width='2'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }
.select option { background: var(--surface); }
.input:focus, .select:focus, .textarea:focus { border-color: rgba(46,229,157,.6); box-shadow: 0 0 0 4px rgba(46,229,157,.12); background: rgba(255,255,255,.05); }
.input::placeholder { color: var(--dim); }
.input-group { position: relative; }
.input-group .input { padding-left: 44px; }
.input-group > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--dim); pointer-events: none; }
.error { color: var(--red); font-size: 13px; }
.pin-input { max-width: 160px; font-size: 22px; letter-spacing: .5em; text-align: center; }
.hint { color: var(--dim); font-size: 12.5px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; color: var(--muted); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--green-2); flex: none; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 44px; height: 26px; border-radius: 99px; background: rgba(255,255,255,.12); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked + .track { background: var(--green-2); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* Two-option picker (admin: add / remove coins) */
.side-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.side-pick label { position: relative; cursor: pointer; }
.side-pick input { position: absolute; opacity: 0; }
.side-pick span {
    display: flex; align-items: center; justify-content: center; gap: 8px; height: 46px; border-radius: 12px;
    border: 1px solid var(--line-2); background: rgba(255,255,255,.03); font-weight: 600; color: var(--muted); transition: all .2s;
}
.side-pick input:checked + span { border-color: rgba(46,229,157,.6); background: rgba(46,229,157,.1); color: var(--green); }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; font-size: 14px; border: 1px solid; }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alert-success { background: rgba(46,229,157,.08); border-color: rgba(46,229,157,.25); color: #b6f5d8; }
.alert-error { background: rgba(248,113,113,.08); border-color: rgba(248,113,113,.25); color: #fecaca; }
.alert-info { background: rgba(96,165,250,.08); border-color: rgba(96,165,250,.25); color: #cfe2ff; }
.toast-wrap { position: fixed; top: 16px; left: 16px; right: 16px; z-index: 100; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast-wrap .alert { pointer-events: auto; max-width: 520px; width: 100%; backdrop-filter: blur(14px); background-color: rgba(10, 15, 28, .92); box-shadow: var(--shadow); animation: toastIn .35s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } }

/* ---------- Progress ---------- */
.progress { height: 10px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: var(--grad); box-shadow: 0 0 20px rgba(46,229,157,.6); transition: width 1s ease; }
.ring { --p: 0; --size: 120px; width: var(--size); height: var(--size); border-radius: 50%; display: grid; place-items: center; flex: none;
    background: conic-gradient(var(--green) calc(var(--p) * 1%), rgba(255,255,255,.07) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: #0c1626; }
.ring > div { position: relative; text-align: center; }
.ring strong { font-size: 26px; display: block; line-height: 1; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--dim); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: rgba(255,255,255,.02); }

/* List rows (mobile friendly) */
.list { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; padding-bottom: 0; }
.list-item:first-child { padding-top: 0; }
.icon-box { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.icon-box svg { width: 20px; height: 20px; }
.icon-box.green { background: rgba(46,229,157,.1); border-color: rgba(46,229,157,.2); color: var(--green); }
.icon-box.gold { background: rgba(251,191,36,.1); border-color: rgba(251,191,36,.2); color: var(--gold); }
.icon-box.blue { background: rgba(96,165,250,.1); border-color: rgba(96,165,250,.2); color: var(--blue); }
.icon-box.violet { background: rgba(167,139,250,.1); border-color: rgba(167,139,250,.2); color: var(--violet); }
.icon-box.red { background: rgba(248,113,113,.1); border-color: rgba(248,113,113,.2); color: var(--red); }

.empty { text-align: center; padding: 32px 12px; color: var(--muted); }
.empty svg { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--dim); }

/* ---------- Stats ---------- */
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 12.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 6px; }
.stat-value { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 1024px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }

/* ============================================================
   App shell
   ============================================================ */
.app { position: relative; z-index: 1; min-height: 100vh; }
.sidebar { display: none; }
.main { padding: 0 16px 110px; max-width: 1180px; margin: 0 auto; }
.topbar {
    position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    height: 64px; margin: 0 -16px 18px; padding: 0 16px;
    background: rgba(5, 8, 15, .78); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line);
}
.topbar-title { font-size: 17px; font-weight: 700; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.02em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--grad); box-shadow: 0 8px 24px -8px rgba(46,229,157,.7); flex: none; }
.brand-mark svg { width: 20px; height: 20px; color: #042018; }
.balance-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 8px; border-radius: 99px; background: rgba(251,191,36,.08); border: 1px solid rgba(251,191,36,.22); font-weight: 700; font-size: 14px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; background: linear-gradient(135deg, #1f3b4d, #183028); border: 1px solid rgba(46,229,157,.3); color: var(--green); text-transform: uppercase; }
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }

/* Bottom nav (mobile) */
.bottom-nav {
    position: fixed; z-index: 40; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
    display: grid; grid-template-columns: repeat(5, 1fr); height: 68px; padding: 0 6px;
    background: rgba(14, 20, 36, .88); backdrop-filter: blur(20px); border: 1px solid var(--line-2); border-radius: 22px;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,.7);
}
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--dim); position: relative; -webkit-tap-highlight-color: transparent; }
.bottom-nav a svg { width: 22px; height: 22px; transition: transform .2s; }
.bottom-nav a.active { color: var(--green); }
.bottom-nav a.active::before { content: ""; position: absolute; top: 6px; width: 40px; height: 32px; border-radius: 12px; background: rgba(46,229,157,.1); z-index: -1; }
.bottom-nav .nav-center span.fab { width: 50px; height: 50px; margin-top: -26px; border-radius: 16px; display: grid; place-items: center; background: var(--grad); color: #042018; box-shadow: 0 12px 28px -8px rgba(46,229,157,.8); border: 4px solid var(--bg); }

/* Menu sheet (mobile "more") */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .25s; }
.sheet { position: fixed; z-index: 61; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(24px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line-2); border-radius: 24px 24px 0 0; transform: translateY(105%); transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 0 auto 14px; }
.sheet-open .sheet { transform: none; }
.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
.sheet a, .sheet button.sheet-link { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 6px; font-weight: 600; border: 0; background: none; cursor: pointer; border-bottom: 1px solid var(--line); text-align: left; }
.sheet a svg, .sheet button svg { width: 20px; height: 20px; color: var(--muted); }

@media (min-width: 1024px) {
    .sidebar {
        display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; width: var(--sidebar); z-index: 20;
        padding: 22px 16px; background: rgba(8, 12, 22, .7); backdrop-filter: blur(20px); border-right: 1px solid var(--line);
    }
    .main { margin-left: var(--sidebar); padding: 0 36px 48px; max-width: none; }
    .main > .inner { max-width: 1160px; margin: 0 auto; }
    .topbar { margin: 0 -36px 28px; padding: 0 36px; height: 72px; }
    .bottom-nav { display: none; }
}
.nav { display: flex; flex-direction: column; gap: 4px; margin-top: 28px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--dim); font-weight: 700; padding: 18px 12px 8px; }
.nav a { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 12px; border-radius: 12px; color: var(--muted); font-weight: 600; font-size: 14.5px; transition: all .15s; }
.nav a svg { width: 20px; height: 20px; }
.nav a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav a.active { color: var(--text); background: linear-gradient(90deg, rgba(46,229,157,.14), rgba(46,229,157,.02)); box-shadow: inset 2px 0 0 var(--green); }
.nav a.active svg { color: var(--green); }
.nav .count { margin-left: auto; font-size: 11px; background: var(--gold-2); color: #2a1a00; border-radius: 99px; padding: 1px 8px; font-weight: 800; }
.sidebar-foot { margin-top: auto; }
.sidebar-card { padding: 16px; border-radius: 16px; background: linear-gradient(135deg, rgba(46,229,157,.12), rgba(34,211,238,.06)); border: 1px solid rgba(46,229,157,.2); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 24px; font-weight: 800; }
@media (min-width: 768px) { .page-head h1 { font-size: 28px; } }

/* Dashboard grid */
.dash-grid { display: grid; gap: 16px; }
@media (min-width: 1024px) {
    .dash-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; }
    .span-2 { grid-column: span 2; }
}
.two-col { display: grid; gap: 16px; }
@media (min-width: 768px) { .two-col { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
.three-col { display: grid; gap: 16px; }
@media (min-width: 768px) { .three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Goal checklist */
.goals { display: flex; flex-direction: column; gap: 10px; }
.goal { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.goal .tick { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; border: 2px solid var(--line-2); color: transparent; }
.goal .tick svg { width: 14px; height: 14px; }
.goal.done .tick { background: var(--green); border-color: var(--green); color: #042018; }
.goal.done { border-color: rgba(46,229,157,.2); }

/* Task cards */
.task-grid { display: grid; gap: 12px; }
@media (min-width: 768px) { .task-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1280px) { .task-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.task { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: var(--radius); background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015)); border: 1px solid var(--line); transition: transform .2s, border-color .2s; }
.task:hover { border-color: var(--line-2); }
.task.is-done { opacity: .65; }
.task-top { display: flex; align-items: flex-start; gap: 14px; }
.task-reward { margin-left: auto; display: flex; align-items: center; gap: 6px; font-weight: 800; color: var(--gold); white-space: nowrap; }
.task-actions { display: flex; gap: 10px; margin-top: auto; }
.task-actions form { flex: 1; display: flex; }
.task-actions .btn { flex: 1; }
.countdown { font-variant-numeric: tabular-nums; }

/* Level cards */
.level-grid { display: grid; gap: 14px; }
@media (min-width: 768px) { .level-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .level-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.level-card { position: relative; overflow: hidden; padding: 22px; border-radius: 20px; background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01)); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px; }
.level-card.current { border-color: rgba(46,229,157,.4); background: linear-gradient(180deg, rgba(46,229,157,.1), rgba(46,229,157,.01)); }
.level-card.locked { opacity: .7; }
.level-num { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.level-name { font-size: 22px; font-weight: 800; }
.level-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.level-meta > div { padding: 12px; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid var(--line); }
.level-meta strong { display: block; font-size: 17px; }
.level-icon { position: absolute; right: -14px; top: -14px; width: 96px; height: 96px; opacity: .08; }

/* ---------- Binary tree ---------- */
.tree-scroll { overflow-x: auto; padding: 8px 0 12px; margin: 0 -20px; -webkit-overflow-scrolling: touch; }
.tree { display: flex; width: max-content; margin: 0 auto; padding: 0 20px; }
.tree ul { position: relative; display: flex; justify-content: center; padding: 26px 0 0; margin: 0; list-style: none; }
.tree li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 26px 6px 0; }
.tree > ul { padding-top: 0; }
.tree > ul > li { padding-top: 0; }
.tree li::before, .tree li::after { content: ""; position: absolute; top: 0; width: 50%; height: 26px; border-top: 2px solid rgba(46,229,157,.28); }
.tree li::before { right: 50%; }
.tree li::after { left: 50%; border-left: 2px solid rgba(46,229,157,.28); }
.tree li:first-child::before, .tree li:last-child::after { border: 0; }
.tree li:last-child::before { border-right: 2px solid rgba(46,229,157,.28); border-radius: 0 10px 0 0; }
.tree li:first-child::after { border-radius: 10px 0 0 0; }
.tree ul ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 26px; border-left: 2px solid rgba(46,229,157,.28); }
.tree > ul > li::before, .tree > ul > li::after { display: none; }
.node { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 96px; padding: 12px 8px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line-2); text-align: center; transition: transform .2s, border-color .2s; }
a.node:hover { transform: translateY(-2px); border-color: rgba(46,229,157,.5); }
.node .avatar { width: 40px; height: 40px; }
.node-name { font-size: 12.5px; font-weight: 700; max-width: 100%; }
.node-meta { font-size: 11px; color: var(--muted); }
.node.root { border-color: rgba(46,229,157,.55); background: linear-gradient(180deg, rgba(46,229,157,.15), var(--surface)); box-shadow: 0 10px 30px -12px rgba(46,229,157,.5); }
.node.empty-slot { border-style: dashed; background: transparent; color: var(--dim); }
.node.empty-slot .avatar { background: transparent; border-style: dashed; border-color: var(--line-2); color: var(--dim); }
.node .side-tag { font-size: 10px; font-weight: 700; letter-spacing: .08em; color: var(--dim); }
@media (min-width: 768px) { .node { width: 128px; } .tree li { padding-left: 10px; padding-right: 10px; } }

/* Referral link box */
.ref-box { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line-2); }
.ref-box input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 13.5px; color: var(--muted); }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 18px; }
.pagination a, .pagination span { min-width: 38px; height: 38px; padding: 0 10px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--muted); }
.pagination a:hover { border-color: var(--line-2); color: var(--text); }
.pagination .active { background: rgba(46,229,157,.12); color: var(--green); border-color: rgba(46,229,157,.3); }
.pagination .disabled { opacity: .4; }

/* Tabs */
.tabs { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line); overflow-x: auto; }
.tabs a { flex: none; height: 36px; padding: 0 14px; display: flex; align-items: center; gap: 8px; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.tabs a.active { background: var(--surface-2); color: var(--text); box-shadow: 0 4px 12px -4px rgba(0,0,0,.5); }
.tabs-fill button { flex: 1; height: 38px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; background: none; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--muted); cursor: pointer; }
.tabs-fill button svg { width: 16px; height: 16px; }
.tabs-fill button .coin { width: 18px; height: 18px; }
.tabs-fill button.active { background: var(--surface-2); color: var(--text); box-shadow: 0 4px 12px -4px rgba(0,0,0,.5); }

/* Modal (native dialog) */
dialog.modal { width: min(460px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line-2); border-radius: 20px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
dialog.modal::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(4px); }
.modal-body { padding: 22px; }

/* Bars (simple charts) */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.bars > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .bar { width: 100%; max-width: 28px; border-radius: 6px 6px 3px 3px; background: var(--grad); min-height: 3px; opacity: .85; }
.bars .bar-label { font-size: 10px; color: var(--dim); }

/* ============================================================
   Auth pages
   ============================================================ */
.auth { position: relative; z-index: 1; min-height: 100vh; display: grid; }
@media (min-width: 1024px) { .auth { grid-template-columns: 1.05fr 1fr; } }
.auth-art { display: none; position: relative; overflow: hidden; padding: 48px; flex-direction: column; justify-content: space-between;
    background: radial-gradient(80% 60% at 30% 20%, rgba(46,229,157,.18), transparent 60%), radial-gradient(60% 60% at 80% 90%, rgba(34,211,238,.15), transparent 60%), #070c17; border-right: 1px solid var(--line); }
@media (min-width: 1024px) { .auth-art { display: flex; } }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.auth-box { width: 100%; max-width: 420px; }
.auth-box h1 { font-size: 28px; font-weight: 800; }

/* ============================================================
   Landing page
   ============================================================ */
.site-nav { position: sticky; top: 0; z-index: 50; background: rgba(5,8,15,.7); backdrop-filter: blur(18px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-nav.scrolled { border-color: var(--line); }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .container { padding: 0 24px; } }
.site-nav .container { display: flex; align-items: center; justify-content: space-between; height: 70px; gap: 16px; }
.site-links { display: none; gap: 28px; font-size: 14.5px; font-weight: 600; color: var(--muted); }
.site-links a:hover { color: var(--text); }
@media (min-width: 900px) { .site-links { display: flex; } }
.nav-rate { display: none; margin-right: 4px; }
.nav-rate { height: 30px; padding: 0 4px 0 10px; transition: border-color .15s; }
.nav-rate:hover { border-color: rgba(46, 229, 157, .5); }
.nav-rate svg { width: 14px; height: 14px; }
.nav-rate-buy { margin-left: 4px; padding: 3px 10px; border-radius: 999px; background: var(--green); color: #05080f; font-weight: 700; }
@media (min-width: 600px) { .nav-rate { display: inline-flex; } }

.hero { position: relative; padding: 48px 0 40px; overflow: hidden; }
@media (min-width: 900px) { .hero { padding: 80px 0 72px; } }
.hero-grid { display: grid; gap: 40px; align-items: center; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr 1fr; gap: 56px; } }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 6px; border-radius: 99px; background: rgba(46,229,157,.08); border: 1px solid rgba(46,229,157,.25); font-size: 13px; font-weight: 600; color: #b6f5d8; }
.eyebrow b { background: var(--grad); color: #042018; border-radius: 99px; padding: 2px 10px; font-size: 11.5px; }
.hero h1 { font-size: clamp(38px, 9vw, 68px); font-weight: 800; letter-spacing: -.035em; line-height: 1.04; margin-top: 20px; }
.hero-lead { font-size: 17px; color: var(--muted); margin-top: 18px; max-width: 520px; }
@media (min-width: 768px) { .hero-lead { font-size: 18.5px; } }
.hero-cta { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.hero-cta .btn { flex: 1 1 auto; }
@media (min-width: 560px) { .hero-cta .btn { flex: 0 0 auto; } }
.trust { display: flex; gap: 24px; margin-top: 32px; flex-wrap: wrap; }
.trust div strong { display: block; font-size: 22px; font-weight: 800; }
.trust div span { font-size: 13px; color: var(--muted); }

/* Hero visual */
.hero-visual { position: relative; max-width: 480px; width: 100%; margin: 0 auto; }
.phone { position: relative; border-radius: 34px; padding: 14px; background: linear-gradient(160deg, #1b2438, #0b111e); border: 1px solid var(--line-2); box-shadow: 0 50px 100px -30px rgba(0,0,0,.8), 0 0 0 8px rgba(255,255,255,.02); }
.phone-screen { border-radius: 24px; background: #070c16; padding: 18px; display: flex; flex-direction: column; gap: 14px; overflow: hidden; }
.float-card { position: absolute; z-index: 2; padding: 12px 14px; border-radius: 16px; background: rgba(14,20,36,.92); backdrop-filter: blur(12px); border: 1px solid var(--line-2); box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; font-size: 13px; animation: floaty 6s ease-in-out infinite; }
.float-card.one { left: -14px; top: 58%; }
.float-card.two { right: -10px; bottom: -22px; animation-delay: -3s; }
@media (min-width: 900px) { .float-card.one { left: -48px; } .float-card.two { right: -36px; } }
@keyframes floaty { 50% { transform: translateY(-10px); } }
.orbit { position: absolute; inset: -40px; border-radius: 50%; border: 1px dashed rgba(46,229,157,.15); animation: spin 40s linear infinite; z-index: -1; }
@keyframes spin { to { transform: rotate(360deg); } }

.section { padding: 64px 0; position: relative; }
@media (min-width: 900px) { .section { padding: 96px 0; } }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 40px; }
.section-head h2 { font-size: clamp(28px, 6vw, 44px); font-weight: 800; letter-spacing: -.03em; }
.section-head p { color: var(--muted); margin-top: 12px; font-size: 16.5px; }
.kicker { display: inline-block; font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--green); margin-bottom: 12px; }

.steps { display: grid; gap: 16px; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
.step { position: relative; padding: 26px; border-radius: 22px; background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.01)); border: 1px solid var(--line); overflow: hidden; }
.step-num { position: absolute; right: 18px; top: 8px; font-size: 64px; font-weight: 800; color: rgba(255,255,255,.04); line-height: 1; }
.step h3 { font-size: 19px; margin: 18px 0 8px; }
.step p { color: var(--muted); font-size: 14.5px; }

.feature-grid { display: grid; gap: 14px; }
@media (min-width: 640px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .feature-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.feature { padding: 22px; border-radius: 20px; border: 1px solid var(--line); background: rgba(255,255,255,.02); transition: border-color .2s, transform .2s; }
.feature:hover { border-color: rgba(46,229,157,.3); transform: translateY(-3px); }
.feature h3 { font-size: 16.5px; margin: 16px 0 6px; }
.feature p { color: var(--muted); font-size: 14px; }

.earn-card { max-width: 560px; margin: 0 auto; padding: 8px 22px 22px; }
.earn-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0; border-bottom: 1px dashed var(--line-2); }
.earn-total { display: flex; align-items: center; justify-content: space-between; padding-top: 18px; font-weight: 800; font-size: 20px; }

.faq { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: 16px; background: rgba(255,255,255,.02); padding: 0 20px; }
.faq summary { list-style: none; cursor: pointer; padding: 18px 0; font-weight: 700; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; color: var(--green); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--muted); padding-bottom: 18px; }

.cta-band { position: relative; overflow: hidden; border-radius: 28px; padding: 40px 22px; text-align: center;
    background: radial-gradient(60% 120% at 50% 0%, rgba(46,229,157,.25), transparent 70%), linear-gradient(180deg, #0d1a24, #0a111d); border: 1px solid rgba(46,229,157,.25); }
@media (min-width: 768px) { .cta-band { padding: 64px 40px; } }
.cta-band h2 { font-size: clamp(26px, 5vw, 40px); font-weight: 800; }

.footer { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--muted); font-size: 14px; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .reveal { opacity: 1; transform: none; }
}

/* Compact tree on phones: three rows, smaller nodes (tap a node to go deeper) */
@media (max-width: 767px) {
    .tree { padding: 0 4px; }
    .tree li { padding-left: 3px; padding-right: 3px; }
    .tree > ul > li > ul > li > ul > li > ul { display: none; }
    .node { width: 74px; padding: 10px 4px; border-radius: 14px; gap: 4px; }
    .node .avatar { width: 32px; height: 32px; font-size: 12px; }
    .node-name { font-size: 11px; }
    .node .side-tag { font-size: 9px; }
}

/* ============================================================
   Messages
   ============================================================ */
.icon-btn { position: relative; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.04); border: 1px solid var(--line-2); color: var(--muted); flex: none; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { color: var(--text); }
.icon-btn-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.unread-pill { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--green); color: #042018; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; }
.thread-item.is-unread .avatar { box-shadow: 0 0 0 2px var(--green); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips-scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid rgba(46,229,157,.3); background: rgba(46,229,157,.08); color: #b6f5d8; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s; }
.chip:hover { background: rgba(46,229,157,.16); }

.chat { display: flex; flex-direction: column; height: calc(100dvh - 64px - 18px); margin: 0 -16px; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 0 16px 12px; border-bottom: 1px solid var(--line); }
.chat-progress { display: flex; align-items: center; gap: 12px; margin: 12px 16px 0; padding: 10px 12px; border-radius: 14px; background: linear-gradient(135deg, rgba(46,229,157,.08), rgba(34,211,238,.04)); border: 1px solid rgba(46,229,157,.2); }
.chat-progress .ring::before { inset: 5px; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.chat-empty { margin: auto; }
.bubble { max-width: 82%; align-self: flex-start; padding: 10px 14px 6px; border-radius: 18px 18px 18px 6px; background: var(--surface-2); border: 1px solid var(--line); animation: bubbleIn .25s ease; }
.bubble.mine { align-self: flex-end; border-radius: 18px 18px 6px 18px; background: linear-gradient(135deg, rgba(46,229,157,.22), rgba(34,211,238,.16)); border-color: rgba(46,229,157,.3); }
.bubble-text { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; font-size: 14.5px; }
.bubble-time { display: block; text-align: right; font-size: 10.5px; color: var(--dim); margin-top: 2px; }
.bubble.is-sending { opacity: .6; }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(6px); } }
.chat-compose { display: flex; flex-direction: column; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: rgba(5,8,15,.85); backdrop-filter: blur(16px); }
.chat-compose .textarea { min-height: 46px; max-height: 140px; height: 46px; resize: none; padding-top: 12px; border-radius: 14px; }
.chat-send { width: 46px; height: 46px; padding: 0; border-radius: 14px; flex: none; }

/* Chat screens take the full phone height: hide the tab bar there */
.chat-page .main { padding-bottom: 0; }
.chat-page .bottom-nav { display: none; }
@media (min-width: 1024px) {
    .chat { height: calc(100dvh - 72px - 28px - 24px); margin: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: rgba(255,255,255,.015); }
    .chat-head { padding: 14px 18px; }
    .chat-head .btn { display: none; }
}

/* Password show/hide toggle */
.input-group.has-toggle .input { padding-right: 48px; }
.input-group.no-icon .input { padding-left: 14px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--dim); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pw-toggle:hover, .pw-toggle[aria-pressed="true"] { color: var(--green); }
.pw-toggle:focus-visible { outline: 2px solid rgba(46,229,157,.6); outline-offset: -2px; }
.pw-toggle svg { width: 18px; height: 18px; }

/* ---------- Payment order ---------- */
.order-bar { height: 6px; border-radius: 6px; background: rgba(255,255,255,.06); overflow: hidden; }
.order-bar span { display: block; height: 100%; width: 100%; background: var(--grad-gold); transition: width 1s linear; }
.order-amount { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 14px; border-radius: 16px; background: rgba(251,191,36,.06); border: 1px solid rgba(251,191,36,.25); text-align: center; }
.order-amount strong { font-size: 40px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.order-qr { align-self: center; padding: 10px; border-radius: 14px; background: #fff; line-height: 0; }
.order-qr:empty { display: none; }
.order h2 { font-size: 20px; }
.order .row.center { justify-content: center; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--green); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Hero journey: start -> levels -> top reward ---------- */
.hero-right { min-width: 0; }
.journey { max-width: 480px; margin: 56px auto 0; padding: 18px; border-radius: 20px; background: linear-gradient(135deg, rgba(251,191,36,.08), rgba(46,229,157,.05)); border: 1px solid rgba(251,191,36,.25); text-align: center; }
.journey-steps { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
.journey-steps > div { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.journey-steps > div .coin, .journey-steps > div .icon-box { width: 36px; height: 36px; }
.journey-steps strong { font-size: 16px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.journey-steps > div > span:last-child { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.journey-steps > svg { width: 18px; height: 18px; color: var(--dim); margin-top: 9px; flex: none; }
.journey-price { display: inline-flex; align-items: center; gap: 8px; margin: -2px auto 16px; padding: 6px 6px 6px 12px; border-radius: 999px; background: rgba(46,229,157,.08); border: 1px solid rgba(46,229,157,.25); color: var(--muted); font-size: 12.5px; font-weight: 600; flex-wrap: wrap; justify-content: center; }
.journey-price b { color: var(--text); font-weight: 800; }
.journey-price .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(46,229,157,.2); animation: livePulse 2s infinite; }
@keyframes livePulse { 50% { box-shadow: 0 0 0 6px rgba(46,229,157,0); } }
.journey-steps small { font-size: 12px; color: var(--green); font-weight: 600; margin-top: -4px; white-space: nowrap; }
.journey p { margin-top: 14px; font-size: 14px; color: var(--muted); line-height: 1.5; }
.journey p b { color: var(--text); }
@media (min-width: 560px) { .journey-steps strong { font-size: 18px; } }

/* Language switcher */
.lang-menu { position: relative; flex: none; }
.lang-menu summary { list-style: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-btn { height: 38px; padding: 0 12px; border-radius: 99px; display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.04); border: 1px solid var(--line-2); color: var(--muted); font-size: 12.5px; font-weight: 700; cursor: pointer; }
.lang-btn:hover, .lang-menu[open] .lang-btn { color: var(--text); }
.lang-btn svg { width: 16px; height: 16px; }
.lang-list { position: absolute; z-index: 70; top: calc(100% + 8px); inset-inline-end: 0; min-width: 170px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.lang-list a { padding: 9px 12px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.lang-list a:hover { background: rgba(255,255,255,.05); color: var(--text); }
.lang-list a.active { color: var(--green); }

/* Right-to-left languages (Arabic, Persian) */
[dir="rtl"] body { font-family: 'Vazirmatn', var(--font); }
[dir="rtl"] .right { text-align: left; }
[dir="rtl"] .table th { text-align: right; }
[dir="rtl"] .input-group .input { padding-left: 14px; padding-right: 44px; }
[dir="rtl"] .input-group > svg { left: auto; right: 14px; }
[dir="rtl"] .input-group.has-toggle .input { padding-left: 48px; }
[dir="rtl"] .pw-toggle { right: auto; left: 4px; }
[dir="rtl"] .select { background-position: left 14px center; padding-left: 40px; padding-right: 14px; }
[dir="rtl"] .switch input:checked + .track::after { transform: translateX(-18px); }
[dir="rtl"] .switch .track::after { left: auto; right: 3px; }
[dir="rtl"] .nav .count, [dir="rtl"] .task-reward { margin-left: 0; margin-right: auto; }
[dir="rtl"] .nav-rate { margin-right: 0; margin-left: 4px; }
[dir="rtl"] .nav-rate-buy { margin-left: 0; margin-right: 4px; }
[dir="rtl"] .ref-box { padding: 6px 14px 6px 6px; }
[dir="rtl"] .bubble { border-radius: 18px 18px 6px 18px; }
[dir="rtl"] .bubble.mine { border-radius: 18px 18px 18px 6px; }
[dir="rtl"] .bubble-time { text-align: left; }
[dir="rtl"] .icon-btn-badge { right: auto; left: -4px; }
[dir="rtl"] .level-icon, [dir="rtl"] .step-num { right: auto; left: 18px; }
[dir="rtl"] .level-icon { left: -14px; }
[dir="rtl"] .btn svg[data-icon="arrow-left"], [dir="rtl"] .btn svg[data-icon="arrow-right"],
[dir="rtl"] .pagination svg[data-icon="arrow-left"], [dir="rtl"] .pagination svg[data-icon="arrow-right"],
[dir="rtl"] .journey-steps > svg[data-icon="arrow-right"] { transform: scaleX(-1); }
/* The team tree keeps a fixed left/right layout so "LEFT" and "RIGHT" legs match their labels */
[dir="rtl"] .tree { direction: ltr; }
[dir="rtl"] .node-name { direction: rtl; }
@media (min-width: 1024px) {
    [dir="rtl"] .sidebar { left: auto; right: 0; border-right: 0; border-left: 1px solid var(--line); }
    [dir="rtl"] .main { margin-left: 0; margin-right: var(--sidebar); }
}
[dir="rtl"] .sheet a, [dir="rtl"] .sheet button.sheet-link { text-align: right; }
