/* VaultBTC — Dark / Light theme */
:root, [data-theme="dark"] {
  --bg: #0b0f19;
  --bg-card: #111827;
  --bg-elevated: #1a2234;
  --border: rgba(255,255,255,0.08);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #0ea5e9;
  --primary-hover: #0284c7;
  --green: #34d399;
  --red: #f87171;
  --radius: 14px;
  --shadow: 0 8px 32px rgba(0,0,0,0.35);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

[data-theme="light"] {
  --bg: #f1f5f9;
  --bg-card: #ffffff;
  --bg-elevated: #e2e8f0;
  --border: rgba(15,23,42,0.1);
  --text: #0f172a;
  --text-muted: #64748b;
  --primary: #0284c7;
  --primary-hover: #0369a1;
  --green: #059669;
  --red: #dc2626;
  --shadow: 0 8px 24px rgba(15,23,42,0.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.gap { gap: 1rem; }
.section { margin-top: 1.5rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; flex-wrap: wrap; gap: 0.5rem; }
.mb { margin-bottom: 0.75rem; }
.mt { margin-top: 0.75rem; }
.muted { color: var(--text-muted); font-size: 0.875rem; }
.tiny { font-size: 0.7rem; }
.center { text-align: center; }
.right { text-align: right; }
.cap { text-transform: capitalize; }
.text-green { color: var(--green); }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg-card) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1100px; margin: 0 auto; padding: 0 1rem;
  height: 56px; display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--text); text-decoration: none; }
.topbar-right { display: flex; align-items: center; gap: 0.75rem; }
.user-chip { font-size: 0.875rem; color: var(--text-muted); }

.logo-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.25rem;
}
.logo-icon.sm { width: 32px; height: 32px; font-size: 1rem; }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; }
.balance-row { display: flex; align-items: baseline; gap: 0.4rem; margin-top: 0.35rem; }
.btc-amount { font-size: 1.85rem; font-weight: 800; letter-spacing: -0.02em; }
.btc-unit { color: var(--primary); font-weight: 700; }
.usd-equiv { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.15rem; }
.price-chip { margin-top: 0.75rem; display: flex; align-items: center; gap: 0.5rem; font-size: 0.8rem; color: var(--text-muted); }
.price-chip strong { color: var(--text); }
.change.up { color: var(--green); }
.change.down { color: var(--red); }
.actions { margin-top: 1.1rem; display: flex; flex-wrap: wrap; gap: 0.5rem; }

.stats-card .stat {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.65rem 0; border-bottom: 1px solid var(--border); font-size: 0.9rem;
}
.stats-card .stat:last-child { border-bottom: none; }
.stats-card .stat span { color: var(--text-muted); }

/* Plans */
.plan-roi { font-size: 2rem; font-weight: 800; margin: 0.25rem 0; }
.plan-roi span { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }
.plan ul { list-style: none; margin: 0.75rem 0 1rem; font-size: 0.875rem; color: var(--text-muted); }
.plan ul li::before { content: "✓ "; color: var(--primary); }
.plan-title { font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem; }
.badge { font-size: 0.65rem; padding: 0.15rem 0.45rem; border-radius: 999px; background: var(--bg-elevated); color: var(--text-muted); font-weight: 600; }
.plan-bronze { border-color: #a67c52; }
.plan-silver { border-color: #9ca3af; }
.plan-gold { border-color: #d4a017; }

/* Grid */
.grid { display: grid; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-chart { grid-template-columns: 1fr; }
@media (min-width: 768px) {
  .grid-2 { grid-template-columns: 1.6fr 1fr; }
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-chart { grid-template-columns: 1.7fr 1fr; }
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.6rem 1.1rem; border-radius: 10px; font-size: 0.875rem; font-weight: 600;
  border: none; cursor: pointer; transition: background 0.15s, color 0.15s;
  font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg-elevated); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--text); background: var(--bg-elevated); }
.btn-sm { padding: 0.35rem 0.7rem; font-size: 0.8rem; }
.btn-block { width: 100%; }

/* Chart */
.chart-wrap { height: 260px; position: relative; }
.range-btns { display: flex; gap: 0.25rem; }
.range-btn {
  padding: 0.3rem 0.6rem; border-radius: 8px; border: none; cursor: pointer;
  font-size: 0.75rem; font-weight: 600; background: transparent; color: var(--text-muted); font-family: inherit;
}
.range-btn.active, .range-btn:hover { background: color-mix(in srgb, var(--primary) 20%, transparent); color: var(--primary); }

/* Signals */
.signals { display: flex; flex-direction: column; gap: 0.5rem; max-height: 280px; overflow-y: auto; }
.signal {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.65rem 0.85rem; border-radius: 10px; border: 1px solid var(--border); font-size: 0.875rem;
}
.signal-buy { background: color-mix(in srgb, var(--green) 12%, transparent); color: var(--green); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.signal-sell { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.signal-hold { background: var(--bg-elevated); color: var(--text-muted); }

/* Table */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th {
  text-align: left; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--text-muted); padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); font-weight: 600;
}
.table td { padding: 0.7rem 0.6rem; border-bottom: 1px solid var(--border); }
.status {
  display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
}
.status-completed { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); }
.status-active { background: color-mix(in srgb, var(--primary) 15%, transparent); color: var(--primary); }
.status-pending { background: color-mix(in srgb, #f59e0b 15%, transparent); color: #f59e0b; }
.status-failed { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }

/* Auth */
.auth-body { display: flex; flex-direction: column; min-height: 100vh; }
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.auth-card {
  width: 100%; max-width: 400px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow);
}
.auth-logo { text-align: center; margin-bottom: 1.5rem; }
.auth-logo h1 { font-size: 1.5rem; margin-top: 0.5rem; }
.auth-logo p { color: var(--text-muted); font-size: 0.875rem; }
.auth-form label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin: 0.75rem 0 0.3rem; }
.auth-form input {
  width: 100%; padding: 0.7rem 0.9rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text); font-size: 0.9rem; font-family: inherit;
}
.auth-form input:focus { outline: 2px solid color-mix(in srgb, var(--primary) 50%, transparent); border-color: var(--primary); }
.auth-form .btn { margin-top: 1.25rem; }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: 0.85rem; color: var(--text-muted); }

