/* =====================================================================
   MapatoHub design system v2 — mobile-first, light/dark, no external deps
   Palette: emerald (brand) · violet (accent) · gold (premium) · sky · rose
   ===================================================================== */
:root {
  --bg: #f3f6fb;
  --bg-glow-1: rgba(16, 185, 129, .10);
  --bg-glow-2: rgba(124, 58, 237, .08);
  --surface: #ffffff;
  --surface-2: #f6f8fc;
  --surface-3: #eef2f8;
  --border: #e4e9f2;
  --border-strong: #d3dbe8;
  --text: #0f1b2d;
  --text-2: #4b5b72;
  --muted: #8392a8;
  --primary: #059669;
  --primary-600: #047857;
  --primary-400: #10b981;
  --primary-50: #e8f8f1;
  --primary-grad: linear-gradient(135deg, #047857 0%, #059669 45%, #10b981 100%);
  --hero-grad: linear-gradient(135deg, #064e3b 0%, #047857 40%, #0d9488 75%, #14b8a6 100%);
  --accent: #7c3aed;
  --accent-50: #f1ebff;
  --accent-grad: linear-gradient(135deg, #6d28d9, #8b5cf6);
  --gold: #d97706;
  --gold-50: #fff6e0;
  --gold-grad: linear-gradient(135deg, #f59e0b, #fbbf24);
  --sky: #0284c7; --sky-50: #e6f4fd;
  --rose: #e11d48; --rose-50: #ffe9ee;
  --success: #059669; --success-50: #e7f8f0;
  --warning: #b45309; --warning-50: #fff4e1;
  --danger: #dc2626;  --danger-50: #fdecec;
  --info: #2563eb;    --info-50: #e9f0fe;
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, .05);
  --shadow: 0 1px 2px rgba(15, 27, 45, .04), 0 4px 16px -6px rgba(15, 27, 45, .10);
  --shadow-lg: 0 24px 48px -16px rgba(15, 27, 45, .28);
  --shadow-glow: 0 10px 30px -10px rgba(5, 150, 105, .55);
  --ring: 0 0 0 4px rgba(16, 185, 129, .18);
  --radius: 18px;
  --radius-sm: 12px;
  --sidebar: 264px;
  --sidebar-bg: linear-gradient(180deg, #0b1f2e 0%, #0b2a2a 55%, #0a2e24 100%);
  --sidebar-text: #b9c8d6;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a1018; --bg-glow-1: rgba(16, 185, 129, .10); --bg-glow-2: rgba(139, 92, 246, .10);
    --surface: #111a25; --surface-2: #162130; --surface-3: #1b2838; --border: #223144; --border-strong: #2d3f56;
    --text: #e7eef6; --text-2: #a9b9cc; --muted: #7487a0;
    --primary: #34d399; --primary-600: #10b981; --primary-400: #6ee7b7; --primary-50: #0f2b23;
    --accent: #a78bfa; --accent-50: #221a3a; --gold: #fbbf24; --gold-50: #2e2410;
    --sky: #38bdf8; --sky-50: #0d2433; --rose: #fb7185; --rose-50: #33141c;
    --success: #34d399; --success-50: #0f2b23; --warning: #fbbf24; --warning-50: #2e2410;
    --danger: #f87171; --danger-50: #351616; --info: #60a5fa; --info-50: #13213a;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -10px rgba(0,0,0,.6); --shadow-lg: 0 24px 48px -16px rgba(0,0,0,.7);
    --ring: 0 0 0 4px rgba(52, 211, 153, .22);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a1018; --bg-glow-1: rgba(16, 185, 129, .10); --bg-glow-2: rgba(139, 92, 246, .10);
  --surface: #111a25; --surface-2: #162130; --surface-3: #1b2838; --border: #223144; --border-strong: #2d3f56;
  --text: #e7eef6; --text-2: #a9b9cc; --muted: #7487a0;
  --primary: #34d399; --primary-600: #10b981; --primary-400: #6ee7b7; --primary-50: #0f2b23;
  --accent: #a78bfa; --accent-50: #221a3a; --gold: #fbbf24; --gold-50: #2e2410;
  --sky: #38bdf8; --sky-50: #0d2433; --rose: #fb7185; --rose-50: #33141c;
  --success: #34d399; --success-50: #0f2b23; --warning: #fbbf24; --warning-50: #2e2410;
  --danger: #f87171; --danger-50: #351616; --info: #60a5fa; --info-50: #13213a;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -10px rgba(0,0,0,.6); --shadow-lg: 0 24px 48px -16px rgba(0,0,0,.7);
  --ring: 0 0 0 4px rgba(52, 211, 153, .22);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; font: 15px/1.6 var(--font); color: var(--text); background: var(--bg);
  background-image: radial-gradient(900px 500px at 100% -10%, var(--bg-glow-2), transparent 60%), radial-gradient(800px 500px at -10% 0%, var(--bg-glow-1), transparent 60%);
  background-attachment: fixed; -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-600); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { margin: 0 0 .5rem; line-height: 1.25; letter-spacing: -.015em; }
h1 { font-size: 1.6rem; font-weight: 800; } h2 { font-size: 1.22rem; font-weight: 750; } h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .75rem; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); } .text-2 { color: var(--text-2); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon-sm { width: 16px; height: 16px; } .icon-lg { width: 28px; height: 28px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* The `hidden` attribute is only a UA-stylesheet `display:none`, so any class or
   inline `display` defeats it and the element shows anyway. Make it win. */
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--primary) 25%, transparent); }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; z-index: 100; border-radius: 8px; }
.skip-link:focus { left: 8px; }
.gradient-text { background: linear-gradient(90deg, var(--primary), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Animations ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
@keyframes stripes { from { background-position: 0 0, 0 0; } to { background-position: 0 0, 28px 0; } }
@keyframes float { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-14px) scale(1.04); } }
@keyframes pulseRing { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 45%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }
@keyframes slidein { from { transform: translateY(-10px) scale(.98); opacity: 0; } }
@keyframes pop { 0% { transform: scale(.94); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes drawLine { to { stroke-dashoffset: 0; } }
@keyframes growBar { from { transform: scaleY(0); } }
@keyframes rippleAnim { to { transform: scale(4); opacity: 0; } }
.content > * { animation: fadeUp .38s var(--ease) both; }
.content > *:nth-child(2) { animation-delay: .03s; } .content > *:nth-child(3) { animation-delay: .06s; } .content > *:nth-child(4) { animation-delay: .09s; }
.content > *:nth-child(n+5) { animation-delay: .12s; }
.grid-4 > .card, .tiles > .tile { animation: pop .4s var(--ease) both; }
.grid-4 > .card:nth-child(2), .tiles > .tile:nth-child(2) { animation-delay: .05s; } .grid-4 > .card:nth-child(3), .tiles > .tile:nth-child(3) { animation-delay: .1s; } .grid-4 > .card:nth-child(4), .tiles > .tile:nth-child(n+4) { animation-delay: .15s; }
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } .reveal { opacity: 1; transform: none; } }
.page-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 90; background: linear-gradient(90deg, var(--primary-400), var(--accent)); box-shadow: 0 0 10px var(--primary-400); transition: width .4s var(--ease), opacity .3s; pointer-events: none; }

