/* =====================================================
   Fylzen design system
   ===================================================== */
:root {
  --bg: #f7f7fa;
  --surface: #ffffff;
  --surface-2: #f4f2f9;
  --surface-3: #e9e5f7;
  --border: #ebe8f2;
  --border-strong: #d3cde8;
  --text: #1b1830;
  --text-2: #57536e;
  --text-3: #8b87a3;
  --brand: #9333ea;
  --brand-hover: #7e22ce;
  --brand-ink: #ffffff;
  --brand-deep: #581c87;
  --brand-soft: #f3e8ff;
  --brand-soft-ink: #7e22ce;
  --gold: #f5b70a;
  --success: #12804a;
  --success-soft: #e3f6eb;
  --danger: #c8283f;
  --danger-soft: #fde8eb;
  --warning: #a8620a;
  --warning-soft: #fdf1dc;
  --info: #1f5fd1;
  --info-soft: #e5eefd;
  --shadow-sm: 0 1px 2px rgba(27, 24, 48, .04), 0 4px 16px -6px rgba(27, 24, 48, .07);
  --shadow: 0 1px 3px rgba(27, 24, 48, .06), 0 8px 24px -12px rgba(27, 24, 48, .12);
  --shadow-lg: 0 24px 60px -20px rgba(27, 24, 48, .35);
  --hero: linear-gradient(135deg, #7e22ce 0%, #9333ea 55%, #a855f7 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-w: 256px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Poppins', 'Inter', system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0c16; --surface: #16131f; --surface-2: #1d1929; --surface-3: #262136;
    --border: #2a2540; --border-strong: #3a3456;
    --text: #ece9f8; --text-2: #b3aecb; --text-3: #7f7a99;
    --brand: #a855f7; --brand-hover: #b975f8; --brand-deep: #d8b4fe;
    --brand-soft: #2a1a45; --brand-soft-ink: #d8b4fe;
    --success: #3ccf86; --success-soft: #12291e; --danger: #f0627a; --danger-soft: #2e141b;
    --warning: #f0b34a; --warning-soft: #2c2010; --info: #6c9df5; --info-soft: #131f36;
    --shadow-sm: none; --shadow: 0 1px 0 rgba(255,255,255,.02), 0 10px 30px -14px rgba(0,0,0,.6);
    --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e0c16; --surface: #16131f; --surface-2: #1d1929; --surface-3: #262136;
  --border: #2a2540; --border-strong: #3a3456;
  --text: #ece9f8; --text-2: #b3aecb; --text-3: #7f7a99;
  --brand: #a855f7; --brand-hover: #b975f8; --brand-deep: #d8b4fe;
  --brand-soft: #2a1a45; --brand-soft-ink: #d8b4fe;
  --success: #3ccf86; --success-soft: #12291e; --danger: #f0627a; --danger-soft: #2e141b;
  --warning: #f0b34a; --warning-soft: #2c2010; --info: #6c9df5; --info-soft: #131f36;
  --shadow-sm: none; --shadow: 0 1px 0 rgba(255,255,255,.02), 0 10px 30px -14px rgba(0,0,0,.6);
  --shadow-lg: 0 24px 60px -20px rgba(0,0,0,.8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 14.5px; line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
p { margin: 0 0 1em; }
img { max-width: 100%; display: block; }
code, .mono { font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-size: .92em; }
.muted { color: var(--text-2); } .faint { color: var(--text-3); }
.tnum { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger { color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 38px; padding: 0; }
.btn-sm.btn-icon { width: 32px; }
.btn-block { width: 100%; }
.btn-lg { height: 48px; padding: 0 22px; font-size: 15px; }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }
.field label, .label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; color: var(--text); }
.field .help { font-size: 12.5px; color: var(--text-3); margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: 400 14.5px var(--font); transition: border-color .15s, box-shadow .15s;
}
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .icon { position: absolute; left: 12px; color: var(--text-3); pointer-events: none; }
.input-group .input { padding-left: 38px; }
.input-suffix { display: flex; } .input-suffix .input { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.input-suffix .addon { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--border-strong); border-left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--surface-2); color: var(--text-2); font-size: 13px; white-space: nowrap; }
.input-prefix { display: flex; } .input-prefix .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.input-prefix .addon { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--surface-2); color: var(--text-2); font-size: 13px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 13.5px; color: var(--text-2); }
.check input { margin-top: 3px; width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 22px; cursor: pointer; transition: .2s; }
.switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::before { transform: translateX(18px); }
.otp-input { letter-spacing: 12px; font: 700 24px/1 var(--font-head); text-align: center; height: 56px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2, .card-head h3 { margin: 0; font-size: 15.5px; }
.card-body { padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }
.stack > * + * { margin-top: 16px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------- Stat tiles ---------- */
.stat { padding: 22px 24px; display: flex; flex-direction: column; gap: 8px; }
.stat-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; color: var(--text-2); font-size: 14px; font-weight: 500; }
.stat-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--brand-soft); color: var(--brand); }
.stat-icon.blue { background: color-mix(in srgb, var(--info) 12%, transparent); color: var(--info); }
.stat-icon .icon { width: 16px; height: 16px; }
.stat-hero { background: var(--hero); border-color: transparent; color: #fff; box-shadow: 0 12px 30px -12px rgba(147, 51, 234, .55); }
.stat-hero .stat-top, .stat-hero .stat-foot { color: rgba(255,255,255,.9); }
.stat-hero .stat-icon { background: #fff; color: #9333ea; }
.stat-value { font: 700 30px/1.15 var(--font); letter-spacing: -.02em; }
.stat-value small { font-size: 13px; font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.stat-foot { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.delta { font-weight: 600; font-size: 13px; }
.delta-up { color: var(--success); }
.delta-down { color: var(--danger); }
.delta-flat { color: var(--text-2); }
.meter { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--brand); border-radius: 6px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 20px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.badge-brand { background: var(--brand-soft); color: var(--brand-soft-ink); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-info { background: var(--info-soft); color: var(--info); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px; border-radius: var(--radius-sm); border: 1px solid; font-size: 13.5px; }
.alert .icon { margin-top: 1px; }
.alert-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--text); }
.alert-info .icon { color: var(--info); }
.alert-warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 30%, transparent); color: var(--text); }
.alert-warning .icon { color: var(--warning); }
.alert-danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); color: var(--text); }
.alert-danger .icon { color: var(--danger); }
.alert-success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 30%, transparent); color: var(--text); }
.alert-success .icon { color: var(--success); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); padding: 10px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); z-index: 40;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 22px 16px 18px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 26px; font: 700 23px var(--font-head); color: var(--brand); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand svg { width: 36px; height: 36px; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); padding: 14px 12px 6px; }
.nav a, .nav .nav-disabled {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 12px;
  color: var(--text); font-weight: 500; font-size: 14.5px;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav a .icon, .nav .nav-disabled .icon { width: 17px; height: 17px; color: var(--text-2); }
.nav a.active .icon { color: var(--brand); }
.nav .nav-disabled { opacity: .55; cursor: default; }
.nav .badge { margin-left: auto; height: 19px; font-size: 10.5px; }
.side-card { margin-top: auto; padding: 16px; border-radius: var(--radius); background: var(--brand-soft); color: var(--text); }
.side-card h4 { display: flex; align-items: center; gap: 10px; font-size: 16px; margin-bottom: 10px; }
.side-card h4 .tg { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; }
.side-card h4 .tg .icon { width: 16px; height: 16px; }
.side-card p { font-size: 12.5px; color: var(--text-2); margin-bottom: 12px; line-height: 1.45; }
.side-card .btn { background: var(--brand); border-color: var(--brand); color: #fff; }
.side-card .btn:hover { background: var(--brand-hover); }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 68px; display: flex; align-items: center; gap: 12px;
  padding: 0 28px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
}
.topbar h1 { font-size: 18px; margin: 0; }
.content { padding: 28px 28px 48px; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.wallet-chip { display: inline-flex; align-items: center; gap: 10px; height: 38px; padding: 0 16px 0 14px; border-radius: 12px; background: var(--brand-soft); font-weight: 600; color: var(--brand); }
.wallet-chip:hover { text-decoration: none; filter: brightness(.97); }
.wallet-chip .icon { width: 17px; height: 17px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; font-size: 14px; flex: none; }
.menu-btn { display: none; }
.scrim { display: none; }
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(10, 8, 20, .45); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 16px; }
  .content { padding: 20px 16px 40px; }
  .wallet-chip .label-long { display: none; }
}
@media (max-width: 520px) { .topbar h1 { display: none; } }