/* Alerts */
.alert { padding: 0.75rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-size: 0.875rem; }
.alert-error { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); }
.alert-success { background: color-mix(in srgb, var(--green) 15%, transparent); color: var(--green); border: 1px solid color-mix(in srgb, var(--green) 30%, transparent); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  z-index: 50; display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  width: 100%; max-width: 400px; padding: 1.25rem; box-shadow: var(--shadow);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.modal-close { background: none; border: none; font-size: 1.5rem; color: var(--text-muted); cursor: pointer; line-height: 1; }
.modal label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); margin: 0.6rem 0 0.25rem; }
.modal input {
  width: 100%; padding: 0.65rem 0.85rem; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text); font-size: 0.9rem; font-family: inherit;
}

/* Toast */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 60;
  padding: 0.75rem 1.1rem; border-radius: 10px; font-size: 0.875rem; font-weight: 600;
  box-shadow: var(--shadow); max-width: 320px;
}
.toast.hidden { display: none; }
.toast.success { background: var(--green); color: #fff; }
.toast.error { background: var(--red); color: #fff; }

/* Theme toggle */
.theme-toggle {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg-elevated); color: var(--text); cursor: pointer; font-size: 1rem;
  display: inline-flex; align-items: center; justify-content: center;
}
.theme-toggle:hover { border-color: var(--primary); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border); padding: 1.25rem 1rem; text-align: center;
  color: var(--text-muted); font-size: 0.8rem;
}
.auth-site-footer { margin-top: auto; }


/* Balance head + refresh */
.balance-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.btn-refresh {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s, transform 0.15s;
  flex-shrink: 0;
}
.btn-refresh:hover {
  color: var(--primary);
  border-color: var(--primary);
}
.btn-refresh.spinning .icon-refresh {
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.icon-refresh { display: block; }

/* Live indicators */
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5);
  animation: pulse-dot 1.6s ease infinite;
  display: inline-block;
  margin-left: 0.25rem;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}
.live-badge {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: color-mix(in srgb, var(--green) 18%, transparent);
  color: var(--green);
  vertical-align: middle;
  margin-left: 0.35rem;
}
.mb-0 { margin-bottom: 0; }
.price-chip { flex-wrap: wrap; }


/* ========== App shell + Sidebar ========== */
.app-body {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 45;
  transition: transform 0.25s ease;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item:hover {
  background: var(--bg-elevated);
  color: var(--text);
  text-decoration: none;
}
.nav-item.active {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--primary);
}
.nav-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.sidebar-footer {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--border);
}
.app-main {
  flex: 1;
  margin-left: 220px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.topbar-left .page-title {
  font-weight: 700;
  font-size: 1.05rem;
}
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 50;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 40;
}
.sidebar-backdrop.show { display: block; }

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .app-main {
    margin-left: 0;
  }
  .sidebar-toggle {
    display: inline-flex;
  }
  .topbar-inner {
    padding-left: 3.25rem;
  }
  .sidebar-brand-text { font-size: 0.95rem; }
}