/* ---------- Layout ---------- */
.app { min-height: 100vh; display: flex; }
.sidebar { width: var(--sidebar); background: var(--sidebar-bg); color: var(--sidebar-text); position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 40; transform: translateX(-100%); transition: transform .28s var(--ease); }
.sidebar::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(300px 200px at 0% 0%, rgba(16,185,129,.22), transparent 70%), radial-gradient(260px 220px at 100% 100%, rgba(139,92,246,.18), transparent 70%); }
.sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
.sidebar-brand { position: relative; display: flex; align-items: center; gap: 11px; padding: 20px 20px 14px; font-weight: 800; font-size: 1.12rem; color: #fff; letter-spacing: -.01em; }
.sidebar-brand:hover { color: #fff; }
.guest-header .sidebar-brand, .guest-header .sidebar-brand:hover { color: var(--text); }
/* The brand mark is the TENOMIXX logo file, which carries its own gradient. */
.brand-mark { width: 36px; height: 36px; border-radius: 11px; display: block; flex: none; box-shadow: var(--shadow-glow); }
.sidebar nav { position: relative; overflow-y: auto; padding: 4px 12px 24px; flex: 1; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: rgba(185, 200, 214, .55); padding: 16px 12px 6px; font-weight: 700; }
.nav-link { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin: 1px 0; border-radius: 11px; color: var(--sidebar-text); font-weight: 550; font-size: .93rem; transition: background .18s, color .18s; }
.nav-link .icon { opacity: .8; transition: transform .2s var(--ease); }
.nav-link:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-link:hover .icon { transform: translateX(2px); opacity: 1; }
.nav-link.active { background: linear-gradient(90deg, rgba(16,185,129,.30), rgba(16,185,129,.06)); color: #fff; }
.nav-link.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: #34d399; box-shadow: 0 0 12px #34d399; }
.nav-link.active .icon { color: #34d399; opacity: 1; }
.nav-link .pill { margin-left: auto; }
.nav-group { margin: 2px 0; }
.nav-group-toggle { width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; font-family: inherit; }
.nav-section-toggle { width: 100%; border: 0; background: transparent; cursor: pointer; display: flex; align-items: center; justify-content: space-between; font-family: inherit; text-align: left; }
.nav-section-toggle:hover { color: #fff; }
.nav-caret { margin-left: auto; font-size: .75rem; opacity: .75; transition: transform .2s var(--ease); }
.nav-group.is-open > .nav-group-toggle .nav-caret,
.nav-group.is-open > .nav-section-toggle .nav-caret { transform: rotate(180deg); }
.nav-group-items { display: none; flex-direction: column; }
.nav-group.is-open > .nav-group-items { display: flex; }
.nav-group:not(.nav-group-section) > .nav-group-items { padding-left: 14px; margin: 2px 0 4px 18px; border-left: 1px solid rgba(255,255,255,.12); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: color-mix(in srgb, var(--surface) 78%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.topbar .spacer { flex: 1; }
.topbar-title { font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; transition: background .15s, color .15s, transform .15s; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .dot { position: absolute; top: 3px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: linear-gradient(135deg, #f43f5e, #e11d48); color: #fff; font-size: .66rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface); animation: pop .3s var(--ease); }
.content { padding: 18px 16px; width: 100%; max-width: 1240px; margin: 0 auto; padding-bottom: 110px; }
.backdrop { position: fixed; inset: 0; background: rgba(8, 15, 25, .5); backdrop-filter: blur(2px); z-index: 35; display: none; animation: fadeIn .2s; }
.backdrop.show { display: block; }
.bottom-nav { position: fixed; bottom: 10px; left: 10px; right: 10px; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 4px; padding-bottom: calc(4px + env(safe-area-inset-bottom)); }
.bottom-nav a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; color: var(--muted); font-size: .68rem; font-weight: 700; border-radius: 15px; transition: color .2s, background .2s; }
.bottom-nav a:hover { color: var(--text); }
.bottom-nav a.active { color: var(--primary); background: var(--primary-50); }
@media (min-width: 992px) {
  .sidebar { transform: none; }
  .main { margin-left: var(--sidebar); }
  .menu-toggle, .bottom-nav { display: none !important; }
  .content { padding: 28px 32px 48px; }
}

/* ---------- Guest layout ---------- */
.guest { min-height: 100vh; display: flex; flex-direction: column; position: relative; overflow: hidden; isolation: isolate; }
.guest::before, .guest::after { content: ""; position: absolute; z-index: -1; border-radius: 50%; filter: blur(50px); opacity: .6; animation: float 12s ease-in-out infinite; pointer-events: none; }
.guest::before { width: 440px; height: 440px; top: -140px; right: -90px; background: radial-gradient(circle, rgba(16,185,129,.45), transparent 65%); }
.guest::after { width: 400px; height: 400px; bottom: -140px; left: -110px; background: radial-gradient(circle, rgba(139,92,246,.35), transparent 65%); animation-delay: -6s; }
.guest-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; max-width: 1180px; width: 100%; margin: 0 auto; }
.guest-main { flex: 1; width: 100%; }
.auth-card { width: 100%; max-width: 470px; margin: 20px auto; padding: 0 16px; }
.auth-card > .card { padding: 30px 24px; border-radius: 24px; box-shadow: var(--shadow-lg); }
.auth-card > .card::before { content: ""; position: absolute; inset: 0 0 auto; height: 5px; border-radius: 24px 24px 0 0; background: linear-gradient(90deg, var(--primary-400), var(--accent), var(--gold)); }
.auth-card > .card h1 { font-size: 1.6rem; }
.guest-footer { text-align: center; padding: 24px 16px; color: var(--muted); font-size: .85rem; }
.guest-footer a { color: var(--text-2); margin: 0 8px; }
.hero { padding: 52px 16px 36px; text-align: center; max-width: 920px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); letter-spacing: -.035em; line-height: 1.06; font-weight: 850; background: linear-gradient(120deg, var(--text) 10%, var(--primary) 55%, var(--accent) 95%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--text-2); font-size: 1.12rem; max-width: 680px; margin-left: auto; margin-right: auto; }

/* ---------- Cards ---------- */
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s; }
.card + .card { margin-top: 16px; }
.grid-2 > .card:hover, .grid-3 > .card:hover, .grid-4 > .card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(15,27,45,.05), 0 18px 36px -14px rgba(15,27,45,.22); border-color: var(--border-strong); }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.card-header h2, .card-header h3 { margin: 0; display: flex; align-items: center; gap: 8px; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-header { padding: 18px 20px 0; }
.card-accent { overflow: hidden; }
.card-accent::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: linear-gradient(90deg, var(--primary-400), var(--accent)); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--text-2); max-width: 720px; }
.grid { display: grid; gap: 16px; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.grid > *, .grid-2 > *, .grid-3 > *, .grid-4 > * { min-width: 0; }
pre, code { overflow-wrap: anywhere; }
@media (min-width: 640px) { .grid-2, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } }
.stack > * + * { margin-top: 12px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 28px; } .mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.w-100 { width: 100%; } .text-right { text-align: right; } .center { text-align: center; } .nowrap { white-space: nowrap; }
hr, .divider { border: 0; border-top: 1px dashed var(--border-strong); margin: 18px 0; }

/* stats */
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-label { color: var(--text-2); font-size: .84rem; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.stat-value { font-size: 1.55rem; font-weight: 850; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: .8rem; color: var(--muted); }
.stat-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); flex: none; }
.stat-label > .icon { padding: 7px; width: 32px; height: 32px; border-radius: 10px; background: var(--primary-50); color: var(--primary); }
.grid-4 > .card:nth-child(4n+2) .stat-label > .icon, .grid-3 > .card:nth-child(3n+2) .stat-label > .icon, .tiles > .tile:nth-child(5n+2) .stat-icon { background: var(--accent-50); color: var(--accent); }
.grid-4 > .card:nth-child(4n+3) .stat-label > .icon, .grid-3 > .card:nth-child(3n+3) .stat-label > .icon, .tiles > .tile:nth-child(5n+3) .stat-icon { background: var(--gold-50); color: var(--gold); }
.grid-4 > .card:nth-child(4n+4) .stat-label > .icon, .tiles > .tile:nth-child(5n+4) .stat-icon { background: var(--sky-50); color: var(--sky); }
.tiles > .tile:nth-child(5n+5) .stat-icon { background: var(--rose-50); color: var(--rose); }
.grid-3 > .card:nth-child(3n+2) > .stat-icon, .grid-2 > .card:nth-child(2n) > .stat-icon { background: var(--accent-50); color: var(--accent); }
.grid-3 > .card:nth-child(3n+3) > .stat-icon { background: var(--gold-50); color: var(--gold); }
.balance-hero { background: var(--hero-grad); color: #fff; border: 0; overflow: hidden; box-shadow: var(--shadow-glow), var(--shadow); }
.balance-hero::after { content: ""; position: absolute; width: 260px; height: 260px; right: -80px; top: -110px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.22), transparent 65%); pointer-events: none; }
.balance-hero::before { content: ""; position: absolute; width: 200px; height: 200px; left: -60px; bottom: -100px; border-radius: 50%; background: radial-gradient(circle, rgba(139,92,246,.5), transparent 65%); pointer-events: none; }
.balance-hero > * { position: relative; z-index: 1; }
.balance-hero .stat-label, .balance-hero .stat-sub { color: rgba(255,255,255,.88); }
.balance-hero .stat-label > .icon { background: rgba(255,255,255,.16); color: #fff; }
.balance-hero .stat-value { font-size: 1.95rem; text-shadow: 0 2px 14px rgba(0,0,0,.18); }
.balance-hero a, .balance-hero a:hover { color: #fff; }
.balance-hero .btn-light { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.3); backdrop-filter: blur(6px); box-shadow: none; }
.balance-hero .btn-light:hover { background: rgba(255,255,255,.28); color: #fff; }
.premium-card { background: linear-gradient(135deg, var(--gold-50) 0%, var(--surface) 65%); border-color: color-mix(in srgb, var(--gold) 30%, var(--border)); }

/* ---------- Buttons ---------- */
.btn { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid transparent; font: 650 .92rem var(--font); letter-spacing: .005em; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: transform .15s var(--ease), box-shadow .2s, background .2s, border-color .2s, color .2s, filter .2s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--primary-grad); color: #fff; box-shadow: 0 6px 18px -8px rgba(5,150,105,.7), inset 0 1px 0 rgba(255,255,255,.18); }
.btn-primary:hover { color: #fff; filter: brightness(1.06); box-shadow: 0 10px 24px -8px rgba(5,150,105,.75), inset 0 1px 0 rgba(255,255,255,.2); transform: translateY(-1px); }
.btn-primary::after, .btn-accent::after, .btn-success::after, .btn-violet::after { content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; background: linear-gradient(110deg, transparent, rgba(255,255,255,.35), transparent); transform: skewX(-20deg); transition: left .6s var(--ease); pointer-events: none; }
.btn-primary:hover::after, .btn-accent:hover::after, .btn-success:hover::after, .btn-violet:hover::after { left: 130%; }
.btn-secondary, .btn-light { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.btn-secondary:hover, .btn-light:hover { background: var(--surface-2); color: var(--text); border-color: color-mix(in srgb, var(--primary) 35%, var(--border-strong)); }
.btn-accent { background: var(--gold-grad); color: #3b2300; box-shadow: 0 6px 18px -8px rgba(217,119,6,.7); }
.btn-accent:hover { color: #3b2300; transform: translateY(-1px); filter: brightness(1.04); }
.btn-danger { background: linear-gradient(135deg, #dc2626, #ef4444); color: #fff; box-shadow: 0 6px 18px -8px rgba(220,38,38,.6); }
.btn-danger:hover { color: #fff; filter: brightness(1.06); }
.btn-success { background: linear-gradient(135deg, #047857, #10b981); color: #fff; box-shadow: 0 6px 18px -8px rgba(5,150,105,.6); }
.btn-success:hover { color: #fff; filter: brightness(1.06); }
.btn-violet { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 18px -8px rgba(124,58,237,.6); }
.btn-violet:hover { color: #fff; filter: brightness(1.06); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .83rem; border-radius: 10px; gap: 6px; }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: 1rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.loading { opacity: .7; pointer-events: none; }
.btn.loading::before { content: ""; width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.45); animation: rippleAnim .6s linear; pointer-events: none; }

/* ---------- Badges, pills, alerts ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: .73rem; font-weight: 750; white-space: nowrap; letter-spacing: .01em; }
.badge-success::before, .badge-warning::before, .badge-danger::before, .badge-info::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-50); color: var(--success); }
.badge-warning { background: var(--warning-50); color: var(--warning); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-info { background: var(--info-50); color: var(--info); }
.badge-neutral { background: var(--surface-3); color: var(--text-2); }
.badge-premium { background: var(--gold-grad); color: #3b2300; box-shadow: 0 4px 12px -4px rgba(217,119,6,.55); }
.pill { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: linear-gradient(135deg, #f43f5e, #e11d48); color: #fff; font-size: .68rem; font-weight: 800; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; border: 1px solid transparent; margin-bottom: 16px; position: relative; }
.alert > .icon { padding: 6px; width: 32px; height: 32px; border-radius: 10px; background: color-mix(in srgb, currentColor 14%, transparent); }
.alert > div { flex: 1; min-width: 0; }
.alert .grow { flex: 1; }
.alert-success { background: var(--success-50); color: var(--success); border-color: color-mix(in srgb, var(--success) 22%, transparent); }
.alert-error, .alert-danger { background: var(--danger-50); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.alert-warning { background: var(--warning-50); color: var(--warning); border-color: color-mix(in srgb, var(--warning) 22%, transparent); }
.alert-info { background: var(--info-50); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }
.alert p:last-child { margin: 0; }
.alert .btn { flex: none; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
label, .label { display: block; font-weight: 650; font-size: .86rem; margin-bottom: 7px; color: var(--text); }
.hint { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.input, input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=url], input[type=date], input[type=datetime-local], input[type=month], input[type=time], input[type=search], input:not([type]), select, textarea {
  width: 100%; min-height: 46px; padding: 11px 14px; border: 1.5px solid var(--border-strong); border-radius: 12px;
  background-color: var(--surface); color: var(--text); font: 15px var(--font); line-height: 1.4;
  box-shadow: inset 0 1px 2px rgba(15,27,45,.04); transition: border-color .18s, box-shadow .18s, background-color .18s;
  -webkit-appearance: none; appearance: none;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
input:hover:not(:focus):not([type=checkbox]):not([type=radio]):not([type=file]):not(:disabled), select:hover:not(:focus):not(:disabled), textarea:hover:not(:focus):not(:disabled) { border-color: color-mix(in srgb, var(--primary) 38%, var(--border-strong)); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); background-color: var(--surface); }
input:disabled, select:disabled, textarea:disabled { background-color: var(--surface-3); color: var(--muted); cursor: not-allowed; }
input[readonly] { background-color: var(--surface-2); }
textarea { min-height: 110px; resize: vertical; }
select { padding-right: 42px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238392a8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
select[multiple] { background-image: none; padding-right: 14px; min-height: 120px; }
select option { background: var(--surface); color: var(--text); }
input[type=number] { -moz-appearance: textfield; }
input[type=date]::-webkit-calendar-picker-indicator, input[type=datetime-local]::-webkit-calendar-picker-indicator, input[type=month]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .6; }
:root[data-theme="dark"] input::-webkit-calendar-picker-indicator { filter: invert(1); }
.form-group:has(.field-error) input:not([type=checkbox]):not([type=radio]), .form-group:has(.field-error) select, .form-group:has(.field-error) textarea { border-color: var(--danger); background-color: color-mix(in srgb, var(--danger-50) 50%, var(--surface)); }
input[type=checkbox], input[type=radio] { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; min-height: 0; margin: 0; padding: 0; flex: none; border: 1.8px solid var(--border-strong); background: var(--surface); display: inline-grid; place-items: center; vertical-align: middle; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; }
input[type=checkbox] { border-radius: 6px; }
input[type=radio] { border-radius: 50%; }
input[type=checkbox]::before { content: ""; width: 11px; height: 11px; transform: scale(0); transition: transform .15s var(--ease); clip-path: polygon(14% 44%, 0 65%, 40% 100%, 100% 22%, 84% 6%, 39% 69%); background: #fff; }
input[type=radio]::before { content: ""; width: 9px; height: 9px; border-radius: 50%; transform: scale(0); transition: transform .15s var(--ease); background: #fff; }
input[type=checkbox]:checked, input[type=radio]:checked { background: var(--primary-grad); border-color: var(--primary); }
input[type=checkbox]:checked::before, input[type=radio]:checked::before { transform: scale(1); }
input[type=checkbox]:hover:not(:checked), input[type=radio]:hover:not(:checked) { border-color: var(--primary); }
input[type=checkbox]:focus-visible, input[type=radio]:focus-visible { box-shadow: var(--ring); outline: none; }
input[type=checkbox]:active, input[type=radio]:active { transform: scale(.9); }
input[type=checkbox].switch { width: 44px; height: 26px; border-radius: 999px; background: var(--surface-3); border-color: var(--border-strong); justify-items: start; padding: 0 3px; }
input[type=checkbox].switch::before { clip-path: none; width: 18px; height: 18px; border-radius: 50%; transform: none; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s var(--ease); }
input[type=checkbox].switch:checked { background: var(--primary-grad); }
input[type=checkbox].switch:checked::before { transform: translateX(18px); }
.check { display: flex; align-items: center; gap: 10px; font-weight: 550; cursor: pointer; padding: 4px 0; margin-bottom: 0; }
.check span { flex: 1; }
.row > .check { display: inline-flex; }
input[type=file] { width: 100%; padding: 10px; border: 1.8px dashed var(--border-strong); border-radius: 14px; background: var(--surface-2); color: var(--text-2); font: 14px var(--font); cursor: pointer; transition: border-color .2s, background .2s; }
input[type=file]:hover { border-color: var(--primary); background: var(--primary-50); }
input[type=file]::file-selector-button { margin-right: 12px; padding: 9px 15px; border: 0; border-radius: 10px; background: var(--primary-grad); color: #fff; font: 650 .85rem var(--font); cursor: pointer; transition: filter .2s; }
input[type=file]::file-selector-button:hover { filter: brightness(1.08); }
input[type=range] { width: 100%; accent-color: var(--primary); }
.field-error { color: var(--danger); font-size: .82rem; font-weight: 600; margin: 6px 0 0; display: flex; align-items: center; gap: 6px; animation: fadeUp .25s var(--ease); }
.field-error::before { content: "!"; display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--danger); color: #fff; font-size: .7rem; font-weight: 900; }
.input-group { display: flex; align-items: stretch; }
.input-group > input, .input-group > select { border-top-right-radius: 0; border-bottom-right-radius: 0; flex: 1; min-width: 0; }
.input-group > .btn { border-top-left-radius: 0; border-bottom-left-radius: 0; min-height: 46px; }
.input-affix { position: relative; }
.input-affix > .affix { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 750; pointer-events: none; }
.input-affix > input { padding-right: 46px; }
.form-grid { display: grid; gap: 0 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .form-grid .full { grid-column: 1 / -1; } }
.form-section { padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); margin-bottom: 16px; }
.form-section > h3, .form-section > h4 { margin-bottom: 12px; }
form.row > input:not([type=checkbox]):not([type=radio]):not([type=hidden]), form.row > select, form .row > input:not([type=checkbox]):not([type=radio]):not([type=hidden]), form .row > select { width: auto; flex: 1 1 140px; }
details { border-radius: 12px; }
details > summary { cursor: pointer; font-weight: 650; color: var(--text-2); padding: 6px 0; }
.choice-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.choice { position: relative; display: block; border: 2px solid var(--border); border-radius: 14px; padding: 14px; cursor: pointer; background: var(--surface); font-weight: 500; transition: border-color .2s, background .2s, transform .2s var(--ease), box-shadow .2s; }
.choice:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); transform: translateY(-2px); box-shadow: var(--shadow); }
.choice > input[type=radio], .choice > input[type=checkbox] { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-50); box-shadow: var(--ring); }
.choice:has(input:checked)::after { content: ""; position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E") center/12px no-repeat, var(--primary-grad); animation: pop .25s var(--ease); }
.choice strong { display: block; padding-right: 24px; }

/* ---------- Tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.table th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 750; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.table td { padding: 13px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; transition: background .15s; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: color-mix(in srgb, var(--primary-50) 55%, transparent); }
.table td input:not([type=checkbox]):not([type=radio]), .table td select { min-height: 38px; padding: 7px 10px; }
.table td select { padding-right: 34px; background-position: right 8px center; }
.amount-credit { color: var(--success); font-weight: 750; white-space: nowrap; }
.amount-debit { color: var(--danger); font-weight: 750; white-space: nowrap; }
@media (max-width: 640px) {
  .table.responsive thead { display: none; }
  .table.responsive tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .table.responsive td { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border: 0; text-align: right; }
  .table.responsive td::before { content: attr(data-label); color: var(--muted); font-size: .78rem; font-weight: 600; text-align: left; }
}

/* ---------- Lists, tabs, misc ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--surface-3); flex: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px color-mix(in srgb, var(--primary) 45%, var(--border)); }
.avatar-lg { width: 76px; height: 76px; }
.tabs { display: flex; width: fit-content; gap: 4px; padding: 4px; margin-bottom: 18px; overflow-x: auto; max-width: 100%; background: var(--surface-3); border-radius: 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { padding: 8px 14px; border: 0; border-radius: 10px; background: none; color: var(--text-2); font: 650 .88rem var(--font); white-space: nowrap; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; display: inline-flex; align-items: center; gap: 6px; }
.tabs a.active, .tabs button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.tabs a:hover:not(.active), .tabs button:hover:not(.active) { color: var(--text); }
.progress { height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background-image: repeating-linear-gradient(45deg, rgba(255,255,255,.2) 0 7px, transparent 7px 14px), linear-gradient(90deg, var(--primary-400), var(--accent)); background-size: 28px 28px, 100% 100%; animation: stripes 1.2s linear infinite; transition: width 1s var(--ease); }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .icon { width: 58px; height: 58px; margin: 0 auto 12px; display: block; padding: 15px; border-radius: 18px; background: linear-gradient(135deg, var(--primary-50), var(--accent-50)); color: var(--primary); }
.copy-box { display: flex; gap: 8px; align-items: center; background: var(--surface-2); border: 1.5px dashed color-mix(in srgb, var(--primary) 40%, var(--border-strong)); border-radius: 14px; padding: 8px 8px 8px 14px; }
.copy-box code { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; color: var(--text); }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; font-size: .92rem; margin: 0; }
.kv dt { color: var(--muted); min-width: 0; } .kv dd { margin: 0; font-weight: 650; text-align: right; max-width: 62vw; overflow-wrap: break-word; word-break: normal; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); }
.filters > * { flex: 1 1 160px; }
.filters .btn { flex: 0 0 auto; }
.pagination { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 10px; border-radius: 11px; border: 1px solid var(--border); color: var(--text-2); background: var(--surface); font-weight: 650; transition: all .15s; }
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .current { background: var(--primary-grad); border-color: transparent; color: #fff; box-shadow: var(--shadow-glow); }
.pagination span.muted { border: 0; background: none; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-weight: 650; font-size: .8rem; text-align: center; min-width: 0; overflow-wrap: anywhere; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.tile:hover { color: var(--text); transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.tile .stat-icon { width: 44px; height: 44px; border-radius: 14px; transition: transform .25s var(--ease); }
.tile:hover .stat-icon { transform: scale(1.1) rotate(-4deg); }
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } .tile { font-size: .84rem; padding: 16px 8px; } }
.chart { width: 100%; height: 230px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .axis { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .label { fill: var(--muted); font-size: 11px; }
.chart .line { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 3000; stroke-dashoffset: 3000; animation: drawLine 1.6s var(--ease) forwards; }
.chart .area { fill: url(#chartArea); opacity: 0; animation: fadeIn .8s .5s forwards; }
.chart .bar { fill: url(#chartBar); transform-origin: bottom; transform-box: fill-box; animation: growBar .9s var(--ease) both; }
.chart .bar:hover { fill: var(--accent); }
.chart .pt { fill: var(--surface); stroke: var(--primary); stroke-width: 2.5; }
.chart .pt:hover { fill: var(--accent); }
.tree ul { list-style: none; margin: 0; padding-left: 20px; border-left: 2px dashed var(--border-strong); }
.tree > ul { padding-left: 0; border: 0; }
.tree li { margin: 8px 0; position: relative; }
.tree ul ul > li::before { content: ""; position: absolute; left: -20px; top: 18px; width: 16px; border-top: 2px dashed var(--border-strong); }
.tree .node { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-sm); transition: border-color .2s, transform .2s; }
.tree .node:hover { border-color: var(--primary); transform: translateX(2px); }
.disclaimer { font-size: .8rem; color: var(--muted); border-left: 3px solid var(--border-strong); padding: 4px 0 4px 12px; }
.ai-tag { font-size: .72rem; background: var(--info-50); color: var(--info); padding: 2px 8px; border-radius: 6px; font-weight: 750; }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 50%, var(--surface-3) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; color: transparent !important; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--success); animation: pulseRing 1.6s infinite; }

/* Chat */
.chat { display: flex; flex-direction: column; height: calc(100vh - 240px); min-height: 400px; }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); border-radius: 16px; border: 1px solid var(--border); }
.msg { max-width: 82%; padding: 11px 14px; border-radius: 18px; white-space: pre-wrap; word-wrap: break-word; animation: pop .25s var(--ease); box-shadow: var(--shadow-sm); }
.msg-user { align-self: flex-end; background: var(--primary-grad); color: #fff; border-bottom-right-radius: 6px; }
.msg-assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 6px; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; }
.chat-form textarea { min-height: 48px; height: 48px; border-radius: 14px; }

/* Modal / toast / dropdown */
.modal { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; padding: 16px; z-index: 60; background: rgba(8,15,25,.55); backdrop-filter: blur(3px); }
.modal.show { display: flex; animation: fadeIn .15s; }
.modal-box { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-lg); max-width: 440px; width: 100%; padding: 24px; animation: pop .25s var(--ease); border: 1px solid var(--border); }
.modal-box h3 { margin-bottom: 8px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }
.toasts { position: fixed; top: 14px; right: 14px; left: 14px; z-index: 70; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; max-width: 380px; width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 14px; padding: 13px 16px; box-shadow: var(--shadow-lg); animation: slidein .25s var(--ease); font-weight: 550; }
.toast-error { border-left-color: var(--danger); } .toast-warning { border-left-color: var(--warning); } .toast-success { border-left-color: var(--success); }
.dropdown { position: relative; }
.dropdown-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 50; transform-origin: top right; }
.dropdown.open .dropdown-menu { display: block; animation: pop .18s var(--ease); }
.dropdown-menu a, .dropdown-menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 11px; border-radius: 10px; color: var(--text); background: none; border: 0; font: 550 .9rem var(--font); cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-3); color: var(--text); }
.admin-badge { background: var(--gold-grad); color: #3b2300; padding: 2px 8px; border-radius: 6px; font-size: .66rem; font-weight: 850; letter-spacing: .08em; }
.sandbox-banner { background: repeating-linear-gradient(45deg, #fff4d6, #fff4d6 10px, #ffe9a8 10px, #ffe9a8 20px); color: #5c3d00; text-align: center; font-weight: 750; padding: 6px; font-size: .82rem; border-radius: 10px; }
.video-frame { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-lg); }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.country-chip { display: inline-flex; gap: 6px; align-items: center; padding: 9px 16px; border: 2px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; font-weight: 650; color: var(--text-2); transition: all .2s var(--ease); }
.country-chip:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.country-chip.active, .country-chip.active:hover { border-color: transparent; background: var(--primary-grad); color: #fff; box-shadow: var(--shadow-glow); }
.instructions { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 12px; padding: 14px; font-size: .92rem; }

/* Referral level editor */
.level-row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); margin-bottom: 10px; box-shadow: var(--shadow-sm); animation: fadeUp .3s var(--ease) both; transition: border-color .2s; }
.level-row:hover { border-color: var(--border-strong); }
.level-badge { display: grid; place-items: center; height: 52px; border-radius: 14px; background: var(--primary-grad); color: #fff; font-weight: 850; font-size: .82rem; line-height: 1.1; text-align: center; box-shadow: var(--shadow-glow); }
.level-badge b { display: block; font-size: 1.15rem; }
.level-row:nth-child(2) .level-badge { background: var(--accent-grad); box-shadow: 0 10px 24px -10px rgba(124,58,237,.6); }
.level-row:nth-child(3) .level-badge { background: var(--gold-grad); color: #3b2300; box-shadow: 0 10px 24px -10px rgba(217,119,6,.6); }
.level-row:nth-child(4) .level-badge { background: linear-gradient(135deg, #0284c7, #38bdf8); box-shadow: 0 10px 24px -10px rgba(2,132,199,.6); }
.level-row:nth-child(n+5) .level-badge { background: linear-gradient(135deg, #be123c, #fb7185); box-shadow: 0 10px 24px -10px rgba(225,29,72,.5); }
.level-fields { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
.level-fields > [hidden] { display: none; }
.level-fields label { font-size: .74rem; color: var(--muted); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .05em; }
.level-preview { display: flex; flex-wrap: wrap; gap: 8px; }
.level-preview .chip { padding: 8px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); font-weight: 650; font-size: .88rem; animation: pop .25s var(--ease); }
.level-preview .chip strong { color: var(--primary); }
.event-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }

@media print { .sidebar, .topbar, .bottom-nav, .no-print, .page-progress { display: none !important; } .main { margin: 0; } body { background: #fff; } .card { box-shadow: none; } .content > * { animation: none; } }

/* ---------- Courses / LMS ---------- */
.course-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.course-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; color: var(--text); transition: border-color .15s, transform .15s; }
.course-card:hover { text-decoration: none; border-color: var(--primary); transform: translateY(-1px); }
.course-thumb { position: relative; aspect-ratio: 16/9; background: linear-gradient(135deg, var(--primary-50), var(--surface-2)); display: grid; place-items: center; color: var(--primary); }
.course-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.course-thumb-ph .icon { width: 44px; height: 44px; opacity: .7; }
.course-flag { position: absolute; top: 10px; left: 10px; }
.course-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.course-title { margin: 2px 0 0; font-size: 1.02rem; line-height: 1.3; }
.course-sub { margin: 0; }
.course-price { font-size: 1.05rem; }
.course-hero { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 960px) { .course-hero { grid-template-columns: 1fr 340px; align-items: start; } .course-side { position: sticky; top: 76px; } }
.lesson-list { list-style: none; margin: 0; padding: 0; }
.lesson-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.lesson-list li:last-child { border-bottom: 0; }
.lesson-list .grow { flex: 1; min-width: 0; }
.lesson-list a.current { font-weight: 700; color: var(--primary); }
.lesson-done { color: var(--success, #16a34a); }
.section-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 14px 0 2px; }
.player-layout { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 1024px) { .player-layout { grid-template-columns: 1fr 320px; align-items: start; } }
.lesson-content { line-height: 1.65; overflow-wrap: anywhere; }
.lesson-content img { max-width: 100%; height: auto; border-radius: 8px; }
.lesson-content pre { overflow-x: auto; background: var(--surface-2); padding: 10px; border-radius: 8px; }
.lesson-content table { width: 100%; border-collapse: collapse; } .lesson-content td, .lesson-content th { border: 1px solid var(--border); padding: 6px; }
.stars { color: #f59e0b; letter-spacing: 1px; white-space: nowrap; }
.rating-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.rating-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating-input label { font-size: 1.6rem; color: var(--border); cursor: pointer; line-height: 1; }
.rating-input input:checked ~ label, .rating-input label:hover, .rating-input label:hover ~ label { color: #f59e0b; }
.rating-input input:focus-visible + label { outline: 2px solid var(--primary); border-radius: 4px; }
.thread { border-left: 3px solid var(--border); padding-left: 12px; margin: 12px 0; }
.thread .reply { margin: 10px 0 0 14px; padding-left: 10px; border-left: 2px solid var(--border); }
.thread .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: .82rem; color: var(--muted); }
.thread .body { white-space: pre-wrap; overflow-wrap: anywhere; margin: 4px 0; }
.thread details summary { cursor: pointer; font-size: .82rem; color: var(--muted); }
.is-hidden { opacity: .55; }
.question { border: 1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 12px; }
.question legend { font-weight: 700; padding: 0 4px; }
.question .opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: 8px; cursor: pointer; }
.question .opt:hover { background: var(--surface-2); }
.upgrade-box { border: 1px dashed var(--primary); background: var(--primary-50); border-radius: 12px; padding: 14px; }
.qb-item { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 12px; background: var(--surface); }
.qb-opt { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.qb-opt input[type=text] { flex: 1; }

/* ---------- Dashboard hero ---------- */
.dash-hero { position: relative; overflow: hidden; display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); padding: 24px; border-radius: 24px; color: #fff; background: var(--hero-grad); box-shadow: var(--shadow-glow), var(--shadow-lg); margin-bottom: 20px; isolation: isolate; }
.dash-hero::before { content: ""; position: absolute; z-index: -1; width: 380px; height: 380px; right: -120px; top: -160px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.25), transparent 65%); animation: float 10s ease-in-out infinite; }
.dash-hero::after { content: ""; position: absolute; z-index: -1; width: 320px; height: 320px; left: 30%; bottom: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(139,92,246,.55), transparent 65%); animation: float 13s ease-in-out infinite reverse; }
.dash-hero h1 { color: #fff; font-size: clamp(1.4rem, 3.5vw, 2rem); margin: 12px 0 4px; }
.dash-sub { color: rgba(255,255,255,.85); margin-bottom: 16px; }
.dash-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.15); font-size: .78rem; font-weight: 650; backdrop-filter: blur(6px); }
.dash-balance { display: flex; flex-direction: column; margin-bottom: 16px; }
.dash-balance-label { font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: rgba(255,255,255,.75); font-weight: 700; }
.dash-balance .stat-value { font-size: clamp(2rem, 6vw, 2.8rem); text-shadow: 0 4px 20px rgba(0,0,0,.2); }
.dash-actions .btn-light { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.28); backdrop-filter: blur(6px); box-shadow: none; }
.dash-actions .btn-light:hover { background: rgba(255,255,255,.3); color: #fff; transform: translateY(-1px); }
.dash-hero-stats { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: center; }
.glass-stat { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); color: #fff; backdrop-filter: blur(10px); transition: background .2s, transform .2s var(--ease); min-width: 0; }
.glass-stat:hover { background: rgba(255,255,255,.2); color: #fff; transform: translateY(-2px); }
.glass-stat > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.glass-stat small { color: rgba(255,255,255,.78); font-size: .76rem; font-weight: 650; }
.glass-stat strong { font-size: 1.12rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glass-stat em { font-style: normal; font-size: .72rem; color: rgba(255,255,255,.75); }
.glass-icon { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.18); }
@media (min-width: 900px) { .dash-hero { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); padding: 30px; } }
@media (max-width: 420px) { .dash-hero { padding: 20px 16px; } .dash-actions .btn { flex: 1 1 45%; } }

/* ---------- Inputs with icons / password toggle ---------- */
.field-icon { position: relative; }
.field-icon > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; transition: color .2s; z-index: 1; }
.field-icon > input, .field-icon > select { padding-left: 44px; }
.field-icon:focus-within > .icon { color: var(--primary); }
.field-icon > .pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.field-icon > .pw-toggle:hover { background: var(--surface-3); color: var(--text); }
.field-icon:has(.pw-toggle) > input { padding-right: 46px; }
.pw-meter { height: 6px; border-radius: 999px; background: var(--surface-3); margin-top: 8px; overflow: hidden; }
.pw-meter > span { display: block; height: 100%; width: 0; border-radius: 999px; transition: width .3s var(--ease), background .3s; }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .8rem; margin: 18px 0; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.trust-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; color: var(--muted); font-size: .8rem; margin-top: 14px; }
.trust-row span { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- Landing extras ---------- */
.steps { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-top: 18px; }
.step { position: relative; padding: 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s; }
.step:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.step-num { position: absolute; right: 14px; top: 6px; font-size: 3.2rem; font-weight: 900; line-height: 1; background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 30%, transparent), transparent); -webkit-background-clip: text; background-clip: text; color: transparent; }
.step .stat-icon { margin-bottom: 12px; }
.steps .step:nth-child(2) .stat-icon { background: var(--accent-50); color: var(--accent); }
.steps .step:nth-child(3) .stat-icon { background: var(--gold-50); color: var(--gold); }
.steps .step:nth-child(4) .stat-icon { background: var(--sky-50); color: var(--sky); }
.cta-band { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin-top: 28px; padding: 30px; border-radius: 24px; color: #fff; background: linear-gradient(120deg, #6d28d9, #059669 60%, #14b8a6); box-shadow: var(--shadow-lg); }
.cta-band h2 { color: #fff; font-size: 1.5rem; } .cta-band p { color: rgba(255,255,255,.85); margin: 0; }
.cta-band .btn-light { background: #fff; color: var(--primary-600); border: 0; }
.cta-band .btn-light:hover { color: var(--primary-600); transform: translateY(-2px); }
.cta-band::after { content: ""; position: absolute; width: 300px; height: 300px; right: -80px; top: -150px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.25), transparent 65%); animation: float 9s ease-in-out infinite; }

.dev-strip { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; margin-bottom: 14px; border-radius: 12px; font-size: .8rem; font-weight: 600; color: var(--warning); background: repeating-linear-gradient(135deg, var(--warning-50), var(--warning-50) 12px, color-mix(in srgb, var(--warning-50) 70%, var(--surface)) 12px, color-mix(in srgb, var(--warning-50) 70%, var(--surface)) 24px); border: 1px dashed color-mix(in srgb, var(--warning) 40%, transparent); }
.dev-strip span { flex: 1; }
.dev-strip .icon-btn { width: 28px; height: 28px; color: inherit; }
li.row { flex-wrap: nowrap; align-items: flex-start; }
li.row > .icon { margin-top: 3px; color: var(--primary); }
/* hero mini-stats: icon on top so amounts always fit */
.glass-stat { flex-direction: column; align-items: flex-start; gap: 8px; }
.glass-stat strong { white-space: normal; overflow: visible; overflow-wrap: anywhere; font-size: 1.05rem; line-height: 1.25; }
.glass-icon { width: 34px; height: 34px; border-radius: 10px; }

/* installer */
.install-steps { display: flex; gap: 8px; margin: 14px 0 18px; }
.install-step { flex: 1; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: .8rem; font-weight: 650; }
.install-step span { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); font-size: .78rem; flex: none; }
.install-step.current { background: var(--primary-50); color: var(--primary); }
.install-step.current span { background: var(--primary-grad); color: #fff; }
.install-step.done span { background: var(--success); color: #fff; }

/* two-option tab bar that always fits the screen (e.g. activation: instant vs manual) */
.tabs.tabs-split { width: 100%; }
.tabs.tabs-split > a, .tabs.tabs-split > button { flex: 1 1 0; min-width: 0; justify-content: center; white-space: normal; text-align: center; line-height: 1.25; }

/* ==========================================================================
   Dashboard wallets, compact hero, premium gate, manual-payment picker
   ========================================================================== */

:root {
  /* One token pair per wallet card so light and dark stay in sync. */
  --w-green: #059669;  --w-green-50: #e3f8ef;  --w-green-grad: linear-gradient(135deg, #047857, #10b981);
  --w-amber: #b45309;  --w-amber-50: #fff3e0;  --w-amber-grad: linear-gradient(135deg, #d97706, #fbbf24);
  --w-violet: #6d28d9; --w-violet-50: #f0eaff; --w-violet-grad: linear-gradient(135deg, #5b21b6, #8b5cf6);
  --w-indigo: #4338ca; --w-indigo-50: #eaedff; --w-indigo-grad: linear-gradient(135deg, #3730a3, #6366f1);
  --w-sky: #0369a1;    --w-sky-50: #e4f3fd;    --w-sky-grad: linear-gradient(135deg, #0369a1, #38bdf8);
  --w-rose: #be123c;   --w-rose-50: #ffe8ed;   --w-rose-grad: linear-gradient(135deg, #9f1239, #fb7185);
  --verified: #1d9bf0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --w-green: #34d399;  --w-green-50: #0d2a22;
    --w-amber: #fbbf24;  --w-amber-50: #2d2410;
    --w-violet: #a78bfa; --w-violet-50: #201a38;
    --w-indigo: #818cf8; --w-indigo-50: #191b38;
    --w-sky: #38bdf8;    --w-sky-50: #0c2232;
    --w-rose: #fb7185;   --w-rose-50: #32141b;
    --verified: #4db5f5;
  }
}
:root[data-theme="dark"] {
  --w-green: #34d399;  --w-green-50: #0d2a22;
  --w-amber: #fbbf24;  --w-amber-50: #2d2410;
  --w-violet: #a78bfa; --w-violet-50: #201a38;
  --w-indigo: #818cf8; --w-indigo-50: #191b38;
  --w-sky: #38bdf8;    --w-sky-50: #0c2232;
  --w-rose: #fb7185;   --w-rose-50: #32141b;
  --verified: #4db5f5;
}

/* ---- Compact green hero (the hero keeps --hero-grad) -------------------- */
.dash-hero-compact { padding: 18px 20px; border-radius: 20px; margin-bottom: 14px; gap: 12px; }
.dash-hero-compact::before { width: 240px; height: 240px; right: -90px; top: -120px; }
.dash-hero-compact::after { width: 200px; height: 200px; bottom: -140px; }
.dash-hero-compact h1 { font-size: clamp(1.05rem, 2.6vw, 1.4rem); margin: 0; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.dash-hero-compact .dash-sub { margin: 3px 0 0; font-size: .82rem; color: rgba(255,255,255,.82); }
.dash-hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dash-identity { min-width: 0; }
.dash-hero-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dash-hero-compact .dash-balance { margin: 14px 0 12px; }
.dash-hero-compact .dash-balance-label { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; }
.dash-hero-compact .dash-balance .stat-value { font-size: clamp(1.6rem, 5vw, 2.2rem); line-height: 1.1; }
.dash-balance-hint { font-size: .74rem; color: rgba(255,255,255,.72); margin-top: 3px; }
.dash-hero-compact .dash-actions { gap: 8px; flex-wrap: wrap; }
.dash-hero-compact .dash-actions .btn { padding: 7px 12px; font-size: .8rem; }
@media (min-width: 900px) { .dash-hero-compact { grid-template-columns: minmax(0, 1fr); padding: 22px 26px; } }
@media (max-width: 420px) { .dash-hero-compact { padding: 16px 14px; } }

/* ---- Verified (blue tick) marker for premium accounts ------------------- */
.verified-tick { display: inline-flex; align-items: center; line-height: 0; color: var(--verified); flex: none; }
.verified-tick .icon { width: 20px; height: 20px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.35)); }
.dash-hero-compact .verified-tick .icon { color: #fff; background: var(--verified); border-radius: 50%; padding: 1px; }
.verified-tick-inline .icon { width: 16px; height: 16px; }

/* ---- Coloured wallet cards --------------------------------------------- */
.wallet-cards { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 680px) { .wallet-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1080px) { .wallet-cards { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.wallet-card {
  position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); box-shadow: var(--shadow-sm); overflow: hidden; min-width: 0;
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
  animation: pop .4s var(--ease) both;
}
.wallet-cards > .wallet-card:nth-child(2) { animation-delay: .04s; }
.wallet-cards > .wallet-card:nth-child(3) { animation-delay: .08s; }
.wallet-cards > .wallet-card:nth-child(4) { animation-delay: .12s; }
.wallet-cards > .wallet-card:nth-child(5) { animation-delay: .16s; }
.wallet-cards > .wallet-card:nth-child(6) { animation-delay: .2s; }
.wallet-card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--wc-grad, var(--primary-grad)); }
.wallet-card:hover { color: var(--text); transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--wc, var(--primary)) 45%, var(--border)); }
.wallet-card-icon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; margin-bottom: 6px; background: var(--wc-50, var(--primary-50)); color: var(--wc, var(--primary)); }
.wallet-card-icon .icon { width: 18px; height: 18px; }
.wallet-card-label { font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; color: var(--text-2); }
.wallet-card-value { font-size: clamp(1rem, 2.6vw, 1.25rem); font-weight: 850; letter-spacing: -.015em; color: var(--wc-text, var(--text)); overflow-wrap: anywhere; }
.wallet-card > small { font-size: .7rem; color: var(--muted); line-height: 1.3; }

.wallet-card-available { --wc: var(--ew-emerald); --wc-50: var(--w-green-50);  --wc-grad: var(--w-green-grad); }
.wallet-card-pending   { --wc: var(--ew-amber);   --wc-50: var(--w-amber-50);  --wc-grad: var(--w-amber-grad); }
.wallet-card-locked    { --wc: var(--ew-violet);  --wc-50: var(--w-violet-50); --wc-grad: var(--w-violet-grad); }
.wallet-card-earned    { --wc: var(--ew-indigo);  --wc-50: var(--w-indigo-50); --wc-grad: var(--w-indigo-grad); }
.wallet-card-withdrawn { --wc: var(--ew-sky);     --wc-50: var(--w-sky-50);    --wc-grad: var(--w-sky-grad); }
.wallet-card-spent     { --wc: var(--ew-rose);    --wc-50: var(--w-rose-50);   --wc-grad: var(--w-rose-grad); }
.wallet-card-primary   { --wc: var(--primary);  --wc-50: var(--primary-50);  --wc-grad: var(--primary-grad); }
.wallet-card-available .wallet-card-value { --wc-text: var(--w-green); }
.wallet-card-pending .wallet-card-value   { --wc-text: var(--w-amber); }
.wallet-card-locked .wallet-card-value    { --wc-text: var(--w-violet); }

/* Other-currency strip */
.card-soft { background: var(--surface-2); }
.other-wallets { display: flex; gap: 10px; flex-wrap: wrap; }
.other-wallet { display: flex; flex-direction: column; gap: 1px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); color: var(--text); min-width: 140px; }
.other-wallet:hover { color: var(--text); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.other-wallet-code { font-size: .7rem; font-weight: 800; letter-spacing: .1em; color: var(--muted); }

/* ---- Premium locks on nav items and dashboard tiles -------------------- */
.nav-lock { display: inline-flex; color: var(--gold); opacity: .85; }
.tile-locked { border-style: dashed; }
.tile-lock { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-grad); color: #3b2300; }
.tile-lock .icon { width: 11px; height: 11px; }

/* ---- Premium-required gate page ---------------------------------------- */
.gate-card { padding: 30px 24px; border-radius: 22px; background: linear-gradient(170deg, var(--gold-50) 0%, var(--surface) 55%); border-color: color-mix(in srgb, var(--gold) 28%, var(--border)); }
.gate-lock { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; margin: 0 auto; background: var(--gold-grad); color: #3b2300; box-shadow: 0 10px 26px -10px rgba(217,119,6,.7); }
.gate-lock .icon { width: 30px; height: 30px; }
.gate-card h1 { font-size: clamp(1.2rem, 3.4vw, 1.6rem); }
.gate-tiers { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-top: 18px; }
.gate-tier { display: flex; flex-direction: column; gap: 2px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); color: var(--text); box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), border-color .2s; }
.gate-tier:hover { color: var(--text); transform: translateY(-2px); border-color: color-mix(in srgb, var(--gold) 50%, var(--border)); }
.gate-tier-price { font-size: 1.15rem; font-weight: 850; color: var(--gold); }

/* ---- Payment-method picker (automatic vs manual) ----------------------- */
.pay-panel { border-radius: 18px; }
.pay-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.pay-badge { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; color: #fff; }
.pay-badge-auto { background: var(--w-green-grad); }
.pay-badge-manual { background: var(--w-amber-grad); color: #3b2300; }
.pay-badge-wallet { background: var(--w-indigo-grad); }
.steps { margin: 0 0 16px; padding-left: 20px; color: var(--text-2); font-size: .88rem; }
.steps li { margin: 4px 0; }
.choice-pay { align-items: flex-start; text-align: left; }
.pay-logo { display: inline-grid; place-items: center; min-width: 38px; height: 26px; padding: 0 7px; border-radius: 7px; background: var(--surface-3); color: var(--text-2); font-size: .7rem; font-weight: 850; letter-spacing: .04em; margin-bottom: 4px; }
.pay-account { font-size: .95rem; font-weight: 800; color: var(--primary); overflow-wrap: anywhere; }
.pay-instructions { display: block; margin-top: 4px; line-height: 1.35; }

/* ---- Admin: premium-only access matrix --------------------------------- */
.premium-matrix { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.premium-matrix-item { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); margin: 0; transition: border-color .15s, background .15s; }
.premium-matrix-item.is-premium { background: var(--gold-50); border-color: color-mix(in srgb, var(--gold) 40%, var(--border)); }
.premium-matrix-item:hover { border-color: var(--border-strong); }

/* ---- Admin: profit and liability tiles --------------------------------- */
.profit-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.profit-tile { position: relative; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); overflow: hidden; }
.profit-tile::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--wc-grad, var(--primary-grad)); }
.profit-label { display: flex; align-items: center; gap: 7px; font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; color: var(--text-2); }
.profit-label .icon { width: 15px; height: 15px; color: var(--wc, var(--primary)); }
.profit-value { display: block; margin-top: 6px; font-size: clamp(1.05rem, 2.4vw, 1.4rem); font-weight: 850; letter-spacing: -.015em; overflow-wrap: anywhere; }
.profit-note { display: block; margin-top: 3px; font-size: .72rem; color: var(--muted); line-height: 1.35; }
.profit-tile-net { --wc: var(--w-green); --wc-grad: var(--w-green-grad); }
.profit-tile-net .profit-value { color: var(--w-green); }
.profit-tile-gross { --wc: var(--w-indigo); --wc-grad: var(--w-indigo-grad); }
.profit-tile-bonus { --wc: var(--w-amber); --wc-grad: var(--w-amber-grad); }
.profit-tile-owed { --wc: var(--w-rose); --wc-grad: var(--w-rose-grad); }
.profit-tile-owed .profit-value { color: var(--w-rose); }
.profit-tile-neutral { --wc: var(--w-sky); --wc-grad: var(--w-sky-grad); }
.profit-negative { color: var(--danger) !important; }

/* ==========================================================================
   Earning wallets — one card per way of earning, under the dashboard hero
   ========================================================================== */

:root {
  --w-orange: #c2410c; --w-orange-50: #fff1e7;
  --w-teal: #0f766e;   --w-teal-50: #e2f6f4;
  --w-pink: #be185d;   --w-pink-50: #ffe9f1;
  --w-cyan: #0e7490;   --w-cyan-50: #e2f5fa;
  --w-lime: #4d7c0f;   --w-lime-50: #f0f8e2;
  --w-slate: #475569;  --w-slate-50: #eef1f6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --w-orange: #fb923c; --w-orange-50: #2e1a0e;
    --w-teal: #2dd4bf;   --w-teal-50: #0c2724;
    --w-pink: #f472b6;   --w-pink-50: #2e1420;
    --w-cyan: #22d3ee;   --w-cyan-50: #0b2530;
    --w-lime: #a3e635;   --w-lime-50: #1b2710;
    --w-slate: #94a3b8;  --w-slate-50: #1a2433;
  }
}
:root[data-theme="dark"] {
  --w-orange: #fb923c; --w-orange-50: #2e1a0e;
  --w-teal: #2dd4bf;   --w-teal-50: #0c2724;
  --w-pink: #f472b6;   --w-pink-50: #2e1420;
  --w-cyan: #22d3ee;   --w-cyan-50: #0b2530;
  --w-lime: #a3e635;   --w-lime-50: #1b2710;
  --w-slate: #94a3b8;  --w-slate-50: #1a2433;
}

/* Shared section heading for the dashboard bands */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 10px; }
.section-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .95rem; font-weight: 800; letter-spacing: -.01em; }
.section-head h2 .icon { width: 17px; height: 17px; color: var(--primary); }
.section-head > a { white-space: nowrap; font-weight: 650; }

.earn-wallets { margin-bottom: 18px; }
/* auto-fit so a member with three earning sources fills the row instead of
   leaving dead space, while a member with ten still wraps to a tidy grid. */
.earn-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 560px) { .earn-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); } }

