:root {
  --bg: #0b0e1a;
  --panel: #131a2e;
  --panel2: #1b2440;
  --line: #2a3560;
  --text: #eef2ff;
  --muted: #9aa6c8;
  --accent: #22d3ee;
  --accent2: #8b5cf6;
  --pink: #f472b6;
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(139, 92, 246, .35), transparent 60%),
    radial-gradient(800px 500px at 0% 110%, rgba(34, 211, 238, .22), transparent 60%),
    radial-gradient(600px 400px at 50% 50%, rgba(244, 114, 182, .08), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ---------- App shell: top bar + bottom nav (mobile-app style) ---------- */
.topbar {
  background: rgba(11, 14, 26, .78); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20; backdrop-filter: blur(10px);
  display: flex; align-items: center; gap: 12px; padding: 10px 20px;
}
.topbar .brand { font-weight: 800; font-size: 1.05rem; background: linear-gradient(90deg, var(--accent), var(--accent2), var(--pink)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; text-decoration: none; display: flex; align-items: center; gap: 8px; min-width: 0; flex-shrink: 0; }
.topbar .brand-logo { height: auto; max-height: 30px; width: auto; max-width: 150px; object-fit: contain; border-radius: 0; background: transparent; padding: 0; border: 0; flex-shrink: 0; display: block; }
.topbar-title { font-weight: 700; font-size: 1rem; flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-user { display: flex; align-items: center; gap: 10px; }

.bottom-nav {
  position: fixed; bottom: 0; right: 0; left: 0; z-index: 40;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: rgba(19, 26, 46, .92); border-top: 1px solid var(--line);
  backdrop-filter: blur(10px);
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom, 0px));
}
.nav-tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--muted); font-size: .7rem; text-decoration: none;
  padding: 4px 0 2px; transition: color .15s, transform .15s;
}
.nav-tab .nav-tab-icon { font-size: 1.3rem; line-height: 1; display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 0 6px rgba(34,211,238,.0)); transition: filter .2s, transform .2s; }
.icon { width: 1.15em; height: 1.15em; vertical-align: -0.2em; display: inline-block; flex-shrink: 0; }
.nav-tab:hover { color: var(--text); }
.nav-tab.active {
  color: var(--accent); font-weight: 700;
  text-shadow: 0 0 12px rgba(34, 211, 238, .7);
}
.nav-tab.active .nav-tab-icon { transform: translateY(-2px) scale(1.1); filter: drop-shadow(0 0 8px rgba(34,211,238,.8)); }