/* ---------- Dropdown ---------- */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; z-index: 50;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 6px; display: none;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--text); background: none; border: 0; font: 500 14px var(--font); cursor: pointer; text-align: left; }
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); text-decoration: none; }
.dropdown-menu .danger { color: var(--danger); }
.dropdown-sep { height: 1px; background: var(--border); margin: 6px 0; }
.notif-menu { width: 340px; max-width: calc(100vw - 32px); padding: 0; }
.notif-menu .nhead { padding: 12px 14px; border-bottom: 1px solid var(--border); font-weight: 600; }
.notif-item { display: block; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--text); }
.notif-item:hover { background: var(--surface-2); text-decoration: none; }
.notif-item.unread { background: color-mix(in srgb, var(--brand-soft) 60%, transparent); }
.notif-item b { display: block; font-size: 13.5px; }
.notif-item span { font-size: 12.5px; color: var(--text-2); }
.bell-dot { position: absolute; top: 6px; right: 7px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(10, 8, 20, .5); }
.modal.open { display: flex; }
.modal-box { width: 100%; max-width: 440px; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); max-height: calc(100vh - 32px); overflow-y: auto; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 0; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-body { padding: 16px 20px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 20px 20px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 12px; background: #1b1830; color: #fff; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-lg); animation: toast-in .2s ease; max-width: calc(100vw - 32px); }
.toast.success .icon { color: #4ade80; } .toast.error .icon { color: #fb7185; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Empty state ---------- */
.empty { text-align: center; padding: 56px 20px; color: var(--text-2); }
.empty .empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-soft-ink); }
.empty .empty-icon .icon { width: 26px; height: 26px; }
.empty h3 { color: var(--text); }