/* Explore / search */
.search-input, .select-input {
  padding: 0.5rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  min-width: 160px;
}
.search-input { min-width: 180px; max-width: 100%; }
.coin-cell {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.coin-cell img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
}
.coin-sym {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}
.hide-sm { }
@media (max-width: 700px) {
  .hide-sm { display: none; }
}

/* Settings */
.settings-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 768px) {
  .settings-layout {
    grid-template-columns: 1fr;
  }
  .settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    padding: 0.65rem !important;
  }
  .settings-tab {
    flex: 1 1 auto;
    text-align: center;
    padding: 0.55rem 0.6rem !important;
    font-size: 0.8rem;
  }
}
.settings-tabs {
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.settings-tab {
  display: block;
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
}
.settings-tab:hover { background: var(--bg-elevated); color: var(--text); text-decoration: none; }
.settings-tab.active {
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--primary);
}
.settings-form label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0.75rem 0 0.3rem;
}
.settings-form input, .settings-form select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
}
.avatar-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-initials {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}
.session-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border);
}
.filter-form { display: flex; gap: 0.5rem; }


/* Payouts ticker — 3 rows visible, slide up */
.payouts-card { overflow: hidden; }
.payouts-viewport {
  height: 7.5rem; /* ~3 rows */
  overflow: hidden;
  position: relative;
  margin-top: 0.25rem;
}
.payouts-track {
  display: flex;
  flex-direction: column;
  transition: transform 0.55s ease;
}
.payout-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  height: 2.5rem;
  padding: 0 0.15rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  flex-shrink: 0;
  animation: payoutPop 0.45s ease;
}
.payout-row:last-child { border-bottom: none; }
.payout-user { font-weight: 600; }
.payout-amt { color: var(--green); font-weight: 600; font-variant-numeric: tabular-nums; }
.payout-meta { color: var(--text-muted); font-size: 0.75rem; }
@keyframes payoutPop {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Dashboard left-bottom popup */
.dash-popup {
  position: fixed;
  left: 1.25rem;
  bottom: 1.25rem;
  z-index: 55;
  max-width: 300px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  transform: translateX(-120%);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
}
.dash-popup.show {
  transform: translateX(0);
  opacity: 1;
}
.dash-popup.hide {
  transform: translateX(-120%);
  opacity: 0;
}
.dash-popup-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  flex-shrink: 0;
}
.dash-popup-body { font-size: 0.85rem; line-height: 1.4; }
.dash-popup-body strong { display: block; margin-bottom: 0.15rem; }
.dash-popup-body span { color: var(--text-muted); font-size: 0.8rem; }
@media (max-width: 900px) {
  .dash-popup { left: 0.75rem; bottom: 0.75rem; max-width: calc(100vw - 1.5rem); }
}


/* Header profile avatar */
.user-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: inherit;
}
.user-profile-link:hover { text-decoration: none; }
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.user-avatar-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--primary) 22%, transparent);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
}


/* Live chat widget — bottom right, minimized */
.chat-widget {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 58;
  font-family: inherit;
}
.chat-fab {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.75rem 1.1rem;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.35);
  font-family: inherit;
  transition: transform 0.15s, box-shadow 0.15s;
}
.chat-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(14, 165, 233, 0.45); }
.chat-fab-label { line-height: 1; }
.chat-panel {
  display: none;
  width: 320px;
  max-width: calc(100vw - 2rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 0.5rem;
  animation: chatIn 0.25s ease;
}
.chat-widget.open .chat-panel { display: block; }
.chat-widget.open .chat-fab { display: none; }
@keyframes chatIn {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.chat-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--primary) 10%, var(--bg-card));
}
.chat-panel-head strong { font-size: 0.95rem; }
.chat-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 0.2rem;
}
.chat-panel-body {
  padding: 0.9rem 1rem 1.1rem;
}
.chat-panel-body label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0.55rem 0 0.25rem;
}
.chat-panel-body input,
.chat-panel-body textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  resize: vertical;
}
.chat-panel-body.hidden { display: none; }
@media (max-width: 480px) {
  .chat-widget { right: 0.75rem; bottom: 0.75rem; }
  .chat-panel { width: calc(100vw - 1.5rem); }
}


/* Deposit QR modal */
.deposit-qr-box {
  text-align: center;
  padding: 0.25rem 0 0.5rem;
}
.deposit-qr-frame {
  position: relative;
  display: inline-block;
  background: #fff;
  border-radius: 16px;
  padding: 1rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 0.85rem;
}
.deposit-qr-img {
  display: block;
  width: 220px;
  height: 220px;
  border-radius: 8px;
}
.deposit-qr-refresh {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.08);
  background: #f8fafc;
  color: #64748b;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.deposit-qr-refresh:hover { color: #0ea5e9; border-color: #0ea5e9; }
