/* =========================================================
   Viewlance Design System — fantasy-sports inspired, violet fintech
   ========================================================= */
:root {
  --primary: #6D28D9; --primary-2: #8B5CF6; --primary-3: #A78BFA; --electric: #A855F7; --primary-soft: #F1EBFF;
  --secondary: #2563EB; --secondary-soft: #E6EEFF;
  --success: #16A34A; --success-soft: #E5F7EC; --warning: #EA7A0C; --warning-soft: #FFF2E3; --error: #DC2626; --error-soft: #FDECEC;
  --gold: #F5B400; --gold-soft: #FFF7DB; --pink: #EC4899;
  --bg: #F4F3FA; --bg-2: #ECEAF6; --card: #FFFFFF; --card-2: #F8F7FD; --line: #E7E4F2; --line-2: #D9D4EA;
  --text: #140D2B; --text-2: #4B4466; --muted: #857EA0; --invert: #FFFFFF;
  --head-1: #1A0B3D; --head-2: #3B1689; --head-3: #6D28D9;
  --radius: 18px; --radius-sm: 12px; --radius-lg: 26px;
  --shadow-1: 0 1px 2px rgba(26, 11, 61, .06), 0 2px 8px rgba(26, 11, 61, .05);
  --shadow-2: 0 8px 24px rgba(42, 18, 92, .10), 0 2px 6px rgba(42, 18, 92, .06);
  --shadow-3: 0 24px 60px rgba(42, 18, 92, .22);
  --glass: rgba(255, 255, 255, .72);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-head: 'Poppins', 'Inter', system-ui, sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1); --spring: cubic-bezier(.34, 1.56, .64, 1);
  --nav-h: 66px; --top-h: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --dark: 1; } }
:root[data-theme="dark"], :root:not([data-theme="light"]).auto-dark {
  --bg: #0C0818; --bg-2: #130E25; --card: #17112C; --card-2: #1D1636; --line: #2A2247; --line-2: #372D5C;
  --text: #F2EEFF; --text-2: #C9C1E6; --muted: #8F86B3; --primary-soft: #261A4B; --secondary-soft: #15224A;
  --success-soft: #0E2A1B; --warning-soft: #2E1D0B; --error-soft: #2F1214; --gold-soft: #2C2408;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 8px 24px rgba(0, 0, 0, .45); --shadow-3: 0 24px 60px rgba(0, 0, 0, .6);
  --glass: rgba(23, 17, 44, .72); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0C0818; --bg-2: #130E25; --card: #17112C; --card-2: #1D1636; --line: #2A2247; --line-2: #372D5C;
    --text: #F2EEFF; --text-2: #C9C1E6; --muted: #8F86B3; --primary-soft: #261A4B; --secondary-soft: #15224A;
    --success-soft: #0E2A1B; --warning-soft: #2E1D0B; --error-soft: #2F1214; --gold-soft: #2C2408;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4); --shadow-2: 0 8px 24px rgba(0, 0, 0, .45); --shadow-3: 0 24px 60px rgba(0, 0, 0, .6);
    --glass: rgba(23, 17, 44, .72); color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, h4, h5 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(24px, 4vw, 34px); font-weight: 800; } h2 { font-size: clamp(19px, 3vw, 24px); font-weight: 700; } h3 { font-size: 17px; font-weight: 700; } h4 { font-size: 15px; font-weight: 600; }