.chip { background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.chip-balance { color: var(--ok); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn { display: inline-block; padding: 8px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel2); color: var(--text); text-decoration: none; cursor: pointer; font-size: .92rem; transition: .15s; }
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn-primary { background: linear-gradient(135deg, var(--accent2), var(--accent), var(--pink)); background-size: 200% 200%; border: none; color: #05060f; font-weight: 700; box-shadow: 0 0 18px rgba(139, 92, 246, .35); animation: gradShift 6s ease infinite; }
.btn-primary:hover { filter: brightness(1.15); }
.btn-ok { background: linear-gradient(135deg, #059669, var(--ok)); border: none; color: #04251c; font-weight: 700; }
.btn-bad { background: linear-gradient(135deg, #b91c1c, var(--bad)); border: none; color: #2b0a0a; font-weight: 700; }
.btn-sm { padding: 5px 12px; font-size: .82rem; }
.btn-block { display: block; width: 100%; text-align: center; }

/* ---------- Layout ---------- */
.page { padding: 26px 20px 98px; max-width: 1080px; margin: 0 auto; }
.grid { display: grid; gap: 26px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
  background: linear-gradient(160deg, rgba(27, 36, 64, .9), rgba(19, 26, 46, .85));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255,255,255,.04);
  position: relative;
}
.grid + .grid, .card + .grid, .grid + .card, .card + .card { margin-top: 26px; }
.card h2 { font-size: 1.05rem; margin-bottom: 14px; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.card h3 { font-size: .95rem; margin-bottom: 8px; }

.link-card { text-decoration: none; color: var(--text); display: block; transition: border-color .15s, transform .15s; }
.link-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 0 20px rgba(34, 211, 238, .18); }
.link-card p { margin: 0; }

.stat { text-align: center; padding: 18px; }
.stat .num { font-size: 1.7rem; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--accent2), var(--pink)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 0 10px rgba(139,92,246,.35)); }
.stat .lbl { color: var(--muted); font-size: .85rem; }

.hero { text-align: center; padding: 40px 0 28px; }
.hero h1 { font-size: 2rem; margin-bottom: 10px; }
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto 20px; }
.hero .cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { text-align: right; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: .82rem; }
tr:hover td { background: rgba(139, 92, 246, .08); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 12px; }
label { font-size: .85rem; color: var(--muted); }
input, select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(11, 14, 26, .6); color: var(--text); font: inherit;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(34, 211, 238, .15); }
textarea { resize: vertical; min-height: 80px; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; border: 1px solid; font-size: .92rem; }
.flash-success { background: rgba(52, 211, 153, .12); border-color: var(--ok); color: var(--ok); }
.flash-error { background: rgba(248, 113, 113, .12); border-color: var(--bad); color: var(--bad); }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-active, .badge-completed, .badge-approved, .badge-member { background: rgba(52, 211, 153, .15); color: var(--ok); box-shadow: 0 0 8px rgba(52,211,153,.25) inset; }
.badge-pending { background: rgba(251, 191, 36, .15); color: var(--warn); box-shadow: 0 0 8px rgba(251,191,36,.25) inset; }
.badge-warn { background: rgba(251, 191, 36, .15); color: var(--warn); }
.badge-paused, .badge-rejected, .badge-cancelled { background: rgba(248, 113, 113, .15); color: var(--bad); }
.badge-ended { background: rgba(148, 163, 184, .18); color: var(--muted); }
.badge-advertiser { background: rgba(34, 211, 238, .15); color: var(--accent); }
.badge-admin { background: rgba(167, 139, 250, .18); color: #c4b5fd; box-shadow: 0 0 8px rgba(167,139,250,.3) inset; }

.muted { color: var(--muted); }
.small { font-size: .8rem; }
.mono { font-family: Consolas, monospace; font-size: .8rem; direction: ltr; text-align: left; display: inline-block; }

/* ---------- Live feed ---------- */
.feed { display: grid; gap: 10px; }
.feed-item { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; }
.feed-item .time { margin-inline-start: auto; color: var(--muted); font-size: .75rem; white-space: nowrap; }
.feed-item .tag { border-radius: 8px; padding: 2px 8px; font-size: .72rem; font-weight: 700; }
.tag-deposit, .tag-profit, .tag-task_reward { background: rgba(52, 211, 153, .15); color: var(--ok); }
.tag-withdrawal { background: rgba(248, 113, 113, .15); color: var(--bad); }
.tag-investment { background: rgba(251, 191, 36, .15); color: var(--warn); }

.pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); margin-inline-end: 6px; animation: pulse 1.6s infinite; box-shadow: 0 0 8px var(--ok); }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.footer { border-top: 1px solid var(--line); padding: 18px 0; color: var(--muted); font-size: .82rem; }
.footer .container { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.empty { text-align: center; color: var(--muted); padding: 30px 0; }

/* ---------- Payment methods ---------- */
.pre-wrap { white-space: pre-wrap; word-break: break-word; direction: ltr; text-align: left; }
.pay-method { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 10px; }
.pay-method-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 6px; }
.pay-method-details { margin: 0; font-size: .82rem; line-height: 1.7; color: var(--text); }