.deposit-addr-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}
.deposit-addr-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.deposit-addr {
  font-size: 0.8rem;
  word-break: break-all;
  max-width: 260px;
  color: var(--text);
  background: var(--bg-elevated);
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.deposit-copy-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.deposit-copy-btn:hover { border-color: var(--primary); }


/* Bitcoin logo center on deposit QR */
.deposit-btc-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #f7931a;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(247, 147, 26, 0.45);
  border: 3px solid #fff;
  pointer-events: none;
  z-index: 2;
}
.deposit-btc-logo span {
  color: #fff;
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1;
  font-family: system-ui, -apple-system, sans-serif;
}


/* Auth extras — register */
.auth-back {
  display: inline-block;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
}
.auth-back:hover { color: var(--primary); }
.auth-form .req { color: #f87171; }
.auth-form .field-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin: 0.25rem 0 0;
  line-height: 1.35;
}
.auth-form .referral-input {
  letter-spacing: 0.12em;
  font-weight: 700;
  text-transform: uppercase;
  font-family: ui-monospace, monospace;
}


/* Withdrawal frozen notice */
.freeze-notice { text-align: center; }
.freeze-icons {
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  margin-bottom: 0.75rem; position: relative; min-height: 64px;
}
.spin-coin {
  display: inline-flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(145deg, #f7931a, #e67e00); color: #fff;
  font-size: 1.75rem; font-weight: 800;
  animation: spinCoin 1.2s linear infinite;
  box-shadow: 0 0 0 4px rgba(247,147,26,0.25);
}
@keyframes spinCoin {
  to { transform: rotate(360deg); }
}
.stop-hand {
  font-size: 2.5rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  color: #ef4444;
}
.freeze-title {
  font-weight: 800; font-size: 1.05rem; color: #f87171; text-align: center;
}


/* Live chat thread */
.chat-thread {
  max-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  padding: 0.35rem 0;
}
.chat-bubble {
  max-width: 92%;
  padding: 0.45rem 0.65rem;
  border-radius: 12px;
  font-size: 0.82rem;
  line-height: 1.4;
}
.chat-bubble.mine {
  align-self: flex-end;
  background: color-mix(in srgb, var(--primary, #0ea5e9) 25%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary, #0ea5e9) 35%, transparent);
}
.chat-bubble.theirs {
  align-self: flex-start;
  background: var(--bg-elevated, rgba(255,255,255,0.06));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
}
.chat-bubble-meta {
  font-size: 0.65rem;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 0.15rem;
  font-weight: 600;
}
.chat-compose textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border, rgba(255,255,255,0.1));
  background: var(--bg, #0b1220);
  color: inherit;
  padding: 0.5rem;
  font-family: inherit;
  font-size: 0.85rem;
  resize: vertical;
}
.freeze-warn { display: inline-flex; }
.stop-hand { display: none !important; }


/* User notification bell */
.user-notif-wrap { position: relative; }
.user-notif-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.user-notif-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
  background: #ef4444; color: #fff; font-size: 0.65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.user-notif-badge.hidden { display: none; }
.user-notif-drop {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: min(320px, 92vw); max-height: 360px; overflow: auto;
  background: var(--card, #151c2c); border: 1px solid var(--border, rgba(255,255,255,0.1));
  border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,0.35); z-index: 80;
}
.user-notif-drop.hidden { display: none; }
.user-notif-h { padding: 0.65rem 0.85rem; font-weight: 700; font-size: 0.85rem; border-bottom: 1px solid var(--border, rgba(255,255,255,0.08)); }
.user-notif-item {
  display: block; padding: 0.65rem 0.85rem; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.06)); font-size: 0.8rem;
}
.user-notif-item:hover { background: rgba(255,255,255,0.04); }
.user-notif-item strong { display: block; font-size: 0.82rem; margin-bottom: 0.15rem; }
.user-notif-item span { color: var(--text-muted, #94a3b8); font-size: 0.75rem; }


/* Auth wait spinner (login approval) */
.auth-spinner {
  width: 42px; height: 42px; margin: 0 auto;
  border: 3px solid rgba(14,165,233,0.2);
  border-top-color: #0ea5e9;
  border-radius: 50%;
  animation: authSpin 0.8s linear infinite;
}
@keyframes authSpin { to { transform: rotate(360deg); } }
.auth-card .hidden { display: none !important; }


/* Mobile: notification panel stays on-screen */
@media (max-width: 700px) {
  .user-notif-drop {
    position: fixed !important;
    left: 50% !important;
    right: auto !important;
    top: 56px !important;
    transform: translateX(-50%);
    width: min(340px, calc(100vw - 1.25rem)) !important;
    max-height: min(65vh, 420px);
    z-index: 200;
  }
  .user-notif-wrap { position: static; }
}