.earn-card {
  position: relative; display: flex; align-items: flex-start; gap: 10px; min-width: 0;
  padding: 13px 13px 13px 12px; border-radius: 16px; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  overflow: hidden; isolation: isolate;
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s;
  animation: pop .4s var(--ease) both;
}
/* A soft wash of the source's own colour, so the grid reads as a set of wallets. */
.earn-card::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background: linear-gradient(135deg, var(--ec-50) 0%, transparent 62%);
}
/* The colour bleed in the corner, which is what makes these feel like cards and not rows. */
.earn-card::after {
  content: ""; position: absolute; z-index: -1; width: 92px; height: 92px;
  right: -34px; top: -38px; border-radius: 50%; opacity: .14;
  background: var(--ec); transition: transform .28s var(--ease), opacity .2s;
}
.earn-card:hover {
  color: var(--text); transform: translateY(-3px);
  box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--ec) 48%, var(--border));
}
.earn-card:hover::after { transform: scale(1.5); opacity: .2; }
.earn-grid > .earn-card:nth-child(2) { animation-delay: .03s; }
.earn-grid > .earn-card:nth-child(3) { animation-delay: .06s; }
.earn-grid > .earn-card:nth-child(4) { animation-delay: .09s; }
.earn-grid > .earn-card:nth-child(5) { animation-delay: .12s; }
.earn-grid > .earn-card:nth-child(n+6) { animation-delay: .15s; }