/* ---------- Auth (app-style) ---------- */
.auth-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px 16px; }
.auth-wrap { width: 100%; max-width: 440px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-logo {
  width: 64px; height: 64px; margin: 0 auto 12px; border-radius: 20px;
  background: linear-gradient(135deg, var(--accent2), var(--accent), var(--pink));
  background-size: 200% 200%;
  color: #05060f; font-size: 2rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 30px rgba(139, 92, 246, .6);
  animation: gradShift 6s ease infinite;
}
.auth-logo-img { object-fit: contain; background: transparent; width: 100%; height: 100%; padding: 10px; }
.auth-brand h1 { font-size: 1.35rem; margin: 0 0 4px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.auth-tabs:has(.auth-tab:nth-child(3)) { grid-template-columns: 1fr 1fr 1fr; }
.auth-tab { border: 0; background: transparent; color: var(--muted); padding: 9px; border-radius: 9px; cursor: pointer; font-weight: 600; }
.auth-tab.active { background: linear-gradient(135deg, var(--accent2), var(--accent), var(--pink)); color: #05060f; box-shadow: 0 0 14px rgba(139,92,246,.4); }
.auth-foot { text-align: center; margin-top: 16px; font-size: .8rem; }

/* ---------- Referral ---------- */
.ref-box { background: rgba(11, 14, 26, .5); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
code { word-break: break-all; }
.ref-code { font-size: 1.5rem; font-weight: 800; letter-spacing: 2px; background: linear-gradient(90deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; direction: ltr; text-align: center; padding: 6px 0 12px; }
.ref-stats { display: flex; gap: 18px; margin: 8px 0; }

/* ---------- Notifications bell ---------- */
.bell { position: relative; color: var(--muted); text-decoration: none; font-size: 1.15rem; padding: 4px 8px; }
.bell-dot { position: absolute; top: -4px; inset-inline-start: 2px; background: var(--bad); color: #fff; font-size: .62rem; font-weight: 800; border-radius: 999px; padding: 1px 5px; box-shadow: 0 0 8px rgba(248,113,113,.6); }
.feed-item.read { opacity: .55; }

/* ---------- Language switcher ---------- */
.lang-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700;
  color: var(--accent); background: var(--panel2); border: 1px solid var(--line);
  text-decoration: none; transition: border-color .15s, color .15s;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--text); }
.lang-toggle .lang-label { min-width: 1.2em; text-align: center; }
.auth-lang-toggle { position: absolute; top: 14px; inset-inline-end: 14px; }

/* ---------- Topbar logout ---------- */
.logout-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--panel2); border: 1px solid var(--line);
  color: var(--muted); text-decoration: none; font-size: 1.05rem;
  transition: background .15s, color .15s;
}
.logout-btn:hover { background: var(--bad); border-color: var(--bad); color: #fff; box-shadow: 0 0 12px rgba(248,113,113,.4); }

/* ---------- Toasts (SweetAlert-lite) ---------- */
.toasts {
  position: fixed; top: 14px; inset-inline-end: 14px; z-index: 1000;
  display: flex; flex-direction: column; gap: 10px;
  width: min(92vw, 380px); pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 14px; color: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  font-size: .9rem; line-height: 1.5; pointer-events: auto;
  animation: toast-in .25s ease-out;
}
.toast-ok { background: linear-gradient(135deg, #047857, #10b981); }
.toast-err { background: linear-gradient(135deg, #b91c1c, #ef4444); }
.toast-icon { font-weight: 900; font-size: 1.05rem; }
.toast-text { flex: 1; }
.toast-close { cursor: pointer; opacity: .85; font-size: .85rem; }
.toast-close:hover { opacity: 1; }
.toast-out { opacity: 0; transform: translateY(-6px); transition: opacity .3s, transform .3s; }
@keyframes toast-in { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Deposit proof thumbnail ---------- */
.proof-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); display: block; }

/* ---------- Attendance wheel ---------- */
.wheel-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.wheel-stage { position: relative; width: min(340px, 82vw); aspect-ratio: 1; }
.wheel { width: 100%; height: 100%; border-radius: 50%; position: relative; overflow: hidden; border: 6px solid var(--accent2); box-shadow: 0 0 40px rgba(139, 92, 246, .5), 0 12px 40px rgba(0,0,0,.35); transition: transform 4s cubic-bezier(.12, .8, .15, 1); }
.wheel .seg { position: absolute; width: 50%; height: 50%; left: 50%; top: 0; transform-origin: 0 100%; display: flex; align-items: flex-start; justify-content: center; }
.wlabel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(var(--ang)) translateY(-38%); font-size: .72rem; font-weight: 800; color: #05060f; white-space: nowrap; text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.wlabel-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.wheel-pointer { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 12px solid transparent; border-right: 12px solid transparent; border-top: 22px solid var(--bad); z-index: 5; filter: drop-shadow(0 0 6px rgba(248,113,113,.7)); }
.wheel-center { position: absolute; inset: 38%; border-radius: 50%; background: var(--panel2); border: 4px solid var(--accent2); display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--accent); z-index: 4; }
.wheel-result { font-size: 1.05rem; font-weight: 700; color: var(--ok); min-height: 26px; }
.wheel-disabled { opacity: .5; pointer-events: none; }

/* ---------- Charts ---------- */
.chart-box { position: relative; width: 100%; }
.chart-box canvas { width: 100%; display: block; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.chart-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* ---------- Team tree ---------- */
.team-depth { border-inline-start: 2px dashed var(--line); padding-inline-start: 16px; margin-top: 12px; }
.team-depth-title { font-size: .78rem; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.team-node { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel2); margin-bottom: 8px; max-width: 380px; }
.team-avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #05060f; font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.team-avatar img { width: 100%; height: 100%; object-fit: cover; }
.conv-avatar img { width: 100%; height: 100%; object-fit: cover; }
.team-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-node .badge { font-size: .68rem; }

/* ---------- Marketplace ---------- */
.market-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; align-items: center; }
.market-filters .filter-group { display: flex; gap: 6px; flex-wrap: wrap; }
.market-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.product-card { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(160deg, rgba(27, 36, 64, .9), rgba(19, 26, 46, .9)); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s, box-shadow .15s, border-color .15s; position: relative; }
.product-card:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 0 24px rgba(34, 211, 238, .2); }
.product-thumb { width: 100%; aspect-ratio: 16/10; object-fit: cover; background: var(--panel2); display: block; }
.featured-ribbon { position: absolute; top: 8px; inset-inline-start: 8px; z-index: 2; background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #1f2937; font-size: .68rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; box-shadow: 0 0 12px rgba(251,191,36,.7); }
.product-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.product-title { font-weight: 700; font-size: .98rem; color: var(--text); text-decoration: none; }
.product-title:hover { color: var(--accent); }
.product-meta { font-size: .76rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; }
.product-price { font-weight: 800; color: var(--ok); font-size: 1.05rem; text-shadow: 0 0 10px rgba(52,211,153,.4); }
.product-price .old { color: var(--muted); text-decoration: line-through; font-weight: 400; font-size: .8rem; text-shadow: none; }
.product-seller { font-size: .76rem; color: var(--muted); }
.tag { display: inline-block; font-size: .66rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.tag-digital { background: rgba(34,211,238,.15); color: var(--accent); }
.tag-physical { background: rgba(251,191,36,.15); color: var(--warn); }
.tag-install { background: rgba(244,114,182,.15); color: var(--pink); }
.tag-wholesale { background: rgba(52,211,153,.15); color: var(--ok); }
.tag-bad { background: rgba(248,113,113,.15); color: var(--bad); }
.tag-video { background: rgba(244,114,182,.15); color: var(--pink); }
.tag-pay { background: rgba(34,211,238,.15); color: var(--accent); }
.pay-check { display: flex; align-items: center; gap: 8px; font-size: .88rem; color: var(--text); }
.pay-check input { width: auto; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.gallery-item { position: relative; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--panel2); }
.gallery-item img { width: 100%; aspect-ratio: 1/1; object-fit: cover; display: block; }
.gallery-item form { position: absolute; bottom: 0; left: 0; right: 0; padding: 6px; background: linear-gradient(transparent, rgba(11,14,26,.85)); }
.gallery-item .btn { width: 100%; }
.stat-num { font-size: 1.25rem; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* ---------- Promo ads (AdSense-style, responsive) ---------- */
.ad-banner { max-width: 1080px; margin: 0 auto; padding: 10px 16px 0; position: relative; z-index: 5; }
.ad-banner-link { position: relative; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(160deg, rgba(27, 36, 64, .9), rgba(19, 26, 46, .9)); text-decoration: none; color: var(--text); box-shadow: 0 4px 18px rgba(0,0,0,.25); }
.ad-banner-img { width: 110px; height: 68px; object-fit: cover; border-radius: 10px; flex-shrink: 0; }
.ad-banner-body { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: 1; min-width: 180px; }
.ad-banner-head { font-weight: 700; font-size: .95rem; }
.ad-banner-desc { font-size: .8rem; color: var(--muted); }
.ad-banner-video { width: 100%; max-height: 260px; border-radius: var(--radius); border: 1px solid var(--line); background: #000; }
.ad-banner-link:hover, .adsense-unit:hover { border-color: var(--accent); box-shadow: 0 0 22px rgba(34,211,238,.25); }

/* Sticky bottom ad pinned above the footer/nav */
.ad-sticky-spacer { height: 190px; }
.adsense-block { position: fixed; bottom: calc(64px + env(safe-area-inset-bottom, 0px)); left: 0; right: 0; z-index: 35; max-width: 420px; margin: 0 auto; padding: 0 10px; }
.adsense-close { position: absolute; top: -10px; inset-inline-end: 6px; z-index: 3; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel2); color: var(--muted); cursor: pointer; font-size: .8rem; line-height: 1; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 10px rgba(0,0,0,.4); }
.adsense-close:hover { color: var(--bad); border-color: var(--bad); }
.adsense-unit { position: relative; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(160deg, rgba(27, 36, 64, .97), rgba(19, 26, 46, .97)); text-decoration: none; color: var(--text); box-shadow: 0 8px 30px rgba(0,0,0,.45); backdrop-filter: blur(6px); }
.adsense-tag { position: absolute; top: 4px; inset-inline-end: 8px; font-size: .6rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; background: rgba(11,14,26,.6); z-index: 2; }
.adsense-img { width: 96px; height: 96px; object-fit: cover; border-radius: 12px; flex-shrink: 0; box-shadow: 0 0 14px rgba(139,92,246,.3); }
.adsense-video { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); background: #000; max-height: 260px; box-shadow: 0 8px 30px rgba(0,0,0,.45); }
.adsense-head { font-weight: 700; font-size: .95rem; }
.adsense-desc { font-size: .8rem; color: var(--muted); max-width: 260px; }
.adsense-btn { margin-inline-start: auto; background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #05060f; font-size: .78rem; font-weight: 800; border-radius: 999px; padding: 6px 14px; flex-shrink: 0; box-shadow: 0 0 12px rgba(34,211,238,.4); }
@media (max-width: 560px) {
    .ad-banner-img { width: 100%; height: auto; aspect-ratio: 16/9; }
    .ad-banner-body { flex-direction: column; align-items: flex-start; }
    .adsense-btn { margin-inline-start: 0; width: 100%; text-align: center; }
    .adsense-block { max-width: 340px; }
}

/* ---------- Profile ---------- */
.profile-head { display: flex; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(160deg, rgba(27, 36, 64, .9), rgba(19, 26, 46, .9)); margin-bottom: 16px; flex-wrap: wrap; }
.profile-avatar { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, var(--accent2), var(--accent)); display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 800; color: #05060f; flex-shrink: 0; overflow: hidden; box-shadow: 0 0 20px rgba(139,92,246,.4); }
.profile-info { flex: 1; min-width: 180px; }
.profile-info h2 { font-size: 1.25rem; }
.profile-bio { color: var(--muted); font-size: .86rem; margin-top: 4px; }
.profile-socials { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.social-link { text-decoration: none; font-size: .72rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); background: var(--panel2); }
.social-link:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Messages ---------- */
.conv-list { display: flex; flex-direction: column; gap: 8px; }
.conv-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); text-decoration: none; color: var(--text); }
.conv-item.unread { border-color: var(--accent); box-shadow: 0 0 14px rgba(34,211,238,.15); }
.conv-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; background: var(--panel2); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--accent); }
.conv-body { flex: 1; min-width: 0; }
.conv-name { font-weight: 700; font-size: .92rem; }
.conv-preview { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-meta { text-align: left; }
.conv-time { font-size: .7rem; color: var(--muted); }
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow-y: auto; padding: 4px; }
.msg { max-width: 78%; padding: 9px 12px; border-radius: 14px; font-size: .9rem; word-break: break-word; }
.msg-mine { align-self: flex-start; background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #05060f; border-end-start-radius: 4px; box-shadow: 0 0 14px rgba(34,211,238,.25); }
.msg-theirs { align-self: flex-end; background: var(--panel2); border: 1px solid var(--line); border-end-end-radius: 4px; }
.msg-time { display: block; font-size: .66rem; opacity: .7; margin-top: 3px; }

/* ---------- Seller / orders ---------- */
.install-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel2); margin-bottom: 6px; font-size: .85rem; }
.install-item.paid { border-color: rgba(52,211,153,.5); }
.qty-row { display: flex; align-items: center; gap: 10px; }
.qty-row input { width: 90px; }

/* ---------- Facebook-style profile ---------- */
.fb-profile { max-width: 640px; margin: 0 auto; }
.fb-cover { height: 160px; border-radius: var(--radius) var(--radius) 0 0; position: relative; }
.fb-head { position: relative; display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--line); border-top: none; border-radius: 0 0 var(--radius) var(--radius); background: var(--panel); margin-bottom: 12px; }
.fb-avatar { width: 96px; height: 96px; border-radius: 50%; border: 4px solid var(--panel); background: linear-gradient(135deg, var(--accent2), var(--accent)); color: #05060f; font-size: 2.3rem; font-weight: 800; display: flex; align-items: center; justify-content: center; overflow: hidden; flex-shrink: 0; margin-top: -56px; box-shadow: 0 0 20px rgba(139,92,246,.4); }
.fb-avatar img { width: 100%; height: 100%; object-fit: cover; }
.fb-id { flex: 1; min-width: 200px; }
.fb-id h2 { font-size: 1.35rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fb-actions { align-self: center; }
.fb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-bottom: 12px; }
.fb-stats .card { text-align: center; padding: 12px; }
.fb-stats .num { font-size: 1.15rem; font-weight: 800; background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.fb-stats .lbl { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.fb-socials { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }

/* ---------- Neon keyframes ---------- */
@keyframes gradShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---------- Mobile / small screens ---------- */
@media (max-width: 640px) {
    .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .topbar { gap: 8px; padding: 8px 10px; }
    .topbar .brand-logo { max-height: 24px; max-width: 110px; }
    .topbar-title { display: none; }
    .topbar-user { gap: 6px; }
    .chip-balance { font-size: .72rem; padding: 3px 8px; }
    .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid { gap: 14px; }
    .card { padding: 14px; }
    .page { padding: 18px 12px 96px; }
    .hero h1 { font-size: 1.5rem; }
    .ref-stats { gap: 10px; flex-wrap: wrap; }
}
@media (max-width: 380px) {
    .grid-3, .grid-4 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