p { margin: 0 0 .8em; } a { color: var(--primary-2); text-decoration: none; } a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; } button { font: inherit; } code { background: var(--card-2); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary-2) 60%, transparent); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.skip-link { position: absolute; left: 8px; top: -60px; z-index: 999; background: var(--primary); color: #fff; padding: 10px 14px; border-radius: 10px; }
.skip-link:focus { top: 8px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .xs { font-size: 11.5px; } .bold { font-weight: 700; } .center { text-align: center; } .right { text-align: right; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: 8px } .mt-2 { margin-top: 16px } .mt-3 { margin-top: 24px } .mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: 8px } .mb-2 { margin-bottom: 16px } .mb-3 { margin-bottom: 24px }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .row.wrap > .grow { flex: 1 1 240px; } .row.between { justify-content: space-between; } .row.top { align-items: flex-start; } .grow { flex: 1; min-width: 0; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grid { display: grid; gap: 14px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .g3.sm-1, .g2.sm-1, .g4.sm-1 { grid-template-columns: 1fr; } }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.green { color: var(--success); } .red { color: var(--error); } .orange { color: var(--warning); } .violet { color: var(--primary-2); } .gold { color: var(--gold); }
.num { font-variant-numeric: tabular-nums; font-family: var(--font-head); }
.hide { display: none !important; }

/* ---------- buttons ---------- */
.btn { --b: var(--card); --c: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--b); color: var(--c); font-weight: 650; font-size: 14.5px; cursor: pointer; transition: transform .15s var(--ease), box-shadow .2s, background .2s, opacity .2s; text-decoration: none !important; white-space: nowrap; position: relative; overflow: hidden; }
.btn:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }
.btn.loading::after { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.btn-primary { --b: linear-gradient(135deg, var(--primary-2), var(--primary) 60%, #5B21B6); --c: #fff; border: 0; box-shadow: 0 6px 16px rgba(109, 40, 217, .35); }
.btn-success { --b: linear-gradient(180deg, #22C55E, #16A34A); --c: #fff; border: 0; box-shadow: 0 6px 16px rgba(22, 163, 74, .3); }
.btn-gold { --b: linear-gradient(180deg, #FFD54A, #F5B400); --c: #3A2A00; border: 0; }
.btn-danger { --b: var(--error-soft); --c: var(--error); border-color: transparent; }
.btn-ghost { --b: transparent; border-color: transparent; } .btn-ghost:hover { --b: var(--primary-soft); box-shadow: none; }
.btn-soft { --b: var(--primary-soft); --c: var(--primary-2); border-color: transparent; }
.btn-white { --b: #fff; --c: var(--primary); border: 0; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 16px; border-radius: 14px; } .btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-block { width: 100%; } .btn-icon { width: 42px; padding: 0; } .btn-icon.btn-sm { width: 34px; }
.btn .ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255, 255, 255, .45); animation: ripple .6s linear; pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 16px; position: relative; }
.card.pad-0 { padding: 0; overflow: hidden; } .card.pad-lg { padding: 22px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.card-h h3 { margin: 0; }
.lift { transition: transform .25s var(--ease), box-shadow .25s; } .lift:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.glass { background: var(--glass); backdrop-filter: blur(18px) saturate(1.4); -webkit-backdrop-filter: blur(18px) saturate(1.4); border: 1px solid rgba(255, 255, 255, .35); }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 2px 12px; }
.section-title h2, .section-title h3 { margin: 0; }
.section-title a { font-weight: 600; font-size: 13.5px; }

/* ---------- chips / badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--text-2); font-size: 13.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all .2s; }
.chip:hover { border-color: var(--primary-3); } .chip.active { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 4px 12px rgba(109, 40, 217, .3); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; } .chips::-webkit-scrollbar { display: none; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; background: var(--card-2); color: var(--text-2); white-space: nowrap; }
.badge.green, .badge.success { background: var(--success-soft); color: var(--success); } .badge.red, .badge.error { background: var(--error-soft); color: var(--error); }
.badge.orange, .badge.warning { background: var(--warning-soft); color: var(--warning); } .badge.violet { background: var(--primary-soft); color: var(--primary-2); }
.badge.blue { background: var(--secondary-soft); color: var(--secondary); } .badge.gold { background: var(--gold-soft); color: #A16207; }
.badge.live { background: #DC2626; color: #fff; } .badge.live::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse-dot 1.2s infinite; }
@keyframes pulse-dot { 50% { opacity: .3; transform: scale(.7); } }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; } .dot.on { background: #22C55E; box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label, .label { font-size: 13px; font-weight: 650; color: var(--text-2); }
.input, select.input, textarea.input { width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--card); color: var(--text); font: inherit; font-size: 15px; transition: border-color .2s, box-shadow .2s; }
textarea.input { min-height: 96px; resize: vertical; }
.input:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-2) 18%, transparent); }
.input.invalid { border-color: var(--error); } .field .err { color: var(--error); font-size: 12.5px; font-weight: 600; }
.input-group { display: flex; align-items: stretch; border: 1.5px solid var(--line-2); border-radius: 12px; overflow: hidden; background: var(--card); }
.input-group:focus-within { border-color: var(--primary-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-2) 18%, transparent); }
.input-group .addon { display: flex; align-items: center; padding: 0 12px; background: var(--card-2); color: var(--muted); font-weight: 700; }
.input-group .input { border: 0; box-shadow: none !important; border-radius: 0; }
.hint { font-size: 12.5px; color: var(--muted); }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 550; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.switch { position: relative; width: 46px; height: 26px; flex: none; } .switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: .25s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .25s var(--spring); box-shadow: var(--shadow-1); }
.switch input:checked + span { background: var(--primary); } .switch input:checked + span::after { transform: translateX(20px); }
.otp-boxes { display: flex; gap: 8px; justify-content: center; }
.otp-boxes input { width: 46px; height: 56px; text-align: center; font-size: 22px; font-weight: 800; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--card); color: var(--text); font-family: var(--font-head); }
.otp-boxes input:focus { outline: none; border-color: var(--primary-2); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary-2) 18%, transparent); transform: translateY(-2px); }
.range { width: 100%; accent-color: var(--primary); }
.seg { display: inline-flex; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; width: 100%; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 10px; border-radius: 9px; font-weight: 650; color: var(--text-2); cursor: pointer; transition: .2s; font-size: 13.5px; }
.seg button.active { background: var(--card); color: var(--primary); box-shadow: var(--shadow-1); }

/* ---------- tabs (underline, fantasy-app style) ---------- */
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 14px; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
.tabs button { position: relative; border: 0; background: none; padding: 12px 14px; font-weight: 650; color: var(--muted); cursor: pointer; white-space: nowrap; font-size: 14px; }
.tabs button.active { color: var(--primary-2); } .tabs button.active::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--primary-2); animation: grow-x .3s var(--ease); }
.tabs button .count { margin-left: 6px; font-size: 11px; background: var(--card-2); padding: 1px 7px; border-radius: 99px; }
@keyframes grow-x { from { transform: scaleX(0); } }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: var(--card); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 12px 14px; background: var(--card-2); white-space: nowrap; }
.tbl td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: color-mix(in srgb, var(--primary-soft) 40%, transparent); }
.tbl .user-cell { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin: 16px 0; }
.pager button { min-width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); cursor: pointer; font-weight: 650; }
.pager button.active { background: var(--primary); color: #fff; border-color: var(--primary); } .pager button:disabled { opacity: .4; }

/* ---------- avatars / list ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--card-2); flex: none; border: 2px solid var(--card); }
.avatar.sm { width: 32px; height: 32px; } .avatar.lg { width: 64px; height: 64px; } .avatar.xl { width: 96px; height: 96px; border-width: 4px; }
.avatar.sq { border-radius: 12px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; } .list-item.click { cursor: pointer; border-radius: 12px; padding: 12px; } .list-item.click:hover { background: var(--card-2); }
.icon-tile { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary-2); }
.icon-tile.green { background: var(--success-soft); color: var(--success); } .icon-tile.red { background: var(--error-soft); color: var(--error); } .icon-tile.orange { background: var(--warning-soft); color: var(--warning); } .icon-tile.blue { background: var(--secondary-soft); color: var(--secondary); } .icon-tile.gold { background: var(--gold-soft); color: #A16207; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; } svg.i.sm { width: 16px; height: 16px; } svg.i.lg { width: 26px; height: 26px; }

/* ---------- progress ---------- */
.progress { height: 8px; background: var(--bg-2); border-radius: 99px; overflow: hidden; position: relative; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--electric), var(--primary)); width: 0; transition: width 1.2s var(--ease); position: relative; }
.progress > i::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .45), transparent); animation: shimmer 2s infinite; }
.progress.green > i { background: linear-gradient(90deg, #4ADE80, #16A34A); } .progress.orange > i { background: linear-gradient(90deg, #FDBA74, #EA580C); } .progress.red > i { background: linear-gradient(90deg, #F87171, #DC2626); }
.progress.thick { height: 12px; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.ring { --p: 0; --c: var(--primary-2); width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--bg-2) 0); transition: --p 1s; position: relative; }
.ring::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: var(--card); }
.ring > * { position: relative; text-align: center; }