/* ---------- Event banner ---------- */
.event-banner { position: relative; overflow: hidden; border-radius: var(--radius); padding: 22px 24px; color: #fff; background: var(--hero); }
.event-banner::after { content: ''; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: rgba(255,255,255,.08); }
.event-banner h3 { font-size: 17px; margin-bottom: 4px; position: relative; }
.event-banner p { opacity: .85; margin-bottom: 14px; position: relative; font-size: 13.5px; }
.event-banner .meter { background: rgba(255,255,255,.2); position: relative; }
.event-banner .meter > span { background: var(--gold); }
.event-banner .btn { position: relative; background: #fff; color: var(--brand-deep); border-color: #fff; }

/* ---------- Charts ---------- */
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.seg button { height: 28px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font: 600 12.5px var(--font); cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.chart-box { position: relative; min-height: 268px; transition: opacity .2s; }
.chart-box.loading { opacity: .45; }
.chart-box svg { display: block; width: 100%; overflow: visible; }
.chart-box svg:focus { outline: none; }
.chart-box svg:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 6px; }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 8px 12px; font-size: 12.5px; white-space: nowrap; transform: translate(-50%, -100%); z-index: 5; }
.chart-tip b { display: block; font-size: 15px; color: var(--text); font-variant-numeric: tabular-nums; }
.chart-tip .k { display: inline-block; width: 12px; height: 2px; background: var(--brand); border-radius: 2px; vertical-align: middle; margin-right: 6px; }
.chart-tip span { color: var(--text-2); }
.chart-empty { position: absolute; inset: 0 0 28px 48px; display: grid; place-items: center; text-align: center; color: var(--text-3); font-size: 13px; pointer-events: none; }
.chart-table { margin-top: 12px; max-height: 260px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.chart-table .table td, .chart-table .table th { padding: 7px 12px; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* ---------- Files ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.toolbar .input-group { flex: 1; min-width: 200px; }
.toolbar select.input { width: auto; }
.thumb { width: 44px; height: 44px; border-radius: 10px; background: var(--surface-2) center/cover no-repeat; display: grid; place-items: center; color: var(--text-3); flex: none; position: relative; overflow: hidden; }
.thumb .dur { position: absolute; bottom: 2px; right: 2px; font-size: 9.5px; font-weight: 700; background: rgba(0,0,0,.65); color: #fff; padding: 0 4px; border-radius: 4px; }
.file-name { font-weight: 600; color: var(--text); max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.file-meta { font-size: 12.5px; color: var(--text-3); }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; padding: 16px; }
.file-card { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); position: relative; }
.file-card .cover { aspect-ratio: 16/10; background: var(--surface-2) center/cover no-repeat; display: grid; place-items: center; color: var(--text-3); position: relative; }
.file-card .cover .icon { width: 32px; height: 32px; }
.file-card .cover .dur { position: absolute; bottom: 8px; right: 8px; font-size: 11px; font-weight: 700; background: rgba(0,0,0,.65); color: #fff; padding: 1px 6px; border-radius: 5px; }
.file-card .fc-body { padding: 12px; }
.file-card .fc-sel { position: absolute; top: 8px; left: 8px; width: 18px; height: 18px; accent-color: var(--brand); }
.file-card .fc-actions { display: flex; gap: 4px; margin-top: 10px; }
.bulkbar { display: none; align-items: center; gap: 10px; padding: 10px 16px; background: var(--brand-soft); border-bottom: 1px solid var(--border); font-weight: 600; color: var(--brand-soft-ink); }
.bulkbar.show { display: flex; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); font-size: 13px; color: var(--text-2); }

/* ---------- Upload ---------- */
.dropzone {
  border: 2px dashed color-mix(in srgb, var(--brand) 55%, transparent); border-radius: 14px; background: var(--surface);
  padding: 56px 24px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); }
.dropzone.disabled { opacity: .5; pointer-events: none; }
.dz-icon { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.dz-icon .icon { width: 24px; height: 24px; }
.dropzone h3 { font-size: 16.5px; font-weight: 600; font-family: var(--font); margin-bottom: 6px; }
.up-item { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.up-item:last-child { border-bottom: 0; }
.up-item .up-main { flex: 1; min-width: 0; }
.up-item .up-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.up-item .up-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-item .progress { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin: 8px 0 6px; }
.up-item .progress > span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.up-item.done .progress > span { background: var(--success); }
.up-item.error .progress > span { background: var(--danger); }
.up-item .up-status { font-size: 12.5px; color: var(--text-3); }
.up-link { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.up-link .input { height: 34px; font-size: 13px; flex: 1; min-width: 180px; background: var(--surface-2); }
.qr-box { display: grid; place-items: center; padding: 16px; background: #fff; border-radius: 12px; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-art { background: var(--hero); color: #fff; padding: 48px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.auth-art::before { content: ''; position: absolute; width: 520px; height: 520px; border-radius: 50%; right: -180px; bottom: -160px; background: rgba(255,255,255,.07); }
.auth-art .brand { color: #fff; padding: 0; }
.auth-art h2 { font-size: 34px; margin: auto 0 14px; max-width: 440px; position: relative; }
.auth-art p { opacity: .85; max-width: 420px; font-size: 15.5px; position: relative; }
.auth-points { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; position: relative; }
.auth-points li { display: flex; gap: 10px; align-items: center; font-size: 14.5px; }
.auth-points .icon { color: var(--gold); }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h1 { font-size: 26px; margin-bottom: 6px; }
.auth-box .sub { color: var(--text-2); margin-bottom: 26px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12.5px; margin: 18px 0; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-art { display: none; } }

/* ---------- Public share page ---------- */
.share-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 24px 16px 48px; background: var(--bg); }
.share-top { width: 100%; max-width: 560px; display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.share-card { width: 100%; max-width: 560px; }
.share-cover { aspect-ratio: 16/9; background: var(--surface-2) center/cover no-repeat; border-radius: var(--radius) var(--radius) 0 0; display: grid; place-items: center; color: var(--text-3); position: relative; overflow: hidden; }
.share-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.45)); }
.share-cover .lock { position: relative; z-index: 1; width: 64px; height: 64px; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--brand-deep); display: grid; place-items: center; box-shadow: var(--shadow-lg); }
.share-cover .lock .icon { width: 28px; height: 28px; }

/* ---------- Landing page ---------- */
.lp-nav { display: flex; align-items: center; justify-content: space-between; max-width: 1160px; margin: 0 auto; padding: 18px 20px; }
.lp-hero { background: var(--hero); color: #fff; position: relative; overflow: hidden; }
.lp-hero .lp-nav .brand { color: #fff; }
.lp-hero .lp-nav a.btn-ghost { color: #fff; }
.lp-hero .lp-nav a.btn-ghost:hover { background: rgba(255,255,255,.12); }
.lp-hero-inner { max-width: 1160px; margin: 0 auto; padding: 56px 20px 96px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.lp-hero h1 { font-size: 52px; line-height: 1.08; letter-spacing: -.03em; margin-bottom: 18px; }
.lp-hero p.lead { font-size: 18px; opacity: .88; max-width: 520px; margin-bottom: 28px; }
.lp-hero .btn-light { background: #fff; color: var(--brand-deep); border-color: #fff; }
.lp-hero .btn-outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.lp-hero .btn-outline-light:hover { background: rgba(255,255,255,.1); }
.lp-mock { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 22px; padding: 20px; backdrop-filter: blur(8px); }
.lp-mock .mock-stat { background: rgba(255,255,255,.12); border-radius: 14px; padding: 14px 16px; margin-bottom: 12px; }
.lp-mock .mock-stat small { opacity: .75; font-size: 12px; }
.lp-mock .mock-stat b { display: block; font: 700 24px var(--font-head); }
.lp-section { max-width: 1160px; margin: 0 auto; padding: 72px 20px; }
.lp-section h2 { font-size: 32px; text-align: center; margin-bottom: 10px; }
.lp-section .lead { text-align: center; color: var(--text-2); max-width: 600px; margin: 0 auto 40px; font-size: 16px; }
.lp-step { padding: 24px; }
.lp-step .num { width: 36px; height: 36px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-soft-ink); display: grid; place-items: center; font-weight: 700; margin-bottom: 14px; }
.lp-foot { border-top: 1px solid var(--border); padding: 28px 20px; text-align: center; color: var(--text-3); font-size: 13px; }
.lp-foot a { color: var(--text-2); margin: 0 10px; }
@media (max-width: 900px) { .lp-hero-inner { grid-template-columns: 1fr; padding: 32px 20px 64px; } .lp-hero h1 { font-size: 38px; } .lp-mock { display: none; } }

/* ---------- Admin ---------- */
.admin .sidebar { background: #120f1d; border-right-color: #231e35; }
.admin .sidebar .brand { color: #fff; }
.admin .nav a, .admin .nav .nav-disabled { color: #b3aecb; }
.admin .nav a:hover { background: #1f1a30; color: #fff; }
.admin .nav a.active { background: #2b2148; color: #e4dbff; }
.admin .nav-label { color: #6d6888; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px 16px; font-size: 13.5px; }
.kv dt { color: var(--text-3); } .kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.settings-row { display: grid; grid-template-columns: 1fr 260px; gap: 16px; align-items: center; padding: 14px 20px; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: 0; }
.settings-row .help { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
@media (max-width: 720px) { .settings-row { grid-template-columns: 1fr; } .kv { grid-template-columns: 1fr; gap: 2px 0; } .kv dd { margin-bottom: 8px; } }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--text-2); font-weight: 600; font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ---------- Dashboard components (reference layout) ---------- */
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1360px) { .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .grid-5 { grid-template-columns: minmax(0, 1fr); } }
.notice-pill { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; padding: 4px 12px; border-radius: 20px; border: 1px solid color-mix(in srgb, var(--warning) 35%, transparent); background: var(--warning-soft); color: var(--warning); font-size: 12.5px; font-weight: 500; }
.notice-pill .icon { width: 14px; height: 14px; }
.notice-bar { padding: 12px 16px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent); background: color-mix(in srgb, var(--brand-soft) 70%, transparent); color: var(--brand-soft-ink); font-size: 13.5px; }
.event-card { display: flex; gap: 20px; align-items: center; padding: 18px 20px; border-radius: var(--radius); border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent); background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface)); }
.event-card .ev-main { flex: 1; min-width: 0; }
.event-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--brand); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.event-pill .icon { width: 13px; height: 13px; }
.event-card h3 { font-size: 19px; margin: 12px 0 8px; }
.event-card p { margin: 0 0 6px; color: var(--text-2); font-size: 14px; }
.event-card .meter { margin-top: 14px; height: 8px; background: color-mix(in srgb, var(--brand) 14%, transparent); }
.event-art { width: 116px; height: 116px; border-radius: 14px; flex: none; display: grid; place-items: center; background: var(--surface) center/cover no-repeat; border: 1px solid var(--border); color: var(--brand); }
.event-art .icon { width: 40px; height: 40px; }
@media (max-width: 640px) { .event-art { display: none; } }
.pill-seg { display: inline-flex; gap: 4px; }
.pill-seg button { height: 30px; padding: 0 12px; border: 0; border-radius: 20px; background: transparent; color: var(--text-2); font: 500 13px var(--font); cursor: pointer; }
.pill-seg button:hover { color: var(--text); }
.pill-seg button.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.card-head.plain { border-bottom: 0; padding: 20px 24px 4px; }
.card-head.plain h3 { font-size: 17px; }
.storage-bar { height: 10px; border-radius: 10px; background: var(--surface-3); overflow: hidden; margin: 10px 0 18px; }
.storage-bar span { display: block; height: 100%; background: var(--brand); border-radius: 10px; min-width: 2px; }
.storage-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 860px) { .storage-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .storage-tiles { grid-template-columns: minmax(0, 1fr); } }
.st-tile { --tint: #2563eb; border-radius: 14px; padding: 16px 18px; background: color-mix(in srgb, var(--tint) 7%, var(--surface)); }
.st-tile .st-head { display: flex; align-items: center; gap: 12px; font-weight: 500; font-size: 15px; margin-bottom: 14px; }
.st-tile .st-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--tint) 14%, var(--surface)); color: var(--tint); }
.st-tile .st-ic .icon { width: 16px; height: 16px; }
.st-tile .st-row { display: flex; justify-content: space-between; align-items: baseline; }
.st-tile .st-row b { font-size: 17px; }
.st-tile .st-row span { color: var(--text-2); font-size: 13px; }
.st-video { --tint: #2563eb; } .st-image { --tint: #9333ea; } .st-audio { --tint: #16a34a; } .st-doc { --tint: #dc2626; } .st-other { --tint: #ca8a04; }
.page-head h1 { font-size: 27px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-outline { background: var(--surface); border-color: var(--border-strong); }

/* ---------- My Files (reference layout) ---------- */
.files-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.files-toolbar .search { flex: 1 1 280px; max-width: 460px; }
.files-toolbar .search .input { border-radius: 12px; background: var(--surface-2); border-color: var(--border); }
.files-toolbar select.input { width: auto; min-width: 120px; border-radius: 12px; }
.files-toolbar .btn-outline { height: 42px; border-radius: 12px; }
.files-toolbar .seg { padding: 4px; border-radius: 12px; }
.files-toolbar .seg button { height: 32px; width: 36px; padding: 0; display: grid; place-items: center; border-radius: 8px; }
.files-toolbar .seg button.active { background: var(--brand); color: #fff; }
@media (min-width: 900px) { .files-toolbar .search { margin-right: auto; } }
.bulkbar.card { margin-bottom: 16px; border-radius: 12px; }
.fgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; }
.fcard { padding: 16px 16px 12px; display: flex; flex-direction: column; gap: 6px; transition: box-shadow .15s, border-color .15s; }
.fcard:hover { border-color: color-mix(in srgb, var(--brand) 30%, var(--border)); box-shadow: var(--shadow); }
.fcard-top { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.fcard-top .sel { width: 16px; height: 16px; accent-color: var(--brand); flex: none; display: none; }
.fcard:hover .sel, .fcard .sel:checked, #files-root.selecting .fcard .sel { display: block; }
.ficon { width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid; place-items: center; color: var(--text-2); background: var(--surface-2) center/cover no-repeat; }
.ficon.has-thumb { border: 1px solid var(--border); }
.fname { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fname:hover { color: var(--brand); text-decoration: none; }
.fsize { color: var(--text-2); font-size: 13.5px; white-space: nowrap; }
.fmeta { color: var(--text-2); font-size: 13px; }
.fcard-foot { display: flex; align-items: center; gap: 2px; margin-top: 8px; }
.fcard-foot .badge { height: 24px; padding: 0 10px; font-size: 12px; }
.act-danger { color: var(--danger); }
.act-danger:hover { background: var(--danger-soft); color: var(--danger); }
.pill-seg a { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 20px; color: var(--text-2); font-size: 13px; font-weight: 500; }
.pill-seg a:hover { color: var(--text); text-decoration: none; }
.pill-seg a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* ---------- Web fallback viewer ---------- */
.web-ad-slot { min-height: 90px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.web-ad-slot:empty::before { content: 'Preparing your file…'; color: var(--text-3); font-size: 13px; }
#web-viewer img, #web-viewer video { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: 12px; background: #000; }
#web-viewer audio { width: 100%; }
#web-viewer iframe { width: 100%; height: 70vh; border: 1px solid var(--border); border-radius: 12px; }

/* ---------- Phase 3: withdraw, settings, referrals, support, admin queues ---------- */
[hidden] { display: none !important; }
.nav a .nav-count { margin-left: auto; }
.nav-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.grid-3-1 { display: grid; gap: 16px; grid-template-columns: minmax(0, 2.2fr) minmax(260px, 1fr); }
@media (max-width: 1000px) { .grid-3-1 { grid-template-columns: minmax(0, 1fr); } }
.row-link { cursor: pointer; }
.tick-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.tick-list li { position: relative; padding-left: 24px; }
.tick-list li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 12px; height: 7px; border-left: 2px solid var(--success); border-bottom: 2px solid var(--success); transform: rotate(-45deg); }

.wd-steps { list-style: none; margin: 18px 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.wd-steps li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; font-weight: 600; font-size: 13px; gap: 4px; color: var(--text-3); }
.wd-steps li small { font-weight: 400; font-size: 11.5px; color: var(--text-3); max-width: 140px; }
.wd-steps li span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface); position: relative; z-index: 1; }
.wd-steps li::before { content: ""; position: absolute; top: 7px; left: -50%; width: 100%; height: 2px; background: var(--border-strong); }
.wd-steps li:first-child::before { display: none; }
.wd-steps li.done, .wd-steps li.current { color: var(--text); }
.wd-steps li.done span { background: var(--success); border-color: var(--success); }
.wd-steps li.done::before, .wd-steps li.current::before { background: var(--success); }
.wd-steps li.current span { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

.pm-list { display: flex; flex-direction: column; }
.pm-row { display: flex; align-items: center; gap: 10px; padding: 12px 16px 12px 20px; border-bottom: 1px solid var(--border); }
.pm-row:last-child { border-bottom: 0; }
.pm-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-soft-ink); flex: none; }
.pm-ic .icon { width: 18px; height: 18px; }
.pm-fields { border: 0; padding: 0; margin: 0; min-width: 0; }

.settings-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; font-size: 14px; }
.settings-nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.settings-nav a .icon { width: 17px; height: 17px; }
.settings-layout .card { scroll-margin-top: 84px; }
@media (max-width: 860px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .settings-nav a { white-space: nowrap; }
}
.pref-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.pref-row:first-child { padding-top: 0; }
.pref-row .help { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.card-danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.card-danger .card-head h3 { color: var(--danger); }

.ref-hero { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px; align-items: center; padding: 28px; border-radius: var(--radius); background: var(--hero); color: #fff; box-shadow: 0 16px 40px -18px rgba(147, 51, 234, .6); }
.ref-hero h2 { color: #fff; font-size: 24px; margin: 12px 0 8px; }
.ref-hero p { color: rgba(255, 255, 255, .88); margin: 0; font-size: 14.5px; }
.ref-hero .input { background: rgba(255, 255, 255, .96); color: #1b1830; border-color: transparent; }
.ref-hero .btn { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .35); }
.ref-hero .btn:hover { background: rgba(255, 255, 255, .26); }
.ref-hero .btn-light { background: #fff; color: #581c87; border-color: #fff; }
.ref-hero .btn-light:hover { background: #f3e8ff; }
.ref-box { background: rgba(0, 0, 0, .14); border-radius: 14px; padding: 16px; }
@media (max-width: 860px) { .ref-hero { grid-template-columns: minmax(0, 1fr); padding: 20px; } }
.how-steps > div { position: relative; padding-left: 46px; }
.how-steps b { display: block; margin-bottom: 4px; }
.how-steps p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.how-num { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-soft-ink); font-weight: 700; }

.faq details { border-bottom: 1px solid var(--border); }
.faq details:last-child { border-bottom: 0; }
.faq summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 20px; font-weight: 600; font-size: 14px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary .icon { color: var(--text-3); transition: transform .2s; flex: none; }
.faq details[open] summary .icon { transform: rotate(180deg); }
.faq details p { margin: 0; padding: 0 20px 16px; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }

.thread { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 82%; padding: 12px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.msg.staff { align-self: flex-start; background: var(--brand-soft); border-color: transparent; border-top-left-radius: 4px; }
.msg.mine { align-self: flex-end; border-top-right-radius: 4px; }
.msg-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: 12.5px; margin-bottom: 6px; }
.msg-body { font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.msg-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.msg-files a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; color: var(--text); }
.msg-files a:hover { border-color: var(--brand); text-decoration: none; }
@media (max-width: 640px) { .msg { max-width: 100%; } }

.queue-strip { display: flex; flex-wrap: wrap; gap: 10px; }
.queue-chip { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-soft-ink); font-size: 13.5px; border: 1px solid transparent; }
.queue-chip:hover { text-decoration: none; border-color: var(--brand); }
.queue-chip.warn { background: var(--warning-soft); color: var(--warning); }
.queue-chip .icon { width: 17px; height: 17px; }
.report-list { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); display: grid; gap: 8px; font-size: 13.5px; }

/* ---------- Phase 4: Bot API ---------- */
.bot-hero { padding: 26px 28px; border-radius: var(--radius); background: color-mix(in srgb, var(--brand) 9%, var(--surface)); border: 1px solid color-mix(in srgb, var(--brand) 22%, transparent); }
.steps-list { margin: 0; padding-left: 20px; display: grid; gap: 10px; font-size: 13.5px; color: var(--text-2); }
.steps-list li::marker { color: var(--brand); font-weight: 700; }
.fund-balance .stat-value { font-size: 32px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; padding: 16px 20px; max-height: 460px; overflow-y: auto; }
.pick { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; min-width: 0; }
.pick:hover { border-color: var(--border-strong); }
.pick:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.pick input { width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.pick .ficon { width: 44px; height: 44px; border-radius: 10px; flex: none; }
.pick .file-name { display: block; max-width: 100%; }
input[type=range] { accent-color: var(--brand); }

/* Icon badge on share/download cards (outside .empty) */
.share-card .empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-soft-ink); }
.share-card .empty-icon .icon { width: 26px; height: 26px; }

/* Landing: store badge, APK link, app card */
.lp-hero .btn-light, .lp-hero .btn-light:hover { color: #581c87; }
.store-btn { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px 0 14px; border-radius: 12px; background: #000; color: #fff; border: 1px solid rgba(255,255,255,.35); cursor: pointer; font: inherit; text-align: left; }
.store-btn:hover { background: #111; }
.store-btn small { display: block; font-size: 10px; letter-spacing: .06em; opacity: .85; line-height: 1.1; }
.store-btn b { display: block; font-size: 18px; font-weight: 600; line-height: 1.1; }
.lp-apk { color: rgba(255,255,255,.9); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; text-decoration: underline; text-underline-offset: 3px; }
.lp-apk:hover { color: #fff; }
.lp-app-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: 28px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.lp-step .num .icon { width: 18px; height: 18px; }

/* =====================================================
   Landing page v2 (lx-)
   ===================================================== */
body.lx { background: var(--bg); }
.lx-hero { position: relative; overflow: hidden; color: #fff; background: radial-gradient(1200px 600px at 85% -10%, #a855f7 0%, transparent 60%), linear-gradient(160deg, #2e1065 0%, #4c1d95 38%, #7e22ce 100%); }
.lx-glow { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; pointer-events: none; }
.lx-glow.a { width: 420px; height: 420px; background: #c084fc; left: -120px; bottom: -160px; }
.lx-glow.b { width: 320px; height: 320px; background: #f5b70a; right: 8%; bottom: -200px; opacity: .25; }
.lx-nav { position: relative; z-index: 2; display: flex; align-items: center; gap: 24px; max-width: 1180px; margin: 0 auto; padding: 18px 20px; }
.lx-brand { display: inline-flex; align-items: center; gap: 10px; font: 700 22px var(--font-head); color: #fff; }
.lx-brand:hover { text-decoration: none; color: #fff; }
.lx-brand.dark { color: var(--text); font-size: 18px; }
.lx-links { display: flex; gap: 22px; margin-left: 18px; flex: 1; }
.lx-links a { color: rgba(255, 255, 255, .82); font-size: 14.5px; font-weight: 500; }
.lx-links a:hover { color: #fff; text-decoration: none; }
.lx-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px; font-weight: 600; font-size: 14.5px; border: 1px solid transparent; cursor: pointer; white-space: nowrap; transition: transform .15s, background .15s; }
.lx-btn:hover { text-decoration: none; transform: translateY(-1px); }
.lx-btn.lg { height: 52px; padding: 0 22px; font-size: 15.5px; border-radius: 14px; }
.lx-btn .icon { width: 18px; height: 18px; }
.lx-btn.white { background: #fff; color: #4c1d95; }
.lx-btn.white:hover { color: #4c1d95; background: #f5f0ff; }
.lx-btn.ghost { color: #fff; }
.lx-btn.ghost:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.lx-btn.outline { color: #fff; border-color: rgba(255, 255, 255, .45); }
.lx-btn.outline:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.lx-btn.primary { background: var(--brand); color: #fff; box-shadow: 0 12px 28px -12px rgba(147, 51, 234, .7); }
.lx-btn.primary:hover { background: var(--brand-hover); color: #fff; }

.lx-hero-in { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; padding: 48px 20px 110px; display: grid; grid-template-columns: 1.08fr .92fr; gap: 40px; align-items: center; }
.lx-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); font-size: 12.5px; font-weight: 600; margin-bottom: 20px; }
.lx-hero h1 { font: 800 56px/1.04 var(--font-head); letter-spacing: -.035em; margin: 0 0 18px; color: #fff; }
.lx-hero h1 span { background: linear-gradient(90deg, #fde68a, #f5b70a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lx-lead { font-size: 18.5px; line-height: 1.55; color: rgba(255, 255, 255, .88); max-width: 540px; margin: 0 0 28px; }
.lx-lead b { color: #fff; }
.lx-ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.lx-apps { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 22px; }
.lx-store { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 18px 0 14px; border-radius: 12px; background: #000; color: #fff; border: 1px solid rgba(255, 255, 255, .3); cursor: pointer; font: inherit; text-align: left; transition: transform .15s; }
.lx-store:hover { transform: translateY(-1px); }
.lx-store small { display: block; font-size: 10px; letter-spacing: .06em; opacity: .85; line-height: 1.1; }
.lx-store b { display: block; font-size: 18px; font-weight: 600; line-height: 1.15; }
.lx-store.light { border-color: rgba(255, 255, 255, .5); }
.lx-apk { color: rgba(255, 255, 255, .88); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; text-decoration: underline; text-underline-offset: 3px; }
.lx-apk:hover { color: #fff; }
.lx-trust { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 13.5px; color: rgba(255, 255, 255, .85); }
.lx-trust li { display: inline-flex; align-items: center; gap: 6px; }
.lx-trust .icon { color: #86efac; }

/* phone mock-up */
.lx-phone-wrap { position: relative; display: flex; justify-content: center; padding: 20px 0; }
.lx-phone { position: relative; width: 290px; height: 580px; border-radius: 44px; background: #0b0814; padding: 12px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .7), 0 0 0 2px rgba(255, 255, 255, .12) inset; transform: rotate(-3deg); }
.lx-notch { position: absolute; top: 18px; left: 50%; width: 92px; height: 24px; margin-left: -46px; background: #0b0814; border-radius: 14px; z-index: 2; }
.lx-screen { height: 100%; border-radius: 34px; background: #14101f; overflow: hidden; padding: 50px 14px 14px; display: flex; flex-direction: column; gap: 10px; color: #ece9f8; }
.lx-app-top { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 4px; }
.lx-mini-logo { width: 26px; height: 26px; border-radius: 8px; background: linear-gradient(135deg, #7e22ce, #a855f7); display: grid; place-items: center; font: 800 14px var(--font-head); color: #fff; }
.lx-coin-card { display: flex; gap: 10px; align-items: center; padding: 14px; border-radius: 16px; background: linear-gradient(135deg, #7e22ce, #a855f7); }
.lx-coin-card b { display: block; font-size: 14px; }
.lx-coin-card small { font-size: 11px; opacity: .85; }
.lx-coin { width: 32px; height: 32px; border-radius: 50%; background: #f5b70a; color: #6b4600; display: grid; place-items: center; font-weight: 800; flex: none; }
.lx-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: #1d1929; border: 1px solid #2a2540; }
.lx-item b { display: block; font-size: 12.5px; }
.lx-item small { font-size: 10.5px; color: #b3aecb; }
.lx-item > div { flex: 1; min-width: 0; }
.lx-thumb { width: 42px; height: 42px; border-radius: 10px; background: linear-gradient(135deg, #0ea5e9, #6366f1); flex: none; }
.lx-thumb.b { background: linear-gradient(135deg, #f97316, #ef4444); }
.lx-chip { font-size: 10.5px; font-weight: 700; padding: 4px 8px; border-radius: 999px; background: #262136; color: #b3aecb; white-space: nowrap; }
.lx-chip.gold { background: rgba(245, 183, 10, .18); color: #fbbf24; }
.lx-code { margin-top: auto; text-align: center; padding: 14px; border-radius: 16px; background: #1d1929; border: 1px dashed #4c3a7a; }
.lx-code small { display: block; font-size: 11px; color: #b3aecb; }
.lx-code b { display: block; font: 800 24px var(--font-head); letter-spacing: 3px; color: #f5b70a; margin: 2px 0 10px; }
.lx-code span { display: block; padding: 9px; border-radius: 10px; background: #9333ea; font-size: 12px; font-weight: 600; }
.lx-float { position: absolute; z-index: 3; display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: rgba(255, 255, 255, .96); color: #1b1830; font-size: 13px; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .5); white-space: nowrap; }
.lx-float.one { top: 70px; left: -10px; }
.lx-float.two { bottom: 64px; right: -6px; }
.lx-float .icon { color: #229ed9; width: 15px; height: 15px; }
.lx-dot { width: 9px; height: 9px; border-radius: 50%; }
.lx-dot.green { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .2); }

/* facts strip */
.lx-facts { position: relative; z-index: 3; max-width: 1080px; margin: -46px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); }
.lx-facts > div { padding: 22px 20px; text-align: center; border-right: 1px solid var(--border); }
.lx-facts > div:last-child { border-right: 0; }
.lx-facts b { display: block; font: 800 24px var(--font-head); color: var(--brand); }
.lx-facts span { font-size: 13px; color: var(--text-2); }

/* sections */
.lx-sec { max-width: 1180px; margin: 0 auto; padding: 84px 20px; }
.lx-kicker { display: block; text-align: center; color: var(--brand); font-weight: 700; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 10px; }
.lx-split .lx-kicker { text-align: left; }
.lx-sec h2 { font: 800 36px/1.15 var(--font-head); letter-spacing: -.02em; text-align: center; margin: 0 0 12px; }
.lx-sub { text-align: center; color: var(--text-2); max-width: 620px; margin: 0 auto 44px; font-size: 16.5px; line-height: 1.55; }
.lx-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lx-step { position: relative; padding: 28px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); }
.lx-step h3 { margin: 16px 0 6px; font-size: 18px; }
.lx-step p, .lx-feat p { margin: 0; color: var(--text-2); font-size: 14.5px; line-height: 1.55; }
.lx-n { position: absolute; top: 22px; right: 24px; font: 800 44px var(--font-head); color: var(--surface-3); line-height: 1; }
.lx-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-soft-ink); }
.lx-ic .icon { width: 22px; height: 22px; }

.lx-split { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; }
.lx-list { list-style: none; counter-reset: s; padding: 0; margin: 0 0 28px; display: grid; gap: 16px; }
.lx-list li { counter-increment: s; position: relative; padding-left: 46px; color: var(--text-2); line-height: 1.55; }
.lx-list li b { color: var(--text); }
.lx-list li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 32px; height: 32px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-soft-ink); font-weight: 800; display: grid; place-items: center; }

/* telegram chat mock-up */
.lx-chat { border-radius: 24px; padding: 18px; background: linear-gradient(180deg, #17212b, #0e1621); box-shadow: var(--shadow-lg); color: #e9eef3; display: flex; flex-direction: column; gap: 10px; }
.lx-chat-top { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.lx-chat-top b { display: block; font-size: 14.5px; }
.lx-chat-top small { color: #7f91a4; font-size: 12px; }
.lx-avatar { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #22d3ee, #6366f1); display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.lx-msg { max-width: 84%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.45; }
.lx-msg small { color: #9fb0c0; }
.lx-msg.in { align-self: flex-start; background: #182533; border-top-left-radius: 4px; }
.lx-msg.out { align-self: flex-end; background: #2b5278; border-top-right-radius: 4px; font: 700 15px var(--font); letter-spacing: 1px; }
.lx-kb { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; max-width: 84%; }
.lx-kb span { padding: 9px; border-radius: 10px; background: rgba(43, 82, 120, .55); text-align: center; font-size: 12.5px; font-weight: 600; }
.lx-kb span:first-child { grid-column: 1 / -1; }

.lx-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 40px; }
.lx-feat { padding: 24px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); transition: border-color .15s, transform .15s; }
.lx-feat:hover { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); transform: translateY(-2px); }
.lx-feat h3 { margin: 14px 0 6px; font-size: 16.5px; }

.lx-band { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; padding: 40px; border-radius: 26px; color: #fff; background: radial-gradient(600px 300px at 100% 0, #c084fc, transparent 60%), linear-gradient(135deg, #4c1d95, #7e22ce); box-shadow: 0 30px 60px -30px rgba(126, 34, 206, .7); }
.lx-band h2 { text-align: left; color: #fff; margin-bottom: 8px; }
.lx-band p { margin: 0; color: rgba(255, 255, 255, .86); max-width: 520px; }
.lx-band-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

.lx-faq .faq { max-width: 760px; margin: 36px auto 0; }
.lx-foot { border-top: 1px solid var(--border); }
.lx-foot-in { max-width: 1180px; margin: 0 auto; padding: 28px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13.5px; }
.lx-foot nav { display: flex; gap: 18px; flex-wrap: wrap; }
.lx-foot nav a { color: var(--text-2); }
.lx-modal-ic { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-soft-ink); }
.lx-modal-ic .icon { width: 26px; height: 26px; }

@media (max-width: 980px) {
  .lx-hero-in { grid-template-columns: 1fr; padding: 28px 20px 96px; }
  .lx-phone-wrap { display: none; }
  .lx-links { display: none; }
  .lx-hero h1 { font-size: 40px; }
  .lx-split { grid-template-columns: 1fr; gap: 32px; }
  .lx-feats, .lx-steps { grid-template-columns: 1fr 1fr; }
  .lx-facts { grid-template-columns: 1fr 1fr; margin: -40px 16px 0; }
  .lx-facts > div:nth-child(2) { border-right: 0; }
  .lx-facts > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
}
@media (max-width: 640px) {
  .lx-nav { padding: 14px 16px; }
  .lx-hero h1 { font-size: 34px; }
  .lx-lead { font-size: 16px; }
  .lx-feats, .lx-steps { grid-template-columns: 1fr; }
  .lx-sec { padding: 60px 16px; }
  .lx-sec h2 { font-size: 28px; }
  .lx-band { padding: 26px 20px; }
  .lx-btn.lg { width: 100%; }
  .lx-ctas { flex-direction: column; }
}

/* landing v2 tweaks */
.lx-float.one { top: 26px; left: -54px; }
.lx-kb span:nth-child(2) { grid-column: 1 / -1; }
.lx-hero-in { grid-template-columns: 1.15fr .85fr; }
.lx-hero h1 { font-size: 52px; }
@media (max-width: 980px) { .lx-hero-in { grid-template-columns: 1fr; } .lx-hero h1 { font-size: 40px; } }
@media (max-width: 640px) { .lx-hero h1 { font-size: 34px; } }