.earn-icon {
  flex: none; width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center;
  background: var(--ec); color: #fff; box-shadow: 0 5px 14px -6px var(--ec);
  transition: transform .25s var(--ease);
}
.earn-icon .icon { width: 17px; height: 17px; }
.earn-card:hover .earn-icon { transform: scale(1.08) rotate(-5deg); }

.earn-body { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.earn-label {
  font-size: .72rem; font-weight: 700; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.earn-amount { font-size: 1.05rem; font-weight: 850; letter-spacing: -.02em; color: var(--ec); overflow-wrap: anywhere; line-height: 1.2; }
.earn-meta { display: inline-flex; align-items: center; gap: 4px; font-size: .68rem; color: var(--muted); }
.earn-meta .icon { width: 11px; height: 11px; }
.earn-meta-pending { color: var(--w-amber); font-weight: 650; }
.earn-meta-cta { color: var(--ec); font-weight: 700; }

/* Sources the member has not earned from yet: present, but clearly secondary. */
.earn-card.is-idle { background: var(--surface-2); border-style: dashed; box-shadow: none; }
.earn-card.is-idle::before { opacity: .22; }
.earn-card.is-idle::after { opacity: .07; }
.earn-card.is-idle .earn-icon { background: var(--ec-50); color: var(--ec); box-shadow: none; }
.earn-card.is-idle .earn-amount { color: var(--muted); font-weight: 750; }
.earn-card.is-idle:hover { background: var(--surface); box-shadow: var(--shadow-sm); }

.earn-green  { --ec: var(--w-green);  --ec-50: var(--w-green-50); }
.earn-amber  { --ec: var(--w-amber);  --ec-50: var(--w-amber-50); }
.earn-violet { --ec: var(--w-violet); --ec-50: var(--w-violet-50); }
.earn-indigo { --ec: var(--w-indigo); --ec-50: var(--w-indigo-50); }
.earn-sky    { --ec: var(--w-sky);    --ec-50: var(--w-sky-50); }
.earn-rose   { --ec: var(--w-rose);   --ec-50: var(--w-rose-50); }
.earn-orange { --ec: var(--w-orange); --ec-50: var(--w-orange-50); }
.earn-teal   { --ec: var(--w-teal);   --ec-50: var(--w-teal-50); }
.earn-pink   { --ec: var(--w-pink);   --ec-50: var(--w-pink-50); }
.earn-cyan   { --ec: var(--w-cyan);   --ec-50: var(--w-cyan-50); }
.earn-lime   { --ec: var(--w-lime);   --ec-50: var(--w-lime-50); }
.earn-slate  { --ec: var(--w-slate);  --ec-50: var(--w-slate-50); }

@media (prefers-reduced-motion: reduce) {
  .earn-card, .earn-icon, .earn-card::after { animation: none; transition: none; }
  .earn-card:hover { transform: none; }
}

/* Earning wallets: total badge, share bar and the "more ways to earn" chips */
.earn-total {
  margin-left: 2px; padding: 2px 9px; border-radius: 999px;
  background: var(--primary-50); color: var(--primary);
  font-size: .76rem; font-weight: 800; letter-spacing: -.01em;
}
/* How much of total earnings came from this source. */
.earn-share {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: color-mix(in srgb, var(--ec) 14%, transparent);
}
.earn-share > span {
  display: block; height: 100%; background: var(--ec); border-radius: 0 3px 3px 0;
  transition: width .5s var(--ease);
}
.earn-card { padding-bottom: 15px; }

/* Show more / show less. The button only appears once JS marks the section
   collapsible, so without JS every card is simply visible. */
.earn-toggle { display: none; }
.earn-wallets.is-collapsible .earn-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  margin: 11px auto 0; padding: 9px 18px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px dashed var(--border-strong); color: var(--text-2);
  font: inherit; font-size: .78rem; font-weight: 700;
  transition: background .18s, border-color .18s, color .18s, transform .18s var(--ease);
}
.earn-wallets.is-collapsible .earn-toggle:hover {
  background: var(--primary-50); border-color: var(--primary); color: var(--primary);
  border-style: solid; transform: translateY(-1px);
}
.earn-wallets.is-collapsible .earn-toggle .icon { transition: transform .22s var(--ease); }
.earn-wallets.is-collapsible.is-expanded .earn-toggle .icon { transform: rotate(180deg); }
.earn-wallets.is-collapsible:not(.is-expanded) .earn-card.is-extra { display: none; }
/* Revealed cards animate in rather than snapping. */
.earn-wallets.is-expanded .earn-card.is-extra { animation: pop .34s var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  .earn-wallets.is-collapsible .earn-toggle:hover { transform: none; }
  .earn-wallets.is-expanded .earn-card.is-extra { animation: none; }
  .earn-share > span { transition: none; }
}

/* ==========================================================================
   Earning-wallet palette, v2 — brighter, more distinct cards
   Each stream gets a colour far enough from its neighbours to be told apart at
   a glance, and a gradient so the icon tile reads as a chip rather than a blob.
   ========================================================================== */
:root {
  --w-sunset: #ea580c;  --w-sunset-50: #fff0e6;
  --w-magenta: #c026d3; --w-magenta-50: #fdeaff;
  --w-grape: #7e22ce;   --w-grape-50: #f6ecff;
  --w-forest: #15803d;  --w-forest-50: #e6f7ec;
  --w-mint: #0d9488;    --w-mint-50: #e0f7f4;
  --w-gold: #ca8a04;    --w-gold-50: #fdf6df;
  --w-plum: #9d174d;    --w-plum-50: #ffeaf1;
  --w-cobalt: #1d4ed8;  --w-cobalt-50: #e8eeff;
  --w-coral: #e11d48;   --w-coral-50: #ffe9ed;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --w-sunset: #fb923c;  --w-sunset-50: #2f1a0d;
    --w-magenta: #e879f9; --w-magenta-50: #2c1130;
    --w-grape: #c084fc;   --w-grape-50: #251733;
    --w-forest: #4ade80;  --w-forest-50: #0e2817;
    --w-mint: #2dd4bf;    --w-mint-50: #0a2724;
    --w-gold: #fcd34d;    --w-gold-50: #2b2310;
    --w-plum: #fb7185;    --w-plum-50: #2e121d;
    --w-cobalt: #60a5fa;  --w-cobalt-50: #111f38;
    --w-coral: #fb7185;   --w-coral-50: #2f1319;
  }
}
:root[data-theme="dark"] {
  --w-sunset: #fb923c;  --w-sunset-50: #2f1a0d;
  --w-magenta: #e879f9; --w-magenta-50: #2c1130;
  --w-grape: #c084fc;   --w-grape-50: #251733;
  --w-forest: #4ade80;  --w-forest-50: #0e2817;
  --w-mint: #2dd4bf;    --w-mint-50: #0a2724;
  --w-gold: #fcd34d;    --w-gold-50: #2b2310;
  --w-plum: #fb7185;    --w-plum-50: #2e121d;
  --w-cobalt: #60a5fa;  --w-cobalt-50: #111f38;
  --w-coral: #fb7185;   --w-coral-50: #2f1319;
}