/* ---------- skeleton ---------- */
.sk { background: linear-gradient(90deg, var(--bg-2) 25%, var(--card-2) 50%, var(--bg-2) 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }
.sk-card { height: 150px; margin-bottom: 12px; border-radius: var(--radius); } .sk-line { height: 14px; margin: 8px 0; } .sk-title { height: 26px; width: 40%; margin: 6px 0 16px; }

/* ---------- empty / error states ---------- */
.state { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.state .art { width: 120px; height: 120px; border-radius: 34px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-2); margin-bottom: 10px; transform: rotate(-6deg); animation: float 4s ease-in-out infinite; }
.state .art svg { width: 54px; height: 54px; }
.state.error .art { background: var(--error-soft); color: var(--error); }
.state p { color: var(--muted); max-width: 360px; }

/* =========================================================
   APP SHELL
   ========================================================= */
.shell { min-height: 100vh; min-height: 100dvh; }
.topbar { position: sticky; top: 0; z-index: 40; height: var(--top-h); display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: linear-gradient(120deg, var(--head-1), var(--head-2) 60%, var(--head-3)); color: #fff; box-shadow: 0 6px 20px rgba(26, 11, 61, .25); }
.topbar .title { font-family: var(--font-head); font-weight: 700; font-size: 17px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .tb-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .1); border: 0; color: #fff; cursor: pointer; position: relative; flex: none; }
.topbar .tb-btn:hover { background: rgba(255, 255, 255, .2); }
.topbar .tb-btn .dot-count { position: absolute; top: 4px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: #F43F5E; color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--head-2); animation: pop .4s var(--spring); }
.wallet-chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 6px 0 12px; border-radius: 12px; background: rgba(255, 255, 255, .12); color: #fff; font-weight: 750; font-family: var(--font-head); cursor: pointer; border: 1px solid rgba(255, 255, 255, .18); white-space: nowrap; }
.wallet-chip .plus { width: 26px; height: 26px; border-radius: 8px; background: #22C55E; display: grid; place-items: center; }
.topbar .logo { height: 30px; }
.topbar .avatar { width: 36px; height: 36px; border-color: rgba(255, 255, 255, .5); cursor: pointer; }
#view { padding: 16px 14px calc(var(--nav-h) + 26px); max-width: 1180px; margin: 0 auto; }
.view-enter { animation: view-in .38s var(--ease) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(14px) scale(.99); } }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 4px 2px 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: clamp(22px, 3.4vw, 28px); } .page-head p { margin: 2px 0 0; color: var(--muted); }

/* bottom nav */
.bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(5, 1fr); background: var(--glass); backdrop-filter: blur(20px) saturate(1.5); -webkit-backdrop-filter: blur(20px) saturate(1.5); border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(26, 11, 61, .08); }
.bottom-nav a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 650; text-decoration: none !important; position: relative; transition: color .2s; }
.bottom-nav a svg { width: 23px; height: 23px; transition: transform .3s var(--spring); }
.bottom-nav a.active { color: var(--primary-2); } .bottom-nav a.active svg { transform: translateY(-2px) scale(1.12); }
.bottom-nav a.active::before { content: ''; position: absolute; top: 0; width: 34px; height: 3px; border-radius: 0 0 4px 4px; background: var(--primary-2); }
.bottom-nav a.fab svg { width: 26px; height: 26px; }
.bottom-nav a.fab span.fab-c { width: 50px; height: 50px; margin-top: -26px; border-radius: 16px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--electric), var(--primary)); box-shadow: 0 10px 22px rgba(109, 40, 217, .45); transform: rotate(45deg); }
.bottom-nav a.fab span.fab-c svg { transform: rotate(-45deg); }

