/* =========================================================
   Asian Project — premium dark UI
   ========================================================= */
:root {
    --bg: #0a0d17;
    --bg-2: #0f1322;
    --surface: rgba(20, 25, 44, .72);
    --surface-solid: #141a2c;
    --surface-2: #1a2138;
    --line: rgba(255, 255, 255, .08);
    --line-2: rgba(255, 255, 255, .14);
    --text: #eef1f8;
    --text-2: #a7afc4;
    --text-3: #6f7891;
    --gold: #f2bf55;
    --gold-2: #e9a83a;
    --gold-grad: linear-gradient(135deg, #f7d57a 0%, #e9a83a 55%, #c9822a 100%);
    --violet: #7c5cff;
    --teal: #2fd6b5;
    --danger: #ff6b7a;
    --success: #35d99a;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 30px 80px -30px rgba(0, 0, 0, .65);
    --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-display: 'Sora', 'Inter', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: #ffd98a; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.02em; margin: 0; }
.mono { font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: .92em; }
.muted-sm { color: var(--text-2); font-size: 14px; }
.text-cap { text-transform: capitalize; }
::selection { background: rgba(242, 191, 85, .35); }

/* ---------- Background orbs ---------- */
.orbs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.orbs span { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .55; animation: drift 22s ease-in-out infinite alternate; }
.orbs span:nth-child(1) { width: 520px; height: 520px; background: #3b2a8f; top: -160px; left: -140px; }
.orbs span:nth-child(2) { width: 420px; height: 420px; background: #8a5a12; bottom: -160px; left: 28%; animation-delay: -6s; opacity: .4; }
.orbs span:nth-child(3) { width: 360px; height: 360px; background: #0f6b62; top: 20%; right: -120px; animation-delay: -12s; opacity: .35; }
.orbs-soft span { opacity: .28; }
@keyframes drift { to { transform: translate(40px, 30px) scale(1.08); } }
body::before {
    content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at 30% 20%, #000 0%, transparent 70%);
}

/* ---------- Brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 19px; letter-spacing: -.01em; }
.brand:hover { color: var(--text); }
.brand img { filter: drop-shadow(0 6px 18px rgba(233, 168, 58, .35)); }

/* ---------- Auth layout ---------- */
.auth-shell { position: relative; z-index: 1; min-height: 100vh; display: grid; grid-template-columns: 1fr; }
.auth-hero { display: none; }
.auth-panel { display: flex; flex-direction: column; align-items: center; padding: 22px 16px 40px; }
.auth-mobile-brand { width: 100%; max-width: 520px; display: flex; justify-content: center; padding: 8px 0 22px; }

@media (min-width: 992px) {
    .auth-shell { grid-template-columns: minmax(420px, 1fr) minmax(520px, 1.05fr); }
    .auth-hero {
        display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
        padding: 48px clamp(40px, 5vw, 80px);
        border-right: 1px solid var(--line);
        background: linear-gradient(180deg, rgba(15,19,34,.2), rgba(15,19,34,.75));
        position: sticky; top: 0; height: 100vh;
    }
    .auth-panel { justify-content: center; padding: 48px clamp(24px, 5vw, 72px); }
    .auth-mobile-brand { display: none; }
}

.eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
    color: var(--gold); padding: 6px 12px; border-radius: 99px;
    background: rgba(242, 191, 85, .08); border: 1px solid rgba(242, 191, 85, .22);
}
.hero-copy h1 { font-size: clamp(34px, 3.4vw, 50px); line-height: 1.08; margin: 22px 0 16px; font-weight: 700; }
.hero-copy h1 em { font-style: normal; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-copy p { color: var(--text-2); font-size: 17px; max-width: 440px; margin: 0; }
.hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; max-width: 460px; }
.hero-points li { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: var(--radius-sm); background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.hero-points li > i { flex: 0 0 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; color: var(--gold); background: rgba(242,191,85,.1); }
.hero-points strong { display: block; font-weight: 600; font-size: 15px; }
.hero-points span { color: var(--text-2); font-size: 14px; }
.hero-foot { color: var(--text-3); }

/* ---------- Card ---------- */
.auth-card {
    width: 100%; max-width: 520px;
    background: var(--surface);
    backdrop-filter: blur(22px) saturate(140%);
    -webkit-backdrop-filter: blur(22px) saturate(140%);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 28px 22px;
    box-shadow: var(--shadow);
    position: relative;
}
.auth-card::before {
    content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
    background: linear-gradient(140deg, rgba(242,191,85,.45), transparent 35%, transparent 70%, rgba(124,92,255,.35));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor; mask-composite: exclude;
}
@media (min-width: 576px) { .auth-card { padding: 36px 36px 30px; } }

.card-head { margin-bottom: 22px; }
.card-head h2 { font-size: 26px; font-weight: 700; }
.card-head p { color: var(--text-2); margin: 6px 0 0; }
.card-foot { text-align: center; color: var(--text-2); margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 14px; }
.card-foot a { font-weight: 600; }

/* ---------- Segmented tabs ---------- */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 14px; background: rgba(0,0,0,.28); border: 1px solid var(--line); margin-bottom: 22px; }
.seg-btn { border: 0; background: transparent; color: var(--text-2); font-weight: 600; font-size: 14px; padding: 10px; border-radius: 10px; transition: .2s; }
.seg-btn.active { background: var(--surface-2); color: var(--text); box-shadow: 0 6px 18px -8px rgba(0,0,0,.6), inset 0 0 0 1px var(--line-2); }
.seg-btn i { margin-right: 4px; }

/* ---------- Steps ---------- */
.steps { list-style: none; padding: 0; margin: 0 0 24px; display: flex; align-items: center; gap: 10px; }
.step { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-weight: 600; font-size: 14px; white-space: nowrap; }
.step-dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); font-size: 13px; transition: .3s; }
.step-dot i { display: none; font-size: 16px; }
.step-line { flex: 1; height: 2px; border-radius: 2px; background: var(--line-2); position: relative; overflow: hidden; }
.step-line::after { content: ""; position: absolute; inset: 0; width: 0; background: var(--gold-grad); transition: width .5s ease; }
.steps .step.is-active { color: var(--text); }
.steps .step.is-active .step-dot { border-color: transparent; background: var(--gold-grad); color: #1a1205; box-shadow: 0 0 0 4px rgba(242,191,85,.15); }
.steps .step.is-done .step-dot { border-color: rgba(53,217,154,.5); background: rgba(53,217,154,.12); color: var(--success); }
.steps .step.is-done .step-dot i { display: block; }
.steps .step.is-done .step-dot b { display: none; }
.steps .step.is-done { color: var(--text-2); }
.steps[data-step="2"] .step-line::after { width: 100%; }
@media (max-width: 380px) { .step-txt { font-size: 13px; } }

/* ---------- Wallet buttons ---------- */
.wallet-options { display: grid; gap: 12px; }
.wallet-btn {
    display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
    padding: 16px; border-radius: 16px; color: var(--text);
    background: rgba(255,255,255,.03); border: 1px solid var(--line-2);
    transition: transform .15s, border-color .2s, background .2s;
}
.wallet-btn:hover { border-color: rgba(242,191,85,.55); background: rgba(242,191,85,.06); transform: translateY(-1px); }
.wallet-btn:disabled { opacity: .6; transform: none; }
.wallet-btn.is-busy .wallet-go { display: none; }
.wallet-btn.is-busy::after { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--gold); animation: spin .7s linear infinite; }
.wallet-ico { flex: 0 0 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 22px; }
.wallet-ico-mm { background: linear-gradient(135deg, #f6851b, #e2761b); color: #fff; box-shadow: 0 10px 24px -10px #f6851b; }
.wallet-ico-tw { background: linear-gradient(135deg, #3375bb, #0500ff); color: #fff; box-shadow: 0 10px 24px -10px #3375bb; }
.wallet-txt { flex: 1; display: flex; flex-direction: column; }
.wallet-txt strong { font-weight: 600; font-size: 16px; }
.wallet-txt small { color: var(--text-2); font-size: 13px; }
.wallet-go { color: var(--text-3); font-size: 18px; }
@keyframes spin { to { transform: rotate(360deg); } }

.wallet-status { margin-top: 14px; padding: 12px 14px; border-radius: 12px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; background: rgba(255,255,255,.04); border: 1px solid var(--line); color: var(--text-2); }
.wallet-status.is-error { background: rgba(255,107,122,.08); border-color: rgba(255,107,122,.3); color: #ffc2c8; }
.wallet-status.is-ok { background: rgba(53,217,154,.08); border-color: rgba(53,217,154,.3); color: #b5f3d9; }
.wallet-status .ws-links { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.note { display: flex; gap: 12px; margin-top: 18px; padding: 14px 16px; border-radius: 14px; background: rgba(124,92,255,.08); border: 1px solid rgba(124,92,255,.22); color: #cfc6ff; font-size: 13.5px; }
.note i { color: #a593ff; font-size: 17px; margin-top: 1px; }

/* ---------- Wallet chip (step 2) ---------- */
.wallet-chip { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 20px; border-radius: 14px; background: rgba(53,217,154,.07); border: 1px solid rgba(53,217,154,.28); }
.wallet-chip-ico { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: rgba(53,217,154,.15); color: var(--success); font-size: 18px; }
.wallet-chip-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wallet-chip-txt small { color: var(--success); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.wallet-chip-txt strong { font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
.chip-btn { border: 1px solid var(--line-2); background: rgba(255,255,255,.05); color: var(--text); font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 99px; transition: .2s; white-space: nowrap; }
.chip-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- Form fields ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 576px) { .grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.field { min-width: 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 7px; }
.input-x {
    display: flex; align-items: center; gap: 10px;
    height: 50px; padding: 0 14px; border-radius: var(--radius-sm);
    background: rgba(0,0,0,.25); border: 1px solid var(--line-2);
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.input-x:focus-within { border-color: rgba(242,191,85,.7); box-shadow: 0 0 0 4px rgba(242,191,85,.12); background: rgba(0,0,0,.35); }
.input-x > i { color: var(--text-3); font-size: 17px; }
.input-x input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15px; }
.input-x input::placeholder { color: var(--text-3); }
.input-x input[readonly] { cursor: default; }
.input-x.is-readonly { background: rgba(255,255,255,.025); border-style: dashed; }
.input-x.is-invalid { border-color: rgba(255,107,122,.7); box-shadow: 0 0 0 4px rgba(255,107,122,.1); }
.input-x.is-valid { border-color: rgba(53,217,154,.6); }
.input-x .prefix { color: var(--text-2); font-weight: 600; padding-right: 10px; border-right: 1px solid var(--line-2); font-size: 14px; }
.input-x input:-webkit-autofill { -webkit-text-fill-color: var(--text); transition: background-color 9999s; caret-color: var(--text); }
.eye { border: 0; background: transparent; color: var(--text-3); padding: 4px; font-size: 17px; }
.eye:hover { color: var(--text); }
.input-state { font-size: 16px; display: grid; place-items: center; }
.input-state .bi-check-circle-fill { color: var(--success); }
.input-state .bi-x-circle-fill { color: var(--danger); }
.input-state .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--gold); animation: spin .7s linear infinite; }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 6px; }
.field-hint { font-size: 12.5px; margin-top: 6px; color: var(--text-3); min-height: 1px; }
.field-hint.is-error { color: var(--danger); }
.strength { height: 4px; border-radius: 4px; background: var(--line); margin-top: 8px; overflow: hidden; }
.strength span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .3s, background .3s; }

/* ---------- Buttons ---------- */
.btn-x {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 50px; padding: 0 22px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 15px; border: 1px solid transparent;
    transition: transform .15s, box-shadow .2s, filter .2s; white-space: nowrap;
}
.btn-x-primary { background: var(--gold-grad); color: #1d1405; box-shadow: 0 14px 30px -14px rgba(233,168,58,.8), inset 0 1px 0 rgba(255,255,255,.35); }
.btn-x-primary:hover { color: #1d1405; filter: brightness(1.06); transform: translateY(-1px); }
.btn-x-primary:disabled { filter: grayscale(.4) brightness(.8); transform: none; }
.btn-x-ghost { background: rgba(255,255,255,.05); border-color: var(--line-2); color: var(--text); }
.btn-x-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-x-sm { height: 38px; padding: 0 14px; font-size: 13px; }
.btn-x .spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(0,0,0,.25); border-top-color: #1d1405; animation: spin .7s linear infinite; }

/* ---------- Alerts / toast ---------- */
.alert-x { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; margin-bottom: 18px; font-size: 14px; }
.alert-x i { font-size: 17px; }
.alert-x-danger { background: rgba(255,107,122,.09); border: 1px solid rgba(255,107,122,.3); color: #ffc2c8; }
.alert-x-success { background: rgba(53,217,154,.09); border: 1px solid rgba(53,217,154,.3); color: #b5f3d9; }
.toast-x {
    position: fixed; left: 50%; bottom: 24px; z-index: 1080; transform: translate(-50%, 140%);
    padding: 12px 18px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2);
    color: var(--text); font-size: 14px; box-shadow: var(--shadow); opacity: 0; visibility: hidden;
    transition: transform .3s cubic-bezier(.2,.9,.3,1.2), opacity .2s, visibility .2s;
    max-width: calc(100% - 32px);
}
.toast-x.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }

/* ---------- Success ---------- */
.success-head { text-align: center; margin-bottom: 22px; }
.success-badge { width: 76px; height: 76px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; font-size: 38px; color: #1d1405; background: var(--gold-grad); box-shadow: 0 0 0 10px rgba(242,191,85,.1), 0 20px 40px -12px rgba(233,168,58,.7); animation: pop .5s cubic-bezier(.2,.9,.3,1.4); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.success-head h2 { font-size: 24px; }
.success-head p { color: var(--text-2); margin: 8px 0 0; }
.id-card { border-radius: 18px; padding: 20px; margin-bottom: 20px; background: linear-gradient(145deg, rgba(242,191,85,.12), rgba(124,92,255,.08)); border: 1px solid rgba(242,191,85,.3); }
.id-card-top { display: flex; justify-content: space-between; align-items: center; }
.id-card-top small { color: var(--text-2); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; }
.id-card-id { font-family: var(--font-display); font-weight: 700; font-size: clamp(28px, 8vw, 36px); letter-spacing: .02em; margin: 8px 0 16px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.id-card-meta, .kv { margin: 0; display: grid; gap: 10px; }
.id-card-meta div, .kv div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.id-card-meta dt, .kv dt { color: var(--text-3); font-weight: 500; }
.id-card-meta dd, .kv dd { margin: 0; text-align: right; color: var(--text); font-weight: 500; word-break: break-word; }

/* ---------- App (dashboard) ---------- */
.user-chip { display: flex; align-items: center; gap: 10px; padding: 5px 12px 5px 5px; border-radius: 99px; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); color: var(--text); }
.user-chip .avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--gold-grad); color: #1d1405; font-family: var(--font-display); }
.user-chip-txt { display: none; text-align: left; line-height: 1.15; }
.user-chip-txt strong { display: block; font-size: 14px; font-weight: 600; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip-txt small { color: var(--text-3); font-size: 12px; }
@media (min-width: 576px) { .user-chip-txt { display: block; } }
.menu-x { background: var(--surface-solid); border: 1px solid var(--line-2); border-radius: 14px; padding: 6px; box-shadow: var(--shadow); min-width: 200px; }
.menu-x .dropdown-item { color: var(--text); border-radius: 9px; padding: 9px 12px; display: flex; gap: 10px; font-size: 14px; }
.menu-x .dropdown-item:hover { background: rgba(255,255,255,.06); color: var(--text); }
.menu-x .text-danger-x { color: var(--danger); }
.menu-x .dropdown-divider { border-color: var(--line); }


.hero-card {
    display: flex; flex-direction: column; gap: 22px; padding: 24px; border-radius: 22px; margin-bottom: 18px;
    background: radial-gradient(circle at 100% 0%, rgba(242,191,85,.18), transparent 50%), linear-gradient(145deg, #171d33, #11162a);
    border: 1px solid var(--line-2); box-shadow: var(--shadow);
}
.hero-card h1 { font-size: clamp(26px, 4vw, 36px); margin: 14px 0 6px; }
.hero-card p { color: var(--text-2); margin: 0; }
.hero-id { padding: 16px 18px; border-radius: 16px; background: rgba(0,0,0,.28); border: 1px solid rgba(242,191,85,.3); display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 12px; }
.hero-id small { color: var(--text-3); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; grid-column: 1; }
.hero-id strong { font-family: var(--font-display); font-size: 26px; grid-column: 1; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-id .chip-btn { grid-column: 2; grid-row: 1 / span 2; }
@media (min-width: 768px) { .hero-card { flex-direction: row; align-items: center; justify-content: space-between; padding: 32px 36px; } .hero-id { min-width: 300px; } }

.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 18px; }
@media (min-width: 992px) { .stats { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
.stat { padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.stat-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(242,191,85,.1); color: var(--gold); font-size: 18px; margin-bottom: 8px; }
.stat small { color: var(--text-3); font-size: 13px; }
.stat strong { font-family: var(--font-display); font-size: clamp(16px, 4.4vw, 20px); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }

.panels { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.panel, .stat { min-width: 0; }
@media (min-width: 992px) { .panels { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .panels .panel-wide { grid-column: 1 / -1; } }
.panel { padding: 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); backdrop-filter: blur(12px); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.panel-head h3 { font-size: 17px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.panel-head h3 i { color: var(--gold); }
.pill { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: rgba(53,217,154,.12); color: var(--success); border: 1px solid rgba(53,217,154,.25); }
.copy-row { display: flex; gap: 8px; margin-top: 10px; }
.copy-row input { flex: 1; min-width: 0; height: 50px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: rgba(0,0,0,.25); color: var(--text); font-size: 14px; outline: 0; }
.copy-row .btn-x { flex: 0 0 auto; padding: 0 16px; }


/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Connect Wallet button ---------- */
.btn-connect {
    display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
    padding: 16px 18px; border-radius: 16px; border: 1px solid rgba(242,191,85,.45); color: var(--text);
    background: linear-gradient(135deg, rgba(242,191,85,.16), rgba(124,92,255,.10));
    box-shadow: 0 18px 40px -22px rgba(233,168,58,.7); transition: transform .15s, border-color .2s, box-shadow .2s;
}
.btn-connect:hover { transform: translateY(-1px); border-color: var(--gold); box-shadow: 0 22px 44px -20px rgba(233,168,58,.85); }
.btn-connect:disabled { opacity: .7; transform: none; }
.btn-connect-ico { flex: 0 0 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; color: #1d1405; background: var(--gold-grad); }
.btn-connect-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.btn-connect-txt strong { font-family: var(--font-display); font-weight: 600; font-size: 17px; }
.btn-connect-txt small { color: var(--text-2); font-size: 12.5px; }
.btn-connect-go { color: var(--gold); font-size: 19px; }
.btn-connect.is-busy .btn-connect-go { display: none; }
.btn-connect.is-busy::after { content: ""; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--gold); animation: spin .7s linear infinite; }

/* ---------- Wallet sheet ---------- */
body.ws-open { overflow: hidden; }
.wsheet { position: fixed; inset: 0; z-index: 1070; display: flex; align-items: flex-end; justify-content: center; }
.wsheet-backdrop { position: absolute; inset: 0; background: rgba(4,6,12,.66); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); opacity: 0; transition: opacity .2s; }
.wsheet-panel {
    position: relative; width: 100%; max-height: 88vh; display: flex; flex-direction: column;
    background: var(--surface-solid); border: 1px solid var(--line-2); border-bottom: 0;
    border-radius: 24px 24px 0 0; box-shadow: 0 -30px 80px -20px rgba(0,0,0,.8);
    transform: translateY(100%); transition: transform .26s cubic-bezier(.2,.9,.3,1);
    padding-bottom: env(safe-area-inset-bottom);
}
.wsheet.is-open .wsheet-backdrop { opacity: 1; }
.wsheet.is-open .wsheet-panel { transform: none; }
.wsheet-handle { width: 42px; height: 5px; border-radius: 5px; background: var(--line-2); margin: 10px auto 0; }
.wsheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 20px 10px; }
.wsheet-head h3 { font-size: 19px; font-weight: 600; }
.wsheet-x { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); color: var(--text-2); display: grid; place-items: center; }
.wsheet-x:hover { color: var(--text); border-color: var(--text-3); }
.wsheet-body { overflow-y: auto; padding: 4px 20px 22px; overscroll-behavior: contain; }
@media (min-width: 768px) {
    .wsheet { align-items: center; }
    .wsheet-panel { max-width: 440px; max-height: 80vh; border-radius: 22px; border-bottom: 1px solid var(--line-2); transform: translateY(16px) scale(.97); opacity: 0; transition: transform .22s, opacity .22s; }
    .wsheet.is-open .wsheet-panel { transform: none; opacity: 1; }
    .wsheet-handle { display: none; }
}

.ws-sec { margin-top: 8px; }
.ws-sec + .ws-sec { margin-top: 18px; }
.ws-sec h4 { font-family: var(--font); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px rgba(53,217,154,.18); }
.wlist { display: grid; gap: 8px; }
.wl-item {
    display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px 12px;
    border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: var(--text); transition: .15s;
}
.wl-item:hover { border-color: rgba(242,191,85,.5); background: rgba(242,191,85,.05); }
.wl-ico { flex: 0 0 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; overflow: hidden; background: rgba(255,255,255,.06); }
.wl-ico img { width: 100%; height: 100%; object-fit: cover; }
.wl-mono { background: var(--wc); color: #fff; font-family: var(--font-display); font-weight: 700; font-size: 14px; text-shadow: 0 1px 2px rgba(0,0,0,.35); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.wl-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.wl-txt strong { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-txt small { color: var(--text-3); font-size: 12.5px; }
.wl-txt small.ok { color: var(--success); }
.wl-cta { font-size: 12.5px; font-weight: 700; padding: 6px 12px; border-radius: 99px; background: var(--gold-grad); color: #1d1405; white-space: nowrap; }
.wl-cta-ghost { background: rgba(255,255,255,.06); color: var(--text-2); border: 1px solid var(--line-2); }
.ws-help { margin-top: 20px; padding: 14px; border-radius: 14px; background: rgba(124,92,255,.07); border: 1px solid rgba(124,92,255,.2); }
.ws-help p { margin: 0; color: #cfc6ff; font-size: 13px; display: flex; gap: 8px; }
.ws-help .copy-row input, .ws-help .copy-row .btn-x { height: 42px; font-size: 13px; }

/* ---------- Success: login details ---------- */
.cred { padding: 4px 0 12px; }
.cred + .cred { border-top: 1px dashed rgba(242,191,85,.25); padding-top: 12px; }
.cred-label { display: block; color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.cred .id-card-id { margin: 4px 0 0; }
.cred-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.cred-value { font-size: 20px; font-weight: 600; letter-spacing: .04em; color: var(--text); word-break: break-all; }
.cred-pass { margin-bottom: 14px; }
.cred-warn { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #ffd98a; background: rgba(242,191,85,.08); border: 1px solid rgba(242,191,85,.25); border-radius: 12px; padding: 10px 12px; margin: -6px 0 18px; }

/* =========================================================
   Member area — sidebar layout
   ========================================================= */
:root { --sb-w: 264px; --sb-w-mini: 78px; --top-h: 68px; }

.sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 1040; width: var(--sb-w);
    display: flex; flex-direction: column;
    background: linear-gradient(180deg, #11162a 0%, #0c1020 100%);
    border-right: 1px solid var(--line);
    transition: width .22s ease, transform .25s ease;
}
.sb-head { display: flex; align-items: center; justify-content: space-between; height: var(--top-h); padding: 0 16px 0 20px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
.sb-head .brand { font-size: 17px; gap: 10px; min-width: 0; }
.sb-head .brand span { white-space: nowrap; }
.sidebar .sb-close { display: none; }

.sb-user { display: flex; align-items: center; gap: 12px; margin: 16px 14px 6px; padding: 12px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.sb-user .avatar, .user-chip .avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--gold-grad); color: #1d1405; font-family: var(--font-display); }
.sb-user .sb-text { min-width: 0; line-height: 1.2; }
.sb-user strong { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user small { color: var(--gold); font-size: 12px; font-weight: 600; }

.sb-nav { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.sb-label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); padding: 8px 10px 6px; }
.sb-link {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border-radius: 12px;
    border: 0; background: transparent; color: var(--text-2); font-size: 14.5px; font-weight: 500; text-align: left;
    transition: background .15s, color .15s; position: relative; white-space: nowrap;
}
.sb-link > i:first-child { font-size: 18px; width: 22px; text-align: center; flex: 0 0 22px; }
.sb-link:hover { background: rgba(255,255,255,.05); color: var(--text); }
.sb-link.active { color: var(--text); background: linear-gradient(90deg, rgba(242,191,85,.16), rgba(242,191,85,.03)); }
.sb-link.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold-grad); }
.sb-link.active > i:first-child { color: var(--gold); }
.sb-caret { margin-left: auto; font-size: 12px; transition: transform .2s; }
.sb-group.open .sb-caret { transform: rotate(180deg); }
.sb-sub { padding-left: 22px; }
.sb-sub-title { display: none; }
.sb-sub a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; margin: 2px 0; border-radius: 10px; color: var(--text-2); font-size: 14px; border-left: 1px solid var(--line-2); border-radius: 0 10px 10px 0; }
.sb-sub a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.sb-sub a.active { color: var(--gold); border-left-color: var(--gold); background: rgba(242,191,85,.06); }
.sb-group .sb-sub { display: block; max-height: 0; overflow: hidden; transition: max-height .25s ease; }
.sb-group.open .sb-sub { max-height: 200px; }

.sb-foot { padding: 12px; border-top: 1px solid var(--line); }
.sb-danger { color: #ff9aa5; }
.sb-danger:hover { background: rgba(255,107,122,.1); color: var(--danger); }

.sb-overlay { position: fixed; inset: 0; z-index: 1035; background: rgba(4,6,12,.6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s; }

/* Main column */
.app-wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; margin-left: var(--sb-w); transition: margin-left .22s ease; }
.topbar {
    position: sticky; top: 0; z-index: 1030; height: var(--top-h); display: flex; align-items: center; gap: 14px; padding: 0 16px;
    background: rgba(10,13,23,.78); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
}
.icon-btn { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line-2); background: rgba(255,255,255,.04); color: var(--text); font-size: 20px; transition: .15s; }
.icon-btn:hover { border-color: var(--gold); color: var(--gold); }
.page-title { font-size: 18px; font-weight: 600; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip-txt { display: none; text-align: left; line-height: 1.15; }
.app-main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 22px 16px 40px; }
.app-foot { text-align: center; color: var(--text-3); font-size: 13px; padding: 18px 16px 24px; }
@media (min-width: 576px) { .user-chip-txt { display: block; } }
@media (min-width: 768px) { .topbar { padding: 0 28px; } .app-main { padding: 32px 28px 48px; } .page-title { font-size: 20px; } }

/* Desktop: icon-only collapsed mode */
@media (min-width: 992px) {
    .sb-collapsed .sidebar { width: var(--sb-w-mini); }
    .sb-collapsed .app-wrap { margin-left: var(--sb-w-mini); }
    .sb-collapsed .sb-text, .sb-collapsed .sb-caret, .sb-collapsed .sb-label { display: none; }
    .sb-collapsed .sb-head { justify-content: center; padding: 0; }
    .sb-collapsed .sb-user { justify-content: center; padding: 8px; margin: 14px 12px 6px; }
    .sb-collapsed .sb-link { justify-content: center; padding: 12px 0; }
    .sb-collapsed .sb-nav { overflow: visible; }
    /* sub-menu becomes a hover flyout */
    .sb-collapsed .sb-group { position: relative; }
    .sb-collapsed .sb-group .sb-sub {
        position: absolute; left: calc(100% + 10px); top: 0; min-width: 210px; max-height: none; padding: 8px;
        background: var(--surface-solid); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow);
        opacity: 0; visibility: hidden; transform: translateX(-6px); transition: .15s;
    }
    .sb-collapsed .sb-group:hover .sb-sub, .sb-collapsed .sb-group:focus-within .sb-sub { opacity: 1; visibility: visible; transform: none; }
    .sb-collapsed .sb-sub-title { display: block; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); padding: 6px 10px 8px; }
    .sb-collapsed .sb-sub a { border-left: 0; border-radius: 10px; }
    .sb-collapsed .sb-link.active::before { left: -12px; }
}

/* Mobile / tablet: slide-in drawer */
@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); width: min(86vw, 300px); box-shadow: 30px 0 80px -20px rgba(0,0,0,.8); }
    .sb-open .sidebar { transform: none; }
    .sb-open .sb-overlay { opacity: 1; visibility: visible; }
    .sb-open body { overflow: hidden; }
    .sidebar .sb-close { display: grid; width: 38px; height: 38px; flex-basis: 38px; font-size: 16px; }
    .app-wrap { margin-left: 0; }
}

/* ---------- Profile ---------- */
.profile-hero {
    display: flex; flex-wrap: wrap; align-items: center; gap: 18px 20px; padding: 24px; margin-bottom: 18px; border-radius: 22px;
    background: radial-gradient(circle at 100% 0%, rgba(242,191,85,.16), transparent 50%), linear-gradient(145deg, #171d33, #11162a);
    border: 1px solid var(--line-2); box-shadow: var(--shadow);
}
.profile-avatar { width: 78px; height: 78px; flex: 0 0 78px; border-radius: 22px; display: grid; place-items: center; font-family: var(--font-display); font-size: 34px; font-weight: 700; color: #1d1405; background: var(--gold-grad); box-shadow: 0 16px 34px -14px rgba(233,168,58,.8); }
.profile-id { flex: 1; min-width: 200px; }
.profile-id h2 { font-size: clamp(22px, 3vw, 28px); margin-bottom: 8px; }
.profile-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pill-gold { background: rgba(242,191,85,.12); color: var(--gold); border-color: rgba(242,191,85,.3); }
.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; width: 100%; }
.profile-actions .btn-x { flex: 1; height: 46px; }
@media (min-width: 768px) { .profile-actions { width: auto; } .profile-actions .btn-x { flex: 0 0 auto; } .profile-hero { padding: 30px 32px; } }

.narrow { max-width: 560px; }
.panel-lg { padding: 26px; }
@media (min-width: 768px) { .panel-lg { padding: 32px; } }
.panel .alert-x { margin-top: 4px; }

/* ---------- Wallet change & logs ---------- */
.sb-group.open .sb-sub { max-height: 320px; }
.text-gold { color: var(--gold); }
.muted-xs { color: var(--text-3); font-size: 12px; }
.mt-0 { margin-top: 0 !important; }
#changeWalletPanel .note { margin-top: 20px; }
.swap-line { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px; margin: -6px 0 18px; border-radius: 12px; background: rgba(0,0,0,.22); border: 1px dashed var(--line-2); font-size: 14px; }
.swap-line i { color: var(--text-3); }

.log-list { display: grid; gap: 10px; }
.log-item { display: flex; gap: 12px; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.025); border: 1px solid var(--line); }
.log-ico { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(242,191,85,.12); color: var(--gold); font-size: 17px; }
.log-ico.is-reg { background: rgba(53,217,154,.12); color: var(--success); }
.log-body { flex: 1; min-width: 0; }
.log-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; }
.log-top strong { font-size: 14.5px; font-weight: 600; }
.log-top time { color: var(--text-3); font-size: 12.5px; }
.log-swap { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 6px; font-size: 13.5px; }
.log-swap small { color: var(--text-3); font-size: 12px; }
.log-swap i { color: var(--text-3); }
.log-meta { color: var(--text-3); font-size: 12px; margin-top: 6px; }

.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); }
.table-x { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-x th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); background: rgba(255,255,255,.03); padding: 12px 14px; white-space: nowrap; }
.table-x td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
.table-x tbody tr:hover td { background: rgba(255,255,255,.02); }
.copy-mini { border: 0; background: transparent; color: var(--text-3); padding: 0 4px; font-size: 13px; }
.copy-mini:hover { color: var(--gold); }
.empty { text-align: center; padding: 40px 10px; color: var(--text-3); }
.empty i { font-size: 34px; display: block; margin-bottom: 8px; }

.pager-x { margin-top: 16px; }
.pager-x .pagination { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0; justify-content: center; }
.pager-x .pagination li a, .pager-x .pagination li span { display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-2); color: var(--text-2); font-size: 14px; }
.pager-x .pagination li.active a, .pager-x .pagination li.active span { background: var(--gold-grad); color: #1d1405; border-color: transparent; font-weight: 700; }

/* =========================================================
   Genealogy
   ========================================================= */
/* Level progress card */
.level-card {
    display: grid; gap: 18px; padding: 22px; margin-bottom: 18px; border-radius: 22px;
    background: radial-gradient(circle at 0% 0%, rgba(124,92,255,.16), transparent 45%), linear-gradient(145deg, #171d33, #11162a);
    border: 1px solid var(--line-2); box-shadow: var(--shadow);
}
@media (min-width: 992px) { .level-card { grid-template-columns: minmax(260px, .8fr) 1.4fr; padding: 28px 30px; align-items: center; } }
.lc-badge { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.lc-num { width: 72px; height: 72px; flex: 0 0 72px; border-radius: 20px; display: grid; place-items: center; font-family: var(--font-display); font-size: 34px; font-weight: 700; color: #1d1405; background: var(--gold-grad); box-shadow: 0 14px 30px -12px rgba(233,168,58,.8); }
.lc-badge strong { display: block; font-family: var(--font-display); font-size: 20px; }
.lc-badge small { color: var(--text-2); font-size: 13px; }
.lc-next { position: relative; padding: 18px; border-radius: 18px; background: rgba(0,0,0,.25); border: 1px solid var(--line); }
.lc-next-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-bottom: 12px; }
.lc-next-head small { display: block; color: var(--text-3); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.lc-next-head strong { font-family: var(--font-display); font-size: 22px; }
.lc-remaining { text-align: right; }
.lc-remaining strong { color: var(--gold); }
.lc-remaining small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.lc-bar { height: 10px; border-radius: 10px; background: rgba(255,255,255,.07); overflow: hidden; }
.lc-bar span { display: block; height: 100%; border-radius: inherit; background: var(--gold-grad); box-shadow: 0 0 16px rgba(242,191,85,.5); transition: width .6s ease; }
.lc-bar.sm { height: 6px; }
.lc-meta { display: flex; justify-content: space-between; color: var(--text-2); font-size: 13px; margin-top: 8px; }
.lc-legs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.lc-leg { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.lc-leg small { display: block; color: var(--text-3); font-size: 12px; }
.lc-leg strong { font-family: var(--font-display); font-size: 18px; }
.lc-leg em { font-style: normal; color: var(--text-3); font-size: 14px; font-weight: 500; }
.lc-done { color: var(--success); font-weight: 600; padding: 10px 0; }
.lc-link { display: inline-flex; gap: 6px; align-items: center; margin-top: 14px; }

/* Level list */
.lv-list { display: grid; gap: 10px; }
.lv-row { display: flex; gap: 14px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.lv-badge { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 12px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; background: rgba(255,255,255,.05); color: var(--text-3); border: 1px solid var(--line-2); }
.lv-row.is-done .lv-badge { background: rgba(53,217,154,.14); color: var(--success); border-color: rgba(53,217,154,.3); font-size: 20px; }
.lv-row.is-current { border-color: rgba(242,191,85,.45); background: rgba(242,191,85,.05); }
.lv-row.is-current .lv-badge { background: var(--gold-grad); color: #1d1405; border-color: transparent; }
.lv-row.is-locked { opacity: .6; }
.lv-body { flex: 1; min-width: 0; }
.lv-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; margin-bottom: 8px; }
.lv-top strong { font-size: 15px; }
.lv-status { font-size: 12.5px; color: var(--text-2); }
.lv-row.is-done .lv-status { color: var(--success); }
.lv-row.is-current .lv-status { color: var(--gold); }
.lv-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: 12.5px; color: var(--text-3); }
.lv-meta a { margin-left: auto; font-weight: 600; }

/* Tree view */
.tree-toolbar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin-bottom: 14px; }
.tree-search, .mini-search { display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 6px 0 14px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.25); flex: 1; max-width: 420px; }
.tree-search i, .mini-search i { color: var(--text-3); }
.tree-search input, .mini-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 14px; }
.tree-search:focus-within, .mini-search:focus-within { border-color: rgba(242,191,85,.6); }
.mini-search { max-width: 260px; padding-right: 14px; }
.tree-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tree-summary { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 768px) { .tree-summary { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.tree-summary > div { padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.tree-summary small { display: block; color: var(--text-3); font-size: 12px; }
.tree-summary strong { font-family: var(--font-display); font-size: 20px; }
.tree-summary span { display: block; color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tree-panel { padding: 0; overflow: hidden; }
.tree-scroll { overflow-x: auto; padding: 26px 12px 18px; -webkit-overflow-scrolling: touch; }
.tree { display: flex; justify-content: center; min-width: max-content; margin: 0 auto; }
.tree ul { position: relative; display: flex; justify-content: center; padding: 26px 0 0; margin: 0; list-style: none; }
.tree > ul { padding-top: 0; }
.tree li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 26px 6px 0; }
.tree > ul > li { padding-top: 0; }
/* connectors */
.tree li::before, .tree li::after { content: ""; position: absolute; top: 0; width: 50%; height: 26px; border-top: 2px solid rgba(242,191,85,.35); }
.tree li::before { right: 50%; }
.tree li::after { left: 50%; border-left: 2px solid rgba(242,191,85,.35); }
.tree li:first-child::before, .tree li:last-child::after { border: 0; }
.tree li:last-child::before { border-right: 2px solid rgba(242,191,85,.35); 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(242,191,85,.35); }
.tree > ul > li::before, .tree > ul > li::after { display: none; }

.tnode {
    position: relative; width: 112px; padding: 12px 8px 10px; border-radius: 16px; text-align: center; color: var(--text);
    background: linear-gradient(160deg, #1b2240, #131a30); border: 1px solid var(--line-2); display: flex; flex-direction: column; align-items: center; gap: 2px;
    transition: transform .15s, border-color .15s, box-shadow .15s;
}
a.tnode:hover { color: var(--text); transform: translateY(-2px); border-color: rgba(242,191,85,.6); box-shadow: 0 14px 30px -14px rgba(233,168,58,.6); }
.tnode.is-top { border-color: rgba(242,191,85,.6); box-shadow: 0 0 0 4px rgba(242,191,85,.08); }
.tnode-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; color: #1d1405; background: var(--gold-grad); margin-bottom: 4px; }
.tnode strong { font-size: 12.5px; letter-spacing: .02em; }
.tnode small { color: var(--text-3); font-size: 11.5px; line-height: 1.2; }
.tnode-legs { display: flex; gap: 6px; margin-top: 6px; }
.tnode-legs span { font-size: 10.5px; font-weight: 600; padding: 2px 6px; border-radius: 6px; background: rgba(255,255,255,.06); color: var(--text-2); }
.tnode-side { position: absolute; top: -9px; right: -6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; background: #2a3150; color: var(--text); border: 1px solid var(--line-2); }
.tnode.is-blocked { opacity: .55; }
.tnode.is-empty { background: transparent; border-style: dashed; color: var(--text-3); padding: 16px 8px; }
.tnode.is-empty .tnode-av { background: rgba(255,255,255,.04); color: var(--text-3); border: 1px dashed var(--line-2); }
.tnode.is-ghost { opacity: .35; }
.tree-hint { padding: 0 18px 18px; margin: 0; }
@media (max-width: 767.98px) {
    .tnode { width: 86px; padding: 10px 4px 8px; border-radius: 14px; }
    .tnode-av { width: 32px; height: 32px; font-size: 13px; }
    .tnode strong { font-size: 10.5px; }
    .tnode small { font-size: 10px; }
    .tnode-legs span { font-size: 9.5px; padding: 1px 4px; }
    .tree li { padding-left: 3px; padding-right: 3px; }
}

/* Lists */
.member-link { display: flex; flex-direction: column; color: var(--text); }
.member-link small { color: var(--text-3); font-size: 12.5px; }
.member-link:hover strong { color: var(--gold); }
.side-tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.side-L { background: rgba(124,92,255,.15); color: #b9a8ff; }
.side-R { background: rgba(47,214,181,.13); color: #7ff0d6; }
.mlist { display: grid; gap: 10px; }
.mcard { display: flex; gap: 12px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.025); color: var(--text); }
.mcard:hover { color: var(--text); border-color: rgba(242,191,85,.4); }
.mcard-av { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #1d1405; background: var(--gold-grad); }
.mcard-body { flex: 1; min-width: 0; }
.mcard-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mcard-top time { color: var(--text-3); font-size: 12px; }
.mcard-body > small { color: var(--text-2); font-size: 13px; }
.mcard-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; color: var(--text-3); font-size: 12px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.filters .mini-search { flex: 1 1 200px; max-width: none; }
.select-x { height: 42px; padding: 0 34px 0 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(0,0,0,.25) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23a7afc4' viewBox='0 0 16 16'%3E%3Cpath d='M1.6 4.6a.5.5 0 0 1 .7 0L8 10.3l5.6-5.7a.5.5 0 0 1 .8.7l-6 6a.5.5 0 0 1-.8 0l-6-6a.5.5 0 0 1 0-.7z'/%3E%3C/svg%3E") no-repeat right 12px center; color: var(--text); font-size: 14px; appearance: none; -webkit-appearance: none; }
.select-x option { background: #141a2c; }
.panel-head h3 .pill { margin-left: 6px; }
.panel-head { flex-wrap: wrap; }
@media (max-width: 575.98px) { .panel-head .mini-search { flex: 1 1 100%; max-width: none; } }
/* Phones: show 3 rows (7 members) so the tree fits; tap a member to go deeper */
@media (max-width: 575.98px) {
    .tree ul ul ul ul { display: none; }
    .tnode { width: 78px; }
    .tree li { padding-left: 2px; padding-right: 2px; }
    .tree-scroll { padding-left: 6px; padding-right: 6px; }
}

/* =========================================================
   Token wallet
   ========================================================= */
.tok-hero {
    display: grid; gap: 18px; padding: 22px; margin-bottom: 18px; border-radius: 22px;
    background: radial-gradient(circle at 100% 0%, rgba(47,214,181,.14), transparent 50%), radial-gradient(circle at 0% 100%, rgba(242,191,85,.14), transparent 50%), linear-gradient(145deg, #171d33, #11162a);
    border: 1px solid var(--line-2); box-shadow: var(--shadow);
}
@media (min-width: 992px) { .tok-hero { grid-template-columns: minmax(280px, .9fr) 1.3fr; align-items: center; padding: 28px 30px; } }
.tok-main > small { display: block; color: var(--text-3); font-size: 13px; margin-top: 14px; }
.tok-bal { font-family: var(--font-display); font-size: clamp(30px, 5vw, 42px); font-weight: 700; line-height: 1.15; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; word-break: break-all; }
.tok-bal span { font-size: .45em; letter-spacing: .06em; }
.tok-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.tok-actions .btn-x { flex: 1; min-width: 130px; height: 46px; }
@media (min-width: 576px) { .tok-actions .btn-x { flex: 0 0 auto; } }
.tok-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tok-tile { padding: 14px; border-radius: 16px; background: rgba(0,0,0,.25); border: 1px solid var(--line); min-width: 0; }
.tok-tile small { display: block; color: var(--text-3); font-size: 12px; }
.tok-tile strong { display: block; font-family: var(--font-display); font-size: 20px; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; }
.tok-tile span { color: var(--text-3); font-size: 12px; }

.txn-list { display: grid; gap: 8px; }
.txn { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.txn-ico { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px; display: grid; place-items: center; font-size: 16px; }
.txn-ico.is-in { background: rgba(53,217,154,.13); color: var(--success); }
.txn-ico.is-out { background: rgba(255,107,122,.12); color: #ff9aa5; }
.txn-body { flex: 1; min-width: 0; }
.txn-body strong { display: block; font-size: 14.5px; font-weight: 600; }
.txn-body small { display: block; color: var(--text-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.txn-amt { text-align: right; flex: 0 0 auto; }
.txn-amt strong { display: block; font-family: var(--font-display); font-size: 16px; }
.txn-amt small { display: block; color: var(--text-3); font-size: 11.5px; }
.is-in, .is-in-txt { color: var(--success); }
.is-out { color: #ff9aa5; }

.status-pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.st-pending { background: rgba(242,191,85,.14); color: var(--gold); }
.st-completed { background: rgba(53,217,154,.14); color: var(--success); }
.st-rejected { background: rgba(255,107,122,.14); color: #ff9aa5; }

.wd-grid { display: grid; gap: 16px; }
@media (min-width: 992px) { .wd-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: start; } }
.wd-balance { padding: 14px 16px; border-radius: 14px; background: rgba(242,191,85,.08); border: 1px solid rgba(242,191,85,.25); margin-bottom: 18px; }
.wd-balance small { display: block; color: var(--text-3); font-size: 12px; }
.wd-balance strong { font-family: var(--font-display); font-size: 26px; color: var(--gold); }
.wd-balance strong span { font-size: 14px; }
.input-x .chip-btn { padding: 4px 10px; font-size: 12px; }
.wd-quote { margin: -4px 0 18px; padding: 12px 14px; border-radius: 14px; background: rgba(0,0,0,.22); border: 1px dashed var(--line-2); display: grid; gap: 6px; font-size: 14px; }
.wd-quote > div { display: flex; justify-content: space-between; gap: 10px; }
.wd-quote span { color: var(--text-2); }
.wd-quote small { color: var(--text-3); }
.wd-quote .wd-net { padding-top: 8px; margin-top: 2px; border-top: 1px solid var(--line); }
.wd-quote .wd-net strong { color: var(--success); font-family: var(--font-display); font-size: 17px; }
.wd-card .mcard-top strong { font-size: 14.5px; }
.txn-list, .log-list, .mlist { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 575.98px) {
    .panel-lg { padding: 18px; }
    .txn { padding: 10px 12px; gap: 10px; }
    .txn-ico { width: 34px; height: 34px; flex-basis: 34px; }
    .txn-amt .muted-xs { display: none; }
}

/* =========================================================
   Admin panel
   ========================================================= */
.admin-tag { font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: .1em; padding: 2px 6px; border-radius: 5px; background: rgba(124,92,255,.22); color: #c4b5ff; vertical-align: middle; margin-left: 4px; }
.sidebar-admin { background: linear-gradient(180deg, #13132b 0%, #0c0e1e 100%); }
.sb-badge { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; display: grid; place-items: center; font-size: 11px; font-weight: 700; background: var(--gold-grad); color: #1d1405; }
.sb-collapsed .sb-badge { position: absolute; top: 4px; right: 10px; min-width: 18px; height: 16px; font-size: 10px; }
.avatar-admin { background: linear-gradient(135deg, #7c5cff, #4b2fd6) !important; color: #fff !important; font-size: 16px; }
.alert-x-warn { background: rgba(242,191,85,.09); border: 1px solid rgba(242,191,85,.35); color: #ffe2a3; }
.btn-x-danger { background: rgba(255,107,122,.14); border-color: rgba(255,107,122,.4); color: #ffb3bb; }
.btn-x-danger:hover { background: rgba(255,107,122,.22); color: #fff; }
.stat-warn { border-color: rgba(242,191,85,.35); }
.stats + .stats { margin-top: -6px; }
.row-link { cursor: pointer; }
.cell-wrap { white-space: normal !important; min-width: 180px; max-width: 360px; }
.small-mono { font-size: 11.5px; color: var(--text-2); word-break: break-word; }
.text-end { text-align: right; }

.admin-login { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; }
.admin-login .auth-card { max-width: 420px; }
.admin-shield { width: 56px; height: 56px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; color: #fff; background: linear-gradient(135deg, #7c5cff, #4b2fd6); box-shadow: 0 14px 30px -12px rgba(124,92,255,.8); }
.text-center { text-align: center; }

/* 14-day bar chart */
.bars { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; align-items: end; height: 180px; padding-top: 18px; }
.bar { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.bar-fill { width: 100%; max-width: 26px; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, #f7d57a, #c9822a); opacity: .9; }
.bar:hover .bar-fill { opacity: 1; box-shadow: 0 0 14px rgba(242,191,85,.5); }
.bar-val { font-size: 11px; color: var(--text-2); margin-bottom: 4px; }
.bar-lbl { font-size: 10.5px; color: var(--text-3); margin-top: 6px; }

/* Segments with counts */
.seg-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 640px; }
.seg-4 .seg-btn { text-align: center; color: var(--text-2); }
.seg-4 .seg-btn.active { color: var(--text); }
.seg-count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; font-size: 11px; background: rgba(255,255,255,.08); }
@media (max-width: 480px) { .seg-4 .seg-btn { font-size: 12.5px; padding: 9px 4px; } .seg-count { display: none; } }

/* Withdrawal processing */
.wd-admin-list { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.wd-item { padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(255,255,255,.02); display: grid; gap: 12px; }
@media (min-width: 992px) { .wd-item { grid-template-columns: minmax(0, 1fr) auto; } .wd-item .wd-form { grid-column: 1 / -1; } }
.wd-item-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.member-inline { color: var(--text); font-weight: 500; }
.member-inline:hover { color: var(--gold); }
.wd-figs { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); gap: 8px 22px; margin-top: 10px; justify-content: start; }
.wd-figs small { display: block; color: var(--text-3); font-size: 11.5px; }
.wd-figs strong { color: var(--gold); font-family: var(--font-display); }
.wd-addr { grid-column: 1 / -1; min-width: 0; }
.wd-addr .mono { word-break: break-all; font-size: 13px; }
.wd-meta { margin-top: 8px; color: var(--text-3); font-size: 12px; word-break: break-word; }
.wd-item-actions { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.wd-form { padding: 14px; border-radius: 12px; background: rgba(0,0,0,.25); border: 1px dashed var(--line-2); }
.wd-form .input-x { height: 44px; }

/* Member actions */
.act-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.act-form { margin-top: 14px; padding: 14px; border-radius: 12px; background: rgba(0,0,0,.22); border: 1px dashed var(--line-2); }
.act-form .input-x { height: 44px; }
.act-form .select-x { height: 44px; }

/* Confirm dialog */
.confirm-box { position: fixed; inset: 0; z-index: 1090; display: grid; place-items: center; padding: 16px; background: rgba(4,6,12,.66); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.confirm-box[hidden] { display: none; }
.confirm-card { width: 100%; max-width: 380px; padding: 24px; border-radius: 20px; text-align: center; background: var(--surface-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.confirm-card > i { font-size: 34px; color: var(--gold); }
.confirm-card p { margin: 10px 0 18px; color: var(--text); }
.confirm-actions { display: flex; gap: 10px; justify-content: center; }

/* Settings */
.settings-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) { .settings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.settings-save { position: sticky; bottom: 0; z-index: 5; margin-top: 16px; padding: 14px 0; display: flex; justify-content: flex-end; background: linear-gradient(0deg, var(--bg) 60%, transparent); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; cursor: pointer; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.18); }
.switch-row span { display: flex; flex-direction: column; }
.switch-row strong { color: var(--text); font-size: 14px; }
.switch-row small { color: var(--text-3); font-size: 12px; font-weight: 400; margin-top: 2px; }
.switch { appearance: none; -webkit-appearance: none; flex: 0 0 46px; width: 46px; height: 26px; border-radius: 99px; background: rgba(255,255,255,.12); position: relative; cursor: pointer; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch:checked { background: var(--success); }
.switch:checked::after { transform: translateX(20px); }
.select-x.is-invalid { border-color: rgba(255,107,122,.7); }

/* Level chips */
.lvl-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.lvl-chip { display: flex; flex-direction: column; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--text); min-width: 96px; }
.lvl-chip strong { font-family: var(--font-display); color: var(--gold); }
.lvl-chip span { color: var(--text-3); font-size: 12px; }
.lvl-chip.active, .lvl-chip:hover { border-color: rgba(242,191,85,.55); color: var(--text); }
.field label.switch-row { display: flex; margin-bottom: 0; }

/* Packages */
.pkg-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1200px) { .pkg-layout { grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr); align-items: start; } .pkg-add { position: sticky; top: calc(var(--top-h) + 16px); } }
.pkg-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.pkg-card { position: relative; padding: 18px; border-radius: 18px; border: 1px solid rgba(242,191,85,.25); background: radial-gradient(circle at 100% 0%, rgba(242,191,85,.14), transparent 55%), rgba(255,255,255,.02); display: flex; flex-direction: column; gap: 4px; }
.pkg-card.is-off { opacity: .55; border-color: var(--line); background: rgba(255,255,255,.02); }
.pkg-top { display: flex; justify-content: space-between; align-items: center; }
.pkg-serial { font-family: var(--font-display); font-weight: 700; font-size: 13px; color: var(--text-3); }
.pkg-name { font-family: var(--font-display); font-size: 18px; margin-top: 6px; }
.pkg-amt { font-family: var(--font-display); font-size: 28px; font-weight: 700; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.2; }
.pkg-amt span { font-size: 14px; }
.pkg-desc { color: var(--text-2); font-size: 13px; margin: 4px 0 0; }
.pkg-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.imp-bar { align-items: center; flex-wrap: wrap; }

/* ---------- Deposits, level incomes, row actions ---------- */
.row-actions { white-space: nowrap; }
.row-actions .btn-x { height: 34px; padding: 0 10px; }
.mcard-actions { display: flex; gap: 8px; margin-top: 10px; }
.mcard-actions .btn-x { height: 34px; }
a.stat { color: var(--text); }
a.stat:hover { border-color: rgba(242,191,85,.45); color: var(--text); }
a.tok-tile { color: var(--text); }
a.tok-tile:hover { border-color: rgba(242,191,85,.45); color: var(--text); }
.tok-tile-dep { border-color: rgba(47,214,181,.3); }
.wd-mini { padding: 12px 14px; }
.wd-mini .wd-meta { margin-top: 4px; }
.pill-danger { background: rgba(255,107,122,.14); color: #ff9aa5; border-color: rgba(255,107,122,.3); }
.input-x .suffix { color: var(--text-3); font-weight: 600; }

.dep-steps { margin: 0 0 16px; padding-left: 20px; color: var(--text-2); font-size: 14px; display: grid; gap: 4px; }
.dep-steps strong { color: var(--text); font-weight: 600; }
.dep-address { display: flex; gap: 16px; align-items: center; padding: 16px; border-radius: 16px; margin-bottom: 14px; background: rgba(47,214,181,.06); border: 1px solid rgba(47,214,181,.28); }
.dep-qr { flex: 0 0 auto; padding: 8px; border-radius: 12px; background: #fff; line-height: 0; }
.dep-qr img, .dep-qr canvas { width: 116px !important; height: 116px !important; }
.dep-address-body { min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.dep-address-body small { color: var(--text-3); font-size: 12px; }
.dep-addr-text { word-break: break-all; font-size: 14px; color: var(--text); }
@media (max-width: 480px) { .dep-address { flex-direction: column; align-items: stretch; text-align: center; } .dep-qr { align-self: center; } .dep-address-body { align-items: center; } }

.lvl-table { display: grid; gap: 6px; }
.lvl-row { display: grid; grid-template-columns: 1fr 1.2fr auto; gap: 12px; align-items: center; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.02); }
.lvl-row.is-off { opacity: .55; }
.lvl-head { background: transparent; border: 0; padding-top: 0; padding-bottom: 0; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.lvl-no { font-family: var(--font-display); font-weight: 600; }
.lvl-input { height: 40px; }
.lvl-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.lvl-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; }
.lvl-input { min-width: 0; }
.lvl-input input { width: 100%; }
@media (max-width: 480px) { .lvl-row { gap: 8px; padding: 8px; } .lvl-no { font-size: 14px; } }

/* ---------- Member packages ---------- */
.pkg-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px; margin-bottom: 16px; }
.pkg-head h2 { font-size: 22px; margin-bottom: 4px; }
.pkg-bal { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: rgba(47,214,181,.07); border: 1px solid rgba(47,214,181,.28); }
.pkg-bal small { display: block; color: var(--text-3); font-size: 11.5px; }
.pkg-bal strong { font-family: var(--font-display); font-size: 18px; }
.pkg-bal strong span { font-size: 12px; color: var(--text-2); }
.mpkg-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.mpkg { display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); position: relative; }
.mpkg h3 { font-size: 19px; margin-top: 4px; }
.mpkg-top { display: flex; justify-content: space-between; align-items: center; }
.mpkg-no { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.mpkg-desc { color: var(--text-2); font-size: 13.5px; margin: 4px 0 0; }
.mpkg-foot { margin-top: auto; padding-top: 14px; }
.mpkg-owned { border-color: rgba(53,217,154,.35); background: radial-gradient(circle at 100% 0%, rgba(53,217,154,.12), transparent 55%), var(--surface); }
.mpkg-available { border-color: rgba(242,191,85,.5); background: radial-gradient(circle at 100% 0%, rgba(242,191,85,.16), transparent 55%), var(--surface); box-shadow: 0 20px 50px -28px rgba(233,168,58,.7); }
.mpkg-locked { opacity: .55; }
.mpkg-locked .pkg-amt { filter: grayscale(.7); }
.st-locked { background: rgba(255,255,255,.06); color: var(--text-3); }
.mpkg-buy { margin-top: 4px; }
.hero-pkg { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.seg-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 220px; }
.seg-2 .seg-btn { text-align: center; color: var(--text-2); }
.seg-2 .seg-btn.active { color: var(--text); }

/* ---------- Email OTP ---------- */
.otp-send { flex: 0 0 auto; }
.otp-send:disabled { opacity: .7; cursor: default; }
.otp-input { letter-spacing: .5em; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 18px !important; font-weight: 600; }
.otp-input::placeholder { letter-spacing: normal; font-family: var(--font); font-size: 14px; font-weight: 400; }
.auth-links { display: flex; justify-content: flex-end; margin: -6px 0 16px; font-size: 13.5px; }
.auth-links a { font-weight: 600; }
.auth-step-note { color: var(--text-2); font-size: 14px; margin: -8px 0 18px; }
.link-btn { border: 0; background: none; padding: 0; color: var(--gold); font-weight: 600; cursor: pointer; }
.link-btn:hover { color: #ffd98a; }

/* ======================================================= Green / red IDs (activation) */
.t-green { color: var(--success); }
.t-red { color: #ff8c98; }
.id-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; flex: 0 0 9px; }
.id-dot.is-green { background: var(--success); box-shadow: 0 0 0 3px rgba(53,217,154,.18); }
.id-dot.is-red { background: var(--danger); box-shadow: 0 0 0 3px rgba(255,107,122,.18); }
.id-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; border: 1px solid transparent; }
.id-badge i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.id-badge.is-green { background: rgba(53,217,154,.12); color: var(--success); border-color: rgba(53,217,154,.3); }
.id-badge.is-red { background: rgba(255,107,122,.12); color: #ff8c98; border-color: rgba(255,107,122,.3); }
.hero-id .id-badge { grid-column: 1; justify-self: start; margin-top: 6px; }
.member-link strong { display: inline-flex; align-items: center; }

/* tree nodes */
.tnode.is-green { border-color: rgba(53,217,154,.55); }
.tnode.is-green .tnode-av { background: linear-gradient(135deg, #5ef0b6, #22b37c); color: #052b1c; }
.tnode.is-red { border-color: rgba(255,107,122,.55); }
.tnode.is-red .tnode-av { background: linear-gradient(135deg, #ff9aa5, #e2475a); color: #2b0509; }
.tnode.is-top.is-green { box-shadow: 0 0 0 4px rgba(53,217,154,.1); }
.tree-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; font-size: 12.5px; color: var(--text-2); margin-bottom: 12px; }
.tree-legend span { display: inline-flex; align-items: center; }
.mcard-av.is-green { background: linear-gradient(135deg, #5ef0b6, #22b37c); color: #052b1c; }
.mcard-av.is-red { background: linear-gradient(135deg, #ff9aa5, #e2475a); color: #2b0509; }

/* segmented tabs with counts */
.seg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.act-tabs { margin: 4px 0 16px; }
.act-tabs .seg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 2px; text-decoration: none; font-size: 13px; padding: 9px 6px; white-space: nowrap; min-width: 0; }
.act-tabs .seg-btn b { margin-left: 6px; font-size: 11.5px; padding: 1px 7px; border-radius: 99px; background: rgba(255,255,255,.08); color: var(--text-2); }
@media (max-width: 420px) { .act-tabs .seg-btn { font-size: 12px; } .act-tabs .seg-btn .id-dot { display: none; } }

/* activation banner + notes */
.act-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 18px; margin-bottom: 18px; border-radius: 18px; background: linear-gradient(135deg, rgba(255,107,122,.12), rgba(255,107,122,.04)); border: 1px solid rgba(255,107,122,.3); }
.act-banner > div { flex: 1 1 220px; min-width: 0; }
.act-banner strong { display: block; font-family: var(--font-display); font-size: 16px; }
.act-banner p { margin: 2px 0 0; color: var(--text-2); font-size: 13.5px; }
.act-banner-ico { width: 44px; height: 44px; flex: 0 0 44px; border-radius: 14px; display: grid; place-items: center; font-size: 20px; background: rgba(255,107,122,.16); color: #ff8c98; }
.act-note { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-2); padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--line); margin: 0 0 16px; }
.act-note i { color: var(--gold); margin-top: 1px; }
.act-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.act-strip-item { padding: 12px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; min-width: 0; align-items: flex-start; }
.act-strip-item small { color: var(--text-3); font-size: 12px; }
.act-strip-item strong { font-size: 15px; }
@media (max-width: 575px) { .act-strip { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .act-strip-item:first-child { grid-column: 1 / -1; } }

/* referral locked */
.ref-locked { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px dashed var(--line-2); }
.ref-locked > i { font-size: 22px; color: #ff8c98; }
.ref-locked > div { flex: 1 1 200px; min-width: 0; }
.ref-locked p { margin: 0; font-size: 13.5px; color: var(--text-2); }
.ref-locked small { color: var(--text-3); font-size: 12px; }
.stat-sub { font-size: 12px; font-weight: 600; }

/* package progress on dashboard */
.pkg-track { margin-bottom: 18px; }
.pkg-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.pkg-step { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--text); text-decoration: none; min-width: 0; transition: .2s; }
.pkg-step:hover { color: var(--text); border-color: var(--line-2); transform: translateY(-1px); }
.pkg-step strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pkg-step small { color: var(--text-3); font-size: 12px; }
.pkg-step em { font-style: normal; font-size: 11.5px; font-weight: 700; margin-top: 4px; color: var(--text-3); }
.pkg-step-dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; margin-bottom: 6px; background: rgba(255,255,255,.06); color: var(--text-2); border: 1px solid var(--line-2); }
.pkg-step.is-owned { border-color: rgba(53,217,154,.35); background: rgba(53,217,154,.06); }
.pkg-step.is-owned .pkg-step-dot { background: var(--success); color: #052b1c; border-color: transparent; }
.pkg-step.is-owned em { color: var(--success); }
.pkg-step.is-next { border-color: rgba(242,191,85,.5); background: rgba(242,191,85,.07); }
.pkg-step.is-next .pkg-step-dot { background: var(--gold-grad); color: #1d1405; border-color: transparent; }
.pkg-step.is-next em { color: var(--gold); }
.pkg-step.is-locked { opacity: .6; }

/* sidebar */
.sb-link.sb-muted { color: var(--text-3); }
.sb-badge.sb-badge-red { background: linear-gradient(135deg, #ff9aa5, #e2475a); color: #2b0509; }

/* admin clean-up */
.cleanup-panel { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 16px; }
.cleanup-panel > div { flex: 1 1 320px; min-width: 0; }
.cleanup-panel h3 { font-size: 16px; margin: 0 0 4px; }
.cleanup-form { display: flex; flex-direction: column; gap: 6px; }
.cleanup-row { display: flex; align-items: center; gap: 8px; }
.cleanup-row input { width: 84px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(0,0,0,.25); color: var(--text); font: inherit; }

/* ======================================================= Admin: contact messages */
.msg-list { display: grid; gap: 12px; }
.msg-item { padding: 16px 18px; border-radius: 16px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.msg-item.is-new { border-color: rgba(242,191,85,.35); background: rgba(242,191,85,.05); }
.msg-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.msg-who { flex: 1 1 200px; min-width: 0; }
.msg-who strong { display: flex; align-items: center; gap: 8px; }
.msg-who small { color: var(--text-3); overflow-wrap: anywhere; }
.msg-subject { font-size: 15.5px; margin: 12px 0 6px; }
.msg-body { color: var(--text-2); font-size: 14px; margin: 0 0 12px; overflow-wrap: anywhere; }
.msg-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