.earn-sunset  { --ec: var(--w-sunset);  --ec-50: var(--w-sunset-50); }
.earn-magenta { --ec: var(--w-magenta); --ec-50: var(--w-magenta-50); }
.earn-grape   { --ec: var(--w-grape);   --ec-50: var(--w-grape-50); }
.earn-forest  { --ec: var(--w-forest);  --ec-50: var(--w-forest-50); }
.earn-mint    { --ec: var(--w-mint);    --ec-50: var(--w-mint-50); }
.earn-gold    { --ec: var(--w-gold);    --ec-50: var(--w-gold-50); }
.earn-plum    { --ec: var(--w-plum);    --ec-50: var(--w-plum-50); }
.earn-cobalt  { --ec: var(--w-cobalt);  --ec-50: var(--w-cobalt-50); }
.earn-coral   { --ec: var(--w-coral);   --ec-50: var(--w-coral-50); }

/* Livelier cards: a deeper colour wash, a gradient icon chip and a lift on hover. */
.earn-card::before { opacity: .85; background: linear-gradient(140deg, var(--ec-50) 0%, transparent 70%); }
.earn-card::after { opacity: .18; }
.earn-card:hover::after { opacity: .26; }
.earn-icon {
  background: linear-gradient(140deg, var(--ec) 0%, color-mix(in srgb, var(--ec) 62%, #ffffff) 100%);
  box-shadow: 0 6px 16px -7px var(--ec);
}
.earn-card:hover { box-shadow: 0 10px 26px -14px var(--ec), var(--shadow); }
.earn-amount { letter-spacing: -.025em; }

/* The six balance cards get the same treatment, so the two bands feel like one set. */
.wallet-card::before { height: 5px; }
.wallet-card-icon {
  background: linear-gradient(140deg, var(--wc) 0%, color-mix(in srgb, var(--wc) 62%, #ffffff) 100%);
  color: #fff;
}
.wallet-card:hover { box-shadow: 0 10px 26px -14px var(--wc), var(--shadow); }

/* ==========================================================================
   Earning wallets v3 — every wallet a solid colour of its own
   22 wallets, 22 distinct hues, ordered so neighbouring cards never share a
   family. Cards are filled rather than tinted, so the grid reads as a set of
   coloured wallets at a glance.
   ========================================================================== */
:root {
  --ew-indigo:   #4f46e5; --ew-emerald:  #059669; --ew-violet:   #7c3aed;
  --ew-rose:     #e11d48; --ew-amber:    #d97706; --ew-cyan:     #0891b2;
  --ew-red:      #dc2626; --ew-fuchsia:  #c026d3; --ew-lime:     #65a30d;
  --ew-blue:     #2563eb; --ew-teal:     #0d9488; --ew-gold:     #ca8a04;
  --ew-purple:   #9333ea; --ew-sky:      #0284c7; --ew-orange:   #ea580c;
  --ew-pink:     #db2777; --ew-green:    #16a34a; --ew-bronze:   #92400e;
  --ew-steel:    #475569; --ew-plum:     #86198f; --ew-stone:    #78716c;
  --ew-graphite: #3f3f46; --ew-crimson:  #9f1239; --ew-aqua:     #0f766e;
}
/* Dark mode: the same hues, lifted a little so a filled card glows less. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ew-indigo:   #4338ca; --ew-emerald:  #047857; --ew-violet:   #6d28d9;
    --ew-rose:     #be123c; --ew-amber:    #b45309; --ew-cyan:     #0e7490;
    --ew-red:      #b91c1c; --ew-fuchsia:  #a21caf; --ew-lime:     #4d7c0f;
    --ew-blue:     #1d4ed8; --ew-teal:     #0f766e; --ew-gold:     #a16207;
    --ew-purple:   #7e22ce; --ew-sky:      #0369a1; --ew-orange:   #c2410c;
    --ew-pink:     #be185d; --ew-green:    #15803d; --ew-bronze:   #78350f;
    --ew-steel:    #334155; --ew-plum:     #701a75; --ew-stone:    #57534e;
    --ew-graphite: #27272a; --ew-crimson:  #881337; --ew-aqua:     #115e59;
  }
}
:root[data-theme="dark"] {
  --ew-indigo:   #4338ca; --ew-emerald:  #047857; --ew-violet:   #6d28d9;
  --ew-rose:     #be123c; --ew-amber:    #b45309; --ew-cyan:     #0e7490;
  --ew-red:      #b91c1c; --ew-fuchsia:  #a21caf; --ew-lime:     #4d7c0f;
  --ew-blue:     #1d4ed8; --ew-teal:     #0f766e; --ew-gold:     #a16207;
  --ew-purple:   #7e22ce; --ew-sky:      #0369a1; --ew-orange:   #c2410c;
  --ew-pink:     #be185d; --ew-green:    #15803d; --ew-bronze:   #78350f;
  --ew-steel:    #334155; --ew-plum:     #701a75; --ew-stone:    #57534e;
  --ew-graphite: #27272a; --ew-crimson:  #881337; --ew-aqua:     #115e59;
}

.earn-indigo   { --ec: var(--ew-indigo); }
.earn-emerald  { --ec: var(--ew-emerald); }
.earn-violet   { --ec: var(--ew-violet); }
.earn-rose     { --ec: var(--ew-rose); }
.earn-amber    { --ec: var(--ew-amber); }
.earn-cyan     { --ec: var(--ew-cyan); }
.earn-red      { --ec: var(--ew-red); }
.earn-fuchsia  { --ec: var(--ew-fuchsia); }
.earn-lime     { --ec: var(--ew-lime); }
.earn-blue     { --ec: var(--ew-blue); }
.earn-teal     { --ec: var(--ew-teal); }
.earn-gold     { --ec: var(--ew-gold); }
.earn-purple   { --ec: var(--ew-purple); }
.earn-sky      { --ec: var(--ew-sky); }
.earn-orange   { --ec: var(--ew-orange); }
.earn-pink     { --ec: var(--ew-pink); }
.earn-green    { --ec: var(--ew-green); }
.earn-bronze   { --ec: var(--ew-bronze); }
.earn-steel    { --ec: var(--ew-steel); }
.earn-plum     { --ec: var(--ew-plum); }
.earn-stone    { --ec: var(--ew-stone); }
.earn-graphite { --ec: var(--ew-graphite); }
.earn-crimson  { --ec: var(--ew-crimson); }
.earn-aqua     { --ec: var(--ew-aqua); }

/* ---- The filled card ---------------------------------------------------- */
.earn-card {
  border: 0;
  color: #fff;
  background: linear-gradient(142deg, var(--ec) 0%, color-mix(in srgb, var(--ec) 74%, #000) 100%);
  box-shadow: 0 6px 18px -10px color-mix(in srgb, var(--ec) 80%, #000);
  padding-bottom: 16px;
}
/* The tint wash and corner bleed belonged to the old outlined card. */
.earn-card::before { content: none; }
.earn-card::after {
  background: #fff; opacity: .10; width: 104px; height: 104px; right: -38px; top: -42px;
}
.earn-card:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 14px 30px -12px color-mix(in srgb, var(--ec) 85%, #000);
  border: 0;
}
.earn-card:hover::after { opacity: .16; }

.earn-icon {
  background: rgba(255, 255, 255, .22);
  color: #fff;
  box-shadow: none;
  backdrop-filter: blur(4px);
}
.earn-label  { color: rgba(255, 255, 255, .88); }
.earn-amount { color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .22); }
.earn-meta   { color: rgba(255, 255, 255, .82); }
.earn-meta-pending { color: #fff; font-weight: 700; }
.earn-meta-cta     { color: #fff; font-weight: 750; }

/* Wallets with nothing in them yet: the same colour, just calmer, so the grid
   still reads as one set while earned wallets keep the eye. */
.earn-card.is-idle {
  background: linear-gradient(142deg,
    color-mix(in srgb, var(--ec) 82%, #000) 0%,
    color-mix(in srgb, var(--ec) 58%, #000) 100%);
  border: 0;
  box-shadow: 0 4px 12px -9px color-mix(in srgb, var(--ec) 70%, #000);
}
.earn-card.is-idle .earn-icon   { background: rgba(255, 255, 255, .17); color: #fff; }
.earn-card.is-idle .earn-amount { color: rgba(255, 255, 255, .92); font-weight: 850; }
.earn-card.is-idle:hover        { background: linear-gradient(142deg, var(--ec) 0%, color-mix(in srgb, var(--ec) 74%, #000) 100%); }

/* Share-of-earnings bar, now white against the fill. */
.earn-share       { background: rgba(255, 255, 255, .22); }
.earn-share > span{ background: #fff; }

/* ---- Show more / show less: a checkbox disclosure, no JavaScript --------- */
/* The stylesheet collapses the extras, so the dashboard opens showing eight
   wallets whether or not app.js ever runs. */
.earn-toggle-input:not(:checked) ~ .earn-grid .earn-card.is-extra { display: none; }
.earn-toggle-input:checked ~ .earn-grid .earn-card.is-extra { animation: pop .34s var(--ease) both; }
.earn-toggle-input:checked ~ .earn-toggle .earn-toggle-more { display: none; }
.earn-toggle-input:not(:checked) ~ .earn-toggle .earn-toggle-less { display: none; }
.earn-toggle-input:checked ~ .earn-toggle .icon { transform: rotate(180deg); }

.earn-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  margin: 12px auto 0; padding: 9px 18px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px dashed var(--border-strong); color: var(--text-2);
  font-size: .78rem; font-weight: 700; width: fit-content;
  transition: background .18s, border-color .18s, color .18s, transform .18s var(--ease);
}
.earn-toggle:hover {
  background: var(--primary-50); border-color: var(--primary); color: var(--primary);
  border-style: solid; transform: translateY(-1px);
}
.earn-toggle .icon { transition: transform .22s var(--ease); }
/* Keyboard users focus the hidden checkbox; show the ring on its label. */
.earn-toggle-input:focus-visible ~ .earn-toggle { outline: 2px solid var(--primary); outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  .earn-toggle:hover { transform: none; }
  .earn-toggle-input:checked ~ .earn-grid .earn-card.is-extra { animation: none; }
  .earn-toggle .icon { transition: none; }
}

/* ==========================================================================
   Access levels (admin matrix) and the activation gate
   ========================================================================== */

/* Admin: one radio column per membership level. */
.level-matrix th.text-center, .level-matrix td.text-center { text-align: center; }
.level-matrix tr.is-muted td { opacity: .55; }
.level-pick { display: inline-grid; place-items: center; cursor: pointer; margin: 0; }
.level-pick input { position: absolute; opacity: 0; width: 0; height: 0; }
.level-pick > span[aria-hidden] {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--border-strong); background: var(--surface);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.level-pick:hover > span[aria-hidden] { border-color: var(--primary); }
.level-pick.is-on > span[aria-hidden],
.level-pick input:checked + span[aria-hidden] {
  border-color: var(--primary); background: var(--primary);
  box-shadow: inset 0 0 0 3px var(--surface);
}
.level-pick input:focus-visible + span[aria-hidden] { outline: 2px solid var(--primary); outline-offset: 2px; }

/* Activation gate page: the same shape as the upgrade gate, in brand green. */
.gate-card-activate {
  background: linear-gradient(170deg, var(--primary-50) 0%, var(--surface) 55%);
  border-color: color-mix(in srgb, var(--primary) 28%, var(--border));
}
.gate-lock-activate { background: var(--hero-grad); color: #fff; box-shadow: var(--shadow-glow); }
.gate-fee {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  margin: 18px auto 0; padding: 14px 20px; width: fit-content;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--border);
}
.gate-fee-label { font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; color: var(--text-2); }
.gate-fee strong { font-size: 1.6rem; font-weight: 900; letter-spacing: -.02em; color: var(--primary); }
.gate-unlocks { list-style: none; margin: 16px auto 0; padding: 0; width: fit-content; text-align: left; }
.gate-unlocks li { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: .88rem; color: var(--text-2); }
.gate-unlocks .icon { color: var(--primary); flex: none; }

/* A wallet or tile locked until the account is activated. */
.lock-chip {
  position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255, 255, 255, .25); color: #fff;
  backdrop-filter: blur(4px);
}
.lock-chip .icon { width: 11px; height: 11px; }
.earn-card.is-locked .earn-amount { opacity: .75; }

/* Impersonation banner: unmissable for the whole borrowed session. */
.impersonation-bar {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px; padding: 12px 16px; border-radius: 14px;
  background: linear-gradient(135deg, #7c2d12, #b45309); color: #fff;
  box-shadow: 0 8px 22px -12px rgba(180, 83, 9, .9);
}
.impersonation-bar .icon { flex: none; width: 20px; height: 20px; }
.impersonation-bar span { flex: 1 1 260px; font-size: .86rem; line-height: 1.4; }
.impersonation-bar strong { font-weight: 800; }
.impersonation-bar form { flex: none; margin: 0; }
.impersonation-bar .btn-light { background: rgba(255,255,255,.95); color: #7c2d12; border: 0; font-weight: 750; }
.impersonation-bar .btn-light:hover { background: #fff; color: #7c2d12; }

/* ---------------------------------------------------------------- video checkpoint
   The "are you still watching" prompt, laid over the player. Kept in CSS rather
   than inline so the `hidden` attribute above is what decides whether it shows. */
.cp-overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 5; background: rgba(8, 12, 20, .82); backdrop-filter: blur(3px); color: #fff; }
.cp-overlay form { max-width: 320px; width: 100%; text-align: center; }
.cp-overlay h3 { color: #fff; margin: 0 0 4px; }
.cp-overlay .small { color: rgba(255,255,255,.82); }
.cp-code { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: 2rem; letter-spacing: .4em; font-weight: 800; margin: 10px 0; padding: 8px 4px; color: #fff; background: rgba(255,255,255,.12); border: 1px dashed rgba(255,255,255,.35); border-radius: 10px; user-select: none; }
.cp-code:empty::before { content: "····"; opacity: .45; letter-spacing: .4em; }
.cp-overlay input { text-align: center; text-transform: uppercase; font-size: 1.3rem; }

/* ---------------------------------------------------------------- withdraw charge preview */
.wd-quote { border: 1px dashed var(--border-strong); border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.wd-quote-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 5px 0; font-size: .92rem; }
.wd-quote-row span { color: var(--text-2); }
.wd-quote-row strong { font-weight: 750; font-variant-numeric: tabular-nums; }
.wd-quote-row .wd-fee { color: var(--wd-warn); }
.wd-quote-net { margin-top: 4px; padding-top: 9px; border-top: 1px solid var(--border); }
.wd-quote-net span { color: var(--text); font-weight: 650; }
.wd-quote-net strong { font-size: 1.22rem; color: var(--primary); }
.wd-quote-warn { margin-top: 8px; color: var(--wd-warn); font-weight: 650; }
.wd-fees + .wd-fees { margin-top: 14px; }
.wd-fees .table { font-size: .84rem; }
.wd-fees .table th, .wd-fees .table td { padding: 8px 10px; }
:root { --wd-warn: #b4530a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --wd-warn: #fbbf74; } }
:root[data-theme="dark"] { --wd-warn: #fbbf74; }

/* ---------------------------------------------------------------- earning centre */
.earn-total { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.earn-total-value { font-size: 1.9rem; font-weight: 900; color: var(--primary); font-variant-numeric: tabular-nums; }
.earn-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.earn-tile { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); text-decoration: none; color: inherit; transition: transform .14s, border-color .14s, box-shadow .14s; }
.earn-tile:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: 0 6px 20px rgba(0,0,0,.07); }
.earn-tile.is-pending { opacity: .72; }
.earn-tile-icon { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; background: var(--primary-50); color: var(--primary); }
.earn-tile-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.earn-tile-name { font-weight: 750; font-size: .93rem; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.earn-tile-amount { font-weight: 850; font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- points wallet */
.points-hero { background: linear-gradient(135deg, var(--surface-2), var(--surface)); }
.points-balance { font-size: 2.4rem; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.points-balance span { font-size: 1rem; font-weight: 700; color: var(--muted); }
.stat-row { display: flex; gap: 26px; flex-wrap: wrap; }

/* A dismissable alert: the close button sits at the end and never shifts the text. */
.alert-dismissible { align-items: flex-start; }
.alert-dismissible form { flex: none; margin: 0; }
.alert-close { background: none; border: 0; cursor: pointer; font-size: 1.35rem; line-height: 1; padding: 0 2px; color: inherit; opacity: .55; }
.alert-close:hover { opacity: 1; }

/* ---------------------------------------------------------------- spin wheel */
.spin-card { text-align: center; }
.spin-stage { position: relative; width: min(340px, 82vw); margin: 10px auto 4px; }
.spin-wheel { transition: transform 4s cubic-bezier(.18, .72, .13, 1); will-change: transform; }
.spin-wheel svg { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 18px rgba(0,0,0,.18)); border-radius: 50%; }
/* The pointer sits above the wheel at twelve o'clock; the wheel turns under it. */
.spin-pointer { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); z-index: 2;
  width: 0; height: 0; border-left: 13px solid transparent; border-right: 13px solid transparent;
  border-top: 22px solid var(--text); filter: drop-shadow(0 2px 3px rgba(0,0,0,.3)); }
.spin-result { min-height: 1.6em; margin: 10px 0 4px; font-weight: 800; font-size: 1.05rem; }
.spin-result.is-win { color: var(--primary); }
.spin-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; }
.btn-lg { padding: 13px 20px; font-size: 1rem; }
@media (prefers-reduced-motion: reduce) { .spin-wheel { transition-duration: .2s; } }

/* ---------------------------------------------------------------- earning programs */
.earn-item { display: flex; flex-direction: column; gap: 7px; }
.earn-item-thumb { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; }
.earn-countdown { font-size: 2rem; font-weight: 900; text-align: center; margin: 10px 0; font-variant-numeric: tabular-nums; }
.quiz-option { display: flex; gap: 10px; align-items: center; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; margin-top: 7px; cursor: pointer; }
.quiz-option:hover { border-color: var(--primary); background: var(--primary-50); }
.quiz-score { font-size: 3rem; font-weight: 900; line-height: 1.1; }
.quiz-score.is-pass { color: var(--primary); }
.quiz-score.is-fail { color: var(--muted); }
.review-proof { width: 100%; max-height: 260px; object-fit: contain; border-radius: 10px; background: var(--surface-2); }

/* ==========================================================================
   Play & earn — the arcade
   The games are drawn on a canvas or built from buttons; this is the frame
   around them: the tiles that lead in, the HUD, the card table and the
   puzzle's chips. Everything sizes from the page so a phone gets a playable
   board rather than a shrunken desktop one.
   ========================================================================== */
.game-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.game-card { display: flex; flex-direction: column; gap: 12px; }
.game-card-head { display: flex; align-items: center; gap: 12px; }
.game-card-head h2 { margin: 0; font-size: 1.1rem; }
.game-card-head .badge { margin-left: auto; }
.game-card-icon {
  display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px;
  border-radius: 14px; background: var(--primary-50); color: var(--primary-600);
}
.game-card-icon .icon { width: 24px; height: 24px; }
.game-how summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.game-how p { margin: 6px 0 0; color: var(--text-2); font-size: .9rem; }
.game-levels { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .game-levels { grid-template-columns: 1fr; } }
.game-level {
  border: 1px solid var(--border); border-radius: 14px; padding: 12px;
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
}
.game-level.is-hard { border-color: color-mix(in srgb, var(--gold) 45%, var(--border)); }
.game-level-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.game-level-facts { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 4px; font-size: .86rem; color: var(--text-2); }
.game-level-facts li { display: flex; align-items: center; gap: 6px; }

.game-hud { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.game-hud-stats { display: flex; gap: 22px; }
.game-hud-stats div { display: flex; flex-direction: column; }
.game-hud-stats strong { font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.game-hud-extra { display: flex; gap: 16px; font-size: .9rem; color: var(--text-2); }
.game-hud-extra strong { color: var(--text); font-variant-numeric: tabular-nums; }

.game-stage { margin-top: 12px; }
.game-stage canvas {
  /* The tall racing board and the wide shooting range share this rule, so the
     board is fitted to the frame rather than the frame to the board: a player
     who has to scroll to see their own car cannot play. */
  display: block; margin: 0 auto; width: auto; max-width: 100%; max-height: min(66vh, 620px);
  border-radius: 16px; touch-action: manipulation;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); cursor: crosshair;
}
.game-result { margin-top: 12px; text-align: center; }
.game-result h2 { margin: 0 0 4px; }
.game-result-score { color: var(--text-2); margin: 0; }
.game-result-score strong { font-size: 1.6rem; color: var(--text); }
.game-result.is-won { border-color: var(--success); }
.game-result.is-review { border-color: var(--gold); }
.game-result .row.gap { justify-content: center; }

/* ---- the card table ---------------------------------------------------- */
.card-table { display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 10px; max-width: 620px; margin: 0 auto; }
.play-card { all: unset; cursor: pointer; aspect-ratio: 3 / 4; perspective: 700px; }
.play-card:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: 12px; }
.play-card-inner {
  position: relative; display: block; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform .35s ease;
}
.play-card.is-open .play-card-inner { transform: rotateY(180deg); }
.play-card-back, .play-card-face {
  position: absolute; inset: 0; border-radius: 12px; display: grid; place-items: center;
  backface-visibility: hidden; border: 1px solid var(--border);
}
.play-card-back { background: linear-gradient(140deg, var(--primary-600), var(--primary-400)); color: #fff; }
.play-card-back svg { width: 38%; height: 38%; }
.play-card-face { background: #fff; transform: rotateY(180deg); display: flex; flex-direction: column; align-items: center; justify-content: center; color: #111827; }
.play-card.is-matched .play-card-face { background: var(--success-50); border-color: var(--success); }
.play-card.is-matched { cursor: default; }
.pc-rank { font-size: clamp(1rem, 4.4vw, 1.6rem); font-weight: 700; line-height: 1; }
.pc-suit { font-size: clamp(.9rem, 4vw, 1.5rem); line-height: 1; }
.pc-rank.is-red, .pc-suit.is-red { color: #dc2626; }

/* ---- the number puzzle -------------------------------------------------- */
.puzzle { max-width: 560px; margin: 0 auto; text-align: center; }
.puzzle-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.puzzle-target { display: flex; align-items: baseline; gap: 8px; }
.puzzle-target span { color: var(--text-2); font-size: .85rem; }
.puzzle-target strong { font-size: 2.2rem; line-height: 1; color: var(--primary-600); font-variant-numeric: tabular-nums; }
.puzzle-pool, .puzzle-ops { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.puzzle-ops { margin-top: 12px; }
.puzzle .chip {
  all: unset; cursor: pointer; min-width: 58px; padding: 12px 14px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface-2); font-weight: 700; font-size: 1.15rem;
  text-align: center; font-variant-numeric: tabular-nums; transition: transform .12s ease, background .12s ease;
}
.puzzle .chip:hover { transform: translateY(-1px); }
.puzzle .chip.is-on { background: var(--primary); color: #fff; border-color: var(--primary); }
.puzzle .chip.op { min-width: 50px; }
.puzzle-steps { list-style: none; margin: 14px 0 6px; padding: 0; display: grid; gap: 4px; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   Supreme award — the gift wall
   The picture of the prize is the whole point, so it leads each card and the
   bar underneath says, without arithmetic, how close the member is.
   ========================================================================== */
.award-hero { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.award-hero-count { display: flex; flex-direction: column; }
.award-hero-count strong { font-size: 2.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.award-hero-next { flex: 1 1 320px; min-width: 260px; }
.progress-sm { height: 7px; }
.award-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 10px; }
.award-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.award-card.is-won { border-color: var(--success); }
.award-img { position: relative; aspect-ratio: 16 / 10; background: var(--surface-2); display: grid; place-items: center; }
.award-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.award-img-blank .icon { width: 46px; height: 46px; color: var(--muted); }
.award-badge { position: absolute; top: 10px; right: 10px; }
.award-card.is-won .award-img::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(140deg, color-mix(in srgb, var(--success) 22%, transparent), transparent 60%);
}
.award-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 2px; }
.award-body h3 { margin: 0 0 2px; font-size: 1.05rem; }

/* ==========================================================================
   Daily slip contest — the board
   A ranked list of slips with the prize stated above it. The vote buttons sit
   on the right at a size a thumb can hit, and the one you pressed stays lit.
   ========================================================================== */
.slip-contest .slip-prize { text-align: right; display: flex; flex-direction: column; }
.slip-contest .slip-prize strong { font-size: 1.7rem; line-height: 1.1; color: var(--primary-600); }
.slip-board { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: slip; }
.slip-entry {
  display: grid; grid-template-columns: 30px 72px 1fr auto; align-items: center; gap: 12px;
  padding: 10px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2);
}
.slip-entry.is-winner { border-color: var(--success); background: color-mix(in srgb, var(--success) 10%, var(--surface-2)); }
.slip-rank { font-weight: 700; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.slip-shot { display: block; width: 72px; height: 54px; border-radius: 8px; overflow: hidden; background: var(--surface-3); }
.slip-shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slip-meta { min-width: 0; }
.slip-meta strong { display: block; }
.slip-votes { display: flex; align-items: center; gap: 6px; }
.slip-votes .vote {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px;
  padding: 7px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  font-variant-numeric: tabular-nums; font-size: .85rem; min-height: 38px;
}
.slip-votes .vote:disabled { opacity: .5; cursor: default; }
.slip-votes .vote.up.is-on { background: color-mix(in srgb, var(--success) 18%, var(--surface)); border-color: var(--success); color: var(--success); }
.slip-votes .vote.down.is-on { background: color-mix(in srgb, var(--danger) 18%, var(--surface)); border-color: var(--danger); color: var(--danger); }
.slip-score { min-width: 2ch; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .slip-entry { grid-template-columns: 24px 56px 1fr; }
  .slip-votes { grid-column: 1 / -1; justify-content: flex-end; }
  .slip-shot { width: 56px; height: 44px; }
}

/* ==========================================================================
   Trading — the pair strip and the price chart
   ========================================================================== */
.pair-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.pair-strip .pair {
  flex: 0 0 auto; display: flex; flex-direction: column; gap: 2px; min-width: 112px;
  padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); text-decoration: none; color: inherit;
}
.pair-strip .pair.is-on { border-color: var(--primary); background: var(--primary-50); }
.pair-strip .pair strong { font-size: .92rem; }
.pair-price { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: .88rem; }
.pair-last { text-align: right; display: flex; flex-direction: column; }
.pair-last strong { font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.price-chart { position: relative; border-radius: 12px; background: var(--surface-2); padding: 6px; }
.price-chart svg { display: block; width: 100%; height: 220px; }
.price-chart .chart-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; }

/* The TradingView embed needs a height of its own: the widget fills whatever box
   it is given, and an auto-height parent collapses to nothing. */
.tv-chart { height: 420px; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
@media (max-width: 560px) { .tv-chart { height: 320px; } }

/* ==========================================================================
   The hero's two figures
   What you can take out now, and what you have made in all — side by side and
   staying that way. The card is a header, not a page: the type shrinks and the
   hint lines go before the layout is allowed to stack.
   ========================================================================== */
.dash-balances {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  gap: clamp(10px, 3vw, 28px); margin: 12px 0 14px;
}
.dash-balances::before {
  content: ""; grid-column: 2; width: 1px; height: 36px; justify-self: center;
  background: rgba(255,255,255,.28);
}
.dash-balances .dash-balance { margin: 0; min-width: 0; }
.dash-balances .dash-balance:first-of-type { grid-column: 1; grid-row: 1; }
.dash-balances .dash-balance:last-of-type { grid-column: 3; grid-row: 1; }
.dash-balances::before { grid-row: 1; }
.dash-balances .dash-balance:last-of-type { text-align: right; }
.dash-balances .dash-balance:last-of-type .dash-balance-label { justify-content: flex-end; }
.dash-balances .stat-value { font-size: clamp(1.3rem, 5vw, 2.1rem); line-height: 1.15; white-space: nowrap; }
.dash-balance-hint {
  font-size: .76rem; color: rgba(255,255,255,.8); line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
@media (max-width: 560px) {
  .dash-balances { gap: 8px; }
  .dash-balances .dash-balance-label { font-size: .64rem; letter-spacing: .06em; }
  .dash-balance-hint { display: none; }   /* the labels already say what they are */
}

/* ---- the card takes its colour from the membership ---------------------- */
.dash-hero.is-premium { background: linear-gradient(135deg, #0c2f6b 0%, #1d4ed8 42%, #2563eb 72%, #38bdf8 100%); }
.dash-hero.is-premium::after { background: radial-gradient(circle, rgba(56,189,248,.5), transparent 65%); }
.dash-hero.is-gold { background: linear-gradient(135deg, #5c3b05 0%, #b45309 38%, #d97706 70%, #fbbf24 100%); }
.dash-hero.is-gold::after { background: radial-gradient(circle, rgba(251,191,36,.45), transparent 65%); }
/* A module switched off in Features still has its admin screens, so the entry
   stays in the menu with a red dot rather than disappearing — otherwise the way
   back to switching it on is the thing that vanishes. */
.nav-off {
  width: 8px; height: 8px; border-radius: 50%; background: var(--danger);
  margin-left: auto; flex: 0 0 8px; box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 25%, transparent);
}
.nav-link .nav-off + .pill { margin-left: 6px; }

/* ==========================================================================
   The feature switch
   A real switch rather than a form to open: the position says the state, and
   the word beside it says it again for anyone who reads labels, not shapes.
   ========================================================================== */
.switch {
  all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  font-size: .85rem; font-weight: 600; color: var(--text-2);
}
.switch:disabled { cursor: not-allowed; opacity: .55; }
.switch-track {
  width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3);
  border: 1px solid var(--border); position: relative; transition: background .18s var(--ease);
  flex: 0 0 42px;
}
.switch-knob {
  position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .18s var(--ease);
}
.switch.is-on .switch-track { background: var(--success); border-color: var(--success); }
.switch.is-on .switch-knob { transform: translateX(18px); }
.switch.is-on .switch-text { color: var(--success); }
.switch:focus-visible .switch-track { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ==========================================================================
   The signed-out header
   Brand on the left, controls on the right, on one line. When the line runs
   out the brand gives up its wordmark first — losing the name is survivable,
   losing "Create account" behind the logo is not.
   ========================================================================== */
.guest-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px; max-width: 1180px; width: 100%; margin: 0 auto;
  flex-wrap: nowrap;
}
.guest-brand {
  display: inline-flex; align-items: center; gap: 10px; min-width: 0;
  font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em;
  color: var(--text); text-decoration: none; flex: 0 1 auto;
}
.guest-brand:hover { color: var(--text); }
.guest-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px; }
.guest-brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.guest-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; flex-wrap: nowrap; }
.guest-actions .btn { white-space: nowrap; }
.guest-lang { gap: 5px; }

@media (max-width: 560px) {
  .guest-header { padding: 12px; gap: 8px; }
  .guest-actions { gap: 6px; }
  .guest-actions .btn { padding: 7px 11px; font-size: .84rem; }
  .guest-lang span { display: none; }   /* the globe is the label at this width */
  .guest-brand { font-size: 1rem; }
}
@media (max-width: 400px) {
  .guest-brand-name { display: none; }
  .guest-brand .brand-mark { width: 30px; height: 30px; flex-basis: 30px; }
}

/* ---- Settings hub -------------------------------------------------------
   A list of places to go, not a form. Each row is a whole tap target, which
   matters most on a phone, where this page is mostly read. */
.settings-list { overflow: hidden; }
.settings-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; color: inherit; text-decoration: none;
  border-bottom: 1px solid var(--border);
}
.settings-list .settings-row:last-child { border-bottom: 0; }
.settings-row:hover { background: var(--surface-2); }
.settings-row-icon {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--accent-50); color: var(--accent);
}
.settings-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.settings-row-text strong { font-weight: 600; }
.settings-row-text small { line-height: 1.35; }
.settings-row-go { flex: 0 0 auto; opacity: .45; }
.settings-row:hover .settings-row-go { opacity: .8; }

/* ---- Points converter ---------------------------------------------------
   Amount and currency side by side, so the member reads it as one sentence:
   "this many points, into this." */
.points-convert { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 480px) { .points-convert { grid-template-columns: 1fr auto; align-items: end; } }
.points-convert select { min-width: 92px; }
.points-worth { font-weight: 600; font-size: 1.05rem; margin: 0; }

/* ---- Supreme award: a claimed round ------------------------------------ */
.award-hero-count .muted { display: block; }

/* ---- A switch inside a form that saves many at once ---------------------
   The .switch above is a button that submits on click. This is the same look
   for a checkbox, used where a page holds a column of them and one Save. */
.switch-check { display: inline-flex; align-items: center; cursor: pointer; }
.switch-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-check .switch-track {
  width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3);
  border: 1px solid var(--border); position: relative; transition: background .18s var(--ease);
  flex: 0 0 42px;
}
.switch-check input:checked + .switch-track { background: var(--success); border-color: var(--success); }
.switch-check input:checked + .switch-track .switch-knob { transform: translateX(18px); }
.switch-check input:focus-visible + .switch-track { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---- Closed for maintenance --------------------------------------------
   Its own page with no header: every control up there leads back into a site
   that is not answering, so there is nothing on this page that does not work. */
.mt-page { min-height: 100vh; margin: 0; display: grid; place-items: center; padding: 24px 16px;
  background: linear-gradient(160deg, var(--surface-2) 0%, var(--surface) 55%); }
.mt-wrap { width: 100%; max-width: 620px; }
.mt-card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
  padding: 36px 28px; text-align: center; box-shadow: var(--shadow-lg); }
.mt-icon { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 18px;
  background: var(--accent-50); color: var(--accent); margin-bottom: 16px; }
.mt-icon .icon { width: 30px; height: 30px; }
.mt-image { max-width: 100%; max-height: 220px; border-radius: 14px; margin-bottom: 18px; }
.mt-title { font-size: clamp(1.35rem, 4vw, 1.9rem); margin: 0 0 10px; }
.mt-body { color: var(--text-2); line-height: 1.6; text-align: left; }
.mt-body :first-child { margin-top: 0; }
.mt-body :last-child { margin-bottom: 0; }
.mt-body img { max-width: 100%; height: auto; border-radius: 10px; }

.mt-countdown { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border); }
.mt-countdown-label { font-size: .8rem; font-weight: 700; letter-spacing: 1.1px;
  text-transform: uppercase; color: var(--text-3); margin: 0 0 12px; }
.mt-clock { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.mt-unit { display: grid; gap: 2px; min-width: 66px; padding: 10px 6px; border-radius: 13px;
  background: var(--surface-2); border: 1px solid var(--border); }
.mt-unit strong { font-size: 1.6rem; font-variant-numeric: tabular-nums; line-height: 1; }
.mt-unit small { font-size: .66rem; text-transform: uppercase; letter-spacing: .7px; color: var(--text-3); }
.mt-when { margin: 12px 0 0; }
.mt-foot { margin: 22px 0 0; }
@media (max-width: 420px) { .mt-unit { min-width: 58px; } .mt-unit strong { font-size: 1.3rem; } }

/* ---- The announcement editor ------------------------------------------- */
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; }
.editor-sep { width: 1px; height: 20px; background: var(--border); margin: 0 2px; }
.editor-area { min-height: 160px; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 12px; background: var(--surface); line-height: 1.6; overflow-wrap: anywhere; }
.editor-area:focus { outline: 2px solid var(--primary); outline-offset: 1px; }
.editor-area :first-child { margin-top: 0; }
.editor-area :last-child { margin-bottom: 0; }

/* ---- Referral levels: what each membership is actually paid -------------
   A list rather than a table: this sits in a narrow sidebar card, and the
   column that mattered most was the one scrolling out of sight. */
.mult-row { display: flex; align-items: baseline; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.mult-row:last-of-type { border-bottom: 0; }
.mult-name { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.mult-x { flex: 0 0 auto; font-size: .8rem; color: var(--text-3); }
.mult-amount { flex: 0 0 auto; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------- activation
   The fee is a single line and the payment form sits at the top of the page:
   a member opening /activate has come to pay, not to read. */
.act-fee { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; padding: 12px 16px; margin-top: 4px;
  border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: 12px; background: var(--surface); }
.act-fee .icon { color: var(--primary); align-self: center; }
.act-fee-label { font-weight: 650; color: var(--text-2); }
.act-fee-amount { font-size: 1.45rem; font-weight: 800; color: var(--primary); line-height: 1.1; }
.act-fee-note { color: var(--text-3); font-size: .85rem; }
.act-h { margin-bottom: 2px; font-size: 1.1rem; }
.act-h-sub { margin-top: 0; margin-bottom: 14px; }
.act-unlocks h3 { margin-bottom: 10px; }
.act-unlock-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.act-unlock-list li { display: flex; gap: 8px; align-items: flex-start; color: var(--text-2); font-size: .92rem; }
.act-unlock-list .icon { color: var(--primary); flex: none; margin-top: 2px; }

/* The bar every page carries until the fee is paid. Fixed to the bottom so it
   is reachable from anywhere, and padded out of the way of the content. */
.activate-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: linear-gradient(135deg, var(--primary-dark, #047857), var(--primary));
  color: #fff; box-shadow: 0 -6px 24px rgba(0,0,0,.22); }
.activate-bar .icon { flex: none; }
.activate-bar-text { flex: 1 1 auto; min-width: 0; line-height: 1.25; }
.activate-bar-text strong { display: block; font-size: .95rem; }
.activate-bar-text span { font-size: .82rem; opacity: .9; }
.activate-bar .btn { flex: none; background: #fff; color: var(--primary-dark, #047857); font-weight: 800; letter-spacing: .3px; border: 0; }
.activate-bar .btn:hover { background: #f3f4f6; }
.activate-bar-close { flex: none; background: transparent; border: 0; color: #fff; opacity: .7; cursor: pointer; padding: 6px; line-height: 0; }
.activate-bar-close:hover { opacity: 1; }
body.has-activate-bar { padding-bottom: 84px; }
/* Below 992px the floating bottom-nav owns the bottom of the screen, so the
   bar stacks above it rather than covering it. */
@media (max-width: 991.98px) {
  .activate-bar { left: 10px; right: 10px; bottom: calc(80px + env(safe-area-inset-bottom)); border-radius: 16px; gap: 8px; padding: 9px 12px; }
  .activate-bar-text span { display: none; }
  body.has-activate-bar { padding-bottom: 150px; }
}
@media print { .activate-bar { display: none; } }

/* ------------------------------------------------------------ task wallets */
.tw-summary { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .tw-summary { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); } }
.tw-total { display: flex; flex-direction: column; gap: 4px; padding: 18px 20px; border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, var(--primary-dark, #047857), var(--primary)); }
.tw-total-label { font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.tw-total-amount { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.tw-total .muted { color: rgba(255,255,255,.8); }
.tw-gate { padding: 16px 18px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface); display: grid; gap: 10px; }
.tw-gate > strong { display: flex; align-items: center; gap: 8px; }
.tw-gate.is-met { border-color: var(--primary); }
.tw-gate.is-met > strong { color: var(--primary); }
.tw-gate-row.is-later { opacity: .55; }
.tw-card { cursor: default; }
.tw-withdraw { display: inline-block; margin-top: 6px; font-weight: 800; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.wd-wallets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 860px) { .wd-wallets { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* ------------------------------------------------------------------ agents */
.agent-tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; vertical-align: middle;
  font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  color: #fff; background: linear-gradient(135deg, #1e3a8a, #2563eb); box-shadow: 0 2px 8px rgba(37,99,235,.35); }
.agent-level { border-left: 4px solid var(--border); }
.agent-level.is-reached { border-left-color: var(--primary); }
.agent-salary { font-size: 1.25rem; color: var(--primary); }
.agent-reqs { display: grid; gap: 10px; margin-top: 12px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
/* ----------------------------------------------------------- chat partners */
.partner-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .partner-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .partner-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1400px) { .partner-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.partner-card { border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface);
  display: flex; flex-direction: column; transition: transform .2s var(--ease), box-shadow .2s; }
.partner-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.partner-photo { position: relative; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, color-mix(in srgb, var(--tint) 30%, var(--surface)), color-mix(in srgb, var(--tint) 12%, var(--surface))); }
.partner-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.partner-emoji { font-size: 3.6rem; line-height: 1; }
.partner-ai { position: absolute; top: 8px; left: 8px; }
.partner-online { position: absolute; top: 10px; right: 10px; }
.online-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.25); vertical-align: middle; }
.partner-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1 1 auto; }
.partner-name { margin: 0; font-size: 1rem; }
.partner-age { font-weight: 500; color: var(--text-2); }
.partner-from { margin: 0; font-size: .8rem; color: var(--text-2); display: flex; align-items: center; gap: 4px; }
.partner-tagline { margin: 0 0 6px; font-size: .8rem; color: var(--text-3, var(--muted)); flex: 1 1 auto;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.btn-block { width: 100%; justify-content: center; }
/* The language switch in the top bar. */
.lang-switch { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-decoration: none; }
.lang-switch:hover { border-color: var(--primary); color: var(--primary); }
/* ------------------------------------------------- chat list, like a chat app */
.chatlist-card { border: 1px solid var(--border); border-radius: 18px; background: var(--surface); overflow: hidden; max-width: 760px; }
.chatlist-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px;
  background: linear-gradient(135deg, var(--primary-dark, #047857), var(--primary)); color: #fff; }
.chatlist-head .muted { color: rgba(255,255,255,.85); }
.chatlist-tools { padding: 10px 12px; border-bottom: 1px solid var(--border); display: grid; gap: 8px; }
.chatlist-tools input { border-radius: 999px; height: 40px; }
.chatlist-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.chat-tab { flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-2); font-size: .8rem; font-weight: 700; cursor: pointer; }
.chat-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chatlist { max-height: 640px; overflow-y: auto; }
.chatrow-form { margin: 0; }
.chatrow-form + .chatrow-form .chatrow { border-top: 1px solid var(--border); }
.chatrow { width: 100%; display: flex; gap: 12px; align-items: center; padding: 11px 14px; background: transparent; border: 0;
  text-align: left; cursor: pointer; color: inherit; font: inherit; }
.chatrow:hover:not(:disabled) { background: var(--surface-2); }
.chatrow:disabled { opacity: .5; cursor: not-allowed; }
.chatrow.is-active { background: var(--primary-50); }
.chatrow-avatar { position: relative; flex: none; width: 54px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; background: color-mix(in srgb, var(--tint) 24%, var(--surface)); }
.chatrow-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.chatrow-online { position: absolute; right: 1px; bottom: 1px; border: 2px solid var(--surface); box-shadow: none; }
.chatrow-main { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.chatrow-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.chatrow-name { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatrow-time { flex: none; font-size: .72rem; color: var(--primary); font-weight: 700; }
.chatrow-preview { font-size: .84rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatrow-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 2px; }
.chat-tag { font-size: .66rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; }
.chat-tag-ai_training { background: rgba(124,58,237,.14); color: #7c3aed; }
.chat-tag-swahili { background: rgba(5,150,105,.14); color: #059669; }
.chat-tag-english { background: rgba(37,99,235,.14); color: #2563eb; }
.reply-assist { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; }
.reply-chip { flex: none; max-width: 300px; padding: 7px 12px; border-radius: 14px; border: 1px solid var(--primary); background: var(--primary-50);
  color: var(--text); font-size: .8rem; text-align: left; cursor: pointer; white-space: normal; }
.reply-chip:hover { background: var(--primary); color: #fff; }
/* ------------------------------------------------------- marketing assistant */
.mk-steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); }
.mk-link.is-off { opacity: .6; }
.mk-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin-top: 10px; font-size: .86rem; color: var(--text-2); }
.mk-stats b { color: var(--text); font-size: 1rem; }

.promo { max-width: 560px; margin: 0 auto; text-align: center; }
.promo-invite { margin: 0 0 4px; font-size: .86rem; font-weight: 700; color: var(--primary); }
.promo-head h1 { margin: 0 0 10px; font-size: 2rem; }
.promo-bonus { display: inline-flex; align-items: center; gap: 8px; margin: 0; padding: 8px 18px; border-radius: 999px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24); color: #2b1a00; font-weight: 800; }
.promo-terms { margin: 10px auto 0; max-width: 44ch; font-size: .84rem; color: var(--text-2); }
.promo-stage { margin-top: 22px; padding: 22px 18px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column; align-items: center; gap: 16px; }
.btn-lg { padding: 14px 30px; font-size: 1.05rem; border-radius: 999px; }

.promo-wheel-wrap { position: relative; width: min(280px, 76vw); aspect-ratio: 1 / 1; }
.promo-pointer { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); z-index: 2; width: 0; height: 0;
  border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 24px solid #dc2626; }
.promo-wheel { position: absolute; inset: 0; border-radius: 50%; border: 6px solid #fff; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  background: conic-gradient(from -30deg, #059669 0 60deg, #f59e0b 60deg 120deg, #047857 120deg 180deg, #7c3aed 180deg 240deg, #10b981 240deg 300deg, #db2777 300deg 360deg);
  transition: transform 4.2s cubic-bezier(.17,.67,.2,1); }
.promo-wheel span { position: absolute; top: 50%; left: 50%; width: 0; height: 0; font-weight: 800; font-size: .86rem; color: #fff; white-space: nowrap;
  transform: rotate(calc(var(--i) * 60deg)) translateY(-36%) translateY(calc(min(280px, 76vw) * -.26)); }
.promo-wheel span::before { content: ""; }
.promo-wheel span { display: flex; align-items: center; justify-content: center; }

.promo-chat { width: 100%; min-height: 220px; max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; text-align: left;
  padding: 12px; border-radius: 14px; background: var(--surface-2); }
.promo-replies { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; min-height: 38px; }
.promo-field { position: relative; width: 100%; height: 240px; border-radius: 14px; background: var(--surface-2); overflow: hidden; }
.promo-coin { position: absolute; font-size: 2.4rem; background: transparent; border: 0; cursor: pointer; line-height: 1; animation: pop .25s var(--ease); }
.promo-video { position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; color: #fff;
  background: linear-gradient(135deg, #02231a, #065f46); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; }
.promo-play { font-size: 2.6rem; opacity: .9; }
.promo-video.is-playing .promo-play { display: none; }
.promo-video-text { display: grid; gap: 4px; }
.promo-progress { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 0; }
.promo-won { margin-top: 22px; padding: 26px 18px; border-radius: 20px; color: #fff;
  background: linear-gradient(135deg, var(--primary-dark, #047857), var(--primary)); }
.promo-won h2 { margin: 4px 0 6px; font-size: 1.8rem; color: #fff; }
.promo-won p { margin: 0 0 16px; opacity: .92; }
.promo-won .btn { background: #fbbf24; color: #2b1a00; border: 0; }
.promo-confetti { font-size: 2.6rem; }
.promo-modal { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.promo-modal[hidden] { display: none; }
.promo-modal-box { width: min(440px, 100%); background: var(--surface); border-radius: 20px; padding: 22px; text-align: left; }
.promo-modal-box h3 { margin-top: 0; display: flex; align-items: center; gap: 8px; }
.promo-modal-box .mk-steps { margin: 12px 0 18px; }
/* ------------------------------------------------ admin: guide & simple menu */
.menu-mode { display: flex; gap: 4px; margin: 4px 10px 8px; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.08); }
.menu-mode button { flex: 1; padding: 6px 4px; border: 0; border-radius: 8px; background: transparent; color: inherit; opacity: .7;
  font-size: .74rem; font-weight: 700; cursor: pointer; }
.menu-mode button.active { background: rgba(255,255,255,.18); opacity: 1; }
#admin-nav.is-simple .nav-extra { display: none; }
.guide-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 14px; border-radius: 14px; text-decoration: none;
  color: var(--text); background: var(--primary-50); border: 1px solid var(--primary); }
.guide-banner span { flex: 1 1 auto; }
.guide-banner .icon { color: var(--primary); flex: none; }
.guide-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.guide-steps li { display: flex; gap: 12px; align-items: flex-start; }
.guide-tick { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; margin-top: 2px; }
.guide-steps li.is-done .guide-tick { background: var(--primary); border-color: var(--primary); color: #fff; }
.guide-steps li.is-done strong { color: var(--text-2); }
.guide-queue.has-work { border-color: var(--primary); }
.guide-queue.has-work .stat-value { color: var(--primary); }
.guide-h { margin: 18px 0 6px; }@media (max-width: 480px) { .lang-switch span { display: none; } .lang-switch { padding: 6px; } }

/* Number tiles game */
.tiles-wrap { display: flex; justify-content: center; padding: 8px 0; }
.tiles-board { --n: 4; display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 8px; width: min(100%, 420px); aspect-ratio: 1; padding: 8px; border-radius: 14px; background: #cbd5e1; user-select: none; }
.tiles-board .tile { display: flex; align-items: center; justify-content: center; border-radius: 10px; background: rgba(255,255,255,0.35); font-weight: 800; font-size: clamp(18px, 6vw, 34px); color: #1e293b; transition: background .12s; }
.tiles-board .tile.fresh { animation: tile-pop .18s ease-out; }
@keyframes tile-pop { from { transform: scale(.4); } to { transform: scale(1); } }

/* Marketing landing: real videos and games */
.promo-vid-grid, .promo-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; width: 100%; margin: 8px 0 12px; }
.promo-vid, .promo-game { position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 8px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); color: inherit; text-decoration: none; cursor: pointer; }
.promo-vid img, .promo-vid-ph { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 10px; background: var(--surface-2, #f1f5f9); display: grid; place-items: center; }
.promo-vid-play { position: absolute; top: 28%; left: 50%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; }
.promo-vid-player { width: 100%; margin-bottom: 10px; }
.promo-vid-frame { position: relative; width: 100%; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; background: #000; }
.promo-vid-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.promo-game-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft, #ecfdf5); color: var(--primary, #059669); }
.promo-game-win { font-size: 12px; font-weight: 700; color: var(--primary, #059669); }
.promo-game:hover, .promo-vid:hover { border-color: var(--primary, #059669); }

/* Uploaded thumbnails on task, game and item cards */
.card-thumb { display: block; width: 100%; margin: 0 0 12px; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; background: var(--surface-2, #eef2f6); }
.thumb-preview { max-height: 90px; margin-top: 8px; border-radius: 10px; }
.earn-yt { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 8px 0; border-radius: 10px; overflow: hidden; background: #000; }
.earn-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.earn-full { margin: 8px 0; padding: 12px; border-radius: 10px; background: var(--surface-2, #f3f6f9); font-size: .95rem; line-height: 1.55; white-space: normal; }

/* ---------------------------------------------------------------- blog */
.blog-hero { padding: 22px 0 6px; }
.blog-hero h1 { margin: 0 0 6px; font-size: clamp(1.6rem, 4vw, 2.3rem); }
.blog-search { display: flex; gap: 8px; margin: 14px 0; max-width: 560px; }
.blog-search input { flex: 1; }
.blog-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 18px; }
.blog-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 650; font-size: .88rem; text-decoration: none; }
.blog-chip.is-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.blog-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.blog-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); overflow: hidden; color: inherit; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.blog-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(15, 23, 42, .08); }
.blog-cover { aspect-ratio: 16 / 9; width: 100%; object-fit: cover; display: flex; align-items: center; justify-content: center; color: #fff; }
.blog-cover .icon { width: 42px; height: 42px; opacity: .9; }
.blog-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.blog-card-body h3 { margin: 0; font-size: 1.05rem; line-height: 1.35; }
.blog-card-body p { margin: 0; color: var(--text-2); font-size: .9rem; }
.blog-meta { display: flex; gap: 10px; align-items: center; font-size: .78rem; color: var(--text-3, var(--text-2)); margin-top: auto; padding-top: 6px; }
.blog-cat { font-size: .75rem; font-weight: 750; text-transform: none; }
.blog-featured { display: grid; grid-template-columns: 1.2fr 1fr; gap: 0; margin-bottom: 22px; }
.blog-featured .blog-cover { aspect-ratio: auto; min-height: 240px; height: 100%; }
.blog-featured .blog-card-body { padding: 22px; justify-content: center; }
.blog-featured h2 { margin: 4px 0; font-size: 1.5rem; }
@media (max-width: 720px) { .blog-featured { grid-template-columns: 1fr; } .blog-featured .blog-cover { min-height: 170px; } }
.blog-article { max-width: 760px; margin: 0 auto; }
.blog-article h1 { font-size: clamp(1.6rem, 4.5vw, 2.4rem); line-height: 1.2; margin: 10px 0; }
.blog-article .blog-cover { border-radius: 18px; margin: 16px 0 8px; aspect-ratio: 21 / 9; }
.blog-body { font-size: 1.05rem; line-height: 1.75; }
.blog-body h2 { font-size: 1.35rem; margin: 28px 0 8px; }
.blog-body ul, .blog-body ol { padding-left: 22px; }
.blog-body li { margin: 6px 0; }
.blog-body blockquote { margin: 22px 0; padding: 14px 18px; border-left: 4px solid var(--primary); background: var(--surface-2); border-radius: 0 12px 12px 0; font-weight: 600; }
.blog-body img { max-width: 100%; border-radius: 12px; }
.blog-pager { display: flex; gap: 8px; justify-content: center; margin: 22px 0; }