@media (max-width: 520px) {
  .topbar { gap: 6px; padding: 0 10px; } .topbar .tb-btn { width: 36px; height: 36px; } .topbar .tb-theme { display: none; }
  .topbar .logo { height: 26px; } .wallet-chip { height: 34px; padding: 0 4px 0 10px; font-size: 14px; } .wallet-chip .plus { width: 24px; height: 24px; }
.ccard .brand-side img { width: 40px; height: 40px; } .ccard .earn-side .amt { font-size: 18px; }
}
@media (max-width: 1023px) { .topbar.has-title .mobile-logo { display: none; } .topbar:not(.has-title) .title { display: none; } }
/* sidebar (desktop) */
.sidebar { display: none; }
@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: 264px 1fr; }
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; background: var(--card); border-right: 1px solid var(--line); padding: 18px 14px; overflow-y: auto; }
  .sidebar .logo { height: 36px; margin: 4px 8px 22px; }
  .sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--text-2); font-weight: 600; font-size: 14px; text-decoration: none; margin-bottom: 2px; transition: background .2s, color .2s, transform .2s; }
  .sidebar nav a:hover { background: var(--card-2); transform: translateX(3px); } .sidebar nav a.active { background: var(--primary-soft); color: var(--primary-2); }
  .sidebar nav .nav-sec { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin: 16px 12px 6px; }
  .sidebar .side-foot { margin-top: auto; padding-top: 14px; }
  .bottom-nav { display: none; } #view { padding: 24px 28px 40px; }
  .topbar { background: var(--glass); color: var(--text); backdrop-filter: blur(16px); box-shadow: none; border-bottom: 1px solid var(--line); height: 64px; padding: 0 28px; }
  .topbar .tb-btn { background: var(--card-2); color: var(--text-2); } .topbar .tb-btn .dot-count { border-color: var(--card); }
  .topbar .wallet-chip { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
  .topbar .mobile-logo { display: none; } .topbar .avatar { border-color: var(--line); }
}
.side-wallet { border-radius: 16px; padding: 14px; color: #fff; background: linear-gradient(135deg, var(--head-2), var(--primary) 60%, var(--electric)); position: relative; overflow: hidden; }
.side-wallet::after { content: ''; position: absolute; right: -30px; top: -30px; width: 100px; height: 100px; border-radius: 50%; background: rgba(255, 255, 255, .12); }

/* =========================================================
   COMPONENTS
   ========================================================= */
/* hero greeting / stat cards */
.hello { border-radius: var(--radius-lg); padding: 20px; color: #fff; position: relative; overflow: hidden; margin-bottom: 14px;
  background: radial-gradient(120% 120% at 100% 0%, rgba(168, 85, 247, .7), transparent 50%), linear-gradient(135deg, #1A0B3D, #3B1689 55%, #6D28D9); box-shadow: var(--shadow-2); }
.hello::before, .hello::after { content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .07); }
.hello::before { width: 220px; height: 220px; right: -60px; top: -90px; } .hello::after { width: 140px; height: 140px; right: 60px; bottom: -80px; }
.hello h1 { color: #fff; font-size: clamp(21px, 3.6vw, 28px); margin-bottom: 2px; } .hello p { color: rgba(255, 255, 255, .78); margin: 0; }
.hello .lvl { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2); padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; margin-top: 10px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; position: relative; overflow: hidden; box-shadow: var(--shadow-1); transition: transform .3s var(--ease), box-shadow .3s; }
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.stat .lbl { padding-right: 38px; font-size: 12.5px; font-weight: 650; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .val { font-family: var(--font-head); font-weight: 800; font-size: clamp(19px, 2.6vw, 25px); margin-top: 6px; letter-spacing: -.02em; }
.stat .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat .ic { position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary-2); }
.stat.hl { background: linear-gradient(135deg, #22C55E, #15803D); color: #fff; border: 0; } .stat.hl .lbl, .stat.hl .sub { color: rgba(255, 255, 255, .8); } .stat.hl .ic { background: rgba(255, 255, 255, .2); color: #fff; }
.stat.hl-v { background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; border: 0; } .stat.hl-v .lbl, .stat.hl-v .sub { color: rgba(255, 255, 255, .8); } .stat.hl-v .ic { background: rgba(255, 255, 255, .2); color: #fff; }

/* banner carousel */
.banners { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; margin: 0 -14px; padding: 4px 14px 8px; }
.banners::-webkit-scrollbar { display: none; }
.banner { scroll-snap-align: start; flex: 0 0 min(86%, 420px); border-radius: 18px; padding: 16px 18px; color: #fff; position: relative; overflow: hidden; min-height: 104px; cursor: pointer; transition: transform .3s var(--ease); }
.banner:hover { transform: scale(1.015); }
.banner h4 { color: #fff; font-size: 16px; margin-bottom: 4px; } .banner p { margin: 0; font-size: 13px; opacity: .9; max-width: 75%; }
.banner::after { content: ''; position: absolute; right: -20px; bottom: -40px; width: 130px; height: 130px; border-radius: 30px; background: rgba(255, 255, 255, .15); transform: rotate(25deg); }
.banner.violet { background: linear-gradient(120deg, #4C1D95, #7C3AED 60%, #C026D3); } .banner.gold { background: linear-gradient(120deg, #B45309, #F59E0B); } .banner.blue { background: linear-gradient(120deg, #1E3A8A, #2563EB 60%, #06B6D4); }
.banner.green { background: linear-gradient(120deg, #065F46, #16A34A 60%, #84CC16); } .banner.pink { background: linear-gradient(120deg, #9D174D, #DB2777); }

/* --- Campaign card (fantasy "match card") --- */
.ccard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; cursor: pointer; transition: transform .35s var(--ease), box-shadow .35s; transform-style: preserve-3d; will-change: transform; }
.ccard:hover { box-shadow: var(--shadow-3); }
.ccard .cc-top { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; font-size: 12px; color: var(--muted); font-weight: 650; border-bottom: 1px dashed var(--line); }
.ccard .cc-body { display: grid; grid-template-columns: minmax(0, 1.25fr) auto minmax(0, .9fr); align-items: center; padding: 14px; gap: 8px; }
.ccard .brand-side { display: flex; align-items: center; gap: 10px; min-width: 0; }
.ccard .brand-side img { width: 46px; height: 46px; border-radius: 14px; box-shadow: var(--shadow-1); }
.ccard .brand-side .nm { font-weight: 800; font-family: var(--font-head); font-size: 14px; line-height: 1.2; }
.ccard .brand-side .sub { font-size: 12px; color: var(--muted); }
.ccard .vs { text-align: center; } .ccard .timer { color: #DC2626; font-weight: 800; font-family: var(--font-head); font-size: 14px; white-space: nowrap; } .ccard .vs .small { color: var(--muted); font-size: 11px; }
.ccard .earn-side { text-align: right; } .ccard .earn-side .amt { font-family: var(--font-head); font-weight: 800; font-size: 20px; color: var(--success); } .ccard .earn-side .sub { font-size: 11.5px; color: var(--muted); }
.ccard .cc-prog { padding: 0 14px 12px; } .ccard .cc-prog .row { font-size: 12px; font-weight: 650; margin-top: 6px; }
.ccard .cc-foot { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--card-2); border-top: 1px solid var(--line); font-size: 12px; color: var(--text-2); font-weight: 600; }
.ccard .cc-foot .act { margin-left: auto; }
.ccard .mega { display: inline-flex; align-items: center; gap: 6px; background: linear-gradient(90deg, #FFF7DB, #FFE58A); color: #7A4F00; font-weight: 800; font-size: 11px; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; letter-spacing: .04em; }
:root[data-theme="dark"] .ccard .mega { background: linear-gradient(90deg, #3A2F0A, #5A4510); color: #FDE68A; }
.plat { display: inline-flex; gap: 4px; } .plat .pi { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; color: #fff; }
.plat .pi svg { width: 13px; height: 13px; } .pi.instagram { background: radial-gradient(circle at 30% 110%, #FEDA75, #FA7E1E 25%, #D62976 50%, #962FBF 75%, #4F5BD5); } .pi.whatsapp { background: #25D366; } .pi.facebook { background: #1877F2; }
.pi.lg { width: 44px; height: 44px; border-radius: 14px; } .pi.lg svg { width: 24px; height: 24px; }
.cards-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
@media (max-width: 400px) { .cards-grid { grid-template-columns: 1fr; } }

/* active campaign card */
.live-card { border-radius: var(--radius); padding: 16px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow-1); position: relative; overflow: hidden; }
.live-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: linear-gradient(90deg, #F43F5E, #A855F7, #3B82F6); background-size: 200% 100%; animation: flow 3s linear infinite; }
@keyframes flow { to { background-position: -200% 0; } }
.counter-big { font-family: var(--font-head); font-weight: 900; font-size: clamp(38px, 9vw, 64px); letter-spacing: -.03em; line-height: 1; background: linear-gradient(135deg, var(--primary-2), var(--pink)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.tick-up { animation: tick-up .5s var(--spring); } @keyframes tick-up { 0% { transform: translateY(6px); opacity: .4; } }
.countdown { font-family: var(--font-head); font-weight: 800; font-variant-numeric: tabular-nums; color: #DC2626; }

/* timeline */
.timeline { position: relative; padding-left: 28px; } .timeline::before { content: ''; position: absolute; left: 10px; top: 6px; bottom: 6px; width: 2px; background: var(--line-2); }
.tl-item { position: relative; padding: 4px 0 18px; } .tl-item::before { content: ''; position: absolute; left: -24px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--card); border: 3px solid var(--line-2); }
.tl-item.done::before { background: var(--success); border-color: var(--success); } .tl-item.now::before { background: var(--primary-2); border-color: var(--primary-soft); box-shadow: 0 0 0 5px color-mix(in srgb, var(--primary-2) 25%, transparent); animation: pulse-ring 1.6s infinite; }
.tl-item .t { font-weight: 700; } .tl-item .d { font-size: 12.5px; color: var(--muted); }
@keyframes pulse-ring { 50% { box-shadow: 0 0 0 9px transparent; } }
.pipeline { display: flex; align-items: stretch; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.pipeline .st { flex: 1; min-width: 92px; background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px; text-align: center; position: relative; }
.pipeline .st b { display: block; font-family: var(--font-head); font-size: 18px; } .pipeline .st span { font-size: 11.5px; color: var(--muted); font-weight: 650; }
.pipeline .st.on { background: var(--primary-soft); border-color: var(--primary-3); }

/* story preview phone */
.phone { width: 230px; aspect-ratio: 9 / 18.5; border-radius: 34px; padding: 9px; background: linear-gradient(145deg, #2B2B35, #0B0B10); box-shadow: 0 30px 60px rgba(0, 0, 0, .35), inset 0 0 0 2px #3A3A46; position: relative; margin: 0 auto; flex: none; }
.phone .scr { position: relative; width: 100%; height: 100%; border-radius: 26px; overflow: hidden; background: #000; }
.phone .notch { position: absolute; top: 9px; left: 50%; width: 76px; height: 20px; transform: translateX(-50%); background: #0B0B10; border-radius: 0 0 14px 14px; z-index: 3; }
.story { position: absolute; inset: 0; display: flex; flex-direction: column; color: #fff; }
.story .creative { position: absolute; inset: 0; background-size: cover; background-position: center; }
.story .bars { position: relative; z-index: 2; display: flex; gap: 3px; padding: 28px 10px 0; } .story .bars i { flex: 1; height: 2.5px; background: rgba(255, 255, 255, .35); border-radius: 2px; overflow: hidden; }
.story .bars i.on::after { content: ''; display: block; height: 100%; background: #fff; animation: story-bar 5s linear infinite; } @keyframes story-bar { from { width: 0; } to { width: 100%; } }
.story .who { position: relative; z-index: 2; display: flex; align-items: center; gap: 7px; padding: 8px 10px; font-size: 11.5px; font-weight: 700; text-shadow: 0 1px 3px rgba(0, 0, 0, .4); }
.story .who img { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid #fff; } .story .who .sp { font-weight: 500; opacity: .85; font-size: 10.5px; }
.story .txt { position: relative; z-index: 2; margin-top: auto; padding: 14px; text-align: center; }
.story .txt h4 { color: #fff; font-size: 22px; font-weight: 900; text-shadow: 0 2px 10px rgba(0, 0, 0, .3); } .story .txt p { font-size: 12px; opacity: .92; }
.story .cta { position: relative; z-index: 2; margin: 0 auto 18px; display: inline-flex; align-items: center; gap: 6px; background: #fff; color: #111; font-weight: 800; font-size: 11.5px; padding: 8px 16px; border-radius: 99px; text-transform: uppercase; }
.story.wa .bars i { background: rgba(255, 255, 255, .25); } .story.wa .bars i.on::after { background: #25D366; }
.story.fb .cta { background: #1877F2; color: #fff; }
.bg-violet { background: linear-gradient(160deg, #A78BFA, #7C3AED 55%, #2E1065); } .bg-sunset { background: linear-gradient(160deg, #F97316, #DB2777 55%, #7C3AED); } .bg-night { background: linear-gradient(160deg, #0F172A, #1E1B4B 55%, #4C1D95); }
.bg-pink { background: linear-gradient(160deg, #F472B6, #E11D48 55%, #7C2D12); } .bg-red { background: linear-gradient(160deg, #EF4444, #B91C1C 55%, #450A0A); } .bg-blue { background: linear-gradient(160deg, #38BDF8, #2563EB 55%, #1E1B4B); }
.bg-coffee { background: linear-gradient(160deg, #D6A26B, #92400E 55%, #3B1D0B); } .bg-green { background: linear-gradient(160deg, #4ADE80, #15803D 55%, #052E16); } .bg-gold { background: linear-gradient(160deg, #FDE047, #F59E0B 55%, #9A3412); } .bg-peach { background: linear-gradient(160deg, #FED7AA, #FB7185 55%, #9D174D); }

/* category tiles (onboarding) */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.cat-tile { border: 2px solid var(--line); background: var(--card); border-radius: 18px; padding: 10px 8px 12px; text-align: center; cursor: pointer; transition: transform .3s var(--spring), border-color .2s, box-shadow .3s; font-weight: 700; font-size: 13px; color: var(--text); position: relative; }
.cat-tile img { width: 64px; height: 64px; margin: 0 auto 8px; border-radius: 18px; transition: transform .4s var(--spring); }
.cat-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); } .cat-tile:hover img { transform: rotate(-6deg) scale(1.08); }
.cat-tile.active { border-color: var(--primary-2); background: var(--primary-soft); box-shadow: 0 10px 24px rgba(109, 40, 217, .25); }
.cat-tile.active::after { content: '✓'; position: absolute; top: 6px; right: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 12px; display: grid; place-items: center; animation: pop .35s var(--spring); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.choice { border: 2px solid var(--line); border-radius: 16px; padding: 14px; cursor: pointer; background: var(--card); transition: .25s; text-align: left; color: var(--text); }
.choice:hover { border-color: var(--primary-3); transform: translateY(-2px); } .choice.active { border-color: var(--primary-2); background: var(--primary-soft); }
.choice .icon-tile { margin-bottom: 8px; } .choice b { display: block; font-size: 14px; } .choice span { font-size: 12px; color: var(--muted); }

/* stepper */
.stepper { display: flex; gap: 6px; margin: 4px 0 18px; } .stepper i { flex: 1; height: 5px; border-radius: 9px; background: var(--line); position: relative; overflow: hidden; }
.stepper i.done { background: var(--primary-2); } .stepper i.now { background: var(--line); } .stepper i.now::after { content: ''; position: absolute; inset: 0; width: 50%; background: var(--primary-2); border-radius: 9px; animation: grow-x .5s var(--ease); transform-origin: left; }

/* wallet card 3D */
.wallet-3d { perspective: 1200px; }
.wallet-card { position: relative; border-radius: 24px; padding: 22px; color: #fff; min-height: 196px; overflow: hidden; transform-style: preserve-3d; transition: transform .6s var(--ease);
  background: radial-gradient(140% 100% at 100% 0%, rgba(236, 72, 153, .55), transparent 50%), radial-gradient(120% 120% at 0% 100%, rgba(59, 130, 246, .55), transparent 55%), linear-gradient(135deg, #1A0B3D, #4C1D95 60%, #6D28D9);
  box-shadow: 0 24px 50px rgba(76, 29, 149, .4); }
.wallet-card::before { content: ''; position: absolute; width: 260px; height: 260px; right: -80px; top: -110px; border-radius: 50%; border: 36px solid rgba(255, 255, 255, .06); }
.wallet-card .chip-gold { width: 42px; height: 32px; border-radius: 8px; background: linear-gradient(135deg, #FDE68A, #D97706); box-shadow: inset 0 0 0 2px rgba(0, 0, 0, .1); }
.wallet-card .bal { font-family: var(--font-head); font-size: clamp(30px, 7vw, 42px); font-weight: 900; letter-spacing: -.02em; margin: 10px 0 2px; }
.wallet-card .lbl { opacity: .75; font-size: 13px; font-weight: 600; }
.wallet-card .split { display: flex; gap: 18px; margin-top: 14px; flex-wrap: wrap; } .wallet-card .split div { font-size: 12px; opacity: .85; } .wallet-card .split b { display: block; font-size: 16px; font-family: var(--font-head); opacity: 1; }
.wallet-card .shine { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .18) 45%, transparent 60%); transform: translateX(-100%); animation: shine 4.5s ease-in-out infinite; }
@keyframes shine { 60%, 100% { transform: translateX(100%); } }
.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.qa { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); color: var(--text-2); font-size: 12px; font-weight: 650; cursor: pointer; transition: .25s var(--spring); text-align: center; }
.qa:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); color: var(--primary-2); }

/* leaderboard podium (3D) */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; perspective: 900px; padding: 20px 0 6px; }
.pod { text-align: center; width: 31%; max-width: 150px; animation: rise .8s var(--spring) both; }
.pod:nth-child(1) { animation-delay: .15s; } .pod:nth-child(3) { animation-delay: .3s; }
.pod .avatar { margin: 0 auto 6px; width: 58px; height: 58px; border: 3px solid #fff; box-shadow: var(--shadow-2); }
.pod.p1 .avatar { width: 74px; height: 74px; border-color: #FBBF24; }
.pod .name { font-weight: 750; font-size: 13px; } .pod .amt { font-weight: 800; color: var(--success); font-family: var(--font-head); font-size: 14px; }
.pod .block { margin-top: 8px; border-radius: 14px 14px 4px 4px; display: grid; place-items: center; color: #fff; font-family: var(--font-head); font-weight: 900; font-size: 30px; transform: rotateX(14deg); transform-origin: bottom; box-shadow: inset 0 -10px 20px rgba(0, 0, 0, .15), 0 18px 30px rgba(42, 18, 92, .25); position: relative; }
.pod .block::before { content: ''; position: absolute; left: 0; right: 0; top: -12px; height: 12px; border-radius: 10px 10px 0 0; background: inherit; filter: brightness(1.2); transform: skewX(-12deg); transform-origin: bottom; }
.pod.p1 .block { height: 130px; background: linear-gradient(180deg, #FCD34D, #D97706); } .pod.p2 .block { height: 100px; background: linear-gradient(180deg, #E5E7EB, #9CA3AF); } .pod.p3 .block { height: 80px; background: linear-gradient(180deg, #FDBA74, #C2410C); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.crown { font-size: 26px; animation: float 3s ease-in-out infinite; }
.lb-row { display: grid; grid-template-columns: 38px 42px 1fr auto; gap: 10px; align-items: center; padding: 12px; border-radius: 14px; transition: background .2s; }
.lb-row:hover { background: var(--card-2); } .lb-row.me { background: var(--primary-soft); border: 1px solid var(--primary-3); }
.lb-row .rk { font-family: var(--font-head); font-weight: 800; color: var(--muted); text-align: center; }

/* chat */
.chat { display: flex; flex-direction: column; height: calc(100dvh - var(--top-h) - var(--nav-h) - 60px); min-height: 420px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.chat-h { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--card-2); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--primary-soft) 60%, transparent), transparent 40%), var(--card); }
.msg { max-width: 78%; padding: 10px 14px; border-radius: 18px; font-size: 14px; position: relative; animation: msg-in .3s var(--spring); word-wrap: break-word; }
.msg.me { align-self: flex-end; background: linear-gradient(135deg, var(--primary-2), var(--primary)); color: #fff; border-bottom-right-radius: 6px; }
.msg.them { align-self: flex-start; background: var(--card-2); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.msg .meta { font-size: 10.5px; opacity: .7; margin-top: 4px; text-align: right; } .msg img { border-radius: 12px; margin-top: 6px; max-height: 200px; }
@keyframes msg-in { from { transform: translateY(10px) scale(.95); opacity: 0; } }
.typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 14px; background: var(--card-2); border-radius: 18px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite; } .typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 30% { transform: translateY(-5px); opacity: .5; } }
.chat-in { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); align-items: center; }
.chat-in .input { min-height: 44px; border-radius: 99px; }

/* overlays: modal, sheet, toast */
.overlay { position: fixed; inset: 0; z-index: 90; background: rgba(12, 6, 30, .55); backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .2s; }
.overlay.closing { animation: fade .2s reverse forwards; }
.modal { background: var(--card); border-radius: 24px; width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow-3); padding: 22px; animation: modal-in .35s var(--spring); position: relative; }
.modal.wide { max-width: 860px; }
.modal-x { position: absolute; top: 12px; right: 12px; }
@keyframes modal-in { from { transform: translateY(20px) scale(.94); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.overlay.sheet-wrap { align-items: flex-end; padding: 0; }
.sheet { background: var(--card); width: 100%; max-width: 640px; border-radius: 26px 26px 0 0; padding: 10px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 92vh; overflow-y: auto; animation: sheet-in .4s var(--ease); box-shadow: var(--shadow-3); }
.sheet::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 9px; background: var(--line-2); margin: 0 auto 14px; }
.overlay.closing .sheet { animation: sheet-in .25s reverse forwards; }
@keyframes sheet-in { from { transform: translateY(100%); } }
@media (min-width: 700px) { .overlay.sheet-wrap { align-items: center; padding: 16px; } .sheet { border-radius: 24px; } .sheet::before { display: none; } }
#toasts { position: fixed; z-index: 120; top: 14px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 24px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 16px; background: var(--card); color: var(--text); box-shadow: var(--shadow-3); border: 1px solid var(--line); animation: toast-in .45s var(--spring); font-weight: 550; font-size: 14px; }
.toast .ti { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--primary-soft); color: var(--primary-2); }
.toast.success .ti { background: var(--success-soft); color: var(--success); } .toast.error .ti { background: var(--error-soft); color: var(--error); } .toast.warning .ti { background: var(--warning-soft); color: var(--warning); }
.toast.out { animation: toast-out .3s forwards; }
@keyframes toast-in { from { transform: translateY(-30px) scale(.9); opacity: 0; } } @keyframes toast-out { to { transform: translateY(-20px); opacity: 0; } }

/* success animation */
.success-anim { width: 96px; height: 96px; margin: 6px auto 12px; border-radius: 50%; background: var(--success-soft); display: grid; place-items: center; animation: pop .5s var(--spring); }
.success-anim svg { width: 56px; height: 56px; stroke: var(--success); stroke-width: 3.5; fill: none; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .6s .25s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } } @keyframes pop { 0% { transform: scale(.4); opacity: 0; } }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 130; }

/* 3D cube loader */
.cube-loader { width: 42px; height: 42px; margin: 30px auto; perspective: 200px; }
.cube-loader .cube { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; animation: cube 2.4s infinite var(--ease); }
.cube-loader .cube i { position: absolute; inset: 0; border-radius: 8px; opacity: .9; }
.cube-loader .cube i:nth-child(1) { background: #8B5CF6; transform: translateZ(21px); } .cube-loader .cube i:nth-child(2) { background: #6D28D9; transform: rotateY(90deg) translateZ(21px); }
.cube-loader .cube i:nth-child(3) { background: #EC4899; transform: rotateY(180deg) translateZ(21px); } .cube-loader .cube i:nth-child(4) { background: #3B82F6; transform: rotateY(-90deg) translateZ(21px); }
.cube-loader .cube i:nth-child(5) { background: #A855F7; transform: rotateX(90deg) translateZ(21px); } .cube-loader .cube i:nth-child(6) { background: #F5B400; transform: rotateX(-90deg) translateZ(21px); }
@keyframes cube { 0% { transform: rotateX(-25deg) rotateY(0); } 50% { transform: rotateX(205deg) rotateY(180deg); } 100% { transform: rotateX(335deg) rotateY(360deg); } }
@keyframes float { 50% { transform: translateY(-8px) rotate(-6deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
.tilt { transform-style: preserve-3d; transition: transform .2s ease-out; }
.flip-in { animation: flip-in .7s var(--ease) both; } @keyframes flip-in { from { transform: perspective(800px) rotateX(-60deg); opacity: 0; } }
.stagger > * { animation: view-in .5s var(--ease) both; } .stagger > *:nth-child(2) { animation-delay: .05s; } .stagger > *:nth-child(3) { animation-delay: .1s; } .stagger > *:nth-child(4) { animation-delay: .15s; } .stagger > *:nth-child(5) { animation-delay: .2s; } .stagger > *:nth-child(6) { animation-delay: .25s; } .stagger > *:nth-child(n+7) { animation-delay: .3s; }

/* charts */
.chart { width: 100%; height: 220px; } .chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .grid-l { stroke: var(--line); stroke-dasharray: 3 4; } .chart .ax { fill: var(--muted); font-size: 10.5px; font-family: var(--font); }
.chart .area { opacity: .25; } .chart .line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1.4s var(--ease) forwards; }
.chart .bar { transform-origin: bottom; transform-box: fill-box; animation: bar-up .8s var(--ease) both; } @keyframes bar-up { from { transform: scaleY(0); } }
.chart .pt { fill: var(--card); stroke-width: 2.5; } .chart .tipzone { fill: transparent; cursor: crosshair; }
.chart-tip { position: fixed; z-index: 140; pointer-events: none; background: #140D2B; color: #fff; padding: 6px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; box-shadow: var(--shadow-2); transform: translate(-50%, -120%); white-space: nowrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); font-weight: 600; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; flex: none; } .donut circle { fill: none; stroke-width: 18; transition: stroke-dasharray 1s var(--ease); }
.funnel .fr { display: grid; grid-template-columns: 90px 1fr 80px; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; font-weight: 650; }
.funnel .fb { height: 26px; border-radius: 8px; background: linear-gradient(90deg, var(--electric), var(--primary)); transform-origin: left; animation: grow-x 1s var(--ease) both; }

/* misc */
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14px; } .kv dt { color: var(--muted); font-weight: 600; } .kv dd { margin: 0; font-weight: 650; text-align: right; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }
.alert { padding: 12px 14px; border-radius: 14px; background: var(--primary-soft); color: var(--text); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; }
.alert.success { background: var(--success-soft); } .alert.error { background: var(--error-soft); } .alert.warning { background: var(--warning-soft); }
.alert svg { flex: none; margin-top: 1px; }
.notice-sim { font-size: 12px; color: #A16207; background: var(--gold-soft); border: 1px dashed #EAB308; padding: 8px 12px; border-radius: 12px; display: flex; gap: 8px; align-items: flex-start; }
.copy-box { display: flex; align-items: center; gap: 8px; border: 2px dashed var(--primary-3); border-radius: 14px; padding: 10px 12px; background: var(--primary-soft); font-family: var(--font-head); font-weight: 800; font-size: 20px; letter-spacing: .08em; color: var(--primary); }
.legal h2 { font-size: 18px; margin-top: 22px; } .legal p, .legal li { color: var(--text-2); } .cms-note { background: var(--gold-soft); border: 1px dashed #EAB308; padding: 10px 12px; border-radius: 12px; font-size: 13px; color: #92400E !important; }
:root[data-theme="dark"] .cms-note { color: #FDE68A !important; }
.amount-chips { display: flex; gap: 8px; flex-wrap: wrap; } .amount-chips .chip { font-family: var(--font-head); }
.pay-method { display: flex; align-items: center; gap: 12px; padding: 14px; border: 2px solid var(--line); border-radius: 14px; cursor: pointer; margin-bottom: 8px; background: var(--card); transition: .2s; }
.pay-method.active { border-color: var(--primary-2); background: var(--primary-soft); }
.notif { display: flex; gap: 12px; padding: 14px; border-radius: 14px; cursor: pointer; transition: background .2s; position: relative; }
.notif:hover { background: var(--card-2); } .notif.unread { background: color-mix(in srgb, var(--primary-soft) 70%, transparent); } .notif.unread::after { content: ''; position: absolute; right: 14px; top: 18px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary-2); }
.kpi-mini { display: flex; flex-direction: column; } .kpi-mini b { font-family: var(--font-head); font-size: 18px; } .kpi-mini span { font-size: 12px; color: var(--muted); font-weight: 600; }
.level-bar { background: rgba(255, 255, 255, .18); height: 6px; border-radius: 9px; overflow: hidden; margin-top: 8px; } .level-bar i { display: block; height: 100%; background: linear-gradient(90deg, #FDE68A, #F59E0B); border-radius: 9px; transition: width 1.2s var(--ease); }
.check-list li { list-style: none; display: flex; gap: 8px; align-items: center; padding: 4px 0; font-size: 13.5px; } .check-list { padding: 0; margin: 0; }
.ok-ic { color: var(--success); } .wait-ic { color: var(--muted); }
.invoice { background: #fff; color: #111; border-radius: 16px; padding: 28px; max-width: 760px; margin: 0 auto; box-shadow: var(--shadow-2); }
.invoice table { width: 100%; border-collapse: collapse; } .invoice th, .invoice td { text-align: left; padding: 10px; border-bottom: 1px solid #eee; } .invoice .tot td { font-weight: 800; font-size: 16px; }
@media print { .topbar, .bottom-nav, .sidebar, .no-print { display: none !important; } #view { padding: 0; } .invoice { box-shadow: none; } body { background: #fff; } }
.fab-btn { position: fixed; right: 18px; bottom: calc(var(--nav-h) + 18px); z-index: 44; width: 56px; height: 56px; border-radius: 18px; border: 0; color: #fff; background: linear-gradient(135deg, var(--electric), var(--primary)); box-shadow: 0 12px 28px rgba(109, 40, 217, .45); display: grid; place-items: center; cursor: pointer; animation: pop .5s var(--spring); }
@media (min-width: 1024px) { .fab-btn { bottom: 28px; right: 28px; } }

/* install page */
.install-page { display: grid; place-items: center; min-height: 100vh; padding: 20px; background: radial-gradient(circle at 20% 10%, #A855F7 0, transparent 40%), radial-gradient(circle at 90% 90%, #3B82F6 0, transparent 40%), #1A0B3D; }
.install-card { max-width: 560px; width: 100%; border-radius: 26px; padding: 30px; background: var(--card); }
.install-card .checks { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .install-card .checks .ok { color: var(--success); } .install-card .checks .bad { color: var(--error); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* form components (v2) */
.chips.wrap-chips { flex-wrap: wrap; overflow: visible; }
.chip-select .chip { font-size: 13px; padding: 6px 12px; }
.img-pick { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.img-pick img { width: 84px; height: 84px; border-radius: 18px; object-fit: cover; border: 2px solid var(--line); background: var(--card-2); }
.img-pick.round img { border-radius: 50%; }
.img-pick .hint { width: 100%; }
select.input:disabled { opacity: .6; }
.int-card .field { margin-bottom: 10px; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; }
.status-dot::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: var(--error); }
.status-dot.on::before { background: var(--success); box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.url-box { font-family: ui-monospace, monospace; font-size: 12.5px; background: var(--card-2); border: 1px dashed var(--line-2); padding: 8px 10px; border-radius: 10px; word-break: break-all; }
@media (max-width: 1023px) { #st > .card[style*="sticky"] { position: static !important; } }

/* story publish: highlight the Link sticker box when the creator forgets to tick it */
@keyframes vl-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.shake { animation: vl-shake .3s 2; outline: 2px solid var(--warning, #F59E0B); }

/* story preview: sound on / off button for video stories */
.story .story-sound { position: absolute; top: 54px; right: 10px; z-index: 5; width: 34px; height: 34px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: rgba(0, 0, 0, .45); color: #fff; backdrop-filter: blur(4px); }
.story .story-sound .i { width: 18px; height: 18px; stroke: #fff; }
.phone.sm .story .story-sound { top: 34px; width: 26px; height: 26px; }
