/* ==========================================================================
   Sharkville Mastery — Core Stylesheet
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600;700&display=swap');

:root {
  /* Sharkville — "Deep-Water Terminal" theme
     Abyss/Trench/Current = background depth scale, evokes descending water.
     Muted Blue = primary accent. Soft Gold = premium/VIP only.
     Soft Green / Soft Red = profit / loss only. Low-glare, eye-friendly palette. */
  --bg: #0F1623;
  --bg-elevated: #121A29;
  --surface: #161F30;
  --surface-2: #1C2740;
  --border: rgba(228, 233, 242, 0.08);
  --border-strong: rgba(228, 233, 242, 0.16);

  --text: #E4E9F2;
  --text-muted: #9FABC1;
  --text-faint: #7F8CA6;

  --blue: #4A7BD8;
  --blue-dark: #3A66BD;
  --blue-light: #6B93E6;
  --gold: #D9A441;
  --green: #3DB88A;
  --red: #E06A6A;
  --violet: #b388ff;

  --grad-blue: linear-gradient(135deg, #4A7BD8 0%, #3A66BD 100%);

  --font-display: 'Space Grotesk', 'Inter', -apple-system, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 4px 14px rgba(0, 0, 0, 0.25);

  --sidebar-w: 260px;
  --topbar-h: 76px;

  color-scheme: dark;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}
* {
  -webkit-tap-highlight-color: transparent;
}

/* ---------------- Professional scrollbars (site-wide) ---------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(107, 147, 230, .35) rgba(255, 255, 255, .04);
}
*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
*::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .03);
  border-radius: 10px;
}
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(107, 147, 230, .45), rgba(15, 184, 154, .45));
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(107, 147, 230, .7), rgba(15, 184, 154, .7));
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background 0.25s ease, color 0.25s ease;
}

/* GPU warm-up for backdrop-filter: the browser compiles/allocates the
   blur filter the first time ANY element uses backdrop-filter on the
   page, which is a one-off cost that stutters whichever modal happens
   to open first (coin picker, network picker, receipt modal, etc. all
   use backdrop-filter: blur(8px) for their overlays). This 1x1,
   effectively-invisible, non-interactive element forces that cost to
   happen at page load instead of on the user's first tap.
   opacity is 0.01, not 0, and z-index is a high positive value rather
   than -1: fully-transparent / fully-behind-content elements are prime
   targets for browser paint-skipping optimizations, which would make
   this silently do nothing. This keeps it technically paintable while
   still imperceptible at 1x1px in a page corner. */
body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 1px;
  height: 1px;
  opacity: 0.01;
  pointer-events: none;
  z-index: 9999;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

h1, h2, h3, h4, h5, h6,
.sv-hero-title, .sv-h2, .sv-h3, .hero-title, .section-title, .page-title {
  font-family: var(--font-display);
  letter-spacing: -0.01em;
}

.price, .signal-price, .watchlist-price, .chart-price-block, .sv-price-amt,
.sv-terminal-price, .balance-card-slim-value, .mobile-balance-card,
.info-value, .progress-value, .wallet-note-min-value, .withdraw-amount-field,
.withdraw-amount-prefix, .market-ticker, .ticker-content, .amount-value,
.data-value, .stat-value {
  font-family: var(--font-mono);
  font-feature-settings: 'tnum' 1;
}

/* ---------------- Signature: sonar ping (live-status indicator) ---------------- */
.sonar-ping { position: relative; display: inline-flex; width: 8px; height: 8px; }
.sonar-ping::before, .sonar-ping::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: var(--blue);
}
.sonar-ping::before {
  animation: sonar-pulse 1.8s cubic-bezier(.4,0,.6,1) infinite;
}
@keyframes sonar-pulse {
  0% { transform: scale(1); opacity: .55; }
  100% { transform: scale(3.2); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sonar-ping::before { animation: none; }
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--blue-light);
  outline-offset: 2px;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color .15s ease;
  white-space: nowrap;
}
/* .btn's own display:inline-flex beats the browser's built-in
   [hidden]{display:none} rule on a specificity tie (author styles always
   win over the user-agent stylesheet regardless of specificity), so any
   .btn given the `hidden` attribute stayed visibly on-screen. Same fix as
   admin.css's .trade-form[hidden] / .chat-reply-actions .btn[hidden]. */
.btn[hidden] { display: none !important; }
.btn:hover { transform: translateY(-1px); }
.btn:disabled,
.btn.is-submitting {
  opacity: .65;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}
.btn-primary {
  background: var(--grad-blue);
  color: #FFFFFF;
  box-shadow: 0 8px 20px rgba(74, 123, 216, 0.3);
}
.btn-primary:hover { box-shadow: 0 10px 26px rgba(74, 123, 216, 0.4); }
.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--blue-light); }
.btn-social {
  background: var(--surface-2);
  border-color: var(--border);
  color: var(--text);
  width: 100%;
}
.btn-social:hover { border-color: var(--border-strong); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }

/* ---------------- Circular plus-icon badge (Add Funds, Buy Stock, etc.) ---------------- */
.btn-icon-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  flex-shrink: 0;
}
.btn-icon-circle svg { display: block; }
.btn-outline .btn-icon-circle,
.btn-social .btn-icon-circle {
  background: rgba(255, 255, 255, .08);
  color: var(--blue-light);
}

/* ---------------- Button click (press) animation ---------------- */
.btn, .icon-btn, .dash-menu-btn, .drawer-close, .notification-drawer-close,
.notification-delete-btn, .toggle-visibility, .notification-confirm-no,
.notification-confirm-yes, .logout-confirm-no, .logout-confirm-yes,
.stock-buy-modal-close, .action-stat-card, .mobile-user-avatar {
  will-change: transform;
}
@keyframes btnClickPop {
  0%   { transform: scale(1); }
  30%  { transform: scale(0.88); }
  65%  { transform: scale(1.1); }
  100% { transform: scale(1); }
}
.btn-clicked {
  animation: btnClickPop 0.45s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes navClickPop {
  0%   { transform: scale(1); }
  30%  { transform: scale(0.95); }
  65%  { transform: scale(1.035); }
  100% { transform: scale(1); }
}
.side-nav a, .mobile-bottom-nav a {
  transform-origin: center;
  will-change: transform;
}
.nav-clicked {
  animation: navClickPop 0.45s cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------------- Page loader ---------------- */
.page-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: radial-gradient(120% 120% at 50% 42%, #0b1a2c 0%, #0F1623 62%, #04070c 100%);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.page-loader.page-loader-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.page-loader-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 420px;
  height: 420px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(74, 123, 216, .22) 0%, rgba(74, 123, 216, 0) 70%);
  filter: blur(6px);
  animation: pageLoaderGlow 3s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pageLoaderGlow {
  0%, 100% { opacity: .55; transform: translate(-50%, -50%) scale(0.92); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}

.page-loader-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  animation: pageLoaderIn .6s cubic-bezier(.22, 1, .36, 1) both;
}
@keyframes pageLoaderIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.page-loader-ring {
  position: relative;
  width: 128px;
  height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.page-loader-ring::before,
.page-loader-ring::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.page-loader-ring::before {
  border: 1px solid rgba(74, 123, 216, .14);
}
.page-loader-ring::after {
  background: conic-gradient(from 0deg, rgba(74, 123, 216, 0) 0%, rgba(74, 123, 216, .85) 18%, rgba(74, 123, 216, 0) 40%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  animation: pageLoaderRing 2.4s linear infinite;
}
@keyframes pageLoaderRing {
  to { transform: rotate(360deg); }
}

.page-loader-logo {
  position: relative;
  z-index: 1;
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 16px;
  animation: pageLoaderPulse 3s ease-in-out infinite;
}
@keyframes pageLoaderPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.16); opacity: 0.88; }
}

.page-loader-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
}
.page-loader-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
}
.page-loader-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--text-muted);
}

.page-loader-bar {
  position: relative;
  width: 148px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}
.page-loader-bar span {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 42%;
  border-radius: 999px;
  background: var(--grad-blue);
  animation: pageLoaderBar 1.5s ease-in-out infinite;
}
@keyframes pageLoaderBar {
  0% { left: -42%; }
  100% { left: 100%; }
}

/* ---------------- Badges ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badge-buy { background: rgba(61, 184, 138, 0.15); color: var(--green); }
.badge-sell { background: rgba(224, 106, 106, 0.15); color: var(--red); }
.badge-premium { color: var(--gold); }

/* ---------------- Plan tier badges (Settings "User's Plan" chip, header
   user menu, Pricing "Your Plan" chip, Wallet deposit-plan banner) ----------------
   One accent per tier instead of every plan wearing the same gold crown —
   see plan_badge() in functions/formatters.php, which picks the class
   below (and matching icon) off the plan's display label. .plan-tint-* are
   the color-only variants for plain text labels (e.g. the small "Plan"
   line under the name in the collapsed header chip) where a full pill
   background/border would look out of place. */
.badge-plan-free { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); }
.badge-plan-basic { background: rgba(107, 147, 230, 0.14); border: 1px solid rgba(107, 147, 230, 0.3); color: var(--blue-light); }
.badge-plan-premium { background: rgba(217, 164, 65, 0.14); border: 1px solid rgba(217, 164, 65, 0.3); color: var(--gold); }
.badge-plan-elite { background: rgba(179, 136, 255, 0.16); border: 1px solid rgba(179, 136, 255, 0.32); color: var(--violet); }
.plan-tint-free { color: var(--text-muted); }
.plan-tint-basic { color: var(--blue-light); }
.plan-tint-premium { color: var(--gold); }
.plan-tint-elite { color: var(--violet); }

.badge-pill {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-weight: 600;
}

/* ---------------- Public Navbar ---------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  max-width: 1280px;
  margin: 0 auto;
}
.navbar-links {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.navbar-links a {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s ease;
  position: relative;
}
.navbar-links a:hover, .navbar-links a.active { color: var(--text); }
.navbar-links a.active::after {
  content: '';
  position: absolute;
  bottom: -18px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--blue);
}
.navbar-actions { display: flex; align-items: center; gap: 12px; }
.nav-burger {
  display: none;
  width: 38px; height: 38px;
  align-items: center; justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}

.logo-link { display: flex; align-items: center; }
.logo-link img { height: 34px; width: auto; }

/* ---------------- Mobile drawer nav ---------------- */
.mobile-drawer {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  padding: 24px;
  overflow-y: auto;
}
.mobile-drawer.open { transform: translateX(0); }
.mobile-drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.mobile-drawer nav ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.mobile-drawer nav a { display: block; padding: 14px 6px; font-size: 16px; font-weight: 600; border-bottom: 1px solid var(--border); color: var(--text); }
.mobile-drawer-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.drawer-close { background: none; border: none; color: var(--text); font-size: 22px; }

/* ---------------- Dashboard mobile drawer (opened from the topbar menu button) ---------------- */
.dash-mobile-drawer {
  position: fixed;
  inset: 0;
  z-index: 200;
  visibility: hidden;
  pointer-events: none;
}
.dash-mobile-drawer.open {
  visibility: visible;
  pointer-events: auto;
}
.dash-mobile-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 17, 28, 0.6);
  opacity: 0;
  transition: opacity 0.38s cubic-bezier(.22, 1, .36, 1);
}
.dash-mobile-drawer.open .dash-mobile-drawer-backdrop {
  opacity: 1;
}
.dash-mobile-drawer-sheet {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 280px;
  max-width: 84vw;
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 20px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.4s cubic-bezier(.22, 1, .36, 1);
  will-change: transform;
}
.dash-mobile-drawer.open .dash-mobile-drawer-sheet {
  transform: translateX(0);
}
body.dash-drawer-open {
  overflow: hidden;
  height: 100dvh;
  overscroll-behavior: none;
}
/* Site-wide mobile nav drawer (home, sign in, sign up, etc — includes/navbar.php).
   Without this, the page behind the fixed-position drawer stays scrollable,
   so swiping/scrolling while the menu is open shifts the hero/form content
   underneath and it visibly leaks through at the drawer's edges. */
body.nav-drawer-open {
  overflow: hidden;
  height: 100dvh;
  overscroll-behavior: none;
}
body.dash-drawer-open .mobile-bottom-nav {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.dash-mobile-drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.dash-mobile-drawer .sidebar-logo {
  padding: 0;
}

/* ---------------- Hero ---------------- */
.hero {
  padding: 60px 0 80px;
  position: relative;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 50px;
  align-items: center;
}
.eyebrow-pill {
  display: inline-flex; align-items: center; gap: 8px;
  align-self: flex-start;
  width: fit-content;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--blue-light);
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(34px, 4.6vw, 54px);
  line-height: 1.12;
  font-weight: 800;
  margin: 0 0 18px;
  letter-spacing: -0.5px;
}
.hero h1 .accent { color: var(--blue-light); }
.hero-sub {
  color: var(--text-muted);
  font-size: 16.5px;
  line-height: 1.65;
  max-width: 520px;
  margin-bottom: 30px;
}
.hero-cta { display: flex; gap: 14px; margin-bottom: 28px; flex-wrap: wrap; }
.hero-social-proof { display: flex; align-items: center; gap: 14px; }
.avatar-stack { display: flex; }
.avatar-stack img, .avatar-stack .avatar-fallback {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid var(--bg);
  margin-left: -10px;
  object-fit: cover;
  background: var(--grad-blue);
}
.avatar-stack img:first-child, .avatar-stack .avatar-fallback:first-child { margin-left: 0; }
.stars { color: var(--gold); font-size: 14px; letter-spacing: 2px; }
.proof-text { font-size: 13.5px; color: var(--text-muted); display: block; margin-top: 2px; }

.hero-media { position: relative; }
.hero-media img.hero-shark { width: 100%; border-radius: var(--radius-lg); }
.live-market-card {
  position: absolute;
  top: 20px; left: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  min-width: 170px;
}
.live-dot {
  position: relative;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  display: inline-block; margin-right: 6px;
  flex-shrink: 0;
}
.live-market-card .label { font-size: 12px; color: var(--text-muted); }
.live-market-card .price { font-size: 22px; font-weight: 800; margin: 2px 0; }
.live-market-card .delta { color: var(--green); font-size: 13px; font-weight: 600; }

/* ---------------- Stats strip ---------------- */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-top: 44px;
}
.stat-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.stat-chip .icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(74, 123, 216, 0.15);
  color: var(--blue-light);
  flex-shrink: 0;
}
.stat-chip .num { font-size: 17px; font-weight: 800; line-height: 1.1; }
.stat-chip .cap { font-size: 12px; color: var(--text-muted); }

/* ---------------- Section ---------------- */
.section { padding: 80px 0; }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head .kicker { color: var(--blue-light); font-weight: 700; font-size: 13px; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 10px; display: block; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; margin: 0 0 14px; letter-spacing: -0.4px; }
.section-head p { color: var(--text-muted); line-height: 1.65; font-size: 15.5px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.feature-card:hover { transform: translateY(-3px); border-color: var(--border-strong); }
.feature-card .icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  background: rgba(74, 123, 216, 0.15);
  color: var(--blue-light);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.feature-card h3 { font-size: 16px; margin: 0 0 8px; font-weight: 700; }
.feature-card p { font-size: 14px; color: var(--text-muted); line-height: 1.55; margin: 0; }

/* ---------------- Cards / generic ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}

/* ---------------- Footer ---------------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 50px 0 26px;
  color: var(--text-muted);
  font-size: 14px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 34px; }
.footer-grid h4 { color: var(--text); font-size: 14px; margin: 0 0 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 22px; border-top: 1px solid var(--border); flex-wrap: wrap; gap: 10px; }

/* ==========================================================================
   Auth pages
   ========================================================================== */
.auth-shell { min-height: 100vh; display: flex; flex-direction: column; }
.auth-main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 0;
}
.auth-visual {
  position: relative;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.auth-visual .pill { margin-bottom: 22px; }
.auth-visual h1 { font-size: clamp(30px, 3.4vw, 42px); font-weight: 800; line-height: 1.15; margin: 0 0 16px; }
.auth-visual h1 .accent { color: var(--blue-light); }
.auth-visual p { color: var(--text-muted); font-size: 15.5px; line-height: 1.6; max-width: 440px; margin-bottom: 34px; }
.auth-perk { display: flex; gap: 14px; margin-bottom: 20px; align-items: flex-start; }
.auth-perk .icon {
  width: 42px; height: 42px; border-radius: 11px; flex-shrink: 0;
  background: rgba(74, 123, 216, 0.15); color: var(--blue-light);
  display: flex; align-items: center; justify-content: center;
}
.auth-perk strong { display: block; font-size: 14.5px; margin-bottom: 3px; }
.auth-perk span { font-size: 13.5px; color: var(--text-muted); }
.auth-shark-img { position: absolute; right: -60px; bottom: -60px; width: 60%; opacity: 0.9; pointer-events: none; }

.auth-form-panel {
  background: var(--surface);
  padding: 50px 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 1px solid var(--border);
}
.auth-form-panel .form-head { margin-bottom: 26px; }
.auth-form-panel .form-head h2 { font-size: 26px; font-weight: 800; margin: 0 0 6px; }
.auth-form-panel .form-head p { color: var(--text-muted); font-size: 14.5px; margin: 0; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 7px; color: var(--text); }
.input-wrap { position: relative; display: flex; align-items: center; transition: transform 0.25s ease; }
.input-wrap .field-icon { position: absolute; left: 14px; color: var(--text-faint); display: flex; transition: color 0.25s ease, transform 0.25s ease; }
.input-wrap input, .input-wrap select {
  width: 100%;
  padding: 12px 14px 12px 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14.5px;
  transition: border-color 0.2s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}
.input-wrap input::placeholder { color: var(--text-faint); }
.input-wrap input:focus, .input-wrap select:focus { border-color: var(--blue); outline: none; }
.input-wrap:hover input,
.input-wrap:hover select {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(74, 123, 216, 0.1);
}
.input-wrap:hover .field-icon {
  color: var(--blue-light);
  transform: scale(1.1);
}
.input-wrap:focus-within {
  transform: translateY(-2px);
  /* :focus-within + transform creates a new stacking context on this wrap.
     Without an explicit z-index here, that context (and any absolutely-
     positioned dropdown menu inside it, e.g. .admin-select-menu) stacks at
     "auto" and gets painted UNDER later sibling fields in the same grid/row,
     even though the menu itself has a high z-index — the sibling's stacking
     context simply comes later in paint order. Raising the whole focused
     wrap above its siblings fixes dropdowns rendering behind nearby fields. */
  z-index: 5;
}
.input-wrap:focus-within input,
.input-wrap:focus-within select {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(74, 123, 216, 0.16);
}
.input-wrap:focus-within .field-icon {
  color: var(--blue);
  transform: scale(1.1);
}
.input-wrap .toggle-visibility {
  position: absolute; right: 12px; background: none; border: none; color: var(--text-faint);
  display: flex;
  transition: color 0.2s ease;
}
.input-wrap .toggle-visibility:hover {
  color: var(--blue-light);
}
/* ---- Custom select: a styled dropdown for form fields (e.g. the Support
   request "Category" field) that replaces the raw browser <select> listing
   with a menu that matches the rest of the UI. A real <select> is kept
   (visually hidden) alongside it so the field still submits/validates and
   resets like a normal form control. ---- */
.custom-select { position: relative; width: 100%; }
.custom-select-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}
.custom-select-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  appearance: none;
  cursor: pointer;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.25s ease, background-color 0.25s ease;
}
.custom-select-trigger span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.custom-select-chevron { flex-shrink: 0; color: var(--text-faint); transition: transform .18s ease, color .18s ease; }
.custom-select:hover .custom-select-trigger {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(74, 123, 216, 0.1);
}
.custom-select.open .custom-select-trigger,
.custom-select-trigger:focus-visible {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(74, 123, 216, 0.16);
  outline: none;
}
.custom-select.open .custom-select-chevron { transform: rotate(180deg); color: var(--blue-light); }
.custom-select-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  display: none;
  flex-direction: column;
  gap: 2px;
  max-height: 260px;
  overflow-y: auto;
}
.custom-select.open .custom-select-menu { display: flex; animation: sv-fade-in .16s ease; }
.custom-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  appearance: none;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  transition: background .15s ease;
}
.custom-select-option:hover { background: var(--surface-2); }
.custom-select-option.active {
  background: color-mix(in srgb, var(--blue) 14%, var(--surface-2));
  font-weight: 700;
}
.custom-select-option-check { flex-shrink: 0; color: var(--blue-light); opacity: 0; }
.custom-select-option.active .custom-select-option-check { opacity: 1; }

.phone-group { display: flex; gap: 8px; }
.phone-code {
  flex: 0 0 88px;
  padding: 12px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.25s ease;
}
.phone-group:hover .phone-code,
.phone-group:focus-within .phone-code {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(74, 123, 216, 0.1);
}
.phone-group .input-wrap { flex: 1; }
.phone-group input { padding-left: 14px; }

.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; font-size: 13.5px; color: var(--text-muted); }
.checkbox-row input { margin-top: 3px; accent-color: var(--blue); }
.checkbox-row a { color: var(--blue-light); font-weight: 600; }

.divider-or { display: flex; align-items: center; gap: 14px; margin: 22px 0; color: var(--text-faint); font-size: 12.5px; }
.divider-or::before, .divider-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.social-stack { display: flex; flex-direction: column; gap: 12px; }
.auth-footer-link { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text-muted); }
.auth-footer-link a { color: var(--blue-light); font-weight: 700; }

.pw-strength { display: flex; gap: 4px; margin-top: 8px; }
.pw-strength span { height: 4px; flex: 1; border-radius: 2px; background: var(--border-strong); }

/* ==========================================================================
   Dashboard
   ========================================================================== */
.dash-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 70;
  height: 100dvh;
  overflow-y: auto;
}
.sidebar-logo { padding: 6px 10px 22px; }
.sidebar-logo img { height: 30px; }
.side-nav { list-style: none; margin: 0; padding: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; }
.side-nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 14.5px; font-weight: 500;
  color: var(--text-muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.side-nav a svg { flex-shrink: 0; }
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a.active { background: var(--grad-blue); color: #FFFFFF; box-shadow: none; }
.side-nav .nav-badge {
  margin-left: auto;
  background: rgba(74, 123, 216,0.18);
  color: var(--blue-light);
  font-size: 10.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px;
}
.side-nav a.active .nav-badge { background: rgba(255,255,255,0.25); color: #fff; }
.side-nav .count-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10.5px; font-weight: 700;
  min-width: 18px; text-align: center;
  padding: 2px 6px; border-radius: 999px;
}

/* Green "live chat" beacon on a nav item (currently: admin Support Tickets)
   — separate from the numeric count-badge, which tracks queued/unread
   items. This means "a conversation is happening right now", the badge
   means "N things waiting for you". When both appear on the same item,
   the beacon takes the auto right-margin and the badge just trails it
   with a small fixed gap instead of its own auto margin. */
.side-nav .nav-live-beacon {
  margin-left: auto;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--green, #4A7BD8);
  box-shadow: 0 0 0 rgba(74,123,216,0.55);
  animation: none;
  flex-shrink: 0;
}
.side-nav .nav-live-beacon + .count-badge { margin-left: 8px; }
@keyframes navLiveBeaconPulse {
  0%   { box-shadow: 0 0 0 0 rgba(74,123,216,0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(74,123,216,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,123,216,0); }
}

.upgrade-card {
  margin-top: 14px;
  background: linear-gradient(160deg, rgba(217, 164, 65,0.14), rgba(217, 164, 65,0.03));
  border: 1px solid rgba(217, 164, 65,0.3);
  border-radius: var(--radius);
  padding: 18px;
}
.upgrade-card .icon { color: var(--gold); margin-bottom: 10px; }
.upgrade-card strong { display: block; font-size: 14.5px; margin-bottom: 4px; }
.upgrade-card p { font-size: 12.5px; color: var(--text-muted); margin: 0 0 14px; }

.dash-main {
  flex: 1;
  min-width: 0;
  width: calc(100% - var(--sidebar-w));
  margin-left: var(--sidebar-w);
}

.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
}
.topbar-search {
  flex: 1; max-width: 380px;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; color: var(--text-faint);
}
.topbar-search input { background: none; border: none; color: var(--text); width: 100%; font-size: 14px; }
.topbar-search input:focus { outline: none; }
.topbar-icons { display: flex; align-items: center; gap: 16px; }
.icon-btn {
  position: relative; width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text-muted);
}
.icon-btn .dot {
  position: absolute; top: -4px; right: -4px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  min-width: 17px; height: 17px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
}
.icon-btn .dot[hidden] { display: none; }
.icon-btn-clip {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-menu { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 6px 6px; margin-left: -4px;
  background: none; border: 1px solid transparent; border-radius: 12px;
  font: inherit; color: inherit; text-align: left; cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.user-chip:hover,
.user-chip[aria-expanded="true"] { background: var(--surface); border-color: var(--border); }
.user-chip img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
/* Wrapper JS swaps the contents of when the profile photo changes
   (see data-topbar-avatar in includes/topbar.php + assets/js/settings.js).
   display:contents keeps it invisible to the .user-chip / .user-menu-head
   flex layouts so the img/fallback still size exactly as before. */
[data-topbar-avatar] { display: contents; }
.user-chip-avatar-fallback {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  background: var(--grad-blue); display: flex; align-items: center; justify-content: center;
  color: #04150f; font-weight: 800; font-size: 15px;
}
.user-chip-meta { min-width: 0; }
.user-chip .name { font-size: 14px; font-weight: 700; line-height: 1.2; }
.user-chip .plan { font-size: 12px; font-weight: 600; }
.user-chip-chevron { flex: 0 0 auto; color: var(--text-faint); transition: transform .22s ease, color .18s ease; }
.user-chip[aria-expanded="true"] .user-chip-chevron { transform: rotate(180deg); color: var(--blue); }

/* ---------------- User account dropdown menu ---------------- */
.user-menu-dropdown {
  position: absolute; top: calc(100% + 12px); right: 0; width: 292px;
  background: linear-gradient(180deg, rgba(13, 27, 50, .99), rgba(15, 22, 35, .99));
  border: 1px solid rgba(135, 164, 213, .24);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  padding: 10px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(-8px) scale(.98);
  transform-origin: top right;
  transition: opacity .2s ease, transform .2s cubic-bezier(.22, .61, .36, 1), visibility 0s linear .2s;
  z-index: 1100;
}
.user-menu-dropdown.open {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateY(0) scale(1);
  transition: opacity .2s ease, transform .2s cubic-bezier(.22, .61, .36, 1), visibility 0s;
}
.user-menu-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 14px; margin-bottom: 8px;
  border-bottom: 1px solid rgba(116, 152, 205, .14);
}
.user-menu-head img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.user-menu-avatar-fallback {
  width: 46px; height: 46px; border-radius: 50%; flex: 0 0 auto;
  background: var(--grad-blue); display: flex; align-items: center; justify-content: center;
  color: #04150f; font-weight: 800; font-size: 17px;
}
.user-menu-id { min-width: 0; }
.user-menu-id strong { display: block; color: #fff; font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.user-menu-plan-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 999px;
}
.user-menu-list { display: flex; flex-direction: column; gap: 2px; }
.user-menu-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 10px; border-radius: 10px;
  color: var(--text); font-size: 13.5px; font-weight: 600;
  transition: background .15s ease, color .15s ease;
}
.user-menu-item:hover,
.user-menu-item:focus-visible { background: rgba(107, 147, 230, .08); color: #fff; }
.user-menu-item-icon {
  width: 32px; height: 32px; flex: 0 0 auto; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; color: var(--text-muted);
  transition: color .15s ease, border-color .15s ease;
}
.user-menu-item:hover .user-menu-item-icon { color: var(--blue); border-color: rgba(107, 147, 230, .3); }
.user-menu-divider { height: 1px; background: rgba(116, 152, 205, .14); margin: 8px 4px; }
.user-menu-logout { color: #ff8080; }
.user-menu-logout .user-menu-item-icon { color: #ff8080; }
.user-menu-logout:hover,
.user-menu-logout:focus-visible { background: rgba(224, 106, 106, .09); color: #ff9d9d; }
.user-menu-logout:hover .user-menu-item-icon { border-color: rgba(224, 106, 106, .3); color: #ff9d9d; }

.dash-content { padding: 28px; }
.dash-welcome { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 26px; flex-wrap: wrap; gap: 14px; }
.welcome-copy { animation: welcome-fade-up .55s cubic-bezier(.22,1,.36,1) both; }
.welcome-prefix { font-weight: inherit; }
.dash-welcome h1 { font-size: 24px; font-weight: 800; margin: 0 0 6px; }
.dash-welcome p { color: var(--text-muted); font-size: 14.5px; margin: 0; }
.wave-mark {
  display: inline-block;
  transform-origin: 70% 70%;
  animation: welcome-wave 1.4s ease-in-out .5s 1 both;
}
@keyframes welcome-fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes welcome-wave {
  0%, 100% { transform: rotate(0deg); }
  15% { transform: rotate(16deg); }
  30% { transform: rotate(-10deg); }
  45% { transform: rotate(14deg); }
  60% { transform: rotate(-4deg); }
  75% { transform: rotate(8deg); }
}
@media (prefers-reduced-motion: reduce) {
  .welcome-copy, .wave-mark { animation: none; }
}
.date-pill {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 16px; font-size: 13.5px; font-weight: 600;
}

.stat-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; margin-bottom: 22px;
}
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.action-stat-card {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.action-stat-card:hover,
.action-stat-card:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(107, 147, 230, .48);
  background: rgba(15, 30, 54, .98);
}
.action-stat-card:focus-visible {
  outline: 2px solid rgba(107, 147, 230, .54);
  outline-offset: 3px;
}
.stat-card .top-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.stat-card .label { font-size: 13px; color: var(--text-muted); }
.stat-card .value { font-size: 24px; font-weight: 800; }
.stat-card .icon-box {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.stat-card .delta { font-size: 12.5px; font-weight: 600; }
.delta-up { color: var(--green); }

.dash-grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; margin-bottom: 18px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.panel-head h3 { font-size: 15.5px; font-weight: 700; margin: 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-head a, .panel-head button { font-size: 13px; color: var(--blue-light); font-weight: 600; background: none; border: none; }

.signal-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.signal-row:last-child { border-bottom: none; }
.signal-pair { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.signal-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.signal-right { text-align: right; flex-shrink: 0; }
.signal-price { font-weight: 700; font-size: 14px; }
.signal-time { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }
.signal-info { min-width: 0; }

/* ---- Live signal rows: real-time mini trend chart + modal launcher ---- */
.market-overview-card {
  padding: 10px 6px;
  margin-bottom: 18px;
  overflow: hidden;
  border-radius: var(--radius);
}
.market-overview-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.panel-head .live-dot {
  width: auto;
  height: auto;
  margin-right: 0;
  display: inline-flex; align-items: center; gap: 6px;
  flex: none;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--green); background: rgba(61, 184, 138, .12);
  border: 1px solid rgba(61, 184, 138, .28);
  border-radius: 999px; padding: 4px 10px 4px 8px;
  box-shadow: none;
  animation: none;
}
.panel-head .live-dot::before {
  content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  flex: none;
}
/* Icon-only variant (no "Live" text, e.g. the TradingView chart panel head):
   .panel-head .live-dot above turns any live-dot into a padded text pill
   (display:inline-flex + align-items/gap/font-size/line-height meant for the
   "Live" label). Reset every property the pill rule sets — not just
   width/height/padding — and force display:block so it can't be
   flex-stretched at all. */
.panel-head .live-dot.live-dot-only {
  display: block;
  position: relative;
  box-sizing: content-box;
  flex: none;
  width: 7px;
  height: 7px;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--green);
  box-shadow: none;
  animation: none;
  font-size: 0;
  line-height: 0;
  letter-spacing: normal;
  text-transform: none;
  align-items: unset;
  gap: 0;
}
.panel-head .live-dot.live-dot-only::before {
  content: none;
}

.market-chart-row {
  cursor: pointer;
  border-radius: 10px;
  padding-left: 8px; padding-right: 8px;
  margin: 0 -8px;
  transition: background .15s ease, transform .15s ease;
}
.market-chart-row:hover,
.market-chart-row:focus-visible {
  background: rgba(107, 147, 230, .08);
}
.market-chart-row:active { transform: scale(.997); }

.signal-trend {
  width: 128px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, .02);
  border: 1px solid rgba(255, 255, 255, .04);
}
.signal-trend svg { width: 100%; height: 100%; display: block; }

.signal-chart-btn {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--blue-light);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.market-chart-row:hover .signal-chart-btn {
  background: rgba(74, 123, 216, .18);
  border-color: rgba(74, 123, 216, .4);
  color: #cfe0ff;
}

@media (max-width: 1180px) {
  .signal-trend { display: none; }
}
@media (max-width: 560px) {
  .signal-chart-btn { width: 30px; height: 30px; }
}

.dash-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; margin-bottom: 18px; }
.mini-card p { color: var(--text-muted); font-size: 13.5px; margin: 6px 0 14px; }
.progress-bar { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 10px 0 14px; }
.progress-bar span { display: block; height: 100%; background: var(--grad-blue); border-radius: 999px; }

.event-row { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.event-row:last-child { border-bottom: none; }
.event-date { text-align: center; flex-shrink: 0; width: 40px; }
.event-date .d { font-size: 16px; font-weight: 800; line-height: 1; }
.event-date .m { font-size: 10.5px; color: var(--text-muted); text-transform: uppercase; }
.event-title { font-size: 13.5px; font-weight: 600; }
.event-impact { font-size: 11.5px; font-weight: 700; }
.impact-high { color: var(--red); }
.impact-med { color: var(--gold); }

.dash-grid-2b { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.dash-grid-2c { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 18px; }
@media (max-width: 900px) { .dash-grid-2c { grid-template-columns: 1fr; } }
.community-post { display: flex; gap: 12px; }
.community-post img { width: 40px; height: 40px; border-radius: 50%; }
.post-meta { font-size: 12px; color: var(--text-faint); }
.post-actions { display: flex; gap: 16px; font-size: 12.5px; color: var(--text-muted); margin-top: 8px; }

.chart-placeholder {
  width: 100%; height: 220px;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(74, 123, 216,0.16), transparent);
  position: relative;
  display: flex; align-items: flex-end;
}

/* Mobile bottom nav (dashboard) */
.mobile-bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 150;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  padding: 8px 6px 10px;
  justify-content: space-around;
}
.mobile-bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10.5px; color: var(--text-muted); font-weight: 600; }
.mobile-bottom-nav a.active { color: var(--blue-light); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .stats-strip { grid-template-columns: repeat(3, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .dash-grid-3 { grid-template-columns: 1fr 1fr; }
  .dash-grid-3 .mini-card:last-child { grid-column: span 2; }
}

@media (max-width: 900px) {
  .navbar-links, .navbar-actions .btn-outline, .navbar-actions .btn-primary { display: none; }
  .nav-burger { display: flex; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-media { order: -1; }
  .auth-main { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-form-panel { padding: 40px 24px; border-left: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .sidebar { display: none; }
  .dash-main {
    width: 100%;
    margin-left: 0;
  }
  .dash-grid-2, .dash-grid-2b, .dash-grid-3 { grid-template-columns: 1fr; }
  .dash-grid-3 .mini-card:last-child { grid-column: span 1; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .mobile-bottom-nav { display: flex; }
  .dash-content { padding-bottom: 90px; }
  .topbar-search { display: none; }
}

@media (max-width: 560px) {
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .form-row { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

/* ==========================================================================
   Reference UI polish
   ========================================================================== */
body.public-page,
body.dashboard-page {
  background:
    radial-gradient(circle at 72% 15%, rgba(15, 95, 235, .2), transparent 32rem),
    radial-gradient(circle at 16% 45%, rgba(3, 104, 255, .12), transparent 28rem),
    linear-gradient(180deg, #0F1623 0%, #06101d 58%, #0F1623 100%);
}

body.public-page::before,
body.dashboard-page::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(44, 118, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(44, 118, 255, .045) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.7), transparent 76%);
}

.navbar {
  background: rgba(11, 17, 28, .86);
  border-bottom-color: rgba(116, 152, 205, .12);
}

.navbar-inner {
  min-height: 78px;
  padding: 0 32px;
}

.logo-link img {
  height: 44px;
}

.navbar-links {
  gap: 32px;
}

.navbar-links a {
  color: #E4E9F2;
  font-size: 14px;
  font-weight: 650;
}

.navbar-links a.active {
  color: var(--blue-light);
}

.navbar-links a.active::after {
  bottom: -29px;
  height: 3px;
  border-radius: 999px;
}

.navbar-actions .btn {
  min-width: 86px;
  height: 42px;
  padding: 0 22px;
}

.mobile-header-spacer,
.nav-burger-mobile-first {
  display: none;
}

.btn {
  border-radius: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, #4A7BD8 0%, #3A66BD 100%);
}

.btn-outline {
  border-color: rgba(255,255,255,.24);
  background: rgba(5, 10, 20, .44);
}

.home-hero {
  padding: 58px 0 0;
  border-bottom: 1px solid rgba(116, 152, 205, .1);
  isolation: isolate;
  background:
    linear-gradient(90deg, rgba(11, 17, 28, .96) 0%, rgba(11, 17, 28, .84) 35%, rgba(11, 17, 28, .35) 65%, rgba(11, 17, 28, .72) 100%),
    linear-gradient(180deg, rgba(11, 17, 28, .38), rgba(11, 17, 28, .92)),
    url('../images/hero.jpg') center right / cover no-repeat;
}

.home-hero::after,
.auth-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(11, 17, 28, .96) 0%, rgba(11, 17, 28, .72) 36%, rgba(11, 17, 28, .1) 68%, rgba(11, 17, 28, .92) 100%),
    radial-gradient(circle at 72% 38%, rgba(0, 118, 255, .22), transparent 30rem);
  z-index: -2;
}

.hero-grid {
  grid-template-columns: minmax(430px, .92fr) minmax(520px, 1.08fr);
  gap: 10px;
  min-height: 525px;
}

.hero-copy {
  padding-top: 42px;
  position: relative;
  z-index: 2;
}

.eyebrow-pill {
  border-color: rgba(65, 132, 255, .42);
  background: linear-gradient(180deg, rgba(17, 45, 103, .72), rgba(7, 21, 48, .72));
  color: #fff;
  box-shadow: 0 10px 34px rgba(0,0,0,.22);
}

.eyebrow-icon {
  display: inline-flex;
  color: #4A7BD8;
}

.hero h1 {
  max-width: 560px;
  color: #fff;
  font-size: clamp(44px, 5vw, 70px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero h1 .accent,
.section-head h2 span,
.auth-visual .accent {
  color: #247cff;
}

.hero-sub {
  max-width: 500px;
  color: rgba(245, 248, 255, .9);
}

.hero-cta .btn {
  min-width: 146px;
  height: 52px;
}

.play-dot {
  width: 22px;
  height: 22px;
  border: 1px solid rgba(255,255,255,.35);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #a8c7ff;
}

.avatar-face {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #121A29;
  margin-left: -10px;
  background:
    radial-gradient(circle at 50% 38%, #ffde9e 0 20%, transparent 21%),
    radial-gradient(circle at 50% 63%, #16233c 0 24%, transparent 25%),
    linear-gradient(135deg, #eac196, #714025);
  box-shadow: 0 0 0 1px rgba(255,255,255,.12);
}

.avatar-face:first-child { margin-left: 0; }
.face-2 { filter: hue-rotate(18deg); }
.face-3 { filter: hue-rotate(-16deg) saturate(.9); }
.face-4 { filter: hue-rotate(42deg); }
.face-5 { filter: hue-rotate(-34deg); }

.stars {
  color: #ffc85c;
  font-size: 15px;
  letter-spacing: 3px;
}

.proof-text {
  color: rgba(245,248,255,.82);
  font-size: 13px;
}

.hero-media {
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-media::before {
  content: '';
  position: absolute;
  inset: 0 -110px -38px -60px;
  background:
    linear-gradient(90deg, rgba(2,6,15,0) 15%, rgba(0,84,255,.11) 58%, rgba(0,84,255,.32) 100%),
    repeating-linear-gradient(90deg, transparent 0 58px, rgba(54,123,255,.08) 59px 60px);
  opacity: .8;
}

.hero-media img.hero-shark {
  display: none;
}

.live-market-card {
  top: 48%;
  left: 4%;
  transform: translateY(-35%);
  width: 186px;
  min-width: 186px;
  padding: 18px 18px 15px;
  border-radius: 16px;
  background: rgba(7, 18, 34, .78);
  border-color: rgba(77, 141, 255, .32);
  backdrop-filter: blur(14px);
}

.live-market-card strong {
  display: block;
  margin-top: 12px;
  font-size: 15px;
}

.live-market-card .price {
  margin: 4px 0 0;
  color: #18ee72;
  font-size: 27px;
  line-height: 1;
}

.live-market-card .delta {
  display: block;
  margin-top: 5px;
}

.mini-market-chart {
  width: 100%;
  height: 58px;
  margin-top: 2px;
}

.stats-strip {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin-top: -6px;
  margin-bottom: 42px;
  border: 1px solid rgba(116, 152, 205, .2);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(13, 31, 56, .82), rgba(8, 18, 34, .7));
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.stat-chip {
  border: 0;
  border-right: 1px solid rgba(116, 152, 205, .18);
  border-radius: 0;
  background: transparent;
  padding: 20px 24px;
}

.stat-chip:last-child { border-right: 0; }

.stat-chip .icon,
.feature-card .icon,
.auth-perk .icon {
  background: radial-gradient(circle at 35% 25%, #3594ff, #0b43c7 68%, #071a45);
  color: #9bd0ff;
  box-shadow: 0 10px 24px rgba(24, 102, 255, .22);
}

.stat-chip .num {
  font-size: 22px;
  color: #fff;
}

.stat-chip .cap {
  color: rgba(245,248,255,.82);
}

.feature-section {
  padding: 46px 0 72px;
  border-top: 1px solid rgba(116, 152, 205, .08);
}

.feature-layout {
  display: grid;
  grid-template-columns: .84fr 1.16fr;
  gap: 58px;
  align-items: start;
}

.section-head {
  max-width: 500px;
  margin-bottom: 0;
}

.section-head .kicker,
.results-head .kicker {
  color: #2683ff;
  font-size: 12px;
  letter-spacing: .8px;
}

.section-head h2 {
  color: #fff;
  font-size: clamp(26px, 2.8vw, 34px);
  line-height: 1.25;
}

.section-head p {
  color: rgba(245,248,255,.82);
}

.section-head .btn {
  margin-top: 18px;
  min-width: 190px;
  height: 48px;
}

.feature-grid {
  gap: 18px;
}

.feature-card,
.card,
.stat-card,
.auth-form-panel,
.mobile-balance-card {
  background:
    linear-gradient(180deg, rgba(15, 32, 58, .88), rgba(7, 17, 32, .88));
  border-color: rgba(116, 152, 205, .22);
  box-shadow: 0 16px 46px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.03);
}

.feature-card {
  min-height: 142px;
  padding: 22px;
  border-radius: 8px;
}

.feature-card h3 {
  color: #fff;
}

.results-section {
  padding-top: 38px;
  border-top: 1px solid rgba(116, 152, 205, .08);
}

.results-head {
  text-align: center;
}

.results-head h2 {
  margin: 10px 0 0;
  font-size: clamp(25px, 3vw, 34px);
}

/* Auth */
.auth-page .navbar {
  position: relative;
}

.auth-shell {
  min-height: calc(100vh - 78px);
  padding: 34px 0 58px;
}

.auth-main {
  grid-template-columns: minmax(380px, .86fr) minmax(520px, 1fr);
  gap: 54px;
  align-items: center;
}

.auth-visual {
  min-height: 720px;
  justify-content: flex-start;
  padding: 58px 0 0 4px;
  isolation: isolate;
}

.signup-page .auth-visual {
  padding: 58px 36px 36px;
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(11, 17, 28, .94) 0%, rgba(11, 17, 28, .68) 54%, rgba(11, 17, 28, .22) 100%),
    linear-gradient(180deg, rgba(11, 17, 28, .16), rgba(11, 17, 28, .82)),
    url('../images/signin.jpg') left center / cover no-repeat;
}

.auth-visual::after {
  border-radius: 18px;
  background:
    radial-gradient(circle at 36% 82%, rgba(14, 117, 255, .38), transparent 24rem),
    linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.2));
}

.auth-visual h1 {
  max-width: 490px;
  color: #fff;
  font-size: clamp(40px, 3.8vw, 56px);
  line-height: 1.14;
  letter-spacing: 0;
}

.auth-visual p {
  color: rgba(245,248,255,.9);
  font-size: 17px;
}

.auth-perks {
  display: grid;
  gap: 20px;
  position: relative;
  z-index: 2;
}

.auth-perk {
  align-items: center;
}

.auth-perk strong {
  color: #fff;
  font-size: 16px;
}

.auth-perk span {
  color: rgba(245,248,255,.82);
}

.auth-shark-img {
  right: -148px;
  bottom: -42px;
  width: 112%;
  opacity: .98;
  filter: drop-shadow(0 0 30px rgba(29, 121, 255, .55));
}

.signup-page .auth-shark-img {
  display: none;
}

.auth-form-panel {
  width: 100%;
  max-width: 675px;
  justify-self: end;
  border: 1px solid rgba(116, 152, 205, .24);
  border-radius: 18px;
  padding: 36px 34px;
  backdrop-filter: blur(18px);
}

.login-panel {
  max-width: 520px;
  justify-self: center;
}

.form-head {
  text-align: center;
}

.auth-form-panel .form-head h2 {
  color: #fff;
  font-size: 32px;
}

.form-row {
  gap: 16px 22px;
}

.form-group {
  margin-bottom: 18px;
}

.input-wrap input,
.input-wrap select,
.phone-code {
  min-height: 48px;
  background: rgba(11, 24, 43, .92);
  border-color: rgba(135, 164, 213, .28);
  color: #fff;
}

.input-wrap select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #9FABC1 50%),
    linear-gradient(135deg, #9FABC1 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.field-icon {
  pointer-events: none;
}

.phone-group {
  gap: 0;
}

.phone-code {
  border-radius: 8px 0 0 8px;
  border-right: 0;
  flex-basis: 94px;
}

.phone-group .input-wrap input {
  border-radius: 0 8px 8px 0;
}

.toggle-visibility {
  padding: 0;
}

.checkbox-row {
  align-items: center;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.recaptcha-slot:empty {
  display: none;
}

/* Cloudflare Turnstile (login/signup/admin-login bot check) — data-size
   "flexible" on the widget itself (see render_turnstile_widget() in
   functions/security.php) makes Cloudflare's iframe fill this container,
   so giving the container the same width as the inputs above/below it is
   enough to make the whole widget match the form's width instead of
   sitting at Cloudflare's fixed 300px default. */
.recaptcha-slot:not(:empty) {
  width: 100%;
  margin-bottom: 18px;
}
.cf-turnstile {
  width: 100%;
}

.divider-or {
  justify-content: center;
}

.btn-social {
  min-height: 48px;
  background: #E4E9F2;
  border-color: transparent;
  color: #050914;
}

.form-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -4px 0 20px;
  color: var(--text-muted);
  font-size: 13.5px;
}

.form-between a {
  color: var(--blue-light);
  font-weight: 700;
}

.checkbox-row.compact {
  margin: 0;
}

.login-auth-main {
  grid-template-columns: minmax(420px, 1fr) minmax(420px, .82fr);
}

.login-visual {
  min-height: 610px;
}

/* Dashboard */
.dashboard-page {
  --sidebar-w: 270px;
  background: #0F1623;
}

.dash-shell {
  background:
    radial-gradient(circle at 85% 10%, rgba(13, 80, 205, .18), transparent 30rem),
    #0F1623;
}

.sidebar {
  width: var(--sidebar-w);
  padding: 25px 16px 28px;
  background: rgba(5, 11, 23, .96);
  border-right-color: rgba(116, 152, 205, .18);
}

.sidebar-logo {
  padding: 0 14px 24px;
}

.sidebar-logo img {
  height: 49px;
}

.side-nav {
  gap: 7px;
}

.side-nav a {
  min-height: 52px;
  padding: 0 16px;
  border-radius: 8px;
  color: rgba(245,248,255,.88);
}

.side-nav a.active {
  background: linear-gradient(135deg, #4A7BD8, #3A66BD);
}

.logout-link {
  color: #E06A6A !important;
}

.upgrade-card {
  text-align: center;
  padding: 22px 18px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 10%, rgba(246, 189, 40, .28), transparent 58%),
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015));
}

.upgrade-card .icon svg {
  width: 62px;
  height: 62px;
  fill: rgba(246, 189, 40, .14);
  stroke: #ffc85c;
}

.topbar {
  height: 80px;
  padding: 0 34px;
  background: rgba(5, 11, 23, .9);
  border-bottom-color: rgba(116, 152, 205, .18);
  backdrop-filter: blur(16px);
}

.dash-menu-btn,
.topbar-mobile-logo {
  display: none;
}

.topbar-search {
  height: 46px;
  border-radius: 999px;
  background: rgba(17, 27, 48, .9);
}

.icon-btn {
  background: transparent;
  border: 0;
  color: #fff;
}

.user-chip {
  gap: 12px;
}

.user-chip img {
  width: 44px;
  height: 44px;
  box-shadow: 0 0 0 2px rgba(255,255,255,.08);
}

.dash-content {
  padding: 32px 36px 38px;
  max-width: 1180px;
}

.dash-welcome {
  align-items: center;
  margin-bottom: 24px;
}

.dash-welcome h1 {
  color: #fff;
  font-size: 27px;
}

.wave-mark {
  color: #ffc85c;
}

.date-pill {
  min-width: 184px;
  justify-content: center;
  background: rgba(17, 27, 48, .9);
}

.mobile-user-avatar,
.mobile-welcome-small,
.mobile-live-time {
  display: none;
}

/* ---- Dashboard balance card (restyled, shown at all breakpoints) ---- */
.mobile-balance-card {
  position: relative;
  display: block;
  animation: balance-float 5s ease-in-out infinite;
  will-change: transform;
}
@keyframes balance-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}
/* :hover is scoped to devices that actually have a hover-capable pointer —
   on touch/mobile, browsers apply :hover on tap and don't clear it until
   something else is tapped, so without this the float animation would
   pause itself the moment someone touched the card and just never resume.
   :focus-within stays unscoped since keyboard/mouse focus is a real signal
   on any device. */
@media (hover: hover) and (pointer: fine) {
  .mobile-balance-card:hover {
    animation-play-state: paused;
  }
}
.mobile-balance-card:focus-within {
  animation-play-state: paused;
}
@media (prefers-reduced-motion: reduce) {
  .mobile-balance-card { animation: none; }
}
.mobile-balance-card {
  margin-bottom: 22px;
  padding: 20px 24px;
  overflow: hidden;
  border-radius: 14px;
  background:
    radial-gradient(circle at 82% 22%, rgba(107, 147, 230, .38), transparent 15rem),
    linear-gradient(135deg, rgba(15, 184, 154, .32), rgba(9, 15, 23, .97));
  border: 1px solid rgba(107, 147, 230, .3);
  box-shadow: 0 20px 48px rgba(3, 6, 10, .45);
}
/* Performance trend chart rendered as a soft backdrop inside the balance
   card (see portfolio.php's .balance-card-trend) — sits behind the balance
   figure/actions, faded so the numbers on top stay easy to read. */
.balance-card-trend {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: .32;
  pointer-events: none;
  color: #6B93E6;
  animation: balance-trend-breathe 6s ease-in-out infinite;
}
/* Slow, soothing "breathing" fade so the whole backdrop gently rises and
   settles instead of sitting static behind the balance figure. */
@keyframes balance-trend-breathe {
  0%, 100% { opacity: .22; transform: scale(1); }
  50% { opacity: .4; transform: scale(1.015); }
}
.balance-card-trend-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.balance-card-trend-svg.is-down { color: #ff6b6b; }
/* A soft current drifting along the trend line, like a slow, calm pulse
   rather than a hard "marching ants" scroll. */
.balance-card-trend-line {
  stroke-dasharray: 3 14;
  stroke-dashoffset: 0;
  animation: balance-trend-flow 9s linear infinite;
}
@keyframes balance-trend-flow {
  to { stroke-dashoffset: -170; }
}
@media (prefers-reduced-motion: reduce) {
  .balance-card-trend,
  .balance-card-trend-line {
    animation: none;
  }
}
.mobile-balance-card .balance-card-inner {
  position: relative;
  z-index: 1;
}
.mobile-balance-card .top-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.mobile-balance-card .balance-copy {
  min-width: 0;
}
.mobile-balance-card .icon-box {
  margin-left: auto;
  flex-shrink: 0;
  width: 38px;
  height: 38px;
}
.mobile-balance-card .icon-box.wallet-glow {
  background: rgba(228, 233, 242, .12);
  color: #fff;
}
/* Ensure every icon-box glyph is dead-center regardless of the SVG's own
   internal whitespace — inline SVGs pick up baseline alignment by default,
   which nudges them off-center inside a flex circle. */
.icon-box svg {
  display: block;
  flex-shrink: 0;
}
.mobile-balance-card .deposit-icon-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  transition: transform .15s ease;
}
.mobile-balance-card .balance-actions {
  align-self: flex-end;
  display: flex;
  gap: 16px;
}
.mobile-balance-card .deposit-icon-btn:hover,
.mobile-balance-card .deposit-icon-btn:focus-visible {
  transform: translateY(-1px);
}
.mobile-balance-card .deposit-icon-btn:active {
  transform: translateY(0);
}
.mobile-balance-card .deposit-icon-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-blue);
  color: #FFFFFF;
  box-shadow: 0 8px 20px rgba(74, 123, 216, .4);
  transition: box-shadow .15s ease;
}
.mobile-balance-card .deposit-icon-circle svg {
  display: block;
}
.mobile-balance-card .deposit-icon-btn:hover .deposit-icon-circle,
.mobile-balance-card .deposit-icon-btn:focus-visible .deposit-icon-circle {
  box-shadow: 0 10px 24px rgba(74, 123, 216, .5);
}
.mobile-balance-card .deposit-icon-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #fff;
  white-space: nowrap;
}

/* ---- Balance card: inner copy column + desktop trend-chart panel ---- */
.balance-card-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  min-height: 104px;
}
.balance-card-chart {
  display: none;
}

@media (min-width: 901px) {
  .mobile-balance-card {
    display: flex;
    align-items: stretch;
    gap: 28px;
  }
  .balance-card-inner {
    flex: 1 1 220px;
    min-width: 0;
  }
  .balance-card-chart {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 250px;
    flex-shrink: 0;
    padding-left: 26px;
    border-left: 1px solid rgba(245, 248, 255, .16);
  }
}

.balance-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.balance-pair-dropdown {
  margin-bottom: 0;
  max-width: 132px;
}
.balance-pair-trigger {
  background: rgba(9, 15, 23, .38);
  border-color: rgba(245, 248, 255, .22);
  padding: 7px 10px;
  border-radius: 9px;
  backdrop-filter: blur(6px);
}
.balance-pair-trigger:hover { border-color: rgba(245, 248, 255, .4); }
.balance-pair-dropdown.open .balance-pair-trigger {
  border-color: #fff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .5);
}
.balance-pair-trigger .coin-dropdown-selected-text strong {
  font-size: 13px;
  color: #fff;
}
.balance-pair-trigger .coin-dropdown-chevron { color: rgba(245, 248, 255, .7); }
.balance-pair-menu {
  min-width: 150px;
  left: auto;
  right: 0;
}
.balance-chart-price-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.balance-chart-price {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: #fff;
}
.balance-chart-change {
  font-size: 12px;
  font-weight: 700;
}
.balance-chart-change.up { color: var(--green); }
.balance-chart-change.down { color: var(--red); }
.balance-chart-svg-wrap {
  width: 100%;
  height: 88px;
  line-height: 0;
}
.balance-chart-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.mobile-balance-card .balance-copy > span {
  display: block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: rgba(245, 248, 255, .78);
  margin-bottom: 6px;
}
.mobile-balance-card strong {
  display: block;
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 4px;
  /* A large/long balance ($1,234,567.89 and up) has no natural break
     points, so without this it overflows straight through the balance
     figure's own box — sliding under the wallet icon to its right and
     getting sheared off at the card's edge (.mobile-balance-card clips
     via overflow: hidden). Wrapping it onto a second line instead keeps
     every digit visible and, since the card only has a min-height (not a
     fixed one), the card simply grows to fit — nothing below it (the
     Add Funds button) gets pushed out of the clipped area either. */
  overflow-wrap: anywhere;
}
/* The big dashboard balance figure's own .balance-value-row wrapper (see
   .balance-value-row's base rules further down for layout) — just needs
   its margin restored here since it now sits where the bare <strong>
   used to, and the toggle button re-themed to match the white-on-gradient
   card instead of the slim card's muted default. */
.mobile-balance-card .balance-value-row {
  margin-bottom: 4px;
}
.mobile-balance-card .balance-value-row strong {
  margin-bottom: 0;
}
.mobile-balance-card .balance-visibility-toggle {
  color: rgba(245, 248, 255, .78);
}
.mobile-balance-card .balance-visibility-toggle:hover,
.mobile-balance-card .balance-visibility-toggle:focus-visible {
  background: rgba(255, 255, 255, .14);
  color: #fff;
}
.mobile-balance-card small {
  font-size: 13.5px;
  color: rgba(245, 248, 255, .78);
}
.mobile-balance-card small b {
  color: #22e879;
  font-weight: 700;
}

@media (max-width: 560px) {
  .mobile-balance-card { padding: 16px 18px; border-radius: 9px; }
  .balance-card-inner { min-height: 0; gap: 10px; }
  .mobile-balance-card strong { font-size: 25px; margin-bottom: 2px; }
  .mobile-balance-card .balance-copy > span { margin-bottom: 3px; }
  .mobile-balance-card .icon-box { width: 32px; height: 32px; }
  .mobile-balance-card .icon-box svg { width: 15px; height: 15px; }
  .mobile-balance-card .deposit-icon-btn { gap: 3px; }
  .mobile-balance-card .balance-actions { gap: 12px; }
  .mobile-balance-card .deposit-icon-circle { width: 32px; height: 32px; }
  .mobile-balance-card .deposit-icon-circle svg { width: 15px; height: 15px; }
  .mobile-balance-card .deposit-icon-label { font-size: 10px; }
}

.stat-cards {
  gap: 18px;
}

.wallet-stat-cards {
  grid-template-columns: minmax(0, 280px);
}

.stat-card {
  padding: 19px 20px;
  border-radius: 10px;
}

.stat-card .value {
  color: #fff;
  font-size: 26px;
  line-height: 1.2;
}

.gold-text {
  color: #ffc85c !important;
}

.muted-text {
  color: var(--text-muted) !important;
}

.icon-box {
  width: 44px;
  height: 44px;
  border-radius: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.wallet-glow {
  background: radial-gradient(circle at 50% 40%, #6B93E6, #3A66BD);
  color: #FFFFFF;
}

.crown-glow {
  color: #ffc85c;
  background: rgba(246, 189, 40, .12);
}

.signal-glow {
  color: #21e47a;
  background: rgba(33, 228, 122, .12);
}

.win-glow,
.journal-glow {
  color: #6b8cff;
  background: rgba(88, 101, 242, .16);
}

.academy-glow {
  color: #4A7BD8;
  background: rgba(83, 234, 214, .15);
}

.event-glow {
  color: #D9A441;
  background: rgba(245, 158, 52, .17);
}

.dash-grid-2 {
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, .92fr);
}

.card {
  border-radius: 10px;
}

.panel-head h3 {
  color: #fff;
  font-size: 18px;
}

.panel-head a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(116, 152, 205, .22);
  border-radius: 8px;
  background: rgba(17, 27, 48, .88);
  padding: 8px 12px;
}

.performance-chart-wrap {
  position: relative;
  height: 270px;
  padding-left: 42px;
}

.chart-placeholder {
  height: 100%;
  background: radial-gradient(circle at 78% 20%, rgba(40, 115, 255, .2), transparent 45%), linear-gradient(180deg, rgba(74, 123, 216,.12), transparent);
}

.axis-label {
  position: absolute;
  left: 0;
  color: #9FABC1;
  font-size: 12px;
}

.axis-top { top: 4px; }
.axis-mid { top: 50%; }
.axis-bottom { bottom: 1px; }

.chart-tooltip {
  position: absolute;
  right: 18px;
  top: 98px;
  padding: 12px 14px;
  border: 1px solid rgba(116, 152, 205, .28);
  border-radius: 8px;
  background: rgba(6, 13, 25, .9);
}

.chart-tooltip span {
  display: block;
  color: #9FABC1;
  font-size: 12px;
}

.chart-tooltip strong {
  color: #fff;
  font-size: 18px;
}

.chart-dates {
  display: flex;
  justify-content: space-between;
  padding-left: 42px;
  margin-top: 10px;
  color: #9FABC1;
  font-size: 12px;
}

.signal-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px 0;
}

.signal-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 900;
  align-self: center;
}

.gold-dot { background: rgba(246, 189, 40, .14); color: #ffc85c; }
.flag-dot { background: linear-gradient(135deg, #274bdb, #d9374c); color: #fff; }
.yen-dot { background: rgba(107, 147, 230, .14); color: #6B93E6; }

.badge {
  border-radius: 4px;
  padding: 3px 8px;
}

.dash-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-head {
  margin-bottom: 8px;
}

.mini-card {
  min-height: 154px;
}

.progress-value {
  margin-top: 8px;
  color: #20e87c;
  font-size: 26px;
  font-weight: 800;
}

.progress-value span {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
}

.inline-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue-light);
  font-weight: 700;
  font-size: 13.5px;
}

.event-row {
  align-items: center;
}

.event-bullet {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffde9e;
  flex: 0 0 auto;
}

.event-copy {
  flex: 1;
}

.calendar-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
}

.community-post {
  align-items: flex-start;
}

.community-post img {
  width: 42px;
  height: 42px;
}

.community-copy {
  min-width: 0;
  flex: 1;
}

.community-copy p {
  margin: 8px 0 0;
  font-size: 14px;
  color: #fff;
}

.post-actions span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.community-chart {
  width: 150px;
  height: 76px;
  align-self: flex-end;
}

@media (max-width: 1200px) {
  .navbar-links {
    gap: 22px;
  }

  .hero-grid {
    grid-template-columns: 1fr 1fr;
  }

  .feature-layout {
    grid-template-columns: 1fr;
  }

  .section-head {
    max-width: 620px;
  }

  .auth-main {
    gap: 32px;
  }
}

@media (max-width: 900px) {
  .navbar-inner {
    min-height: 80px;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    padding: 0 24px;
  }

  .nav-burger-mobile-first {
    display: inline-flex;
    grid-column: 1;
    background: transparent;
    border: 0;
    color: #fff;
  }

  .logo-link {
    grid-column: 2;
    justify-self: center;
  }

  .logo-link img {
    height: 45px;
  }

  .navbar-actions {
    grid-column: 3;
    justify-self: end;
  }

  .navbar-actions .btn-outline,
  .navbar-actions .btn-primary {
    display: none;
  }

  .mobile-header-spacer {
    width: 40px;
    height: 40px;
    display: block;
  }

  .mobile-drawer {
    background:
      radial-gradient(circle at 50% 0, rgba(24, 102, 255, .18), transparent 20rem),
      #020711;
  }

  .home-hero {
    padding-top: 8px;
    background:
      linear-gradient(180deg, rgba(11, 17, 28, .88) 0%, rgba(11, 17, 28, .74) 45%, rgba(11, 17, 28, .96) 100%),
      linear-gradient(90deg, rgba(11, 17, 28, .94), rgba(11, 17, 28, .38)),
      url('../images/hero.jpg') center top / cover no-repeat;
  }

  .hero-grid {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-media {
    display: none;
  }

  .hero-media::before,
  .live-market-card {
    display: none;
  }

  .hero-copy {
    padding-top: 34px;
  }

  .hero h1 {
    font-size: 34px;
    max-width: 360px;
  }

  .hero-sub {
    max-width: 390px;
    font-size: 15px;
  }

  .hero-cta {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .hero-cta .btn {
    flex: 1 1 0;
    min-width: 0;
    height: 46px;
    padding: 0 12px;
    font-size: 13px;
  }

  .stats-strip {
    grid-template-columns: repeat(3, 1fr);
    margin-top: 28px;
  }

  .stat-chip {
    border-bottom: 1px solid rgba(116, 152, 205, .18);
  }

  .feature-section {
    padding-top: 30px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .auth-shell {
    padding: 28px 0 34px;
  }

  .signup-page .auth-shell {
    background:
      linear-gradient(180deg, rgba(11, 17, 28, .92), rgba(11, 17, 28, .86)),
      url('../images/signin.jpg') left center / cover no-repeat;
  }

  .auth-main,
  .login-auth-main {
    grid-template-columns: 1fr;
    display: block;
  }

  .auth-visual {
    display: none;
  }

  .auth-form-panel {
    max-width: 560px;
    margin: 0 auto;
    padding: 28px 20px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    background: transparent;
    box-shadow: none;
  }

  .auth-form-panel .form-head h2 {
    font-size: 28px;
  }

  .sidebar {
    display: none;
  }

  .dash-main {
    width: 100%;
  }

  .topbar {
    height: 60px;
    display: grid;
    grid-template-columns: 40px 1fr 40px;
    padding: 0 20px;
  }

  .dash-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(116, 152, 205, .3);
    border-radius: 10px;
    color: #fff;
  }

  .topbar-mobile-logo {
    display: block;
    justify-self: center;
  }

  .topbar-mobile-logo img {
    height: 46px;
  }

  .topbar-search,
  .topbar-icons .icon-btn:not(:first-child),
  .topbar-icons .user-menu {
    display: none;
  }

  .topbar-icons {
    justify-self: end;
  }

  .topbar-icons .icon-btn:first-child {
    display: inline-flex;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(116, 152, 205, .3);
    border-radius: 10px;
  }

  .dash-content {
    padding: 22px 22px 92px;
    max-width: none;
  }

  .dash-welcome {
    display: grid;
    grid-template-columns: 1fr auto;
    margin-bottom: 22px;
  }

  .welcome-copy {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .mobile-welcome-small {
    display: block;
    color: rgba(245,248,255,.86);
  }

  .dash-welcome h1 {
    font-size: 25px;
    margin-bottom: 0;
    color: #fff;
  }

  .welcome-prefix {
    display: none;
  }

  .wave-mark {
    display: inline-block;
    font-size: 25px;
  }

  .dash-welcome p,
  .date-pill {
    display: none;
  }

  .mobile-user-avatar {
    display: block;
    width: 54px;
    height: 54px;
    border-radius: 50%;
  }

  .mobile-user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(74, 123, 216,.28), rgba(74, 123, 216,.08));
    border: 1px solid rgba(107, 147, 230,.35);
    flex-shrink: 0;
  }

  .mobile-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .mobile-user-avatar-fallback {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
  }

  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .mobile-journal-stat {
    display: block;
  }

  .stat-card {
    padding: 15px;
  }

  .stat-card .value {
    font-size: 18px;
  }

  .stat-card .delta {
    display: none;
  }

  .stat-card .icon-box {
    width: 38px;
    height: 38px;
  }

  .dash-grid-2,
  .dash-grid-2b,
  .dash-grid-3 {
    grid-template-columns: 1fr;
  }

  .chart-card,
  .economic-card,
  .news-card,
  .dash-grid-3 {
    display: none;
  }

  .recent-signals-card {
    background: transparent;
    border: 0;
    padding: 0;
    box-shadow: none;
  }

  .recent-signals-card .panel-head {
    margin: 22px 0 10px;
  }

  .signal-row {
    background: linear-gradient(180deg, rgba(15, 32, 58, .88), rgba(7, 17, 32, .88));
    border: 1px solid rgba(116, 152, 205, .16);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 12px;
  }

  .desktop-only-row {
    display: none;
  }

  .mobile-bottom-nav {
    display: flex;
    background: rgba(4, 10, 21, .96);
    border-top-color: rgba(116, 152, 205, .16);
  }
}

@media (max-width: 560px) {
  .container {
    padding: 0 22px;
  }

  .home-hero .container {
    padding: 0 28px;
  }

  .eyebrow-pill {
    font-size: 12px;
    padding: 7px 12px;
  }

  .hero h1 {
    font-size: 33px;
  }

  .hero-social-proof {
    align-items: flex-start;
  }

  .stats-strip {
    grid-template-columns: repeat(2, 1fr);
    border-radius: 12px;
  }

  .stat-chip {
    padding: 15px 13px;
  }

  .stat-chip .icon {
    width: 30px;
    height: 30px;
  }

  .stat-chip .num {
    font-size: 16px;
  }

  .stat-chip .cap {
    font-size: 10px;
  }

  .section-head h2 {
    font-size: 26px;
  }

  .feature-card {
    min-height: auto;
  }

  .form-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .phone-group {
    display: grid;
    grid-template-columns: 88px 1fr;
  }

  .auth-form-panel {
    padding-left: 14px;
    padding-right: 14px;
  }

  .input-wrap input,
  .input-wrap select,
  .phone-code {
    font-size: 13px;
  }

  .checkbox-row {
    font-size: 12px;
  }

  .dash-content {
    padding-left: 18px;
    padding-right: 18px;
  }

  .stat-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card .label {
    font-size: 11px;
  }

  .signal-pair {
    font-size: 13px;
  }
}

@media (max-width: 390px) {
  .hero-cta {
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .hero-cta .btn {
    width: auto;
    min-width: 0;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .phone-group {
    grid-template-columns: 86px 1fr;
  }
}

/* ==========================================================================
   Auth/header refinement
   ========================================================================== */
.logo-link {
  width: 240px;
  height: 76px;
  overflow: hidden;
  border-radius: 8px;
}

.logo-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

.drawer-logo {
  width: 190px;
  height: 64px;
  object-fit: cover;
  object-position: center 42%;
  border-radius: 8px;
}

.sidebar-logo {
  display: block;
  width: 218px;
  height: 74px;
  overflow: hidden;
  border-radius: 8px;
}

.sidebar-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

.topbar-mobile-logo {
  width: 178px;
  height: 60px;
  overflow: hidden;
  border-radius: 8px;
}

.topbar-mobile-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

body.auth-page {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(11, 17, 28, .93) 0%, rgba(11, 17, 28, .73) 42%, rgba(11, 17, 28, .48) 100%),
    linear-gradient(180deg, rgba(11, 17, 28, .12), rgba(11, 17, 28, .94)),
    url('../images/signin.jpg') left center / cover fixed no-repeat;
}

body.auth-page::before {
  display: none;
}

.auth-page .navbar {
  background: rgba(11, 17, 28, .62);
  backdrop-filter: blur(14px);
}

.auth-page .auth-shell {
  background: transparent;
}

.auth-page .auth-main,
.auth-page .auth-visual,
.signup-page .auth-visual,
.login-page .auth-visual {
  background: transparent;
}

.auth-page .auth-visual {
  min-height: 700px;
  padding: 76px 20px 56px 8px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.auth-page .auth-visual::after {
  display: none;
}

.auth-page .auth-visual h1,
.auth-page .auth-visual p,
.auth-page .auth-perk {
  text-shadow: 0 3px 18px rgba(0, 0, 0, .72);
}

.auth-page .auth-visual h1 {
  max-width: 560px;
  font-size: clamp(42px, 4.2vw, 62px);
}

.auth-page .auth-visual p {
  max-width: 520px;
}

.auth-page .auth-perks {
  max-width: 520px;
}

.auth-page .auth-shark-img {
  display: none;
}

.auth-page .auth-form-panel {
  background: rgba(15, 22, 35, .58);
  border-color: rgba(164, 188, 231, .3);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .36), inset 0 1px 0 rgba(255,255,255,.05);
}

.auth-page .login-panel {
  max-width: 560px;
}

@media (max-width: 1180px) {
  .logo-link {
    width: 204px;
    height: 66px;
  }
}

@media (max-width: 900px) {
  .navbar-inner {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
  }

  .logo-link {
    width: 178px;
    height: 60px;
  }

  .auth-page .auth-shell,
  .signup-page .auth-shell,
  .login-page .auth-shell {
    background:
      linear-gradient(180deg, rgba(11, 17, 28, .88), rgba(11, 17, 28, .76) 38%, rgba(11, 17, 28, .95)),
      url('../images/signin.jpg') left center / cover no-repeat;
  }

  .auth-page .auth-visual {
    display: none;
  }

  .auth-page .auth-form-panel {
    max-width: 620px;
    padding: 24px 18px 30px;
    background: rgba(15, 22, 35, .46);
    border: 1px solid rgba(164, 188, 231, .2);
    border-radius: 12px;
    backdrop-filter: blur(10px);
  }

  .login-page .auth-form-panel {
    margin-top: 16px;
  }

  .signup-page .account-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .navbar-inner {
    min-height: 74px;
    padding: 0 14px;
  }

  .logo-link {
    width: 164px;
    height: 56px;
  }

  .mobile-drawer-head .drawer-logo {
    max-height: 40px;
  }

  .auth-shell {
    padding: 18px 0 30px;
  }

  .auth-page .auth-form-panel {
    padding: 22px 14px 26px;
  }

  .auth-page .form-row {
    gap: 10px;
  }

  .signup-page .account-row {
    grid-template-columns: 1fr;
  }

  .signup-page .contact-row label,
  .signup-page .password-row label {
    font-size: 11.5px;
  }

  .signup-page .contact-row input,
  .signup-page .contact-row select,
  .signup-page .password-row input {
    font-size: 12px;
    padding-left: 34px;
  }

  .signup-page .phone-group {
    grid-template-columns: 74px 1fr;
  }

  .signup-page .phone-code {
    font-size: 11px;
    padding-left: 7px;
    padding-right: 4px;
  }
}

@media (max-width: 390px) {
  .logo-link {
    width: 150px;
    height: 52px;
  }
}

/* Final logo and image visibility pass */
.navbar-inner {
  min-height: 80px;
}

.logo-link {
  width: 312px;
  height: 98px;
  border-radius: 10px;
}

.logo-link img {
  object-fit: cover;
  object-position: center center;
}

.site-footer .logo-link {
  width: 300px;
  height: 96px;
  margin-left: -8px;
}

.drawer-logo {
  width: 238px;
  height: 78px;
}

.sidebar-logo {
  width: 242px;
  height: 82px;
  margin-bottom: 10px;
}

.topbar-mobile-logo {
  width: 218px;
  height: 72px;
}

body.auth-page {
  background:
    linear-gradient(90deg, rgba(11, 17, 28, .66) 0%, rgba(11, 17, 28, .48) 42%, rgba(11, 17, 28, .18) 100%),
    linear-gradient(180deg, rgba(11, 17, 28, .08), rgba(11, 17, 28, .68)),
    url('../images/signin.jpg') left center / cover fixed no-repeat;
}

.auth-page .navbar {
  background: rgba(11, 17, 28, .46);
}

.auth-page .auth-shell {
  min-height: calc(100vh - 96px);
}

.auth-page .auth-form-panel {
  background: rgba(15, 22, 35, .42);
  border-color: rgba(184, 205, 244, .34);
}

.auth-page .auth-visual {
  padding-top: 90px;
}

@media (max-width: 1180px) {
  .logo-link {
    width: 258px;
    height: 84px;
  }

  .navbar-inner {
    min-height: 88px;
  }
}

@media (max-width: 900px) {
  .navbar-inner {
    min-height: 64px;
    padding: 0 16px;
  }

  .logo-link {
    width: 160px;
    height: 52px;
  }

  .auth-page .auth-shell,
  .signup-page .auth-shell,
  .login-page .auth-shell {
    min-height: calc(100vh - 64px);
    background:
      linear-gradient(180deg, rgba(11, 17, 28, .72), rgba(11, 17, 28, .7) 42%, rgba(11, 17, 28, .88)),
      url('../images/signin.jpg') left center / cover no-repeat;
  }

  .auth-page .auth-form-panel {
    background: rgba(15, 22, 35, .38);
  }

  /* Dashboard mobile topbar logo - keep inside the topbar instead of overflowing it */
  .topbar-mobile-logo {
    width: 140px;
    height: 44px;
  }
}

@media (max-width: 560px) {
  .navbar-inner {
    min-height: 56px;
    padding: 0 12px;
  }

  .logo-link {
    width: 140px;
    height: 46px;
  }

  .mobile-drawer-head .drawer-logo {
    max-height: 46px;
  }

  .auth-page .auth-shell,
  .signup-page .auth-shell,
  .login-page .auth-shell {
    min-height: calc(100vh - 56px);
    background:
      linear-gradient(180deg, rgba(11, 17, 28, .66), rgba(11, 17, 28, .72) 45%, rgba(11, 17, 28, .9)),
      url('../images/signin.jpg') left center / cover no-repeat;
  }

  .topbar {
    height: 56px;
  }

  .topbar-mobile-logo {
    width: 118px;
    height: 38px;
  }
}

@media (max-width: 390px) {
  .navbar-inner {
    min-height: 52px;
    padding: 0 10px;
  }

  .logo-link {
    width: 124px;
    height: 40px;
  }

  .topbar {
    height: 52px;
  }

  .topbar-mobile-logo {
    width: 104px;
    height: 34px;
  }
}

/* Mobile register form should fill the screen and keep key fields paired. */
@media (max-width: 700px) {
  .signup-page .auth-shell {
    min-height: calc(100vh - 56px);
    padding: 0;
  }

  .signup-page .auth-main.container {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .signup-page .auth-form-panel {
    width: 100%;
    max-width: none;
    min-height: calc(100vh - 56px);
    margin: 0;
    padding: 18px 12px 28px;
    border: 0;
    border-radius: 0;
    background: rgba(15, 22, 35, .36);
    display: block;
  }

  .signup-page .form-head {
    margin-bottom: 18px;
  }

  .signup-page .form-head h2 {
    font-size: 24px;
  }

  .signup-page .form-row {
    gap: 9px;
    margin: 0;
  }

  .signup-page .account-row {
    grid-template-columns: 1fr !important;
  }

  .signup-page .form-group {
    min-width: 0;
    margin-bottom: 13px;
  }

  .signup-page .form-group label {
    font-size: 11px;
    margin-bottom: 5px;
    white-space: nowrap;
  }

  .signup-page .input-wrap input,
  .signup-page .input-wrap select,
  .signup-page .phone-code {
    min-height: 43px;
    font-size: 12px;
  }

  .signup-page .name-row input,
  .signup-page .contact-row input,
  .signup-page .contact-row select,
  .signup-page .password-row input {
    padding-left: 32px;
    padding-right: 9px;
  }

  .signup-page .password-row input {
    padding-right: 34px;
  }

  .signup-page .field-icon {
    left: 10px;
  }

  .signup-page .phone-group {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .signup-page .phone-code {
    min-width: 0;
    padding: 0 4px 0 6px;
    font-size: 10.5px;
  }

  .signup-page .toggle-visibility {
    right: 8px;
  }

  .login-page .auth-shell {
    min-height: calc(100vh - 56px);
    padding: 0;
  }

  .login-page .auth-main.container {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .login-page .auth-form-panel {
    width: 100%;
    max-width: none;
    min-height: calc(100vh - 56px);
    margin: 0;
    padding: 18px 12px 28px;
    border: 0;
    border-radius: 0;
    background: rgba(15, 22, 35, .36);
    display: block;
  }

  .login-page .form-head {
    margin-bottom: 18px;
  }

  .login-page .form-head h2 {
    font-size: 24px;
  }
}

@media (max-width: 360px) {
  .signup-page .auth-form-panel {
    padding-left: 9px;
    padding-right: 9px;
  }

  .signup-page .form-row {
    gap: 7px;
  }

  .signup-page .phone-group {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .signup-page .input-wrap input,
  .signup-page .input-wrap select,
  .signup-page .phone-code {
    font-size: 11px;
  }

  .login-page .auth-form-panel {
    padding-left: 9px;
    padding-right: 9px;
  }
}

/* Professional mobile registration polish */
.signup-page {
  overflow-x: hidden;
}

.phone-code {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #9FABC1 50%),
    linear-gradient(135deg, #9FABC1 50%, transparent 50%);
  background-position: calc(100% - 13px) 20px, calc(100% - 8px) 20px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

@media (max-width: 700px) {
  .signup-page .auth-form-panel form {
    width: 100%;
  }

  .signup-page .input-wrap,
  .signup-page .phone-group,
  .signup-page .input-wrap input,
  .signup-page .input-wrap select,
  .signup-page .phone-code {
    min-width: 0;
  }

  .signup-page .phone-group {
    grid-template-columns: 76px minmax(0, 1fr);
    border-radius: 8px;
  }

  .signup-page .phone-code {
    height: 43px;
    padding: 0 17px 0 7px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    background-position: calc(100% - 11px) 19px, calc(100% - 7px) 19px;
    background-size: 4px 4px, 4px 4px;
  }

  .signup-page #phone {
    padding-left: 10px;
  }

  .signup-page #country {
    padding-left: 32px;
    padding-right: 18px;
    text-overflow: ellipsis;
  }

  .signup-page .contact-row .form-group:first-child {
    min-width: 0;
  }
}

@media (max-width: 430px) {
  .signup-page .auth-form-panel {
    padding-left: 10px;
    padding-right: 10px;
  }

  .signup-page .form-row {
    gap: 8px;
  }

  .signup-page .phone-group {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .signup-page .phone-code {
    font-size: 11.5px;
    padding-left: 5px;
    padding-right: 14px;
  }

  .signup-page .input-wrap input,
  .signup-page .input-wrap select {
    font-size: 11.5px;
  }
}

@media (max-width: 360px) {
  .signup-page .phone-group {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .signup-page .phone-code {
    font-size: 10.5px;
  }

  .signup-page #phone::placeholder {
    color: transparent;
  }
}

/* Reliable CSS flags for registration selects. */
.flag {
  position: relative;
  display: inline-block;
  width: 21px;
  height: 14px;
  flex: 0 0 21px;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .24);
  background: rgba(255,255,255,.12);
}

.flag::before,
.flag::after {
  content: '';
  position: absolute;
}

.flag-empty {
  background: transparent;
  border: 1px dashed rgba(170, 184, 214, .5);
  box-shadow: none;
}

.flag-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(37, 99, 235, .95), rgba(14, 165, 233, .85));
  color: #fff;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .2px;
  line-height: 1;
  text-transform: uppercase;
}

.flag-image {
  background: transparent;
}

.flag-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.flag-ca {
  background: linear-gradient(90deg, #d52b1e 0 25%, #fff 25% 75%, #d52b1e 75% 100%);
}

.flag-ca::after {
  width: 6px;
  height: 6px;
  left: 50%;
  top: 50%;
  background: #d52b1e;
  transform: translate(-50%, -50%) rotate(45deg);
}

.flag-ng {
  background: linear-gradient(90deg, #008751 0 33.33%, #fff 33.33% 66.66%, #008751 66.66% 100%);
}

.flag-za {
  background:
    linear-gradient(146deg, transparent 0 39%, #007a4d 39% 48%, #D9A441 48% 54%, #000 54% 63%, transparent 63%),
    linear-gradient(180deg, #de3831 0 50%, #002395 50% 100%);
}

.flag-gb {
  background:
    linear-gradient(27deg, transparent 0 43%, #fff 43% 48%, #c8102e 48% 52%, #fff 52% 57%, transparent 57%),
    linear-gradient(153deg, transparent 0 43%, #fff 43% 48%, #c8102e 48% 52%, #fff 52% 57%, transparent 57%),
    linear-gradient(90deg, transparent 0 42%, #fff 42% 58%, transparent 58%),
    linear-gradient(0deg, transparent 0 38%, #fff 38% 62%, transparent 62%),
    linear-gradient(90deg, transparent 0 45%, #c8102e 45% 55%, transparent 55%),
    linear-gradient(0deg, transparent 0 42%, #c8102e 42% 58%, transparent 58%),
    #012169;
}

.flag-us {
  background: repeating-linear-gradient(180deg, #b22234 0 7.69%, #fff 7.69% 15.38%);
}

.flag-us::before {
  inset: 0 auto auto 0;
  width: 44%;
  height: 54%;
  background: #3c3b6e;
}

.phone-code-shell {
  appearance: none;
  position: relative;
  flex: 0 0 96px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  padding: 0 10px;
  border: 1px solid rgba(135, 164, 213, .28);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: rgba(11, 24, 43, .92);
  font: inherit;
  cursor: pointer;
}

.phone-code-display {
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.country-select-shell .flag {
  position: absolute;
  left: 13px;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  pointer-events: none;
}

.country-select-shell select {
  padding-left: 44px !important;
}

@media (max-width: 700px) {
  .signup-page .phone-group {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .signup-page .phone-code-shell {
    flex: none;
    min-height: 43px;
    padding: 0 18px 0 6px;
    gap: 5px;
  }

  .signup-page .phone-code-shell .flag {
    width: 18px;
    height: 12px;
    flex-basis: 18px;
  }

  .signup-page .phone-code-display {
    font-size: 11px;
  }

  .signup-page .country-select-shell .flag {
    left: 10px;
    width: 18px;
    height: 12px;
    flex-basis: 18px;
  }

  .signup-page .country-select-shell select {
    padding-left: 34px !important;
  }
}

@media (max-width: 430px) {
  .signup-page .phone-group {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .signup-page .phone-code-shell {
    padding-left: 5px;
    padding-right: 16px;
  }
}

@media (max-width: 360px) {
  .signup-page .phone-group {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .signup-page .phone-code-shell .flag {
    width: 16px;
    height: 11px;
    flex-basis: 16px;
  }

  .signup-page .phone-code-display {
    font-size: 10px;
  }
}

/* Registration modal pickers */
body.modal-open {
  overflow: hidden;
  height: 100dvh;
  overscroll-behavior: none;
}

body.modal-open .dash-shell,
body.modal-open .topbar {
  pointer-events: none;
}

/* Bug fix: .dash-content .card has a hover/active lift (`transform:
   translateY(-2px)`, see the rule further down). Tapping a trigger button
   that lives inside a card (e.g. the deposit/withdraw coin & network
   pickers, both of which render as position:fixed full-screen sheets on
   mobile) puts that card into :hover/:active on touch, which — even for
   the split second the transform is non-identity while it eases back out
   — makes the card a new containing block for any position:fixed
   descendant. The "full-screen" modal then gets stuck sized/positioned
   inside the card's box instead of the viewport (looks "trapped" inside
   the panel: offset from the edges and narrower/shorter than the screen)
   instead of covering it. Killing the transform for the duration any
   modal is open removes that containing block so fixed descendants like
   .coin-dropdown-menu / .network-dropdown-menu size against the viewport
   again, the way inset: 0 intends.

   transition: none is just as important as the transform reset above.
   Mobile browsers keep :hover "stuck" on whatever was last tapped until
   something else is tapped, so after the modal is closed once, the card
   is still :hover'd and its transform eases from none back to
   translateY(-2px) over the card's own .18s transition. Re-opening the
   modal re-applies transform: none here, but without also cancelling the
   transition that reset itself animates back to identity over another
   .18s instead of snapping instantly — so on every open after the first,
   the card briefly has a non-identity transform again for that ~180ms
   window, which is exactly when the modal-fine-on-first-touch,
   trapped-on-second-touch symptom shows up. */
body.modal-open .card,
body.modal-open .card:hover,
body.modal-open .wallet-panel,
body.modal-open .coin-deposit-detail {
  transform: none !important;
  transition: none !important;
}

body.modal-open .mobile-bottom-nav {
  display: none !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

body.notification-drawer-open {
  overflow: hidden;
  overscroll-behavior: none;
}

body.notification-drawer-open .mobile-bottom-nav {
  transform: translateY(110%);
  opacity: 0;
  pointer-events: none;
}

.notification-drawer {
  position: fixed;
  inset: 0;
  z-index: 1160;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear .32s;
}

.notification-drawer.open {
  pointer-events: auto;
  visibility: visible;
  transition-delay: 0s;
}

.notification-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 6, 14, .58);
  backdrop-filter: blur(7px);
  opacity: 0;
  transition: opacity .24s ease;
}

.notification-drawer.open .notification-drawer-backdrop {
  opacity: 1;
}

.notification-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(430px, 100vw);
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(135, 164, 213, .24);
  background: linear-gradient(180deg, rgba(13, 27, 50, .99), rgba(15, 22, 35, .99));
  box-shadow: -26px 0 80px rgba(0, 0, 0, .46);
  transform: translateX(105%);
  transition: transform .32s cubic-bezier(.22, .61, .36, 1);
  overflow: hidden;
}

.notification-drawer.open .notification-drawer-panel {
  transform: translateX(0);
}

.notification-drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 22px 16px;
  border-bottom: 1px solid rgba(116, 152, 205, .14);
}

.notification-drawer-head span {
  display: block;
  margin-bottom: 5px;
  color: var(--blue-light);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.notification-drawer-head h2 {
  margin: 0;
  color: #fff;
  font-size: 22px;
  line-height: 1.1;
}

.notification-drawer-close {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid rgba(135, 164, 213, .24);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

.notification-drawer-close:hover,
.notification-drawer-close:focus-visible {
  background: rgba(255, 255, 255, .1);
}

.notification-drawer-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px 16px 18px;
}

.notification-drawer-empty {
  padding: 24px 4px;
  color: var(--text-faint);
  font-size: 13.5px;
  text-align: center;
}

.notification-drawer-list::-webkit-scrollbar {
  width: 8px;
}

.notification-drawer-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .04);
}

.notification-drawer-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(107, 147, 230, .76), rgba(61, 184, 138, .68));
}

.notification-drawer-foot {
  flex: 0 0 auto;
  padding: 12px 16px 18px;
  border-top: 1px solid rgba(116, 152, 205, .14);
}

.notification-drawer-viewmore {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(135, 164, 213, .24);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: var(--blue-light);
  font-size: 13.5px;
  font-weight: 800;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}

.notification-drawer-viewmore:hover,
.notification-drawer-viewmore:focus-visible {
  color: #fff;
  border-color: rgba(107, 147, 230, .4);
  background: rgba(107, 147, 230, .08);
  animation: sv-viewmore-bounce .7s ease infinite;
}

.notification-drawer-viewmore svg {
  flex-shrink: 0;
}

@keyframes sv-viewmore-bounce {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
  50% { transform: translateY(0); }
  70% { transform: translateY(-2px); }
}

/* The generic .btn-clicked pop (scale) is replaced here with a punchier
   vertical bounce so a tap on View More reads as a distinct, bouncy action. */
.notification-drawer-viewmore.btn-clicked {
  animation: sv-viewmore-tap-bounce .45s cubic-bezier(.34, 1.56, .64, 1);
}

@keyframes sv-viewmore-tap-bounce {
  0%   { transform: translateY(0) scale(1); }
  30%  { transform: translateY(-7px) scale(1.03); }
  55%  { transform: translateY(1px) scale(.98); }
  80%  { transform: translateY(-2px) scale(1.01); }
  100% { transform: translateY(0) scale(1); }
}

.notif-list-item.notif-jump-highlight {
  position: relative;
  animation: sv-notif-jump-slide .9s cubic-bezier(.22, .61, .36, 1);
}

.notif-list-item.notif-jump-highlight::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -2px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(107, 147, 230, .95), rgba(61, 184, 138, .85));
  animation: sv-notif-jump-bar .9s cubic-bezier(.22, .61, .36, 1);
}

@keyframes sv-notif-jump-slide {
  0% {
    transform: translateX(-22px);
    background: rgba(107, 147, 230, .2);
  }
  45% {
    transform: translateX(3px);
    background: rgba(107, 147, 230, .14);
  }
  100% {
    transform: translateX(0);
    background: transparent;
  }
}

@keyframes sv-notif-jump-bar {
  0%   { opacity: 0; transform: scaleY(.2); }
  30%  { opacity: 1; transform: scaleY(1); }
  75%  { opacity: 1; transform: scaleY(1); }
  100% { opacity: 0; transform: scaleY(1); }
}

.notification-drawer-item.notification-drawer-item-highlight {
  animation: sv-drawer-item-highlight .9s ease;
}

@keyframes sv-drawer-item-highlight {
  0% { background: rgba(107, 147, 230, .24); }
  100% { background: transparent; }
}

.notification-drawer-item {
  position: relative;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 12px;
  padding: 15px 16px 15px 2px;
  color: inherit;
  border-bottom: 1px solid rgba(116, 152, 205, .12);
}

.notification-drawer-item:hover,
.notification-drawer-item:focus-visible {
  background: rgba(107, 147, 230, .07);
}

.notification-drawer-link {
  display: block;
  min-width: 0;
  color: inherit;
}

.notification-status {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .5);
}

.notification-drawer-item.unread .notification-status {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(61, 184, 138, .12);
}

.notification-drawer-link strong,
.notification-drawer-link small,
.notification-drawer-link em {
  display: block;
}

.notification-drawer-link strong {
  color: #fff;
  font-size: 14px;
  line-height: 1.25;
}

.notification-drawer-link small {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.notification-drawer-link em {
  margin-top: 8px;
  color: var(--text-faint);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
}

.notification-delete-btn {
  position: absolute;
  right: 4px;
  bottom: 12px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(224, 106, 106, .24);
  border-radius: 10px;
  background: rgba(224, 106, 106, .08);
  color: #ffadad;
}

.notification-delete-btn:hover,
.notification-delete-btn:focus-visible {
  border-color: rgba(224, 106, 106, .46);
  background: rgba(224, 106, 106, .16);
  color: #fff;
}

.notification-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1240;
  display: none;
  place-items: center;
  padding: 18px;
}

.notification-confirm-modal.open {
  display: grid;
}

.notification-confirm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(1, 6, 14, .72);
  backdrop-filter: blur(8px);
}

.notification-confirm-card {
  position: relative;
  width: min(330px, 100%);
  border: 1px solid rgba(135, 164, 213, .24);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(16, 32, 58, .98), rgba(6, 15, 30, .98));
  box-shadow: 0 28px 80px rgba(0, 0, 0, .42);
  padding: 20px;
}

.notification-confirm-card h3 {
  margin: 0;
  color: #fff;
  font-size: 18px;
}

.notification-confirm-card p {
  margin: 8px 0 18px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.notification-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.notification-confirm-actions button {
  min-height: 40px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 900;
}

.notification-confirm-no {
  border: 1px solid rgba(135, 164, 213, .24);
  background: rgba(255, 255, 255, .04);
  color: #fff;
}

.notification-confirm-yes {
  border: 1px solid rgba(224, 106, 106, .48);
  background: rgba(224, 106, 106, .18);
  color: #fff;
}

[data-notification-item].is-removing {
  opacity: 0;
  transform: translateX(8px);
  transition: opacity .18s ease, transform .18s ease;
}

/* ==========================================================================
   Notifications page (pages/notifications.php)
   ========================================================================== */
.notif-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
}
.notif-card-head .wallet-tabs {
  margin-bottom: 0;
  border-bottom: none;
  padding-top: 0;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
}
.notif-card-head .notif-mark-all-btn {
  margin-left: auto;
  flex-shrink: 0;
}
.wallet-tab .count-badge { margin-left: 6px; }

.notif-mark-all-btn {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.notif-mark-all-btn:hover,
.notif-mark-all-btn:focus-visible {
  color: var(--green);
  border-color: rgba(61, 184, 138, .4);
  background: rgba(61, 184, 138, .08);
}
.notif-mark-all-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}
.notif-mark-all-btn:disabled:hover {
  color: var(--text-muted);
  border-color: var(--border);
  background: var(--surface);
}

.notif-list {
  display: flex;
  flex-direction: column;
}

.notif-list-item {
  position: relative;
  display: block;
  padding: 16px 46px 16px 2px;
  border-bottom: 1px solid rgba(116, 152, 205, .12);
}
.notif-list-item:last-child { border-bottom: none; }
.notif-list-item:hover { background: rgba(107, 147, 230, .05); }

.notif-body {
  display: block;
  min-width: 0;
  color: inherit;
}

.notif-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.3;
}

.notif-unread-dot {
  display: none;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(61, 184, 138, .14);
  flex-shrink: 0;
}
.notif-list-item.unread .notif-unread-dot { display: inline-block; }

.notif-message {
  display: block;
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.notif-time {
  display: block;
  margin-top: 8px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.notif-empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 48px 20px;
  color: var(--text-faint);
  text-align: center;
}
.notif-empty-state:not([hidden]) {
  display: flex;
}
.notif-empty-state p { margin: 0; font-size: 14px; font-weight: 600; }

@media (max-width: 560px) {
  .notif-card-head .wallet-tab {
    padding-left: 10px;
    padding-right: 10px;
    font-size: 13.5px;
  }
  .notif-list-item {
    padding: 14px 42px 14px 2px;
  }
}

@media (max-width: 900px) {
  .notif-card {
    display: flex;
    flex-direction: column;
  }

  .notif-list {
    max-height: 60vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .notif-list::-webkit-scrollbar {
    width: 6px;
  }

  .notif-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, .04);
  }

  .notif-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(107, 147, 230, .76), rgba(61, 184, 138, .68));
  }
}

@media (max-width: 560px) {
  .notification-drawer-panel {
    width: 100vw;
  }

  .notification-drawer-head {
    padding: 20px 16px 14px;
  }
}

.logout-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: none;
  place-items: center;
  padding: 18px;
}

.logout-confirm-modal.open {
  display: grid;
}

.logout-confirm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 6, 14, .72);
  backdrop-filter: blur(8px);
}

.logout-confirm-card {
  position: relative;
  width: min(330px, 100%);
  border: 1px solid rgba(135, 164, 213, .24);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(16, 32, 58, .98), rgba(6, 15, 30, .98));
  box-shadow: 0 28px 80px rgba(0, 0, 0, .42);
  padding: 20px;
}

.logout-confirm-card h3 {
  margin: 0;
  color: #fff;
  font-size: 18px;
}

.logout-confirm-card p {
  margin: 8px 0 18px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}

.logout-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.logout-confirm-actions button {
  min-height: 40px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 900;
}

.logout-confirm-no {
  border: 1px solid rgba(135, 164, 213, .24);
  background: rgba(255, 255, 255, .04);
  color: #fff;
}

.logout-confirm-yes {
  border: 1px solid rgba(224, 106, 106, .48);
  background: rgba(224, 106, 106, .18);
  color: #fff;
}

body.modal-open .logout-confirm-modal {
  pointer-events: auto;
}

/* ---------------- Hidden analytics gate modal (index.php) ---------------- */
.sv-secret-modal {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: none;
  place-items: center;
  padding: 18px;
}

.sv-secret-modal.open {
  display: grid;
}

.sv-secret-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 6, 14, .78);
  backdrop-filter: blur(8px);
}

.sv-secret-modal-card {
  position: relative;
  width: min(380px, 100%);
  border: 1px solid rgba(135, 164, 213, .24);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(16, 32, 58, .98), rgba(6, 15, 30, .98));
  box-shadow: 0 28px 80px rgba(0, 0, 0, .48);
  padding: 24px 22px 22px;
}

.sv-secret-modal-x {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(135, 164, 213, .24);
  background: rgba(255, 255, 255, .04);
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.sv-secret-modal-x:hover {
  color: #fff;
  border-color: rgba(135, 164, 213, .4);
}

body.modal-open .sv-secret-modal {
  pointer-events: auto;
}

.native-modal-select {
  position: absolute;
  inset: 0;
  width: 1px !important;
  height: 1px !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0;
  pointer-events: none;
  clip-path: inset(50%);
}

.country-modal-field .field-icon {
  display: none;
}

.country-select-trigger {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid rgba(135, 164, 213, .28);
  border-radius: 8px;
  background: rgba(11, 24, 43, .92);
  color: #fff;
  font-size: 14.5px;
  text-align: left;
}

.phone-code-shell:hover,
.country-select-trigger:hover {
  border-color: rgba(54, 130, 255, .55);
  background: rgba(13, 30, 54, .96);
}

.phone-code-shell:focus-visible,
.country-select-trigger:focus-visible {
  outline: 2px solid rgba(54, 130, 255, .58);
  outline-offset: 2px;
}

.phone-code-shell.field-invalid,
.country-modal-field.country-field-invalid .country-select-trigger {
  border-color: rgba(224, 106, 106, .8);
  box-shadow: 0 0 0 1px rgba(224, 106, 106, .24);
}

.country-select-trigger [data-country-trigger-label] {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-globe {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8fd9c8;
}

.country-trigger-chev {
  color: #9FABC1;
  flex: 0 0 auto;
}

.country-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
}

.country-picker-modal.open {
  display: block;
}

.country-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(8px);
}

.country-picker-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(540px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 48px));
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(135, 164, 213, .26);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(15, 32, 58, .98), rgba(15, 22, 35, .98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .48);
  overflow: hidden;
}

.country-picker-handle {
  display: none;
}

.country-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 14px;
}

.country-picker-head h3 {
  margin: 0;
  color: #fff;
  font-size: 18px;
}

.country-picker-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(135, 164, 213, .24);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.country-picker-search {
  margin: 0 20px 14px;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid rgba(135, 164, 213, .24);
  border-radius: 10px;
  background: rgba(11, 24, 43, .95);
  color: #8fd9c8;
}

.country-picker-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 14px;
}

.country-picker-list {
  overflow-y: auto;
  padding: 4px 10px 14px;
}

.country-picker-option {
  width: 100%;
  min-height: 50px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  text-align: left;
}

.country-picker-option:hover,
.country-picker-option.selected {
  background: rgba(35, 124, 255, .16);
}

.picker-country-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.picker-dial-code {
  color: #88b8ff;
  font-weight: 800;
}

.country-picker-empty {
  padding: 24px;
  color: var(--text-muted);
  text-align: center;
}

/* ---- Live market chart modal ---- */
.market-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: none;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}
.market-modal.open { display: block; }

.market-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .7);
  backdrop-filter: blur(8px);
}

.market-modal-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(980px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 40px));
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(135, 164, 213, .26);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(15, 32, 58, .98), rgba(15, 22, 35, .98));
  box-shadow: 0 30px 100px rgba(0, 0, 0, .55);
  overflow: hidden;
  isolation: isolate;
  overscroll-behavior: contain;
  touch-action: auto;
}

.market-modal-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 68px 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  min-height: 72px;
}

.market-modal-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.market-modal-title h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}

.market-modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 12.5px;
  color: var(--text-muted);
}
.market-modal-meta b { color: var(--text); }

.market-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 38px; height: 38px; flex-shrink: 0;
  border: 1px solid rgba(135, 164, 213, .24);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}
.market-modal-close:hover { background: rgba(255, 255, 255, .1); }

.market-modal-chart {
  flex: 1;
  min-height: 420px;
  background: #121A29;
  overflow: hidden;
  overscroll-behavior: contain;
}
.market-modal-chart svg { width: 100%; height: 100%; display: block; }

.market-modal-loading {
  height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 13.5px;
}

@media (max-width: 700px) {
  .market-modal {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    background: #0F1623;
  }

  .market-modal-backdrop {
    background: #0F1623;
    backdrop-filter: none;
  }

  .market-modal-chart { min-height: 340px; }
  .market-modal-head { padding: 14px 16px; }
  .market-modal-title h3 { font-size: 16px; }
}

@media (max-width: 900px) {
  .navbar-inner {
    height: 54px;
    min-height: 54px;
    grid-template-columns: 34px 1fr 34px;
    padding: 0 10px;
  }

  .logo-link {
    width: 128px;
    height: 42px;
  }

  .nav-burger-mobile-first,
  .mobile-header-spacer {
    width: 34px;
    height: 34px;
  }

  .topbar {
    height: 54px;
    grid-template-columns: 34px 1fr 34px;
    padding: 0 10px;
  }

  .topbar-mobile-logo {
    width: 128px;
    height: 42px;
  }

  .dash-menu-btn,
  .topbar-icons .icon-btn:first-child {
    width: 34px;
    height: 34px;
  }

  .auth-page .auth-shell,
  .signup-page .auth-shell,
  .login-page .auth-shell {
    min-height: calc(100vh - 54px);
  }

  .country-picker-sheet {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 82vh;
    transform: none;
    border-radius: 18px 18px 0 0;
  }

  .country-picker-handle {
    display: block;
    width: 42px;
    height: 4px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .32);
  }

  .country-select-trigger {
    min-height: 43px;
    font-size: 12px;
    padding: 0 10px;
  }
}

@media (max-width: 560px) {
  .navbar-inner {
    height: 50px;
    min-height: 50px;
    grid-template-columns: 32px 1fr 32px;
    padding: 0 8px;
  }

  .logo-link {
    width: 120px;
    height: 38px;
  }

  .topbar {
    height: 50px;
    grid-template-columns: 32px 1fr 32px;
    padding: 0 8px;
  }

  .topbar-mobile-logo {
    width: 120px;
    height: 38px;
  }

  .nav-burger-mobile-first,
  .mobile-header-spacer,
  .dash-menu-btn,
  .topbar-icons .icon-btn:first-child {
    width: 32px;
    height: 32px;
  }

  .auth-page .auth-shell,
  .signup-page .auth-shell,
  .login-page .auth-shell {
    min-height: calc(100vh - 50px);
  }

  .country-picker-head {
    padding: 16px 16px 12px;
  }

  .country-picker-search {
    margin: 0 16px 12px;
  }
}

@media (max-width: 390px) {
  .logo-link,
  .topbar-mobile-logo {
    width: 112px;
    height: 36px;
  }
}

/* Final mobile header alignment and image framing */
.logo-link,
.topbar-mobile-logo {
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-link img,
.topbar-mobile-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.home-hero {
  background:
    linear-gradient(90deg, rgba(11, 17, 28, .93) 0%, rgba(11, 17, 28, .68) 38%, rgba(11, 17, 28, .18) 68%, rgba(11, 17, 28, .46) 100%),
    linear-gradient(180deg, rgba(11, 17, 28, .2), rgba(11, 17, 28, .82)),
    url('../images/hero.jpg') center right / cover no-repeat;
}

body.auth-page {
  background:
    linear-gradient(90deg, rgba(11, 17, 28, .58) 0%, rgba(11, 17, 28, .38) 44%, rgba(11, 17, 28, .18) 100%),
    linear-gradient(180deg, rgba(11, 17, 28, .08), rgba(11, 17, 28, .58)),
    url('../images/signin.jpg') left center / cover fixed no-repeat;
}

@media (max-width: 900px) {
  .navbar-inner {
    height: 58px;
    min-height: 58px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: center;
    padding: 0 12px;
  }

  .nav-burger-mobile-first {
    grid-column: 1;
    justify-self: start;
    width: 40px;
    height: 40px;
  }

  .logo-link {
    grid-column: 2;
    justify-self: center;
    align-self: center;
    width: 172px;
    height: 54px;
  }

  .navbar-actions {
    grid-column: 3;
    justify-self: end;
  }

  .mobile-header-spacer {
    display: block;
    width: 40px;
    height: 40px;
  }

  .topbar {
    height: 58px;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: center;
    padding: 0 12px;
  }

  .dash-menu-btn {
    grid-column: 1;
    justify-self: start;
    width: 40px;
    height: 40px;
  }

  .topbar-mobile-logo {
    grid-column: 2;
    justify-self: center;
    align-self: center;
    width: 172px;
    height: 54px;
  }

  .topbar-icons {
    grid-column: 3;
    justify-self: end;
  }

  .topbar-icons .icon-btn:first-child {
    width: 40px;
    height: 40px;
  }

  .home-hero {
    background:
      linear-gradient(180deg, rgba(11, 17, 28, .82) 0%, rgba(11, 17, 28, .64) 42%, rgba(11, 17, 28, .92) 100%),
      linear-gradient(90deg, rgba(11, 17, 28, .92) 0%, rgba(11, 17, 28, .48) 54%, rgba(11, 17, 28, .26) 100%),
      url('../images/hero.jpg') 58% top / cover no-repeat;
  }

  body.auth-page {
    background: #0F1623;
  }

  .auth-page .auth-shell,
  .signup-page .auth-shell,
  .login-page .auth-shell {
    min-height: calc(100vh - 58px);
    background:
      linear-gradient(180deg, rgba(11, 17, 28, .76), rgba(11, 17, 28, .66) 40%, rgba(11, 17, 28, .9)),
      linear-gradient(90deg, rgba(11, 17, 28, .52), rgba(11, 17, 28, .2)),
      url('../images/signin.jpg') left center / cover no-repeat;
  }
}

@media (max-width: 560px) {
  .navbar-inner {
    height: 54px;
    min-height: 54px;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    padding: 0 10px;
  }

  .nav-burger-mobile-first,
  .mobile-header-spacer {
    width: 38px;
    height: 38px;
  }

  .logo-link {
    width: 160px;
    height: 50px;
  }

  .topbar {
    height: 54px;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    padding: 0 10px;
  }

  .dash-menu-btn,
  .topbar-icons .icon-btn:first-child {
    width: 38px;
    height: 38px;
  }

  .topbar-mobile-logo {
    width: 160px;
    height: 50px;
  }

  .home-hero {
    background:
      linear-gradient(180deg, rgba(11, 17, 28, .8) 0%, rgba(11, 17, 28, .66) 44%, rgba(11, 17, 28, .94) 100%),
      linear-gradient(90deg, rgba(11, 17, 28, .92) 0%, rgba(11, 17, 28, .5) 58%, rgba(11, 17, 28, .24) 100%),
      url('../images/hero.jpg') 56% top / cover no-repeat;
  }

  .auth-page .auth-shell,
  .signup-page .auth-shell,
  .login-page .auth-shell {
    min-height: calc(100vh - 54px);
    background:
      linear-gradient(180deg, rgba(11, 17, 28, .72), rgba(11, 17, 28, .68) 42%, rgba(11, 17, 28, .9)),
      url('../images/signin.jpg') left center / cover no-repeat;
  }
}

@media (max-width: 390px) {
  .navbar-inner,
  .topbar {
    height: 52px;
    min-height: 52px;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    padding: 0 8px;
  }

  .nav-burger-mobile-first,
  .mobile-header-spacer,
  .dash-menu-btn,
  .topbar-icons .icon-btn:first-child {
    width: 36px;
    height: 36px;
  }

  .logo-link,
  .topbar-mobile-logo {
    width: 150px;
    height: 48px;
  }
}

/* Homepage market ticker, photo avatars, and final mobile header scale */
.logo-link img,
.topbar-mobile-logo img {
  object-fit: contain;
  object-position: center center;
}

.hero-social-proof {
  align-items: center;
}

.avatar-stack img {
  width: 38px;
  height: 38px;
  border: 2px solid #121A29;
  border-radius: 50%;
  margin-left: -10px;
  object-fit: cover;
  object-position: center;
  background: #121A29;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 8px 18px rgba(0,0,0,.26);
}

.avatar-stack img:first-child {
  margin-left: 0;
}

.market-ticker-wrap {
  position: relative;
  z-index: 3;
  margin-top: -16px;
  margin-bottom: 22px;
}

.market-ticker {
  min-height: 54px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  overflow: hidden;
  border: 1px solid rgba(116, 152, 205, .2);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(13, 31, 56, .82), rgba(8, 18, 34, .72));
  box-shadow: 0 18px 44px rgba(0,0,0,.24);
  backdrop-filter: blur(14px);
}

.ticker-label {
  height: 100%;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  border-right: 1px solid rgba(116, 152, 205, .18);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.ticker-track {
  min-width: 0;
  display: flex;
  align-items: center;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%);
}

/* .ticker-rail holds both .ticker-content copies back-to-back and is the
   element that actually moves. Driven from JS (home-redesign.js), which
   measures the real pixel width of one copy and wraps the offset by
   exactly that amount every frame — not a CSS @keyframes translateX(-100%)
   on each copy independently. That older approach looked fine at a
   glance but broke (visible jump/stall) the moment live price text
   changed a copy's own width mid-cycle, since the animation's -100% is
   resolved against that copy's current box size. Wrapping in JS with a
   measured pixel width is immune to that. */
.ticker-rail {
  display: flex;
  flex: none;
  width: max-content;
  will-change: transform;
}

.ticker-content {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 26px;
  min-width: max-content;
  padding-right: 26px;
}

.ticker-content span {
  color: rgba(245,248,255,.82);
  font-size: 13px;
  white-space: nowrap;
}

.ticker-content b {
  color: #fff;
  font-weight: 900;
}

.ticker-content em {
  font-style: normal;
  font-weight: 900;
}

.ticker-content .up {
  color: #3DB88A;
}

.ticker-content .down {
  color: #ff7a7a;
}

.home-hero {
  background:
    linear-gradient(90deg, rgba(11, 17, 28, .88) 0%, rgba(11, 17, 28, .62) 36%, rgba(11, 17, 28, .12) 68%, rgba(11, 17, 28, .34) 100%),
    linear-gradient(180deg, rgba(11, 17, 28, .12), rgba(11, 17, 28, .72)),
    url('../images/hero.jpg') center right / cover no-repeat;
}

body.auth-page {
  background:
    linear-gradient(90deg, rgba(11, 17, 28, .48) 0%, rgba(11, 17, 28, .28) 44%, rgba(11, 17, 28, .1) 100%),
    linear-gradient(180deg, rgba(11, 17, 28, .06), rgba(11, 17, 28, .52)),
    url('../images/signin.jpg') left center / cover fixed no-repeat;
}

@media (max-width: 900px) {
  .navbar-inner,
  .topbar {
    height: 96px;
    min-height: 96px;
    grid-template-columns: 42px minmax(0, 1fr) 42px;
    padding: 0 12px;
  }

  .nav-burger-mobile-first,
  .mobile-header-spacer,
  .dash-menu-btn,
  .topbar-icons .icon-btn:first-child {
    width: 42px;
    height: 42px;
  }

  .logo-link,
  .topbar-mobile-logo {
    width: 184px;
    height: 58px;
    justify-self: center;
  }

  .home-hero {
    background:
      linear-gradient(180deg, rgba(11, 17, 28, .74) 0%, rgba(11, 17, 28, .58) 42%, rgba(11, 17, 28, .88) 100%),
      linear-gradient(90deg, rgba(11, 17, 28, .86) 0%, rgba(11, 17, 28, .42) 54%, rgba(11, 17, 28, .18) 100%),
      url('../images/hero.jpg') 58% top / cover no-repeat;
  }

  .auth-page .auth-shell,
  .signup-page .auth-shell,
  .login-page .auth-shell {
    min-height: calc(100vh - 62px);
    background:
      linear-gradient(180deg, rgba(11, 17, 28, .68), rgba(11, 17, 28, .58) 40%, rgba(11, 17, 28, .86)),
      linear-gradient(90deg, rgba(11, 17, 28, .46), rgba(11, 17, 28, .14)),
      url('../images/signin.jpg') left center / cover no-repeat;
  }
}

@media (max-width: 700px) {
  .market-ticker-wrap {
    margin-top: 6px;
    margin-bottom: 18px;
  }

  .market-ticker {
    grid-template-columns: 1fr;
    gap: 0;
    min-height: 60px;
  }

  .ticker-label {
    min-height: 28px;
    justify-content: center;
    border-right: 0;
    border-bottom: 1px solid rgba(116, 152, 205, .16);
  }

  .ticker-track {
    min-height: 30px;
  }

  .ticker-content {
    gap: 20px;
  }
}

@media (max-width: 560px) {
  .navbar-inner,
  .topbar {
    height: 92px;
    min-height: 92px;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    padding: 0 10px;
  }

  .nav-burger-mobile-first,
  .mobile-header-spacer,
  .dash-menu-btn,
  .topbar-icons .icon-btn:first-child {
    width: 40px;
    height: 40px;
  }

  .logo-link,
  .topbar-mobile-logo {
    width: 172px;
    height: 54px;
  }

  .avatar-stack img {
    width: 34px;
    height: 34px;
  }

  .home-hero {
    background:
      linear-gradient(180deg, rgba(11, 17, 28, .72) 0%, rgba(11, 17, 28, .6) 44%, rgba(11, 17, 28, .9) 100%),
      linear-gradient(90deg, rgba(11, 17, 28, .88) 0%, rgba(11, 17, 28, .44) 58%, rgba(11, 17, 28, .16) 100%),
      url('../images/hero.jpg') 56% top / cover no-repeat;
  }

  .auth-page .auth-shell,
  .signup-page .auth-shell,
  .login-page .auth-shell {
    min-height: calc(100vh - 58px);
    background:
      linear-gradient(180deg, rgba(11, 17, 28, .66), rgba(11, 17, 28, .62) 42%, rgba(11, 17, 28, .86)),
      url('../images/signin.jpg') left center / cover no-repeat;
  }
}

@media (max-width: 390px) {
  .navbar-inner,
  .topbar {
    height: 88px;
    min-height: 88px;
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    padding: 0 8px;
  }

  .nav-burger-mobile-first,
  .mobile-header-spacer,
  .dash-menu-btn,
  .topbar-icons .icon-btn:first-child {
    width: 38px;
    height: 38px;
  }

  .logo-link,
  .topbar-mobile-logo {
    width: 160px;
    height: 52px;
  }
}

/* Professional interactive homepage sections */
.section-head-row {
  max-width: none;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.section-head-row > div {
  max-width: 640px;
}

.home-page .panel-card {
  border: 1px solid rgba(116, 152, 205, .22);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(15, 32, 58, .86), rgba(7, 17, 32, .88));
  box-shadow: 0 18px 50px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.04);
}

.home-page .panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.home-page .panel-head h3 {
  margin: 4px 0 0;
  color: #fff;
  font-size: 22px;
}

.home-page .panel-head a {
  color: var(--blue-light);
  font-size: 13px;
  font-weight: 800;
}

.home-page .panel-kicker {
  color: #6B93E6;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
}

.market-section {
  padding-top: 70px;
  background: linear-gradient(180deg, rgba(15, 22, 35, .72), rgba(11, 17, 28, .92));
}

.market-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 20px;
}

.market-watch,
.signal-preview,
.performance-chart,
.trade-calculator,
.testimonial-panel,
.faq-panel {
  padding: 22px;
}

.market-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(34, 240, 120, .28);
  border-radius: 999px;
  color: #3DB88A;
  background: rgba(61, 184, 138, .1);
  font-size: 12px;
  font-weight: 900;
}

.quote-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(116, 152, 205, .16);
  border-radius: 10px;
  background: rgba(4, 12, 24, .48);
}

.quote-label {
  display: block;
  margin-bottom: 4px;
  color: rgba(245,248,255,.62);
  font-size: 12px;
}

.quote-card strong {
  color: #fff;
  font-size: clamp(28px, 4vw, 44px);
}

.quote-change {
  font-weight: 900;
}

.quote-change.up { color: #3DB88A; }
.quote-change.down { color: #ff7a7a; }

.market-sparkline {
  width: 100%;
  height: 180px;
  margin-bottom: 18px;
}

.market-selector {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.market-selector button,
.results-tabs button {
  min-height: 42px;
  border: 1px solid rgba(116, 152, 205, .18);
  border-radius: 8px;
  background: rgba(4, 12, 24, .42);
  color: rgba(245,248,255,.82);
  font-weight: 800;
}

.market-selector button.active,
.results-tabs button.active {
  border-color: rgba(54, 130, 255, .62);
  background: linear-gradient(135deg, rgba(35, 124, 255, .28), rgba(7, 84, 233, .18));
  color: #fff;
}

.home-signal-list {
  display: grid;
  gap: 12px;
}

.home-signal-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(116, 152, 205, .16);
  border-radius: 8px;
  background: rgba(4, 12, 24, .42);
}

.home-signal-row strong,
.home-signal-row span {
  display: block;
}

.home-signal-row strong {
  color: #fff;
  font-size: 15px;
}

.home-signal-row span {
  color: rgba(245,248,255,.62);
  font-size: 12px;
}

.home-signal-row b {
  min-width: 48px;
  padding: 5px 8px;
  border-radius: 6px;
  text-align: center;
  font-size: 11px;
}

.home-signal-row .buy {
  color: #54f49c;
  background: rgba(61, 184, 138, .18);
}

.home-signal-row .sell {
  color: #ff7a7a;
  background: rgba(224, 106, 106, .18);
}

.home-signal-row em {
  color: #fff;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

.results-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 24px 0;
}

.results-tabs button {
  min-width: 116px;
}

.performance-board {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
  gap: 20px;
}

.home-page .performance-chart .panel-head strong {
  color: #3DB88A;
  font-size: 24px;
}

.bar-chart {
  height: 280px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: end;
  gap: 12px;
  padding-top: 24px;
}

.bar-chart span {
  min-height: 28px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #2f89ff, #3A66BD);
  box-shadow: 0 12px 24px rgba(7, 84, 233, .24);
}

.performance-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.metric-card {
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid rgba(116, 152, 205, .2);
  border-radius: 10px;
  background: rgba(8, 18, 34, .74);
}

.metric-card span {
  color: rgba(245,248,255,.62);
  font-size: 13px;
}

.metric-card strong {
  color: #fff;
  font-size: clamp(24px, 3vw, 34px);
}

.planner-section {
  background: linear-gradient(180deg, rgba(11, 17, 28, .92), rgba(15, 22, 35, .78));
}

.planner-layout {
  display: grid;
  grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr);
  gap: 36px;
  align-items: center;
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.calc-grid label {
  color: rgba(245,248,255,.76);
  font-size: 13px;
  font-weight: 800;
}

.calc-grid input {
  width: 100%;
  min-height: 46px;
  margin-top: 8px;
  padding: 0 12px;
  border: 1px solid rgba(116, 152, 205, .22);
  border-radius: 8px;
  background: rgba(4, 12, 24, .62);
  color: #fff;
}

.calc-grid input[type="range"] {
  padding: 0;
  accent-color: #4A7BD8;
}

.calc-grid label > span {
  display: block;
  margin-top: 6px;
  color: #6B93E6;
}

.calc-results {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.calc-results div {
  padding: 16px;
  border-radius: 8px;
  background: rgba(35, 124, 255, .12);
}

.calc-results span,
.calc-results strong {
  display: block;
}

.calc-results span {
  color: rgba(245,248,255,.62);
  font-size: 12px;
}

.calc-results strong {
  margin-top: 5px;
  color: #fff;
  font-size: 22px;
}

.trust-layout {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: 20px;
}

.testimonial-panel p {
  margin: 0 0 18px;
  color: #fff;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.35;
}

.testimonial-panel > span {
  color: rgba(245,248,255,.62);
}

.testimonial-controls {
  display: flex;
  gap: 8px;
}

.testimonial-controls button {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(116, 152, 205, .22);
  border-radius: 8px;
  background: rgba(4, 12, 24, .48);
  color: #fff;
  font-size: 24px;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-item {
  width: 100%;
  padding: 16px;
  border: 1px solid rgba(116, 152, 205, .16);
  border-radius: 8px;
  background: rgba(4, 12, 24, .4);
  color: #fff;
  text-align: left;
}

.faq-item span {
  display: block;
  font-weight: 900;
}

.faq-item em {
  display: none;
  margin-top: 8px;
  color: rgba(245,248,255,.68);
  font-style: normal;
  line-height: 1.55;
}

.faq-item.open {
  border-color: rgba(54, 130, 255, .38);
  background: rgba(35, 124, 255, .1);
}

.faq-item.open em {
  display: block;
}

.home-cta-section {
  padding: 32px 0 82px;
}

.home-cta-band {
  min-height: 148px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 28px;
  border: 1px solid rgba(116, 152, 205, .24);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(35, 124, 255, .2), rgba(8, 18, 34, .86)),
    url('../images/hero.jpg') center right / cover no-repeat;
}

.home-cta-band h2 {
  margin: 6px 0 0;
  color: #fff;
  font-size: clamp(26px, 3vw, 38px);
}

@media (max-width: 980px) {
  .section-head-row,
  .home-cta-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .market-workspace,
  .performance-board,
  .planner-layout,
  .trust-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .market-selector,
  .performance-metrics,
  .calc-grid,
  .calc-results {
    grid-template-columns: 1fr;
  }

  .home-signal-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .home-signal-row em {
    grid-column: 1 / -1;
  }

  .bar-chart {
    height: 210px;
    gap: 8px;
  }
}

/* Homepage arrangement polish */
.home-page main {
  background:
    linear-gradient(180deg, #0F1623 0%, #031022 45%, #0F1623 100%);
}

.home-page .section {
  padding: 72px 0;
}

.home-page .feature-section,
.home-page .results-section,
.home-page .trust-section {
  background: #0F1623;
}

.home-page .market-section,
.home-page .planner-section {
  border-top: 1px solid rgba(116, 152, 205, .08);
  border-bottom: 1px solid rgba(116, 152, 205, .08);
}

.home-page .feature-layout {
  grid-template-columns: minmax(300px, .78fr) minmax(0, 1.22fr);
  gap: 48px;
  align-items: center;
}

.home-page .feature-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-page .feature-card {
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.home-page .feature-card:hover,
.home-page .panel-card:hover,
.home-page .metric-card:hover {
  border-color: rgba(54, 130, 255, .36);
}

.home-page .market-workspace {
  align-items: stretch;
}

.home-page .signal-preview {
  display: flex;
  flex-direction: column;
}

.home-page .home-signal-list {
  flex: 1;
  align-content: start;
}

.home-page .results-section {
  padding-top: 78px;
}

.home-page .results-head {
  max-width: 720px;
  margin: 0 auto;
}

.home-page .performance-metrics {
  align-content: stretch;
}

.home-page .metric-card {
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.home-page .planner-layout .section-head {
  max-width: 520px;
}

.home-page .trade-calculator {
  position: relative;
  overflow: hidden;
}

.home-page .trade-calculator::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 88% 0%, rgba(35, 124, 255, .2), transparent 20rem);
}

.home-page .trade-calculator > * {
  position: relative;
  z-index: 1;
}

.home-page .trust-section {
  padding-top: 76px;
}

.home-page .testimonial-panel,
.home-page .faq-panel {
  min-height: 300px;
}

.home-page .testimonial-panel {
  display: flex;
  flex-direction: column;
}

.home-page .testimonial-panel p {
  flex: 1;
}

.home-page .faq-item,
.home-page .market-selector button,
.home-page .results-tabs button,
.home-page .testimonial-controls button {
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.home-page .faq-item:hover,
.home-page .market-selector button:hover,
.home-page .results-tabs button:hover,
.home-page .testimonial-controls button:hover {
  border-color: rgba(54, 130, 255, .42);
  transform: translateY(-1px);
}

.home-page .faq-item:focus-visible,
.home-page .market-selector button:focus-visible,
.home-page .results-tabs button:focus-visible,
.home-page .testimonial-controls button:focus-visible,
.home-page .calc-grid input:focus-visible {
  outline: 2px solid rgba(54, 130, 255, .62);
  outline-offset: 2px;
}

.home-page .home-cta-band {
  overflow: hidden;
  position: relative;
}

.home-page .home-cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(11, 17, 28, .9) 0%, rgba(11, 17, 28, .68) 48%, rgba(11, 17, 28, .24) 100%);
}

.home-page .home-cta-band > * {
  position: relative;
  z-index: 1;
}

@media (max-width: 980px) {
  .home-page .section {
    padding: 58px 0;
  }

  .home-page .feature-layout,
  .home-page .feature-grid {
    grid-template-columns: 1fr;
  }

  .home-page .feature-layout {
    gap: 26px;
  }

  .home-page .section-head-row .btn,
  .home-page .home-cta-band .btn {
    width: auto;
  }
}

@media (max-width: 700px) {
  .home-page .section {
    padding: 46px 0;
  }

  .home-page .market-watch,
  .home-page .signal-preview,
  .home-page .performance-chart,
  .home-page .trade-calculator,
  .home-page .testimonial-panel,
  .home-page .faq-panel {
    padding: 18px;
  }

  .home-page .panel-head {
    gap: 12px;
  }

  .home-page .panel-head h3 {
    font-size: 18px;
  }

  .home-page .quote-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-page .market-sparkline {
    height: 130px;
  }

  .home-page .results-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-page .results-tabs button {
    min-width: 0;
  }

  .home-page .metric-card {
    min-height: 108px;
  }

  .home-page .calc-results div {
    padding: 14px;
  }

  .home-page .testimonial-panel,
  .home-page .faq-panel {
    min-height: 0;
  }

  .home-page .home-cta-band {
    padding: 24px 20px;
  }
}

@media (max-width: 430px) {
  .home-page .home-signal-row {
    gap: 10px;
    padding: 12px;
  }

  .home-page .market-selector {
    gap: 8px;
  }

  .home-page .bar-chart {
    height: 170px;
  }

  .home-page .home-cta-band .btn,
  .home-page .section-head-row .btn {
    width: 100%;
  }
}

/* ==========================================================================
   Bigger mobile logo (final override — bumps every earlier mobile size)
   ========================================================================== */
@media (max-width: 900px) {
  .logo-link,
  .topbar-mobile-logo {
    width: 232px;
    height: 74px;
  }

  .drawer-logo,
  .mobile-drawer-head .drawer-logo {
    max-height: 52px;
  }
}

@media (max-width: 560px) {
  .logo-link,
  .topbar-mobile-logo {
    width: 210px;
    height: 68px;
  }

  .drawer-logo,
  .mobile-drawer-head .drawer-logo {
    max-height: 46px;
  }
}

@media (max-width: 390px) {
  .logo-link,
  .topbar-mobile-logo {
    width: 192px;
    height: 62px;
  }

  .drawer-logo,
  .mobile-drawer-head .drawer-logo {
    max-height: 40px;
  }
}

/* ==========================================================================
   Wallet page — tabs, coin selector, deposit detail
   ========================================================================== */
.wallet-card { padding: 8px 24px 24px; }

/* ---- Wallet page: Trade History card (desktop) + mobile trigger ---- */
.wallet-main-row { display: block; }
.wallet-main-row .wallet-card { margin-bottom: var(--dash-row-gap); }
.wallet-trade-history-card { display: none; }

/* Match the pure-black panel used by the "View Trades" modal
   (.dash-trade-modal) instead of the site's usual navy card gradient. */
.wallet-trade-history-card {
  background: #0a0a0d;
  border-color: rgba(255, 255, 255, .08);
}

@media (min-width: 901px) {
  .wallet-main-row {
    display: flex;
    align-items: stretch;
    gap: var(--dash-row-gap);
  }
  .wallet-main-row .wallet-card {
    flex: 1.4 1 480px;
    min-width: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    height: min(680px, 78vh);
  }
  .wallet-main-row .wallet-card-head { flex-shrink: 0; }
  .wallet-main-row .wallet-panel.active {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
  }
  .wallet-trade-history-card {
    display: flex;
    flex-direction: column;
    flex: 1 1 360px;
    min-width: 0;
    margin-bottom: 0;
    height: min(680px, 78vh);
  }
  .wallet-trade-history-card .panel-head,
  .wallet-trade-history-card .trade-history-card-stats {
    flex-shrink: 0;
  }
  .wallet-trade-history-card .trade-pulse {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 6px;
  }
}

.wallet-trade-history-trigger {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 15px 16px;
  margin-bottom: var(--dash-row-gap);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.wallet-trade-history-trigger-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(74, 123, 216, 0.12);
  color: var(--blue);
}
.wallet-trade-history-trigger-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wallet-trade-history-trigger-copy strong { font-size: 14px; font-weight: 800; }
.wallet-trade-history-trigger-copy small { font-size: 12px; color: var(--text-muted); }
.wallet-trade-history-trigger-chevron { flex-shrink: 0; color: var(--text-faint); }

@media (min-width: 901px) {
  .wallet-trade-history-trigger { display: none; }
}

/* Reuse the .trade-modal machinery (see the Trade modal section further
   down) for the Wallet page's mobile "Trade History" full-screen modal —
   same fixed overlay + body.modal-open scroll-lock so nothing behind it
   is visible or scrollable while it's open. */
.trade-modal-history-card { margin-top: 22px; }

/* Trade History rows inside either "View Trades" modal (portfolio.php +
   wallet.php) always read as a plain horizontal-line list — each row
   divided from the next by a single bottom border, no boxed/bordered
   "tile" per row — matching the compact list styling already used for
   Trade History and Recent Transactions on the main dashboard, instead
   of the bordered-tile treatment .trade-pulse-row uses by default
   elsewhere (e.g. pages/journal.php). Applies at every viewport, not
   just the <900px rules further down that do the same thing for the
   dashboard's inline (non-modal) cards. */
.trade-modal-history-card .trade-pulse-list { gap: 0; }
.trade-modal-history-card .trade-pulse-row {
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding-left: 2px;
  padding-right: 2px;
}
.trade-modal-history-card .trade-pulse-row:last-child { border-bottom: none; }
.trade-modal-history-card .trade-pulse-row:hover { background: rgba(255, 255, 255, 0.03); }

/* Solid black container (var(--bg-elevated) is the app's darkest surface
   tone) instead of the default .card background — the modal itself is a
   dark navy gradient, so the card was barely distinguishable from it at
   the lighter default .card background. */
.trade-modal-history-card {
  background: var(--bg-elevated);
  border-color: rgba(255, 255, 255, .06);
}

/* On narrow screens, bleed the card out to the edges of the modal — same
   treatment as the dashboard's own Trade History card on mobile (see the
   .balance-chart-row .dash-trade-history-card rules further down) —
   instead of sitting inset inside the modal's 22px side padding. The
   Performance card gets the same width treatment so both containers in
   the modal line up edge-to-edge instead of Performance staying narrower. */
@media (max-width: 560px) {
  .trade-modal-history-card,
  .trade-modal-performance-card {
    width: calc(100% + 44px);
    margin-left: -22px;
    margin-right: -22px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    padding-left: 16px;
    padding-right: 16px;
  }
}


.wallet-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 6px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}
.wallet-card-head .wallet-tabs {
  margin-bottom: 0;
  padding-top: 0;
  border-bottom: none;
}
.wallet-card-head .balance-card-slim { margin-bottom: 10px; }

.wallet-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
  padding-top: 6px;
}
.wallet-tab {
  appearance: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14.5px;
  font-weight: 700;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.wallet-tab:hover { color: var(--text); }
.wallet-tab.active { color: var(--blue-light); border-color: var(--blue); }

.wallet-panel { display: none; }
/* Opacity-only on purpose (no transform): this panel is the containing
   element for the coin-dropdown / network-picker full-screen modals.
   A transform here — even a subtle translateY — gives position:fixed
   descendants a containing block other than the viewport for as long as
   the animation runs, so a modal opened during this transition would
   render boxed to the panel instead of full-screen and visibly jump
   once the animation finished. Keep this transform-free. */
.wallet-panel.active { display: block; animation: sv-panel-fade-in .3s ease; }
@keyframes sv-panel-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sv-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.wallet-panel-sub { color: var(--text-muted); font-size: 14px; margin: 0 0 20px; line-height: 1.6; }

.wallet-tx-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.wallet-tx-icon.tx-in { background: rgba(61, 184, 138,.14); color: var(--green); }
.wallet-tx-icon.tx-out { background: rgba(224, 106, 106,.14); color: var(--red); }
.wallet-tx-copy { flex: 1; min-width: 0; }
.wallet-tx-title { font-size: 14.5px; font-weight: 600; color: var(--text); }
.wallet-tx-amt { font-size: 14.5px; font-weight: 700; white-space: nowrap; }

/* ---- Deposit / withdrawal history table (column layout) ---- */
.wallet-history-table { width: 100%; }
.wallet-history-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, .9fr);
  align-items: center;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--border);
}
.wallet-history-row:last-child { border-bottom: none; }

.wallet-history-head {
  padding: 0 4px 10px;
  border-bottom: 1px solid var(--border-strong);
}
.wallet-history-head span {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.wallet-history-head .wallet-history-col-amt { text-align: right; }

.wallet-history-col-type { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wallet-history-col-date { font-size: 13.5px; color: var(--text-muted); }
.wallet-history-col-status { display: flex; }
.wallet-history-col-amt { font-size: 14.5px; font-weight: 700; white-space: nowrap; text-align: right; }

.badge-status-completed { background: rgba(61, 184, 138,.14); color: var(--green); }
.badge-status-pending { background: rgba(217,164,65,.14); color: #D9A441; }
.badge-status-failed { background: rgba(224, 106, 106,.14); color: var(--red); }

@media (max-width: 640px) {
  .wallet-history-head { display: none; }
  .wallet-history-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px 4px;
  }
  .wallet-history-col-date,
  .wallet-history-col-status,
  .wallet-history-col-amt {
    padding-left: 50px;
  }
  .wallet-history-col-date::before,
  .wallet-history-col-status::before,
  .wallet-history-col-amt::before {
    content: attr(data-label);
    display: inline-block;
    min-width: 56px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: var(--text-faint);
    margin-right: 8px;
  }
  .wallet-history-col-amt { text-align: left; }
}
.tx-amt-in { color: var(--green); }
.tx-amt-out { color: var(--red); }

/* ---- Coin dropdown (used for both Deposit coin picker and Withdraw coin picker) ---- */
.coin-dropdown {
  position: relative;
  margin-bottom: 24px;
  max-width: 360px;
}

/* Deposit panel: every other row (QR/network/address grid, amount field,
   submit row, note) spans the full panel width, so the coin picker should
   match that width instead of floating narrower than everything below it. */
[data-wallet-panel="deposit"] .coin-dropdown {
  max-width: none;
}
.coin-dropdown-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.coin-dropdown-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%;
  appearance: none; cursor: pointer;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text);
  text-align: left;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.coin-dropdown-trigger:hover { border-color: var(--border-strong); }
.coin-dropdown.open .coin-dropdown-trigger {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}
.coin-dropdown-selected { display: flex; align-items: center; gap: 12px; min-width: 0; }
.coin-dropdown-selected svg { flex-shrink: 0; }
.coin-dropdown-selected-text { display: flex; flex-direction: column; min-width: 0; }
.coin-dropdown-selected-text strong { font-size: 14.5px; font-weight: 700; line-height: 1.3; }
.coin-dropdown-selected-text small { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.coin-dropdown-chevron {
  flex-shrink: 0;
  color: var(--text-faint);
  transition: transform .18s ease;
}
.coin-dropdown.open .coin-dropdown-chevron { transform: rotate(180deg); color: var(--blue-light); }

.coin-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  display: none;
  flex-direction: column;
  gap: 2px;
  max-height: min(360px, 60vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.coin-dropdown.open .coin-dropdown-menu { display: flex; animation: sv-fade-in .16s ease; }

.coin-dropdown-option {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  appearance: none; cursor: pointer;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 10px 10px;
  color: var(--text);
  text-align: left;
  transition: background .15s ease;
}
.coin-dropdown-option:hover { background: var(--surface-2); }
.coin-dropdown-option.active {
  background: color-mix(in srgb, var(--coin-accent, var(--blue)) 14%, var(--surface-2));
}
.coin-dropdown-option svg:first-child,
.coin-dropdown-option img:first-child,
.coin-dropdown-option-icon { flex-shrink: 0; border-radius: 50%; }
.coin-dropdown-option-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.coin-dropdown-option-text strong { font-size: 14px; font-weight: 700; }
.coin-dropdown-option-text small { font-size: 11.5px; color: var(--text-muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin-dropdown-check { flex-shrink: 0; color: var(--coin-accent, var(--blue)); opacity: 0; }
.coin-dropdown-option.active .coin-dropdown-check { opacity: 1; }

/* Mobile full-screen modal chrome for the coin dropdown (deposit + withdraw
   coin pickers). Hidden/inert on desktop — see the max-width:720px block
   below, which is what actually turns .coin-dropdown-menu into a full-screen
   sheet and reveals these elements. */
.coin-dropdown-modal-backdrop { display: none; }
.coin-dropdown-modal-head { display: none; }

.network-dropdown {
  max-width: 320px;
  margin-bottom: 0;
}
.network-dropdown-trigger {
  min-height: 42px;
  padding: 9px 12px;
}
.network-dropdown .coin-dropdown-selected-text strong {
  font-size: 13.5px;
}
.network-dropdown-selected-icon { border-radius: 50%; flex-shrink: 0; }
.network-dropdown-menu {
  max-height: min(220px, 50vh);
}
.coin-network-single {
  display: inline-flex; align-items: center; gap: 8px;
}
.coin-network-single img { border-radius: 50%; flex-shrink: 0; }

.coin-deposit-detail { display: none; }
/* Opacity-only, same reasoning as .wallet-panel.active above: the
   per-coin network picker (.network-dropdown-menu, position:fixed on
   mobile) lives nested inside this block, so a transform here would
   trap that modal inside this panel's box for the duration of the
   swap animation whenever it's opened right after picking a coin. */
.coin-deposit-detail.active { display: block; animation: sv-panel-fade-in .3s ease; }

/* Network row -> QR code -> Address row, stacked in that order on both
   mobile and desktop (replaces the old QR-beside-info grid). */
.coin-deposit-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 420px;
}

.coin-qr {
  width: min(200px, 100%);
  margin: 0 auto;
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  border: 3px solid var(--coin-accent, var(--blue));
  text-align: center;
}
.qr-mock { width: 100%; height: auto; display: block; }
.qr-mock svg { display: block; width: 100%; height: auto; }

.coin-deposit-info { display: flex; flex-direction: column; gap: 16px; }
.info-row { display: flex; flex-direction: column; gap: 7px; }
.info-label { font-size: 12.5px; font-weight: 700; letter-spacing: .3px; text-transform: uppercase; color: var(--text-faint); }
.info-value { font-size: 14.5px; font-weight: 600; color: var(--text); }


.network-select {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 12px;
  max-width: 320px;
}

.network-modal-trigger {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text);
  padding: 10px 13px;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.network-trigger-icon { flex-shrink: 0; border-radius: 50%; }
.network-modal-trigger .coin-dropdown-chevron { margin-left: auto; flex-shrink: 0; }

.network-modal-trigger:hover,
.network-modal-trigger:focus-visible {
  border-color: rgba(107, 147, 230, .6);
  background: rgba(13, 30, 54, .96);
}

.network-modal-trigger:focus-visible {
  outline: 2px solid rgba(107, 147, 230, .42);
  outline-offset: 2px;
}

.network-trigger-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.network-trigger-copy strong {
  min-width: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.network-trigger-copy small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.address-copy-field {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px 12px;
}
.address-copy-field code {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text);
  overflow-x: auto;
  white-space: nowrap;
  font-family: 'SFMono-Regular', Consolas, monospace;
}
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  flex-shrink: 0;
  appearance: none; cursor: pointer;
  background: var(--grad-blue);
  border: none;
  border-radius: 7px;
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 12px;
  transition: opacity .15s ease, transform .15s ease;
}
.copy-btn:hover { transform: translateY(-1px); }
.copy-btn.copied { background: var(--green); }

.deposit-amount-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 420px;
  margin-top: 18px;
}

.wallet-deposit-submit-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}
.deposit-amount-form .wallet-deposit-submit-row { justify-content: stretch; }
.deposit-amount-form .wallet-deposit-submit-row .btn { width: 100%; justify-content: center; }

.wallet-deposit-note-group {
  margin-top: 18px;
}

.stock-buy-submit-row {
  margin: 0;
}

.wallet-note {
  display: flex; align-items: flex-start; gap: 9px;
  background: rgba(217, 164, 65,.08);
  border: 1px solid rgba(217, 164, 65,.25);
  color: #ffde9e;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
}
.wallet-note svg { flex-shrink: 0; margin-top: 1px; color: var(--gold); }

.wallet-note-body { flex: 1; min-width: 0; }
.wallet-note-min-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.wallet-note-min-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: #ffde9e;
  opacity: .85;
}
.wallet-note-min-value {
  font-size: 14px;
  font-weight: 800;
  color: #ffde9e;
  white-space: nowrap;
}
.wallet-note-text { margin: 0; }

/* ---- Withdraw form ---- */
.withdraw-form { max-width: 420px; }
.withdraw-input {
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 12px;
  width: 100%;
}
.withdraw-input:focus { outline: none; border-color: var(--blue); }
.withdraw-amount-field {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 0 6px 0 12px;
}
.withdraw-amount-prefix { color: var(--text-faint); font-weight: 700; }
.withdraw-amount-field .withdraw-input {
  background: none; border: none; padding: 11px 4px; flex: 1; min-width: 0;
}
.withdraw-max-btn {
  flex-shrink: 0;
  appearance: none; cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  color: var(--blue-light);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
}
.withdraw-max-btn:hover { border-color: var(--blue); }
.withdraw-help-text { display: block; margin-top: 7px; font-size: 12.5px; color: var(--text-muted); }
.withdraw-form .wallet-note { margin-top: 20px; }
.withdraw-form .btn { margin-top: 18px; width: 100%; }
.withdraw-success {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 16px;
  background: rgba(61, 184, 138,.1);
  border: 1px solid rgba(61, 184, 138,.3);
  color: #7fe3a4;
  border-radius: 10px;
  padding: 13px 14px;
  font-size: 13.5px;
  line-height: 1.55;
}
.withdraw-success svg { flex-shrink: 0; margin-top: 1px; color: var(--green); }

.network-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 1120;
  display: none;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.network-picker-modal.open {
  display: block;
}

.network-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(8px);
}

/* Opening transition: backdrop fades in, sheet fades + scales up from
   its centered position. Kept as a separate keyframe (rather than reusing
   sv-fade-in) because sv-fade-in's translateY would fight with this
   sheet's translate(-50%, -50%) centering transform. */
@keyframes sv-network-picker-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes sv-network-picker-sheet-in {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.94); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.network-picker-modal.open .network-picker-backdrop {
  animation: sv-network-picker-backdrop-in .18s ease;
}
.network-picker-modal.open .network-picker-sheet {
  animation: sv-network-picker-sheet-in .2s cubic-bezier(.16, 1, .3, 1);
}

.network-picker-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(520px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 48px));
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(135, 164, 213, .26);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(15, 32, 58, .98), rgba(15, 22, 35, .98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .5);
  overflow: hidden;
  isolation: isolate;
  overscroll-behavior: contain;
  touch-action: auto;
}

.network-picker-handle {
  display: none;
}

.network-picker-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 68px 14px 20px;
}

.network-picker-head h3 {
  margin: 0;
  color: #fff;
  font-size: 18px;
}

.network-picker-head p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.network-picker-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid rgba(135, 164, 213, .24);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.network-picker-close:hover {
  background: rgba(255, 255, 255, .1);
}

.network-picker-search {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 20px 12px;
  padding: 0 14px;
  border: 1px solid rgba(135, 164, 213, .24);
  border-radius: 10px;
  background: rgba(11, 24, 43, .95);
  color: #8fd9c8;
}

.network-picker-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.network-picker-list {
  overflow-y: auto;
  padding: 4px 10px 14px;
  overscroll-behavior: contain;
}

.network-picker-option {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.network-picker-option:hover,
.network-picker-option.selected {
  background: rgba(35, 124, 255, .16);
}

.network-picker-option[hidden] {
  display: none;
}

.network-option-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--coin-accent, var(--blue-light));
  background: color-mix(in srgb, var(--coin-accent, var(--blue)) 16%, transparent);
}
.network-option-icon img { width: 22px; height: 22px; border-radius: 50%; }

.network-option-copy {
  min-width: 0;
}

.network-option-copy strong,
.network-option-copy small {
  display: block;
}

.network-option-copy strong {
  overflow: hidden;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.network-option-copy small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.network-option-check {
  color: var(--green);
  opacity: 0;
}

.network-picker-option.selected .network-option-check {
  opacity: 1;
}

@media (max-width: 720px) {
  .coin-qr { width: 160px; margin: 0 auto; }
  .wallet-tabs { overflow-x: auto; }
  .coin-dropdown, .withdraw-form { max-width: none; }

  /* ---- Coin dropdown -> full-screen modal on mobile ----
     The Deposit "Cryptocurrency" picker and the Withdraw "Withdraw in"
     picker both use .coin-dropdown-menu as an inline absolute-positioned
     popover on desktop. On phones there isn't room for that treatment, so
     it becomes a fixed full-screen sheet with its own header/close button
     and a backdrop, matching the withdrawal-network picker pattern used
     elsewhere on this page. wallet.js toggles body.modal-open and wires
     the backdrop/close button when a coin-dropdown opens on mobile. */
  .coin-dropdown-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1115;
    display: none;
    background: rgba(0, 0, 0, .68);
    backdrop-filter: blur(8px);
    will-change: opacity;
  }
  .coin-dropdown.open .coin-dropdown-modal-backdrop {
    display: block;
    animation: sv-coin-modal-backdrop-in .18s ease;
  }

  .coin-dropdown-menu {
    position: fixed;
    inset: 0;
    z-index: 1120;
    top: 0; left: 0; right: 0; bottom: 0;
    width: 100%;
    max-height: 100vh;
    height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    background: #0F1623;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform-origin: center center;
  }
  /* Full-screen entrance — mirrors the network picker's mobile sheet
     animation (sv-network-picker-sheet-in-mobile) exactly: fade + a
     small upward slide, no scale. Backdrop fades on the same timing so
     the two don't feel disjointed. */
  @keyframes sv-coin-modal-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  @keyframes sv-coin-modal-sheet-in-mobile {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .coin-dropdown.open .coin-dropdown-menu {
    display: flex;
    flex-direction: column;
    animation: sv-coin-modal-sheet-in-mobile .18s ease;
  }

  .coin-dropdown-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 16px 14px;
    border-bottom: 1px solid rgba(135, 164, 213, .16);
    background: #0F1623;
    position: sticky;
    top: 0;
    z-index: 2;
  }
  .coin-dropdown-modal-title {
    color: #fff;
    font-size: 17px;
    font-weight: 800;
  }
  .coin-dropdown-modal-close {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(135, 164, 213, .24);
    border-radius: 10px;
    background: rgba(255, 255, 255, .04);
    color: #fff;
    font-size: 22px;
    line-height: 1;
  }
  .coin-dropdown-modal-close:hover { background: rgba(255, 255, 255, .1); }

  /* body.modal-open sets pointer-events:none on .dash-shell (see the
     rule near the top of this file) so the dimmed background can't be
     clicked while a modal is open. This coin-dropdown-menu lives inside
     .dash-shell in the DOM (fixed positioning still renders it as a
     full-viewport overlay on top of everything), so without this
     override that same rule cascades onto the modal itself and freezes
     every coin option/button inside it — nothing responds to taps. */
  body.modal-open .coin-dropdown-menu,
  body.modal-open .coin-dropdown-modal-backdrop {
    pointer-events: auto;
  }

  .coin-dropdown-menu .coin-dropdown-option {
    min-height: 58px;
    padding: 12px 16px;
    border-radius: 0;
    gap: 14px;
  }
  .coin-dropdown-menu .coin-dropdown-option:hover,
  .coin-dropdown-menu .coin-dropdown-option.active {
    background: rgba(35, 124, 255, .16);
  }
}

/* ---- Mobile-first: dashboard/wallet/academy card containers ----
   Cards were losing too much usable width on small screens because the
   page gutter (.dash-content) and the card's own padding stacked on top
   of each other. Trim both proportionally as the viewport narrows so
   content (deposit address, forms, video grid) has real room to breathe. */
@media (max-width: 700px) {
  .dash-content { padding-left: 16px; padding-right: 16px; }
  .card { padding: 16px; }
  .wallet-card { padding: 6px 16px 18px; }
  .academy-library-card { padding: 16px 16px 20px; }
  .wallet-tab { padding: 12px 12px; font-size: 14px; }

  /* Deposit address + Copy button: stay on one row on mobile instead of
     stacking. The address text shrinks and truncates with an ellipsis
     (the full value is still what gets copied — see wallet.js) so the
     Copy button always has room to sit flush against the right edge of
     the pill, "joined" to the container rather than floating below it. */
  .address-copy-field {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    padding: 0;
    overflow: hidden;
  }
  .address-copy-field code {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    padding: 10px 10px 10px 12px;
    font-size: 11.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .copy-btn {
    flex: 0 0 auto;
    width: auto;
    align-self: stretch;
    justify-content: center;
    border-radius: 0;
    padding: 0 14px;
  }

  /* Withdrawal network picker: match the same edge-to-edge full-screen
     modal chrome as the coin-dropdown-menu / deposit network picker above
     (sticky header + close button, no rounded corners, no drag handle)
     instead of the bottom-sheet look, so all four
     deposit-coin / deposit-network / withdraw-coin / withdraw-network
     pickers look and behave the same way on mobile. */
  .network-picker-sheet {
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    transform: none;
    border-radius: 0;
    background: #0F1623;
    overflow: hidden;
  }

  /* The desktop open animation centers/scales the sheet with
     translate(-50%, -50%), which would fight this fullscreen layout
     (no centering transform needed here). Swap in a fullscreen-safe
     version: fade + slide up, matching the coin-dropdown-menu's
     full-screen entrance on the other three pickers. */
  @keyframes sv-network-picker-sheet-in-mobile {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .network-picker-modal.open .network-picker-sheet {
    animation: sv-network-picker-sheet-in-mobile .18s ease;
  }

  .network-picker-handle {
    display: none;
  }

  .network-picker-head {
    padding: 18px 62px 14px 16px;
    position: sticky;
    top: 0;
    z-index: 2;
    background: #0F1623;
  }

  .network-picker-search {
    margin-left: 16px;
    margin-right: 16px;
  }
}

@media (max-width: 430px) {
  .dash-content { padding-left: 14px; padding-right: 14px; }
  .card { padding: 14px; }
  .wallet-card { padding: 6px 14px 16px; }
  .academy-library-card { padding: 14px 14px 18px; }
}

/* ---------------- Wallet: View More button ---------------- */
.wallet-view-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue-light);
  font-size: 13px;
  font-weight: 700;
  background: none;
  border: none;
  padding: 4px 2px;
}
.wallet-view-more-btn svg {
  transition: transform 0.2s ease;
}
.wallet-view-more-btn:hover svg {
  transform: translateX(2px);
}

/* ---------------- Deposit & Withdrawal History modal ---------------- */
.history-modal {
  position: fixed;
  inset: 0;
  z-index: 1120;
  display: none;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}
.history-modal.open {
  display: block;
}
.history-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(8px);
}
.history-modal-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(640px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 48px));
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(135, 164, 213, .26);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(15, 32, 58, .98), rgba(15, 22, 35, .98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .5);
  overflow: hidden;
  isolation: isolate;
  overscroll-behavior: contain;
  touch-action: auto;
}
.history-modal-handle {
  display: none;
}
.history-modal-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 68px 16px 22px;
  border-bottom: 1px solid rgba(135, 164, 213, .14);
}
.history-modal-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.history-modal-head h3 {
  margin: 0;
  color: #fff;
  font-size: 18px;
}
.history-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid rgba(135, 164, 213, .24);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}
.history-modal-close:hover {
  background: rgba(255, 255, 255, .1);
}
.history-modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 22px 22px;
}
.history-modal-table .wallet-history-row {
  padding: 14px 4px;
}
.history-modal-table .wallet-history-row[hidden] {
  display: none;
}

.history-filter-group {
  display: flex;
  gap: 8px;
  margin: 4px 0 16px;
  overflow-x: auto;
}
.history-filter-pill {
  flex: 0 0 auto;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(135, 164, 213, .24);
  background: rgba(255, 255, 255, .03);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.history-filter-pill:hover {
  border-color: rgba(135, 164, 213, .4);
  color: var(--text);
}
.history-filter-pill.active {
  background: var(--grad-blue);
  border-color: transparent;
  color: #FFFFFF;
}

.history-empty-state {
  padding: 40px 12px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
}

@media (max-width: 720px) {
  .history-modal-sheet {
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    max-height: none;
    height: 100%;
    transform: none;
    border-radius: 0;
    border: none;
    background: #0F1623;
  }
  .history-modal-body {
    flex: 1;
    padding: 8px 16px max(28px, env(safe-area-inset-bottom));
  }
  .history-modal-head {
    padding: 18px 60px 14px 16px;
    padding-top: max(18px, env(safe-area-inset-top));
  }
}

/* ==========================================================================
   Slim wide balance card — top-right of the main card on non-dashboard pages
   ========================================================================== */
.balance-card-slim {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(74, 123, 216,.14), rgba(74, 123, 216,.03));
  border: 1px solid rgba(107, 147, 230,.28);
  border-radius: 14px;
  padding: 10px 18px;
  max-width: 100%;
}
.balance-card-slim-icon {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: 10px;
  background: rgba(74, 123, 216,.18);
  color: var(--blue-light);
  flex-shrink: 0;
}
.balance-card-slim-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding-right: 6px;
  border-right: 1px solid rgba(255,255,255,.08);
}
.balance-card-slim-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}
.balance-card-slim-value {
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
}
/* Balance visibility toggle — blurred state. Applied to any balance figure
   ([data-balance-countup] or .balance-card-slim-value) while hidden; the
   real text stays in the DOM, it's just visually obscured, so the figure
   un-blurs instantly on toggle instead of re-fetching/re-rendering text. */
[data-balance-countup].is-balance-hidden,
.balance-card-slim-value.is-balance-hidden {
  filter: blur(7px);
  -webkit-filter: blur(7px);
  user-select: none;
  transition: filter .15s ease;
}
.balance-card-slim-delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--green);
  white-space: nowrap;
}

/* ---- Balance visibility toggle — the eye button next to any "Total
   Balance" figure (this slim card, reused across every tab besides the
   dashboard, and the dashboard's own big balance card in portfolio.php,
   see .mobile-balance-card .balance-value-row below). Hides/reveals via
   assets/js/main.js's "Balance visibility" module, which also persists
   the choice in localStorage so it carries across tabs/pages instead of
   resetting on every navigation. ---- */
.balance-value-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.balance-visibility-toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-faint);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.balance-visibility-toggle:hover,
.balance-visibility-toggle:focus-visible {
  background: rgba(255, 255, 255, .08);
  color: var(--text);
  outline: none;
}
.balance-visibility-toggle svg { display: block; }
.balance-visibility-toggle .balance-eye-icon-closed { display: none; }
.balance-visibility-toggle[aria-pressed="true"] .balance-eye-icon-open { display: none; }
.balance-visibility-toggle[aria-pressed="true"] .balance-eye-icon-closed { display: block; }

.balance-card-slim--sm .balance-visibility-toggle {
  width: 18px;
  height: 18px;
}
.balance-card-slim--sm .balance-visibility-toggle svg {
  width: 13px;
  height: 13px;
}

.balance-card-slim--sm {
  gap: 10px;
  padding: 6px 12px;
  border-radius: 11px;
}
.balance-card-slim--sm .balance-card-slim-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.balance-card-slim--sm .balance-card-slim-icon svg {
  width: 14px;
  height: 14px;
}
.balance-card-slim--sm .balance-card-slim-label {
  font-size: 9.5px;
}
.balance-card-slim--sm .balance-card-slim-value {
  font-size: 14px;
}

@media (max-width: 560px) {
  .balance-card-slim:not(.balance-card-slim--sm) { width: 100%; }
}

@media (max-width: 480px) {
  .balance-card-slim--sm {
    gap: 7px;
    padding: 5px 9px;
    border-radius: 9px;
  }
  .balance-card-slim--sm .balance-card-slim-icon {
    width: 24px;
    height: 24px;
  }
  .balance-card-slim--sm .balance-card-slim-label {
    display: none;
  }
  .balance-card-slim--sm .balance-card-slim-value {
    font-size: 12.5px;
    white-space: nowrap;
  }
}

/* When the delta pill is hidden, the copy block is the last child —
   drop its trailing divider so there's no dangling border. */
.balance-card-slim-copy:last-child {
  border-right: none;
  padding-right: 0;
}

/* ==========================================================================
   Trade modal — opened via "View Trades" on the shared slim balance card.
   Mirrors the Buy Stock modal's overlay pattern (fixed, centered, backdrop
   blur, body.modal-open scroll-lock) and reuses .performance-card /
   .timeframe-dropdown styling + JS as-is.
   ========================================================================== */
.trade-modal {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: none;
  place-items: center;
  padding: 18px;
}
.trade-modal.open {
  display: grid;
}
.trade-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 6, 14, .72);
  backdrop-filter: blur(8px);
}
.trade-modal-card {
  position: relative;
  width: min(520px, 92vw);
  max-height: min(76vh, 640px);
  overflow-y: auto;
  /* overflow-x must be set explicitly (not left at the default "visible")
     — per the CSS overflow spec, pairing overflow-y:auto with an
     unset/visible overflow-x forces the browser to also make overflow-x
     "auto", turning this whole modal card into a second horizontal
     scroll container on top of the chart's own .performance-chart-scroll
     scrollbar (the wide-chart's "View Trades" modal in portfolio.php /
     wallet.php). Keeping this hidden lets only the inner chart scroll. */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  border: 1px solid rgba(135, 164, 213, .24);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(16, 32, 58, .98), rgba(6, 15, 30, .98));
  box-shadow: 0 28px 80px rgba(0, 0, 0, .42);
  padding: 24px 22px calc(24px + env(safe-area-inset-bottom));
  animation: sv-fade-in .22s ease;
}
.trade-modal-card h3 {
  margin: 0 0 6px;
  color: #fff;
  font-size: 19px;
}
.trade-modal-close {
  position: sticky;
  top: 0;
  float: right;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.trade-modal-balance-slim {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(135deg, rgba(74, 123, 216,.14), rgba(74, 123, 216,.03));
  border: 1px solid rgba(107, 147, 230,.28);
  border-radius: 14px;
  padding: 14px 18px;
  margin: 0 0 18px;
}
.trade-modal-balance-delta {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-muted);
}
.trade-modal-balance-delta b { color: var(--green); }
.trade-modal-balance-slim-main {
  display: flex;
  align-items: center;
  gap: 14px;
}
.trade-modal-performance-card {
  margin-top: 18px;
  margin-bottom: 22px;
}
.trade-history-card {
  margin-bottom: 0;
  padding: 20px 22px;
}
.trade-history-list { width: 100%; }
.trade-history-row {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, .9fr);
  align-items: center;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--border);
}
.trade-history-row:last-child { border-bottom: none; }
.trade-history-col-type { display: flex; align-items: center; gap: 12px; min-width: 0; }
.trade-history-col-date { font-size: 13.5px; color: var(--text-muted); }
.trade-history-col-amt { font-size: 14.5px; font-weight: 700; white-space: nowrap; text-align: right; }
@media (max-width: 480px) {
  .trade-history-col-date { display: none; }
  .trade-history-row { grid-template-columns: minmax(0, 1fr) minmax(0, .9fr); }
}

/* ---- Trade Pulse — the redesigned "Trade History" feed on the Wallet
   page (desktop card + mobile Trade History modal share these classes,
   via renderTradeHistoryCool() in pages/wallet.php) ---- */
.trade-pulse-empty {
  color: var(--text-muted);
  font-size: 13.5px;
  padding: 14px 4px;
  display: flex;
  align-items: center;
  min-height: 44px;
}

.trade-streak-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  margin-bottom: 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .2px;
}
.trade-streak-badge.streak-win {
  color: var(--green);
  background: rgba(61, 184, 138, .12);
  border: 1px solid rgba(61, 184, 138, .3);
}
.trade-streak-badge.streak-loss {
  color: #E06A6A;
  background: rgba(224, 106, 106, .1);
  border: 1px solid rgba(224, 106, 106, .28);
}

.trade-pulse-list { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.trade-pulse-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.trade-pulse-row:hover { background: rgba(255, 255, 255, 0.045); border-color: rgba(255, 255, 255, .14); }

.trade-pulse-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.trade-pulse-avatar {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
}
.trade-pulse-avatar.is-up { background: rgba(61, 184, 138, .14); color: var(--green); }
.trade-pulse-avatar.is-down { background: rgba(224, 106, 106, .12); color: #E06A6A; }

/* Trade pair icon: a real flag image (or gold/silver bar) for the base
   currency, in place of the plain letter avatar, when recognized — see
   tradePairIcon() in includes/journal-stats.php. */
.trade-pulse-flag {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .06);
}
.trade-pulse-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.trade-pulse-copy strong { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Pair name + BUY/SELL tag on the same line, tag pinned to the right. */
.trade-pulse-toprow { display: flex; align-items: center; gap: 8px; min-width: 0; }
.trade-pulse-toprow strong { flex-shrink: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.trade-pulse-dir-tag {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .3px;
  padding: 2px 7px;
  border-radius: 999px;
  line-height: 1.5;
}
.trade-pulse-dir-tag.dir-buy { color: var(--green); background: rgba(61, 184, 138, .12); border: 1px solid rgba(61, 184, 138, .28); }
.trade-pulse-dir-tag.dir-sell { color: #E06A6A; background: rgba(224, 106, 106, .1); border: 1px solid rgba(224, 106, 106, .26); }

/* TP / SL, shown under the pair name in place of the old date line. */
.trade-pulse-levels { font-size: 11px; font-weight: 600; letter-spacing: .1px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trade-pulse-levels .level-tp { color: var(--green); }
.trade-pulse-levels .level-sl { color: #E06A6A; }
.trade-pulse-levels .level-sep { color: var(--text-muted); margin: 0 4px; }

/* Right column: P/L amount with the trade's timestamp underneath. */
.trade-pulse-amt-col { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.trade-pulse-amt { font-size: 14px; font-weight: 800; white-space: nowrap; text-align: right; }
.trade-pulse-time { font-size: 11px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }

@media (max-width: 480px) {
  .trade-pulse-row { grid-template-columns: minmax(0, 1fr) auto; }
}

/* ---- Trade History rows on the Wallet page's desktop side card, the
   Dashboard's desktop card, and the Journal's Recent Trades card read as a
   plain horizontal-line list — each row divided from the next by a single
   bottom border — instead of the bordered/rounded "tile" treatment
   .trade-pulse-row uses by default elsewhere. Matches the styling already
   used in the mobile "View Trades" modal (.trade-modal-history-card,
   above) and applies at every viewport since these cards are desktop-only
   / already get their own mobile sizing rules further down. ---- */
.wallet-trade-history-card .trade-pulse-list,
.dash-trade-history-card .trade-pulse-list,
.journal-recent-trades-card .trade-pulse-list {
  gap: 0;
}
.wallet-trade-history-card .trade-pulse-row,
.dash-trade-history-card .trade-pulse-row,
.journal-recent-trades-card .trade-pulse-row {
  border: none;
  border-radius: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding-left: 2px;
  padding-right: 2px;
}
.wallet-trade-history-card .trade-pulse-row:last-child,
.dash-trade-history-card .trade-pulse-row:last-child,
.journal-recent-trades-card .trade-pulse-row:last-child {
  border-bottom: none;
}
.wallet-trade-history-card .trade-pulse-row:hover,
.dash-trade-history-card .trade-pulse-row:hover,
.journal-recent-trades-card .trade-pulse-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* ---- Wallet page (desktop): Trade History card gets a compact
   Win Rate / Net P/L header + sticks in view while the deposit/withdraw
   panels beside it scroll, so performance context stays visible. ---- */
.trade-history-card-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.ths-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
}
.ths-k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--text-faint); }
.ths-v { font-size: 17px; font-weight: 800; color: var(--text); }
.ths-v.up { color: var(--green); }
.ths-v.down { color: #E06A6A; }

body.modal-open .trade-modal {
  pointer-events: auto;
}
@media (max-width: 560px) {
  .trade-modal {
    padding: 0;
  }
  .trade-modal-card {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding: calc(16px + env(safe-area-inset-top)) 18px calc(24px + env(safe-area-inset-bottom));
  }
}

/* ==========================================================================
   Academy — video library
   ========================================================================== */
.academy-library-card { padding-bottom: 26px; }

.academy-filter-dropdown {
  position: relative;
  margin-bottom: 20px;
  max-width: 320px;
}
.academy-filter-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%;
  appearance: none; cursor: pointer;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px; font-weight: 700;
  text-align: left;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.academy-filter-trigger:hover { border-color: var(--border-strong); }
.academy-filter-dropdown.open .academy-filter-trigger {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}
.academy-filter-dropdown.open .coin-dropdown-chevron { transform: rotate(180deg); color: var(--blue-light); }

.academy-filter-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  display: none;
  flex-direction: column;
  gap: 2px;
  max-height: min(360px, 60vh);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.academy-filter-dropdown.open .academy-filter-menu { display: flex; animation: sv-fade-in .16s ease; }

.academy-filter-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%;
  appearance: none; cursor: pointer;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 13.5px; font-weight: 600;
  text-align: left;
  transition: background .15s ease, color .15s ease;
}
.academy-filter-option:hover { background: var(--surface-2); color: var(--text); }
.academy-filter-option.active {
  background: color-mix(in srgb, var(--blue) 14%, var(--surface-2));
  color: #fff;
}
.academy-filter-option .coin-dropdown-check { flex-shrink: 0; color: var(--blue-light); opacity: 0; }
.academy-filter-option.active .coin-dropdown-check { opacity: 1; }

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.video-card {
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.video-card:hover,
.video-card:focus-visible {
  transform: translateY(-3px);
  border-color: rgba(107, 147, 230, .4);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .3);
}

.video-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #121A29;
  overflow: hidden;
}
.video-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .25s ease;
}
.video-card:hover .video-thumb img { transform: scale(1.04); }

.video-play-btn {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  margin: auto;
  width: 54px; height: 54px;
  border-radius: 50%;
  background: rgba(10, 14, 26, .55);
  border: 1px solid rgba(255, 255, 255, .25);
  color: #fff;
  backdrop-filter: blur(2px);
}
.video-card:hover .video-play-btn {
  background: var(--blue);
  border-color: transparent;
}

.video-complete-flag {
  position: absolute; top: 10px; right: 10px;
  display: flex; align-items: center; gap: 5px;
  background: rgba(61, 184, 138, .92);
  color: #06210f;
  font-size: 11px; font-weight: 800;
  padding: 4px 9px 4px 7px;
  border-radius: 999px;
}

.video-body { padding: 16px 16px 18px; }
.video-tags { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.video-cat-badge {
  background: rgba(83, 234, 214, .14); color: #4A7BD8;
  border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 700;
}
.video-level { font-size: 11.5px; color: var(--text-faint); }
.video-title { margin: 0 0 8px; font-size: 15px; font-weight: 700; line-height: 1.35; color: #fff; }
.video-desc { margin: 0 0 12px; font-size: 13px; color: var(--text-muted); line-height: 1.55; }
.video-watch-link { font-size: 13px; }

.video-empty-state {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 0 10px;
}

/* Video modal (reuses .market-modal shell) */
.video-modal-sheet { width: min(900px, calc(100vw - 28px)); }
.video-modal-player { min-height: 460px; background: #000; }
.video-modal-player iframe { display: block; }
.video-modal-footer {
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
}
.video-complete-toggle {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13.5px; color: var(--text-muted);
}
.video-complete-toggle input {
  width: 17px; height: 17px; accent-color: var(--green);
}

@media (max-width: 700px) {
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
  .video-modal-player { min-height: 240px; }
}
@media (max-width: 560px) {
  .video-grid { grid-template-columns: 1fr; }
  .academy-filter-dropdown { max-width: none; }
}

/* Academy — Elite paywall banner + locked lesson state */
.academy-paywall-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 196, 0, .28);
  background: linear-gradient(135deg, rgba(255, 196, 0, .08), var(--surface));
}
.academy-paywall-copy { display: flex; align-items: flex-start; gap: 14px; }
.academy-paywall-copy h4 { margin: 0 0 4px; font-size: 15px; font-weight: 800; color: #fff; }
.academy-paywall-copy p { margin: 0; font-size: 13px; color: var(--text-muted); max-width: 46ch; }
.academy-paywall-cta { flex-shrink: 0; white-space: nowrap; }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.academy-progress-summary { display: flex; align-items: center; gap: 10px; }
.academy-progress-label { font-size: 12.5px; color: var(--text-muted); white-space: nowrap; }
.academy-progress-track {
  width: 110px; height: 6px; border-radius: 999px;
  background: var(--surface-2); overflow: hidden;
}
.academy-progress-bar { height: 100%; background: var(--green); border-radius: 999px; transition: width .25s ease; }

.video-card-locked .video-play-btn { background: rgba(10, 14, 26, .68); }
.video-card-locked .video-thumb img { filter: grayscale(.55) brightness(.6); }
.video-card-locked:hover .video-play-btn { background: rgba(255, 196, 0, .85); color: #201400; }

.video-modal-locked {
  height: 100%; min-height: 460px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center; color: var(--text-muted); padding: 20px;
}
.video-modal-locked p { margin: 0; font-size: 14px; max-width: 32ch; }
@media (max-width: 700px) { .video-modal-locked { min-height: 240px; } }

/* ==========================================================================
   Final responsive cleanup: logos, dashboard charts, wallet forms
   ========================================================================== */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

.logo-link,
.drawer-logo,
.sidebar-logo,
.topbar-mobile-logo {
  background: transparent;
}

.logo-link img,
.drawer-logo,
.sidebar-logo img,
.topbar-mobile-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.site-footer .logo-link {
  width: min(360px, 100%);
  height: 100px;
}

.deposit-glow {
  color: #8ff0b2;
  background: rgba(61, 184, 138, .15);
}

.withdraw-glow {
  color: #ffadad;
  background: rgba(224, 106, 106, .15);
}

.panel-action-label {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.market-overview-card {
  padding: 18px;
  border: 1px solid rgba(116, 152, 205, .18);
  background: linear-gradient(180deg, rgba(15, 32, 58, .88), rgba(7, 17, 32, .9));
}

.market-overview-card .panel-head {
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.market-overview-card .panel-head p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.45;
}

.market-summary-card {
  appearance: none;
  border: 1px solid rgba(116, 152, 205, .18);
  border-radius: 10px;
  background: rgba(4, 10, 21, .72);
  color: var(--text);
  display: grid;
  grid-template-rows: auto auto minmax(58px, 1fr);
  gap: 8px;
  min-height: 150px;
  overflow: hidden;
  padding: 14px;
  text-align: left;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.market-summary-card:hover,
.market-summary-card:focus-visible {
  background: rgba(13, 27, 52, .9);
  border-color: rgba(107, 147, 230, .42);
  transform: translateY(-1px);
}

.market-summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 800;
}

.market-summary-top b {
  color: var(--green);
  font-size: 12px;
}

.market-summary-top b.down {
  color: var(--red);
}

.market-summary-card > strong {
  color: #fff;
  font-size: 22px;
  line-height: 1.1;
}

.market-summary-chart {
  display: block;
  min-height: 62px;
}

.market-summary-chart svg {
  width: 100%;
  height: 100%;
  display: block;
}

.market-charts-card .panel-head {
  gap: 10px;
}

.market-chart-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(116px, .45fr) auto auto;
  align-items: center;
}

.market-chart-row .signal-info {
  min-width: 0;
}

.local-market-chart {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
}

.local-market-chart svg {
  flex: 1;
  min-height: 260px;
}

.local-market-chart-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.local-market-chart-caption strong,
.market-modal-meta b {
  color: var(--green);
}

.market-modal-meta b.is-down {
  color: var(--red);
}

.wallet-card,
.academy-library-card,
.chart-card,
.market-charts-card,
.economic-card,
.news-card,
.mini-card {
  min-width: 0;
}

.address-copy-field,
.withdraw-amount-field,
.coin-dropdown-trigger,
.network-select,
.withdraw-input {
  min-width: 0;
}

@media (max-width: 1180px) {
  .market-overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .dash-shell {
    min-height: 100vh;
  }

  .dash-main {
    min-width: 0;
  }

  .dash-content {
    width: 100%;
    padding: 22px clamp(14px, 4vw, 24px) 96px;
  }

  .dash-welcome {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .dash-welcome h1 {
    font-size: clamp(22px, 6vw, 28px) !important;
    line-height: 1.12;
  }

  .wave-mark {
    font-size: inherit !important;
  }

  .dash-welcome p {
    display: block;
    max-width: 44rem;
    color: var(--text-muted);
  }

  .stat-cards,
  .wallet-stat-cards,
  .academy-stat-cards {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
  }

  /* Academy / Wallet / Charts: keep the header as a row on mobile so the
     compact balance card stays pinned top-right, opposite the title. */
  .dash-welcome.academy-welcome,
  .dash-welcome.wallet-welcome,
  .dash-welcome.charts-welcome,
  .dash-welcome.settings-welcome,
  .dash-welcome.notifications-welcome,
  .dash-welcome.support-welcome,
  .dash-welcome.pricing-welcome {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
  }
  .academy-welcome > div:first-child,
  .wallet-welcome > div:first-child,
  .charts-welcome > div:first-child,
  .settings-welcome > div:first-child,
  .notifications-welcome > div:first-child,
  .support-welcome > div:first-child,
  .pricing-welcome > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
  }
  .academy-welcome .balance-card-slim,
  .wallet-welcome .balance-card-slim,
  .charts-welcome .balance-card-slim,
  .settings-welcome .balance-card-slim,
  .notifications-welcome .balance-card-slim,
  .support-welcome .balance-card-slim,
  .pricing-welcome .balance-card-slim {
    flex-shrink: 0;
  }

  .market-overview-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  }

  .dash-grid-2,
  .dash-grid-2b,
  .dash-grid-2c,
  .dash-grid-3 {
    display: grid;
    grid-template-columns: 1fr;
  }

  .chart-card,
  .economic-card,
  .news-card {
    display: block;
  }

  .recent-signals-card.market-charts-card {
    padding: 16px;
    border: 1px solid rgba(116, 152, 205, .18);
    background: linear-gradient(180deg, rgba(15, 32, 58, .88), rgba(7, 17, 32, .9));
  }

  .market-chart-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .market-chart-row .signal-trend,
  .market-chart-row .signal-right {
    display: none;
  }

  .wallet-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: visible;
  }

  .wallet-tab {
    min-width: 0;
    text-align: center;
    white-space: nowrap;
  }

  /* Notifications page only has 2 tabs (All / Unread) and needs to share
     the row with the mark-all-read button opposite it, so it opts out of
     the generic 3-column wallet-tabs grid above. */
  .notif-card-head .wallet-tabs {
    display: flex;
    grid-template-columns: none;
  }

  .notif-card-head .wallet-tab {
    text-align: left;
    flex: 0 0 auto;
  }
}

@media (max-width: 640px) {
  .logo-link,
  .topbar-mobile-logo {
    width: min(58vw, 172px);
    height: 50px;
  }

  .drawer-logo {
    width: min(72vw, 210px);
    height: 62px;
  }

  .topbar {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  .market-overview-card,
  .recent-signals-card.market-charts-card,
  .wallet-card,
  .academy-library-card {
    padding: 14px;
  }

  .market-summary-card {
    min-height: 138px;
  }

  .market-summary-card > strong {
    font-size: 20px;
  }

  .address-copy-field {
    align-items: stretch;
  }

  .local-market-chart {
    padding: 14px;
  }

  .local-market-chart svg {
    min-height: 220px;
  }
}

@media (max-width: 420px) {
  .dash-content {
    padding-left: 12px;
    padding-right: 12px;
  }

  .stat-card {
    padding: 13px;
  }

  .stat-card .top-row {
    gap: 10px;
  }

  .stat-card .value {
    font-size: 17px;
  }

  .wallet-tabs {
    gap: 0;
  }

  .wallet-tab {
    padding-left: 8px;
    padding-right: 8px;
    font-size: 13px;
  }

  .panel-head {
    align-items: flex-start;
    gap: 10px;
  }

  .panel-action-label,
  .market-overview-card .live-dot,
  .market-charts-card .live-dot {
    display: none;
  }
}

/* ==========================================================================
   Charts page, menu logo, wallet overflow, mobile modal refinements
   ========================================================================== */
.sidebar .sidebar-logo,
.dash-mobile-drawer .sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  width: auto;
  height: auto;
  padding: 4px 6px 24px;
  margin: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}

.dash-mobile-drawer .sidebar-logo {
  padding: 0 0 4px;
}

.sidebar-logo-mark {
  position: relative;
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
}

.dash-mobile-drawer .sidebar-logo-mark {
  width: 40px;
  height: 40px;
}

/* The source mark has a built-in margin of empty space around the badge
   itself; at 100% size that empty space reads as a gap between the mark
   and the "Sharkville Mastery" text next to it. Scaling the image up and
   centering it inside the circular, overflow:hidden mark crops that empty
   margin away so the badge fills the circle edge-to-edge. */
.sidebar .sidebar-logo img,
.dash-mobile-drawer .sidebar-logo img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 132%;
  height: 132%;
  max-width: none;
  object-fit: cover;
  object-position: 44% 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.sidebar-logo-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.sidebar-logo-text strong {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: .1px;
  white-space: nowrap;
}

.sidebar-logo-text small {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .6px;
  text-transform: uppercase;
}

@media (max-width: 900px) {
  .dashboard-page .topbar {
    min-height: 96px;
    height: 96px;
  }

  /* Match the public-page header logo sizing (Home / Sign In / Sign Up):
     same 76px height, full mark shown via object-fit: contain, instead of
     the old wide box + object-fit: cover crop that zoomed the logo in. */
  .dashboard-page .topbar-mobile-logo {
    width: auto;
    height: 76px;
    overflow: visible;
  }

  .dashboard-page .topbar-mobile-logo img {
    width: auto;
    height: 100%;
    max-height: 76px;
    object-fit: contain;
    object-position: center;
  }
}

.charts-content {
  max-width: 1280px;
  min-width: 0;
  overflow-x: hidden;
}

.charts-welcome {
  margin-bottom: 18px;
}

.chart-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
  min-width: 0;
  max-width: 100%;
}

.chart-terminal-card,
.market-watchlist-card,
.professional-market-card {
  /* Bybit-style flat black, matching the Hot Market fullscreen trading
     view (see .hot-market-modal / .hm-modal-* above) instead of the old
     navy-tinted card so the Charts tab reads as the same product. */
  border: 1px solid rgba(255, 255, 255, .08);
  background: linear-gradient(180deg, #131C2B 0%, #0F1623 100%);
}

.chart-terminal-card {
  padding: 0;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
}

.chart-terminal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  min-width: 0;
}

.chart-terminal-head-pair {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.hot-market-coin.chart-terminal-logo {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.chart-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 7px;
  background: rgba(107, 147, 230, .12);
  color: var(--blue-light);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.chart-terminal-head h2 {
  margin: 8px 0 2px;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  overflow-wrap: anywhere;
}

.chart-terminal-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
}

.chart-price-block {
  text-align: right;
  white-space: nowrap;
  min-width: 0;
}

.chart-price-block strong {
  display: block;
  color: #fff;
  font-size: 32px;
  line-height: 1;
}

.chart-price-block span {
  display: block;
  margin-top: 7px;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.chart-price-block span.is-down {
  color: var(--red);
}

.chart-symbol-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 160px) auto;
  gap: 10px;
  align-items: end;
  padding: 16px 22px 0;
  min-width: 0;
  max-width: 100%;
}

.chart-symbol-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.chart-symbol-field span {
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
}

.chart-symbol-field input,
.chart-symbol-field select {
  min-width: 0;
  width: 100%;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 0 12px;
}

.chart-symbol-field input:focus,
.chart-symbol-field select:focus {
  outline: 2px solid rgba(107, 147, 230, .42);
  border-color: rgba(107, 147, 230, .62);
}

.chart-symbol-bar .btn {
  height: 42px;
  margin: 0;
  white-space: nowrap;
}

.timeframe-modal-trigger {
  display: none;
  min-width: 0;
  height: 42px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(0, 0, 0, .6);
  color: #fff;
  padding: 0 12px;
  text-align: left;
}

.timeframe-modal-trigger span {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.timeframe-modal-trigger strong {
  margin-left: auto;
  font-size: 14px;
  font-weight: 900;
}

.chart-toolbar {
  display: flex;
  gap: 6px;
  padding: 14px 22px 0;
}

.chart-toolbar button {
  min-width: 44px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .04);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.chart-toolbar button.active,
.chart-toolbar button:hover {
  color: #fff;
  border-color: rgba(107, 147, 230, .46);
  background: rgba(74, 123, 216, .18);
}

.watchlist-scroll,
.watchlist-filter,
.chart-toolbar,
.coin-dropdown-menu,
.market-modal-chart,
.market-filter-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(107, 147, 230, .62) rgba(255, 255, 255, .06);
}

.watchlist-scroll::-webkit-scrollbar,
.watchlist-filter::-webkit-scrollbar,
.chart-toolbar::-webkit-scrollbar,
.coin-dropdown-menu::-webkit-scrollbar,
.market-modal-chart::-webkit-scrollbar,
.market-filter-list::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.watchlist-scroll::-webkit-scrollbar-track,
.watchlist-filter::-webkit-scrollbar-track,
.chart-toolbar::-webkit-scrollbar-track,
.coin-dropdown-menu::-webkit-scrollbar-track,
.market-modal-chart::-webkit-scrollbar-track,
.market-filter-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .05);
  border-radius: 999px;
}

.watchlist-scroll::-webkit-scrollbar-thumb,
.watchlist-filter::-webkit-scrollbar-thumb,
.chart-toolbar::-webkit-scrollbar-thumb,
.coin-dropdown-menu::-webkit-scrollbar-thumb,
.market-modal-chart::-webkit-scrollbar-thumb,
.market-filter-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(107, 147, 230, .82), rgba(74, 123, 216, .48));
  border-radius: 999px;
}

.timeframe-picker-modal {
  position: fixed;
  inset: 0;
  z-index: 1130;
  display: none;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.timeframe-picker-modal.open {
  display: block;
}

.timeframe-picker-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(8px);
}

.timeframe-picker-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(520px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 48px));
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(135, 164, 213, .26);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(15, 32, 58, .98), rgba(15, 22, 35, .98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .5);
  overflow: hidden;
  isolation: isolate;
  overscroll-behavior: contain;
  touch-action: auto;
}

.timeframe-picker-handle {
  display: none;
}

.timeframe-picker-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 68px 14px 20px;
}

.timeframe-picker-head h3 {
  margin: 0;
  color: #fff;
  font-size: 18px;
}

.timeframe-picker-head p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.timeframe-picker-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border: 1px solid rgba(135, 164, 213, .24);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.timeframe-picker-close:hover {
  background: rgba(255, 255, 255, .1);
}

.timeframe-picker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 20px 20px;
}

.timeframe-picker-grid button {
  min-width: 0;
  min-height: 66px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 4px;
  border: 1px solid rgba(116, 152, 205, .2);
  border-radius: 10px;
  background: rgba(255, 255, 255, .035);
  color: #fff;
  padding: 12px;
  text-align: left;
}

.timeframe-picker-grid button:hover,
.timeframe-picker-grid button.active {
  border-color: rgba(107, 147, 230, .55);
  background: rgba(74, 123, 216, .18);
}

.timeframe-picker-grid strong {
  font-size: 16px;
  font-weight: 900;
}

.timeframe-picker-grid span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.market-filter-modal {
  position: fixed;
  inset: 0;
  z-index: 1135;
  display: none;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}

.market-filter-modal.open {
  display: block;
}

.market-filter-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(8px);
}

.market-filter-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(420px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 48px));
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(135, 164, 213, .26);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(15, 32, 58, .98), rgba(15, 22, 35, .98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .5);
  overflow: hidden;
  isolation: isolate;
  overscroll-behavior: contain;
  touch-action: auto;
}

.market-filter-handle {
  display: none;
}

.market-filter-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 68px 14px 20px;
}

.market-filter-head h3 {
  margin: 0;
  color: #fff;
  font-size: 18px;
}

.market-filter-head p {
  margin: 5px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.market-filter-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(135, 164, 213, .24);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.market-filter-close:hover {
  background: rgba(255, 255, 255, .1);
}

.market-filter-list {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 10px 14px;
}

.market-filter-list button {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  padding: 10px;
  text-align: left;
}

.market-filter-list button:hover,
.market-filter-list button.active {
  background: rgba(35, 124, 255, .16);
}

.market-filter-list span {
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
}

.market-filter-check {
  color: var(--green);
  opacity: 0;
}

.market-filter-list button.active .market-filter-check {
  opacity: 1;
}

.professional-chart {
  min-height: 420px;
  margin: 0;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px),
    #0F1623;
  background-size: 64px 64px;
}

.professional-chart.tradingview-chart {
  height: 520px;
  min-height: 520px;
  position: relative;
  overflow: hidden;
  background: #0F1623;
  width: 100%;
  max-width: 100%;
}

.tv-chart-frame,
.tradingview-widget-container {
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: inherit;
}

.tv-chart-frame {
  position: relative;
}

.tv-chart-frame iframe {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.tv-loading {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: #0F1623;
}

.local-market-chart.is-terminal-chart {
  min-height: 420px;
  padding: 18px 22px 16px;
}

.local-market-chart.is-terminal-chart svg {
  min-height: 330px;
}

.market-chart-svg {
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .24));
}

.local-market-chart-caption strong.is-down {
  color: var(--red);
}

.chart-terminal-footer {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 22px 18px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  color: var(--text-muted);
  font-size: 12.5px;
}

.chart-terminal-footer b {
  color: #fff;
}

/* ==================================================================
   Charts terminal "live" row — chart + Buy/Sell order ticket, styled to
   match the Hot Market modal's trading view (see includes/hot-market-
   modal.php and the .hm-modal-* rules above) so the two feel like the
   same product. The order ticket itself reuses those exact .hm-modal-
   order/.hm-order-*/.hm-submit-* classes; only this wrapper + the sim
   banner variant below are new. Buy/Sell here is a client-side
   simulation only, same as the Hot Market modal — see the "Chart
   terminal order ticket" block in assets/js/market.js.
   ================================================================== */
.chart-terminal-sim-banner {
  border-bottom: 1px solid rgba(240, 185, 11, .18);
}
.chart-terminal-live {
  display: flex;
  align-items: stretch;
  min-width: 0;
}
.chart-terminal-chart-col {
  flex: 1;
  min-width: 0;
}
.chart-terminal-order {
  border-left: 1px solid rgba(255, 255, 255, .08);
}

@media (max-width: 980px) {
  .chart-terminal-live {
    flex-direction: column;
  }
  .chart-terminal-order {
    width: 100%;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, .08);
  }
}
@media (max-width: 700px) {
  .chart-terminal-order {
    padding: 14px;
  }
}

.market-watchlist-card {
  /* Height is synced to the chart terminal card via JS on desktop (see
     market.js) — the watchlist scrolls internally within that height.
     Below 980px the chart terminal card is hidden, so this just sizes
     to its own natural height there. */
  display: flex;
  flex-direction: column;
  padding: 18px;
  min-width: 0;
  max-width: 100%;
}

.watchlist-filter {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.watchlist-filter button {
  flex: 0 0 auto;
  min-height: 30px;
  border: 1px solid rgba(116, 152, 205, .2);
  border-radius: 8px;
  background: rgba(255, 255, 255, .035);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 800;
  padding: 6px 9px;
}

.watchlist-filter button.active,
.watchlist-filter button:hover {
  color: #fff;
  border-color: rgba(107, 147, 230, .46);
  background: rgba(74, 123, 216, .18);
}

.market-filter-trigger {
  width: 100%;
  min-height: 46px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  color: #fff;
  padding: 0 12px;
  text-align: left;
}

.market-filter-trigger:hover,
.market-filter-trigger:focus-visible {
  border-color: rgba(107, 147, 230, .52);
  background: rgba(255, 255, 255, .06);
}

.market-filter-trigger span {
  min-width: 0;
  color: var(--text-faint);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.market-filter-trigger strong {
  color: #fff;
  font-size: 13.5px;
  font-weight: 900;
}

.watchlist-search {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  background: rgba(255, 255, 255, .03);
  color: var(--text-faint);
}
.watchlist-search:focus-within {
  border-color: rgba(107, 147, 230, .52);
}
.watchlist-search-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  cursor: default;
}

.watchlist-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.watchlist-scroll {
  /* Height is synced to match .chart-terminal-card's rendered height via
     JS on desktop (see the ".sv-sync-height" logic in market.js) — CSS
     alone can't do this: a grid row's "auto" track sizes off the
     *tallest* item's full content, so capping this with max-height
     doesn't stop it from inflating the row (and therefore the chart
     terminal card next to it) to fit every watchlist row. Below 981px
     the chart terminal card is hidden, so this falls back to its own
     natural cap instead. */
  max-height: 540px;
  overflow-y: auto;
  padding-right: 2px;
  min-width: 0;
}

@media (min-width: 981px) {
  .watchlist-scroll {
    flex: 1;
    min-height: 0;
    max-height: none;
  }
}

.watchlist-row {
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 13px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: transparent;
  color: var(--text);
  text-align: left;
}

.hot-market-coin.watchlist-row-coin {
  width: 28px;
  height: 28px;
  font-size: 11.5px;
  flex-shrink: 0;
}

.watchlist-row-copy {
  min-width: 0;
}

.watchlist-row:last-child {
  border-bottom: 0;
}

.watchlist-row[hidden] {
  display: none;
}

.watchlist-row:hover,
.watchlist-row.active {
  color: #fff;
}

.watchlist-row b,
.watchlist-row small {
  display: block;
}

.watchlist-row small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11.5px;
}

.watchlist-price {
  text-align: right;
  min-width: 0;
}

.watchlist-price small {
  color: var(--green);
  font-weight: 800;
}

.watchlist-row.is-down .watchlist-price small {
  color: var(--red);
}

.chart-market-grid {
  display: none;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  min-width: 0;
  max-width: 100%;
}

.professional-market-card {
  min-height: 178px;
  min-width: 0;
  max-width: 100%;
}

.market-card-meta {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.coin-deposit-detail,
.coin-deposit-info,
.info-row,
.address-row,
.wallet-panel {
  min-width: 0;
  max-width: 100%;
}

.info-value {
  overflow-wrap: anywhere;
}

.address-copy-field {
  width: 100%;
  max-width: 100%;
}

.address-copy-field code {
  max-width: 100%;
}

.wallet-note {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.video-modal-desc {
  margin: 0 0 12px;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.55;
}

@media (max-width: 980px) {
  .charts-content {
    width: 100%;
    max-width: 100%;
  }

  .chart-workspace {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .market-watchlist-card {
    order: -1;
  }

  /* Below this width, Buy/Sell moves into the Hot Market modal (tap a
     Market Watch row — see assets/js/main.js), so the inline chart
     terminal card is redundant here and just hidden. */
  .chart-terminal-card {
    display: none;
  }
}

@media (max-width: 700px) {
  body.charts-page {
    overflow-x: hidden;
  }

  .charts-page .dash-main,
  .charts-page .dash-content,
  .charts-page .charts-content {
    min-width: 0;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .charts-page .dash-content {
    padding-left: 10px;
    padding-right: 10px;
  }

  .charts-page .dash-welcome {
    margin-bottom: 14px;
  }

  .charts-page .dash-welcome p {
    display: none;
  }

  .charts-page .dash-welcome h1 {
    font-size: 20px !important;
  }

  .academy-welcome p,
  .wallet-welcome p,
  .settings-welcome p,
  .notifications-welcome p,
  .support-welcome p {
    display: none;
  }

  .academy-welcome h1,
  .wallet-welcome h1,
  .settings-welcome h1,
  .notifications-welcome h1,
  .support-welcome h1 {
    font-size: 20px !important;
  }

  .chart-workspace,
  .chart-market-grid {
    gap: 12px;
  }

  .chart-terminal-card,
  .market-watchlist-card,
  .professional-market-card {
    width: 100%;
    max-width: 100%;
  }

  .market-modal-sheet,
  .video-modal-sheet {
    inset: 0 !important;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
    max-height: none;
    transform: none;
    border: 0;
    border-radius: 0;
    background: #0F1623;
    overflow: hidden;
  }

  .market-modal-head {
    flex: 0 0 auto;
    padding: 14px 62px 14px 16px;
    min-height: 64px;
  }

  .market-modal-chart {
    min-height: 0;
    flex: 1 1 auto;
    height: 100%;
    background: #0F1623;
  }

  .local-market-chart,
  .local-market-chart.is-terminal-chart {
    min-height: 100%;
  }

  .video-modal .market-modal-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    padding-top: 12px;
  }

  .video-modal .market-modal-title {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .video-modal .market-modal-close {
    grid-column: auto;
    grid-row: auto;
    justify-self: auto;
  }

  .video-modal-player {
    min-height: 0;
    aspect-ratio: auto;
  }

  .video-modal-footer {
    flex: 0 0 auto;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  }

  .chart-terminal-head {
    flex-direction: column;
    gap: 10px;
    padding: 14px 12px 10px;
  }

  .chart-terminal-head h2 {
    font-size: 24px;
  }

  .chart-price-block {
    text-align: left;
    white-space: normal;
  }

  .chart-price-block strong {
    font-size: 23px;
  }

  .chart-symbol-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px 12px 0;
  }

  .chart-interval-field,
  .chart-toolbar {
    display: none;
  }

  .timeframe-modal-trigger {
    display: inline-flex;
  }

  .chart-symbol-field input,
  .chart-symbol-field select,
  .timeframe-modal-trigger,
  .chart-symbol-bar .btn {
    height: 40px;
  }

  .chart-symbol-bar .btn {
    width: 100%;
    grid-column: 1 / -1;
  }

  .professional-chart,
  .local-market-chart.is-terminal-chart {
    min-height: 320px;
  }

  .professional-chart.tradingview-chart {
    height: 360px;
    min-height: 360px;
  }

  .local-market-chart.is-terminal-chart {
    padding: 12px;
  }

  .local-market-chart.is-terminal-chart svg {
    min-height: 230px;
  }

  .chart-terminal-footer {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
    overflow-wrap: anywhere;
  }

  .market-watchlist-card {
    padding: 12px;
  }

  .watchlist-filter {
    margin-right: -2px;
  }

  .watchlist-filter button {
    min-height: 28px;
    padding: 5px 8px;
    font-size: 11px;
  }

  .watchlist-search {
    min-height: 38px;
    margin-bottom: 8px;
  }

  .watchlist-scroll {
    max-height: 310px;
  }

  .watchlist-row {
    gap: 8px;
    padding: 11px 0;
  }

  .watchlist-row b,
  .watchlist-row small,
  .watchlist-price b,
  .watchlist-price small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .watchlist-price {
    max-width: 112px;
  }

  .chart-market-grid {
    display: none;
  }

  .professional-market-card {
    min-height: 150px;
  }

  .timeframe-picker-sheet {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 82vh;
    transform: none;
    border-radius: 18px 18px 0 0;
    background: #0F1623;
    overflow: hidden;
  }

  .timeframe-picker-handle {
    display: block;
    width: 42px;
    height: 4px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .32);
  }

  .timeframe-picker-head {
    padding: 16px 62px 12px 16px;
  }

  .timeframe-picker-grid {
    padding: 0 16px 16px;
  }

  .market-filter-sheet {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: 100%;
    max-height: 82vh;
    transform: none;
    border-radius: 18px 18px 0 0;
    background: #0F1623;
    overflow: hidden;
  }

  .market-filter-handle {
    display: block;
    width: 42px;
    height: 4px;
    margin: 10px auto 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .32);
  }

  .market-filter-head {
    padding: 16px 62px 12px 16px;
  }

  .coin-qr {
    width: min(160px, 100%);
  }

  .network-select {
    width: 100%;
    max-width: 100%;
  }

  /* Keep the address + Copy button on one row here too (see the shared
     rules above) instead of the old grid, which stacked the button full
     width below the (also full-width, wrapping) address text. */
  .address-copy-field {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    padding: 0;
    overflow: hidden;
  }

  .address-copy-field code {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    padding: 10px 10px 10px 12px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    word-break: normal;
  }

  .copy-btn {
    flex: 0 0 auto;
    width: auto;
    align-self: stretch;
    justify-content: center;
    border-radius: 0;
    padding: 0 14px;
  }
}

@media (max-width: 420px) {
  .charts-page .dash-content {
    padding-left: 8px;
    padding-right: 8px;
  }

  .charts-page .dash-welcome h1 {
    font-size: 19px !important;
  }

  .market-watchlist-card,
  .chart-terminal-card,
  .professional-market-card {
    border-radius: 8px;
  }

  .market-watchlist-card {
    padding: 10px;
  }

  .chart-terminal-head {
    padding: 12px 10px 10px;
  }

  .chart-symbol-bar {
    padding-left: 10px;
    padding-right: 10px;
  }

  .chart-toolbar {
    padding-left: 10px;
    padding-right: 10px;
  }

  .chart-market-grid {
    grid-template-columns: 1fr;
  }

  .professional-chart.tradingview-chart {
    height: 330px;
    min-height: 330px;
  }

  .chart-terminal-footer {
    padding: 10px;
  }

  .watchlist-row {
    grid-template-columns: auto minmax(0, 1fr) minmax(78px, 100px);
  }

  .watchlist-price {
    max-width: 100px;
  }

  .market-summary-card {
    padding: 14px;
  }

  .market-summary-chart {
    min-height: 50px;
  }

  .wallet-note {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }
}

/* ==================================================================
   Trading Journal (pages/journal.php)
   ================================================================== */
.journal-flash {
  padding: 13px 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}
.journal-flash-success {
  background: rgba(61, 184, 138, .12);
  border-color: rgba(61, 184, 138, .3);
  color: var(--green);
}
.journal-flash-error {
  background: rgba(224, 106, 106, .12);
  border-color: rgba(224, 106, 106, .3);
  color: var(--red);
}
.journal-flash-error code {
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, .08);
  padding: 1px 5px;
  border-radius: 4px;
}

.journal-stat-cards { margin-bottom: 22px; }

.journal-form-card,
.journal-list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 22px;
}

.journal-form-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-faint);
}
.field input,
.field select,
.field textarea {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(74, 123, 216, .15);
}
.field-notes { margin-bottom: 18px; }
.field textarea { resize: vertical; font-family: var(--font-body); }

.journal-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}

.journal-table-wrap { overflow-x: auto; }
.journal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  white-space: nowrap;
}
.journal-table th {
  text-align: left;
  color: var(--text-faint);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.journal-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.journal-table tbody tr:last-child td { border-bottom: none; }
.journal-pair { font-weight: 700; font-family: var(--font-mono); }
.journal-pnl-up { color: var(--green); font-weight: 700; }
.journal-pnl-down { color: var(--red); font-weight: 700; }
.journal-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.journal-delete-btn:hover {
  background: rgba(224, 106, 106, .12);
  border-color: rgba(224, 106, 106, .35);
  color: var(--red);
}

@media (max-width: 900px) {
  .journal-form-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .journal-form-grid { grid-template-columns: 1fr; }
  .journal-form-card, .journal-list-card { padding: 18px; }
}

/* ==================================================================
   Journal: "+ Log Trade" trigger + interactive Full Trade Log
   ================================================================== */
.journal-log-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.journal-log-card-wrap { margin-bottom: 22px; }
.journal-log-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 11px;
}

.journal-empty-icon { color: var(--text-faint); margin-bottom: 10px; }

.journal-log-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.journal-log-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 220px;
  min-width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text-faint);
}
.journal-log-search input {
  border: none;
  background: none;
  outline: none;
  color: var(--text);
  font-size: 13.5px;
  width: 100%;
  font-family: var(--font-body);
}
.journal-log-search input::placeholder { color: var(--text-faint); }

.journal-chip-group { display: flex; gap: 6px; flex-shrink: 0; }
.journal-chip {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.journal-chip:hover { border-color: var(--border-strong); color: var(--text); }
.journal-chip.active {
  background: rgba(74, 123, 216, .14);
  border-color: rgba(107, 147, 230, .4);
  color: var(--blue-light);
}

.journal-log-emotion-filter {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--font-body);
  flex-shrink: 0;
}

.journal-log-cards { display: flex; flex-direction: column; gap: 10px; }
.journal-log-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.journal-log-card:hover {
  background: rgba(255, 255, 255, .03);
  border-color: var(--border-strong);
}
.journal-log-card:active { transform: scale(.995); }
.journal-log-card:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.journal-log-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.journal-log-pair { font-weight: 700; font-family: var(--font-mono); font-size: 14px; }
.journal-log-date { color: var(--text-faint); font-size: 12.5px; margin-left: auto; }
.journal-log-pnl { font-weight: 800; font-size: 14.5px; white-space: nowrap; }
.journal-log-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.journal-log-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.journal-tag {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: .1px;
}
.journal-tag-strategy {
  background: rgba(107, 147, 230, .1);
  color: var(--blue-light);
  border: 1px solid rgba(107, 147, 230, .25);
}
.journal-emotion-chip { border: 1px solid transparent; }
.journal-emotion-chip.emotion-confident { background: rgba(61, 184, 138, .12); color: var(--green); border-color: rgba(61, 184, 138, .3); }
.journal-emotion-chip.emotion-calm { background: rgba(107, 147, 230, .1); color: var(--blue-light); border-color: rgba(107, 147, 230, .28); }
.journal-emotion-chip.emotion-anxious { background: rgba(217, 164, 65, .12); color: var(--gold); border-color: rgba(217, 164, 65, .3); }
.journal-emotion-chip.emotion-fomo { background: rgba(167, 139, 250, .14); color: #c4b0fb; border-color: rgba(167, 139, 250, .32); }
.journal-emotion-chip.emotion-revenge { background: rgba(224, 106, 106, .12); color: var(--red); border-color: rgba(224, 106, 106, .3); }

.journal-log-chevron { color: var(--text-faint); flex-shrink: 0; transition: transform .15s ease, color .15s ease; }
.journal-log-card:hover .journal-log-chevron { transform: translateX(3px); color: var(--blue-light); }

.journal-log-no-results {
  text-align: center;
  padding: 30px 12px;
  color: var(--text-muted);
  font-size: 13.5px;
}

@media (max-width: 560px) {
  .journal-log-date { display: none; }
  .journal-log-toolbar { flex-direction: column; align-items: stretch; }
  .journal-chip-group { width: 100%; }
  .journal-chip { flex: 1; text-align: center; }
  .journal-log-emotion-filter { width: 100%; }
}

/* ---- Add Trade modal (reuses .trade-modal machinery) ---- */
.add-trade-modal-card { width: min(640px, 94vw); }
.add-trade-modal-sub { color: var(--text-muted); font-size: 13.5px; margin: 0 0 18px; }

.journal-dir-toggle, .journal-emotion-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.journal-dir-toggle input, .journal-emotion-picker input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.journal-dir-option, .journal-emotion-option {
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 10px;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
  user-select: none;
}
.journal-dir-toggle { flex: 1; }
.journal-dir-option { flex: 1; text-align: center; }
.journal-dir-option.dir-buy:hover { border-color: rgba(61, 184, 138, .35); }
.journal-dir-option.dir-sell:hover { border-color: rgba(224, 106, 106, .35); }
#dirBuy:checked ~ .journal-dir-option.dir-buy,
input[value="buy"]:checked + .journal-dir-option.dir-buy {
  background: rgba(61, 184, 138, .14);
  border-color: rgba(61, 184, 138, .4);
  color: var(--green);
}
input[value="sell"]:checked + .journal-dir-option.dir-sell {
  background: rgba(224, 106, 106, .12);
  border-color: rgba(224, 106, 106, .35);
  color: var(--red);
}
.field-emotion { margin-bottom: 18px; }
.journal-emotion-option { border-radius: 999px; }
input[value="confident"]:checked + .journal-emotion-option.emotion-confident {
  background: rgba(61, 184, 138, .14); border-color: rgba(61, 184, 138, .4); color: var(--green);
}
input[value="calm"]:checked + .journal-emotion-option.emotion-calm {
  background: rgba(107, 147, 230, .12); border-color: rgba(107, 147, 230, .35); color: var(--blue-light);
}
input[value="anxious"]:checked + .journal-emotion-option.emotion-anxious {
  background: rgba(217, 164, 65, .14); border-color: rgba(217, 164, 65, .4); color: var(--gold);
}
input[value="fomo"]:checked + .journal-emotion-option.emotion-fomo {
  background: rgba(167, 139, 250, .16); border-color: rgba(167, 139, 250, .4); color: #c4b0fb;
}
input[value="revenge"]:checked + .journal-emotion-option.emotion-revenge {
  background: rgba(224, 106, 106, .14); border-color: rgba(224, 106, 106, .4); color: var(--red);
}
.add-trade-submit { width: 100%; }

@media (max-width: 560px) {
  .journal-dir-toggle { width: 100%; }
}

/* ---- Trade Detail modal (shared by Journal, Portfolio, Wallet) ---- */
.trade-detail-modal-card {
  width: min(480px, 92vw);
  /* Flat black, same Bybit-style treatment as .hot-market-modal /
     .chart-terminal-card, instead of the navy-tinted base .trade-modal-card
     background this modal used to inherit. */
  background: linear-gradient(180deg, #131C2B 0%, #0F1623 100%);
  border-color: rgba(255, 255, 255, .08);
  /* Faint graph-paper texture across the whole card — reinforces the
     "trading terminal" feel at a glance, subtle enough to sit behind every
     surface (stats grid / chart panel) without fighting their own
     backgrounds. */
  background-image:
    linear-gradient(180deg, #131C2B 0%, #0F1623 100%),
    linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);
  background-size: auto, 22px 22px, 22px 22px;
}

/* Decorative candlestick cluster watermark filling the chart panel behind
   the real price line/gridlines. Colored via .is-up/.is-down, set in JS
   by the same renderTradeChart() call that colors the real chart line
   below it, so both always agree — a CSS variable wouldn't work here
   since the trade's outcome color is set on .trade-detail-logo, a
   sibling element, which custom properties don't cascade sideways to. */
.trade-detail-watermark {
  position: absolute;
  z-index: -1;
  inset: 10px 12px auto;
  width: calc(100% - 24px);
  height: 90px;
  color: var(--text-faint);
  opacity: .1;
  pointer-events: none;
}
.trade-detail-watermark.is-up { color: var(--green); }
.trade-detail-watermark.is-down { color: var(--red); }

.trade-detail-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 4px 0 18px;
}
.hot-market-coin.trade-detail-logo {
  width: 46px;
  height: 46px;
  font-size: 17px;
}
.trade-detail-heading { min-width: 0; flex: 1; }
.trade-detail-heading h3 { margin: 0 0 4px; font-size: 18px; font-family: var(--font-mono); }
.trade-detail-subrow { display: flex; align-items: center; gap: 8px; }
.trade-detail-date { color: var(--text-faint); font-size: 12.5px; }
.trade-detail-pnl { font-size: 14px; font-weight: 800; white-space: nowrap; }

.trade-detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}
/* On the Trade Detail modal's flat-black card specifically, use the same
   subtle white-on-black overlay as .hm-order-rows (Hot Market modal)
   instead of the navy-tinted --bg-elevated, so the two feel like one
   product. */
.trade-detail-modal-card .trade-detail-stats,
.trade-detail-modal-card .trade-detail-chart {
  background: rgba(255, 255, 255, .03);
  border-color: rgba(255, 255, 255, .08);
}
.trade-detail-stat { display: flex; flex-direction: column; gap: 4px; }
.trade-detail-stat .k { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--text-faint); }
.trade-detail-stat .v { font-size: 14.5px; font-weight: 700; font-family: var(--font-mono); }

/* Per-trade entry->exit mini chart, shown in the Trade Detail modal (see
   includes/trade-detail-modal.php + renderTradeChart() in main.js). Same
   green/red-on-black treatment as the rest of the app's price charts. */
.trade-detail-chart {
  position: relative;
  /* z-index: 0 (paired with position: relative above) establishes a local
     stacking context, so the watermark's z-index: -1 below stays
     contained inside this panel — painting above this panel's own
     background but below the real chart content — instead of escaping to
     an ancestor's stacking context and disappearing behind this panel's
     own background entirely. */
  z-index: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px 8px;
  margin-bottom: 16px;
}
.trade-detail-chart-svg {
  width: 100%;
  height: 90px;
  display: block;
  color: var(--red);
}
.trade-detail-chart-svg.is-up { color: var(--green); }
.trade-detail-chart-dot { fill: currentColor; stroke: var(--bg-elevated); stroke-width: 2; }

/* No padding of its own — see the comment in includes/trade-detail-modal.php
   on why the price tags need this exact, offset-free box to position
   against. */
.trade-detail-chart-plot { position: relative; }

/* Animated dashed gridlines behind the price path — same sweep-in used by
   the Stocks tab's .stock-chart-gridline, reused here so both "price
   chart" surfaces in the app share one visual language. */
.trade-detail-chart-gridline {
  stroke: rgba(255, 255, 255, .07);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transform: scaleX(0);
  opacity: 0;
  animation: sv-trade-grid-sweep .5s cubic-bezier(.22, .61, .36, 1) forwards;
}
@keyframes sv-trade-grid-sweep {
  0%   { transform: scaleX(0); opacity: 0; }
  60%  { opacity: .55; }
  100% { transform: scaleX(1); opacity: .45; }
}

/* Soft "live price" ping around the exit dot — expands and fades on a
   loop, same idea as an exchange terminal's last-price marker. Purely
   decorative: the trade is closed, this just sells the "market" feel. */
.trade-detail-chart-pulse {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  opacity: 0;
  animation: sv-trade-pulse-ping 2.4s ease-out .5s infinite;
  pointer-events: none;
}
@keyframes sv-trade-pulse-ping {
  0%   { r: 4; opacity: .5; }
  75%  { r: 14; opacity: 0; }
  100% { r: 14; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .trade-detail-chart-gridline { opacity: .45; transform: scaleX(1); animation: none; }
  .trade-detail-chart-pulse { display: none; }
}

.trade-detail-chart-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-faint);
  margin-top: 4px;
}

/* Floating price tags anchored to the entry/exit dots (position set in %
   by renderTradeChart() in main.js, matching the dots' own x/y) — see the
   comment in includes/trade-detail-modal.php for why these are plain HTML
   rather than SVG text. */
.trade-detail-chart-price-tag {
  position: absolute;
  transform: translate(-50%, -135%);
  background: #0a0a0a;
  border: 1px solid rgba(255, 255, 255, .14);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  animation: sv-trade-tag-in .35s ease .55s forwards;
}
.trade-detail-chart-price-tag-exit.is-up { border-color: rgba(0, 200, 120, .4); color: var(--green); }
.trade-detail-chart-price-tag-exit.is-down { border-color: rgba(224, 106, 106, .4); color: var(--red); }
@keyframes sv-trade-tag-in {
  from { opacity: 0; transform: translate(-50%, -125%); }
  to   { opacity: 1; transform: translate(-50%, -135%); }
}
@media (prefers-reduced-motion: reduce) {
  .trade-detail-chart-price-tag { opacity: 1; animation: none; }
}

.trade-detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.trade-detail-tags:empty { display: none; }

/* Any row wired to open the Trade Detail modal gets a pointer + a11y focus ring */
.trade-pulse-row.is-clickable { cursor: pointer; }
.trade-pulse-row.is-clickable:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
  border-radius: 8px;
}

/* ==================================================================
   Dashboard performance chart (replaces the old Win Rate + Journal
   stat-card pair with a single equity-curve summary card)
   ================================================================== */
.performance-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 22px;
}
.performance-card .panel-head { margin-bottom: 6px; }
.performance-range .trend-badge {
  margin-bottom: 10px;
}
.performance-meta {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.performance-meta .metric { display: flex; flex-direction: column; gap: 2px; }
.performance-meta .metric .k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-faint);
  font-weight: 700;
}
.performance-meta .metric .v {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.performance-meta .metric .v.up { color: var(--green); }
.performance-meta .metric .v.down { color: var(--red); }
.performance-chart-svg { width: 100%; height: auto; display: block; }
.performance-chart-svg.is-demo { opacity: .68; }
.performance-chart-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin: 0 -4px;
  padding: 0 4px 6px;
  scrollbar-width: thin;
}
.performance-chart-scroll::-webkit-scrollbar { height: 6px; }
.performance-chart-scroll::-webkit-scrollbar-track { background: transparent; }
.performance-chart-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.performance-chart-svg-wide {
  width: auto;
  max-width: none;
  height: 120px;
  flex-shrink: 0;
  display: block;
}
.performance-demo-tag {
  font-size: 11.5px;
  font-style: italic;
  color: var(--text-faint);
  margin-bottom: 8px;
}
.performance-empty {
  padding: 24px 4px 6px;
  color: var(--text-muted);
  font-size: 13.5px;
}

/* ---- "View Trades" modal chart (portfolio.php + wallet.php) — reuses the
   Stocks tab's .stock-chart-yaxis / .stock-chart-grid / .stock-chart-svg
   treatment (see stock chart rules further down) so this equity curve reads
   as the same style of trading chart instead of a bare sparkline. The only
   addition needed here is the time-axis layout: unlike the Stocks tab's
   fixed-width chart (evenly spaced flex labels), this chart can scroll
   horizontally, so its labels are positioned by percentage-of-width instead,
   scrolling in sync with the chart underneath them. ---- */
.trade-modal-chart-plot { gap: 8px; }
.trade-modal-chart-xaxis {
  position: relative;
  height: 15px;
  margin-top: 6px;
}
.trade-modal-chart-xaxis .stock-chart-axis-label {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}
/* portfolio.php's modal keeps the win-rate ring row directly under this
   chart (wallet.php's modal has no ring, so needed no extra spacing here)
   — a little breathing room so the two don't run together. */
.performance-range .trade-modal-chart-plot {
  margin-bottom: 14px;
}

/* ---- Journal page's own Performance card — identical scrollable chart
   treatment to the "View Trades" modal above (.trade-modal-chart-plot /
   .trade-modal-chart-xaxis), just under the journal-specific class names
   so it doesn't accidentally pick up the modal's own spacing tweaks. ---- */
.journal-chart-plot { gap: 8px; }
.journal-chart-xaxis {
  position: relative;
  height: 15px;
  margin-top: 6px;
}
.journal-chart-xaxis .stock-chart-axis-label {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
}

/* Both this card and the "View Trades" modal above nest their own
   .performance-chart-scroll (which does the horizontal scrolling) inside
   the generic .stock-chart-plot-main (which also scrolls-x by default for
   the Stocks tab's non-wide charts). With a scrolling wide chart inside,
   that leaves two overflow-x:auto containers stacked on the same content,
   so desktop shows two horizontal scrollbars. Only the inner one should
   scroll here. */
.journal-chart-plot .stock-chart-plot-main,
.trade-modal-chart-plot .stock-chart-plot-main {
  /* overflow-y must also be set to "visible" here — per the CSS overflow
     spec (see the .trade-modal-card comment above), pairing overflow-x:
     visible with the base rule's inherited overflow-y: hidden forces the
     browser to compute overflow-x back to "auto", silently undoing this
     override and leaving the outer container scrollable again alongside
     the inner .performance-chart-scroll. */
  overflow-x: visible;
  overflow-y: visible;
}

/* ==================================================================
   Live TradingView widgets (Economic Calendar + Forex News) — real,
   auto-updating third-party embeds, no API key required.
   ================================================================== */
.widget-frame {
  min-height: 380px;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.economic-card .panel-head .live-dot,
.news-card .panel-head .live-dot {
  margin-left: auto;
}

/* ---- Dashboard "Stocks" preview card (replaces the old Economic Calendar) ---- */
.stocks-preview-body {
  display: flex;
  min-height: 0;
}
.stocks-preview-list {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-x: hidden;
}
.stocks-preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 13px 4px;
  border-bottom: 1px solid var(--border);
}
.stocks-preview-row:last-child { border-bottom: none; }
.stocks-preview-row .stock-logo { flex-shrink: 0; }
.stocks-preview-row-clickable {
  cursor: pointer;
  border-radius: 10px;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  transition: background .15s ease;
}
.stocks-preview-row-clickable:hover,
.stocks-preview-row-clickable:focus-visible {
  background: var(--surface-2);
}
.stocks-preview-row-clickable:focus-visible {
  outline: 2px solid var(--blue-light);
  outline-offset: -2px;
}
.stocks-preview-row-clickable.is-active-chart {
  background: rgba(47, 143, 255, .1);
  border-bottom-color: transparent;
}
.stocks-preview-row-clickable.is-active-chart .stocks-preview-copy strong {
  color: var(--blue-light);
}
/* Cap the list at ~3 rows before scrolling, on mobile and desktop alike —
   every stock still renders and is reachable by scrolling, only the
   visible viewport height is capped. Each row is padding 13px top/bottom
   + content ~34px (the 34px logo is the tallest child) + 1px border, plus
   the list's 4px flex-gap between rows. */
.stocks-preview-card .stocks-preview-body {
  --stocks-preview-row-height: 61px;
  --stocks-preview-row-gap: 4px;
  max-height: calc((var(--stocks-preview-row-height) * 3) + (var(--stocks-preview-row-gap) * 2));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.stocks-preview-card .stocks-preview-body::-webkit-scrollbar { width: 5px; }
.stocks-preview-card .stocks-preview-body::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.stocks-preview-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.stocks-preview-copy strong { font-size: 14px; font-weight: 800; }
.stocks-preview-copy small { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stocks-preview-price {
  flex-shrink: 0;
  text-align: right;
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stocks-preview-price small { display: block; margin-top: 2px; font-size: 11px; font-weight: 700; }

/* ==================================================================
   Performance trend badge (up/down %, next to "Open Journal")
   ================================================================== */
.performance-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  line-height: 1.6;
}
.trend-badge.up {
  color: var(--green);
  background: rgba(61, 184, 138, .12);
  border: 1px solid rgba(61, 184, 138, .28);
}
.trend-badge.down {
  color: var(--red);
  background: rgba(224, 106, 106, .12);
  border: 1px solid rgba(224, 106, 106, .28);
}

/* ==================================================================
   Upcoming Events — now a single full-width live card (Trading
   Journal mini-card removed) with a per-event live countdown.
   ================================================================== */
.dash-grid-2c.single-card {
  grid-template-columns: 1fr;
}
.upcoming-events-card .event-row {
  align-items: center;
}
.event-countdown {
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-light);
  white-space: nowrap;
}

/* ---- Interactive event rows: expandable accordion with a per-event
   "time since last release" progress ring ---- */
.event-list { display: flex; flex-direction: column; max-height: 340px; overflow-y: auto; }
.event-item { border-bottom: 1px solid var(--border); }
.event-item:last-child { border-bottom: none; }
.upcoming-events-card .event-item .event-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 2px;
  border-bottom: none;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  border-radius: 8px;
  transition: background .15s ease;
}
.upcoming-events-card .event-item .event-row:hover { background: var(--surface-2); }
.upcoming-events-card .event-item .event-row:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}
.event-progress-ring { flex-shrink: 0; display: flex; }
.event-progress-track { stroke: var(--border); }
.event-progress-bar { stroke: var(--blue); transition: stroke-dashoffset .5s ease; }
.event-row-copy { flex: 1; min-width: 0; }
.event-row-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.event-chevron {
  color: var(--text-faint);
  transition: transform .2s ease;
  flex-shrink: 0;
}
.event-item .event-row[aria-expanded="true"] .event-chevron {
  transform: rotate(180deg);
  color: var(--blue);
}
.event-panel {
  padding: 0 2px 14px 50px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
}
.event-panel p { margin: 0 0 8px; }
.event-source-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 700;
  color: var(--blue-light);
}
.event-source-link:hover { text-decoration: underline; }

/* ==================================================================
   Hot Market — crypto pair ticker card that replaced Upcoming Events
   on the dashboard (see .stocks-events-row / hotMarketPairs() in
   portfolio.php). Bybit-style ticker row: coin badge, symbol + price,
   a tiny colored sparkline, and a green/red change pill.
   ================================================================== */
.hot-market-list {
  display: flex;
  flex-direction: column;
  max-height: 340px;
  overflow-y: auto;
}
.hot-market-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--border);
  width: 100%;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .12s ease;
  border-radius: 8px;
}
.hot-market-row:hover, .hot-market-row:focus-visible {
  background: rgba(255, 255, 255, .04);
  outline: none;
}
.hot-market-row:last-child { border-bottom: none; }
.hot-market-coin {
  position: relative;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 800;
  color: #fff;
  background: var(--pair-accent, var(--blue));
  overflow: hidden;
}
.hot-market-coin-fallback { position: relative; z-index: 1; }
.hot-market-coin-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 2;
  background: #fff;
}
.hot-market-copy { flex: 1; min-width: 0; }
.hot-market-symbol {
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hot-market-symbol span { color: var(--text-muted); font-weight: 600; }
.hot-market-price {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}
.hot-market-spark {
  flex-shrink: 0;
  width: 56px;
  height: 26px;
}
.hot-market-spark.is-up { color: var(--green); }
.hot-market-spark.is-down { color: var(--red); }
.hot-market-change {
  flex-shrink: 0;
  min-width: 62px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}
.hot-market-change.is-up { color: var(--green); }
.hot-market-change.is-down { color: var(--red); }
@media (max-width: 480px) {
  /* Was `display: none` — the trend sparkline disappeared entirely on
     phones instead of just shrinking. Scale it (and tighten the row's
     other spacing a bit) so it still fits alongside the coin, price, and
     % change instead of being dropped. */
  .hot-market-row { gap: 8px; padding-left: 0; padding-right: 0; }
  .hot-market-spark { width: 34px; height: 22px; }
  .hot-market-change { min-width: 50px; font-size: 11.5px; }
}

/* ==================================================================
   Dashboard "View Trades" modal — Bybit-style restyle. Scoped to
   .dash-trade-modal, added to both portfolio.php's "View Trades" modal
   and wallet.php's mobile Performance+History modal (they share the
   same .trade-modal/.trade-modal-card markup) so both render with the
   identical pure-black panel + a live pair ticker strip + a green/red
   Buy/Sell action bar — a trading-terminal look rather than the site's
   usual navy card gradient.
   ================================================================== */
.dash-trade-modal .trade-modal-card {
  background: #000;
  border: 1px solid rgba(255, 255, 255, .08);
}
.dash-trade-modal .card {
  background: #0a0a0d;
  border-color: rgba(255, 255, 255, .08);
}

/* ==================================================================
   Journal page — same pure-black treatment as the "View Trades" modal
   above (.dash-trade-modal), applied across the whole page: stat
   cards, the Performance chart card and the Recent Trades card all get
   the trading-terminal-black panel instead of the site's usual navy
   card gradient. Scoped to .journal-black-theme (pages/journal.php's
   <main>) so nothing else on the dashboard is affected.
   ================================================================== */
.journal-black-theme .card,
.journal-black-theme .stat-card {
  background: #0a0a0d;
  border-color: rgba(255, 255, 255, .08);
}
.bybit-ticker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #0a0a0d;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 12px;
  padding: 12px 16px;
  margin: 0 0 14px;
}
.bybit-ticker-pair {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.bybit-ticker-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pair-accent, var(--green));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pair-accent, var(--green)) 25%, transparent);
}
.bybit-ticker-pair strong {
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}
.bybit-ticker-perp {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-muted);
  background: rgba(255, 255, 255, .06);
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
}
.bybit-ticker-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 800;
  white-space: nowrap;
}
.bybit-ticker-price.is-up { color: var(--green); }
.bybit-ticker-price.is-down { color: var(--red); }
.bybit-ticker-change {
  font-size: 12px;
  font-weight: 700;
}
.bybit-trade-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.bybit-trade-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 12px;
  border-radius: 10px;
  font-size: 14.5px;
  font-weight: 800;
  text-decoration: none;
  letter-spacing: .01em;
  transition: filter .15s ease, transform .1s ease;
}
.bybit-trade-btn:active { transform: scale(.98); }
.bybit-trade-btn.bybit-buy {
  background: var(--green);
  color: #06110d;
}
.bybit-trade-btn.bybit-sell {
  background: var(--red);
  color: #1a0505;
}
.bybit-trade-btn:hover { filter: brightness(1.08); }
@media (max-width: 480px) {
  .bybit-ticker { padding: 10px 12px; }
  .bybit-ticker-price { font-size: 15px; }
}

/* ==================================================================
   Hot Market modal — fullscreen Bybit-style trading view, opened from
   any .hot-market-row (see includes/hot-market-modal.php + the
   "Hot Market modal" block in main.js). Pure black surface, live
   TradingView chart on the left, a green/red simulated order ticket on
   the right. Fully separate from .trade-modal — this is its own
   full-viewport overlay, not a centered card.
   ================================================================== */
.hot-market-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.01);
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}
.hot-market-modal.open {
  opacity: 1;
  visibility: visible;
  transform: none;
}
body.modal-open { overflow: hidden; }

.hm-modal-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: #050505;
}
.hm-modal-pair {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.hm-modal-logo {
  position: relative;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
  background: var(--pair-accent, var(--blue));
  overflow: hidden;
}
.hm-modal-logo-fallback { position: relative; z-index: 1; }
.hm-modal-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
  z-index: 2;
}
.hm-modal-pair-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hm-modal-symbol { font-size: 16px; font-weight: 800; color: #fff; white-space: nowrap; }
.hm-modal-sub { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.hm-modal-price-block {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-mono);
  white-space: nowrap;
}
.hm-modal-price { font-size: 17px; font-weight: 800; color: #fff; }
.hm-modal-change { font-size: 13px; font-weight: 700; }
.hm-modal-change.is-up { color: var(--green); }
.hm-modal-change.is-down { color: var(--red); }
.hm-modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .06);
  border: none;
  color: #fff;
  cursor: pointer;
  transition: background .12s ease;
}
.hm-modal-close:hover { background: rgba(255, 255, 255, .12); }

.hm-modal-sim-banner {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  font-size: 12px;
  font-weight: 600;
  color: #f0b90b;
  background: rgba(240, 185, 11, .08);
  border-bottom: 1px solid rgba(240, 185, 11, .18);
}
.hm-modal-sim-banner svg { flex-shrink: 0; }

.hm-modal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
}
.hm-modal-chart {
  flex: 1;
  min-width: 0;
  background: #050505;
  border-right: 1px solid rgba(255, 255, 255, .08);
}
.hm-chart-frame-wrap { width: 100%; height: 100%; }
.hm-chart-frame { width: 100%; height: 100%; border: 0; display: block; }

.hm-modal-order {
  flex-shrink: 0;
  width: 340px;
  padding: 18px;
  overflow-y: auto;
  background: #000;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hm-order-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: rgba(255, 255, 255, .05);
  border-radius: 10px;
  padding: 3px;
}
.hm-order-tab {
  border: none;
  background: none;
  padding: 10px 8px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.hm-order-tab.is-active[data-hm-tab="buy"] { background: var(--green); color: #06110d; }
.hm-order-tab.is-active[data-hm-tab="sell"] { background: var(--red); color: #1a0505; }

.hm-order-field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.hm-order-field input {
  width: 100%;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  padding: 12px 12px;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #fff;
}
.hm-order-field input:focus { outline: none; border-color: var(--green); }

.hm-order-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.hm-order-presets button {
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .03);
  color: var(--text-muted);
  border-radius: 8px;
  padding: 7px 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.hm-order-presets button:hover { background: rgba(255, 255, 255, .08); color: #fff; }

.hm-order-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, .03);
  border-radius: 10px;
}
.hm-order-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
}
.hm-order-row span { color: var(--text-muted); }
.hm-order-row b { color: #fff; font-family: var(--font-mono); font-weight: 700; }

.hm-submit-btn {
  width: 100%;
  border: none;
  border-radius: 10px;
  padding: 14px 12px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .01em;
  cursor: pointer;
  transition: filter .15s ease, transform .1s ease;
}
.hm-submit-btn:active { transform: scale(.98); }
.hm-submit-btn:hover { filter: brightness(1.08); }
.hm-submit-buy { background: var(--green); color: #06110d; }
.hm-submit-sell { background: var(--red); color: #1a0505; }

.hm-order-confirm {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(61, 184, 138, .1);
  color: var(--green);
  border: 1px solid rgba(61, 184, 138, .25);
}
.hm-order-confirm.is-sell {
  background: rgba(224, 106, 106, .1);
  color: var(--red);
  border-color: rgba(224, 106, 106, .25);
}

.hm-pos-head { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 12px; font-weight: 700; color: rgba(255,255,255,.65); }
.hm-pos-head b { color: #fff; }
.hm-pos-empty { font-size: 12px; color: rgba(255,255,255,.45); padding: 8px 0; }
.hm-pos-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.hm-pos { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); }
.hm-pos-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.hm-pos-main small { flex-basis: 100%; font-size: 11px; color: rgba(255,255,255,.5); }
.hm-pos-side { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 6px; }
.hm-pos-side.is-buy { background: rgba(61,184,138,.15); color: var(--green); }
.hm-pos-side.is-sell { background: rgba(224,106,106,.15); color: var(--red); }
.hm-pos-pnl { font-size: 13px; font-weight: 800; }
.hm-pos-pnl.is-up { color: var(--green); }
.hm-pos-pnl.is-down { color: var(--red); }
.hm-pos-close { border: 1px solid rgba(255,255,255,.2); background: transparent; color: #fff; border-radius: 8px; padding: 6px 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
.hm-pos-close:disabled { opacity: .5; }

@media (max-width: 860px) {
  .hm-modal-body { flex-direction: column; overflow-y: auto; }
  .hm-modal-chart { border-right: none; border-bottom: 1px solid rgba(255, 255, 255, .08); min-height: 320px; }
  .hm-modal-order { width: 100%; }
  .hm-modal-sub { display: none; }
}
@media (max-width: 480px) {
  .hm-modal-header { padding: 12px 14px; }
  .hm-modal-sim-banner { padding: 7px 14px; font-size: 11px; }
  .hm-modal-order { padding: 14px; }
}

/* ==================================================================
   Hot Market card header — "Live" pill + "View more" trigger that opens
   the fullscreen Markets list modal below. Grouped together on the
   right side of .panel-head so both stay next to the "Hot Market"
   title regardless of card width.
   ================================================================== */
.hot-market-head-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.hot-market-viewmore {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--blue-light);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
}
.hot-market-viewmore:hover, .hot-market-viewmore:focus-visible { text-decoration: underline; outline: none; }
.hot-market-viewmore svg { flex-shrink: 0; }

/* ==================================================================
   Hot Market list modal — fullscreen "Markets" browser opened via
   "View more" on the Hot Market card (see includes/hot-market-list-
   modal.php + the "Hot Market list modal" block in main.js). Same
   full-viewport overlay treatment as .hot-market-modal, but built
   around a search box and a scrollable list instead of a chart, and
   works identically on desktop and mobile (always fullscreen).
   ================================================================== */
.hot-market-list-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.01);
  transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
}
.hot-market-list-modal.open {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.hml-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: #050505;
}
.hml-header h2 { margin: 0; font-size: 17px; font-weight: 800; color: #fff; }
.hml-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  color: #fff;
  cursor: pointer;
}
.hml-close:hover { background: rgba(255, 255, 255, .1); }
.hml-search-wrap {
  flex-shrink: 0;
  position: relative;
  margin: 14px 20px;
}
.hml-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.hml-search-input {
  width: 100%;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 12px;
  padding: 12px 14px 12px 40px;
  font: inherit;
  font-size: 14.5px;
  color: #fff;
}
.hml-search-input::placeholder { color: var(--text-muted); }
.hml-search-input:focus {
  outline: none;
  border-color: var(--blue-light);
  background: rgba(255, 255, 255, .07);
}
.hml-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px 24px;
}
.hml-row { padding: 13px 6px; }
.hml-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  padding: 40px 0;
  margin: 0;
}
@media (max-width: 480px) {
  .hml-header { padding: 14px 16px; }
  .hml-search-wrap { margin: 12px 16px; }
  .hml-list { padding: 0 16px 24px; }
}

/* ==================================================================
   Economic Calendar / Forex News — light, readable heading text on
   the dark card, with the site's usual blue-light link accent.
   ================================================================== */
.economic-card .panel-head h3,
.news-card .panel-head h3 {
  color: #fff;
}
.economic-card .panel-head a {
  color: var(--blue-light);
}
.widget-frame {
  background: rgba(7, 17, 32, .5);
  border: 1px solid rgba(116, 152, 205, .16);
  border-radius: var(--radius-sm);
}

/* ==================================================================
   Performance timeframe dropdown (replaces "Open Journal" link) —
   picks which pre-rendered 7D/30D/90D range block is shown below.
   ================================================================== */
.timeframe-dropdown {
  position: relative;
}
.timeframe-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  appearance: none;
  cursor: pointer;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.timeframe-dropdown-trigger:hover {
  border-color: var(--border-strong);
}
.timeframe-dropdown.open .timeframe-dropdown-trigger {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}
.timeframe-dropdown-chevron {
  flex-shrink: 0;
  color: var(--text-faint);
  transition: transform .18s ease;
}
.timeframe-dropdown.open .timeframe-dropdown-chevron {
  transform: rotate(180deg);
  color: var(--blue-light);
}
.timeframe-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 150px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  display: none;
  flex-direction: column;
  gap: 2px;
}
.timeframe-dropdown.open .timeframe-dropdown-menu {
  display: flex;
  animation: sv-fade-in .16s ease;
}
.timeframe-dropdown-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  appearance: none;
  cursor: pointer;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  transition: background .15s ease;
}
.timeframe-dropdown-option:hover {
  background: var(--surface-2);
}
.timeframe-dropdown-option.active {
  background: color-mix(in srgb, var(--blue) 14%, var(--surface-2));
  font-weight: 700;
}
.timeframe-dropdown-check {
  flex-shrink: 0;
  color: var(--blue-light);
  opacity: 0;
}
.timeframe-dropdown-option.active .timeframe-dropdown-check {
  opacity: 1;
}

/* ==================================================================
   Stocks page (Buy Stocks with Crypto + My Stocks holdings)
   ================================================================== */
.delta-down { color: var(--red); }

.stock-buy-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .stock-buy-grid { grid-template-columns: 1fr; }
}
.stock-buy-grid.stock-buy-grid--single {
  grid-template-columns: 1fr;
  max-width: 360px;
}
@media (max-width: 640px) {
  .stock-buy-grid.stock-buy-grid--single { max-width: none; }
}

/* ---- Stock List (search + list, replaces the old overview strip + dropdown) ---- */
.stock-list-search {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-faint);
}
.stock-list-search input {
  min-width: 0;
  flex: 1;
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
}
.stock-list-search-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin: 6px 0;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--surface-3, var(--surface-2));
  color: var(--text);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease;
}
.stock-list-search-btn:hover { border-color: var(--blue); }

.stock-list-scroll {
  max-height: min(360px, 50vh);
  overflow-y: auto;
  overflow-x: auto;
  padding-right: 2px;
  margin-bottom: 4px;
  scrollbar-width: thin;
}
.stock-list-scroll::-webkit-scrollbar { height: 5px; width: 5px; }
.stock-list-scroll::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.stock-list-row {
  width: 100%;
  min-width: 300px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 6px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background .15s ease;
}
.stock-list-row:last-child { border-bottom: 0; }
.stock-list-row[hidden] { display: none; }
.stock-list-row:hover { background: var(--surface-2); }
.stock-list-row.active { background: color-mix(in srgb, var(--blue) 8%, var(--surface-2)); }
.stock-list-row svg { flex-shrink: 0; }
.stock-list-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; }
.stock-list-copy strong { font-size: 14px; font-weight: 800; }
.stock-list-copy small { font-size: 11.5px; color: var(--text-muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stock-list-price {
  flex-shrink: 0;
  text-align: right;
  font-size: 13.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stock-list-price small { display: block; margin-top: 2px; font-size: 11px; font-weight: 700; }

.stock-list-empty {
  padding: 18px 4px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ---- Stock trend chart card (Buy panel) ---- */
.stock-chart-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 16px 16px 8px;
  margin-bottom: 16px;
}
.stock-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.stock-chart-id { display: flex; align-items: center; gap: 10px; min-width: 0; }
.stock-chart-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.stock-chart-copy strong { font-size: 15px; font-weight: 800; }
.stock-chart-copy small {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  display: block;
}
.stock-chart-price-block { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.stock-chart-price { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stock-chart-range-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 12px;
}

/* Desktop (>=901px): plain inline chip group. Mobile: professional dropdown
   instead, so 1W/1M/3M/1Y doesn't have to fight for space on a small screen. */
.stock-chart-range-row .journal-chip-group { display: none; }
.stock-range-dropdown { display: inline-flex; }

/* This trigger sits on the LEFT of its row (unlike the Performance dropdown
   elsewhere, which sits on the right) — anchor the menu to the left edge
   too, or the shared .timeframe-dropdown-menu right:0 rule pushes it off
   the left side of small/mobile screens. */
.stock-range-dropdown .timeframe-dropdown-menu {
  left: 0;
  right: auto;
}

@media (min-width: 901px) {
  .stock-chart-range-row .journal-chip-group { display: flex; }
  .stock-range-dropdown { display: none; }
}

.stock-chart-svg { width: 100%; height: 100px; display: block; color: var(--green); }
.stock-chart-svg.is-down { color: var(--red); }

/* ---- Chart plot: price axis on the left, sparkline + time axis on the
   right, like a proper trading chart instead of a bare sparkline. ---- */
.stock-chart-plot {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.stock-chart-yaxis {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 100px;
}
.stock-chart-plot-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.stock-chart-plot-main::-webkit-scrollbar { height: 5px; }
.stock-chart-plot-main::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.stock-chart-svg, .stock-chart-xaxis { flex-shrink: 0; }
.stock-chart-xaxis {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.stock-chart-axis-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  animation: stock-axis-fade-in .38s ease forwards;
}
.stock-chart-yaxis .stock-chart-axis-label {
  position: absolute;
  right: 0;
  transform: translateY(-50%);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes stock-axis-fade-in {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---- Animated horizontal grid ("equator") lines behind the price line —
   each one sweeps outward from the chart's center on load / range change,
   with a short stagger per row so they read as a ripple rather than a
   single flat flash. ---- */
.stock-chart-gridline {
  stroke: var(--border-strong);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: 50% 50%;
  transform: scaleX(0);
  opacity: 0;
  animation: stock-gridline-sweep .55s cubic-bezier(.22, .61, .36, 1) forwards;
}
@keyframes stock-gridline-sweep {
  0%   { transform: scaleX(0);   opacity: 0; }
  55%  { opacity: .6; }
  100% { transform: scaleX(1);   opacity: .5; }
}
@media (prefers-reduced-motion: reduce) {
  .stock-chart-axis-label { opacity: 1; animation: none; }
  .stock-chart-gridline { opacity: .5; transform: scaleX(1); animation: none; }
}

@media (max-width: 560px) {
  .stock-chart-yaxis { width: 36px; height: 84px; }
  .stock-chart-svg { height: 84px; }
  .stock-chart-axis-label { font-size: 9.5px; }
}

/* ---- Buy button, moved below the chart itself — compact and right-aligned
   at every screen width (not just desktop). ---- */
.stock-chart-buy-row { margin-top: 16px; display: flex; justify-content: flex-end; }
.stock-chart-buy-btn { width: auto; justify-content: center; gap: 8px; padding-left: 18px; padding-right: 18px; }

/* ---- Holdings list on the chart card ----
   Everything below the Buy button (pending purchases + your holdings)
   scrolls as a single unit capped at a fixed height, so this block never
   keeps growing the chart card taller as more rows are added — only this
   panel scrolls, the buy button above it stays put. */
.stock-chart-holdings {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  max-height: min(480px, 55vh);
  min-width: 0;
  overflow-y: auto;
  overflow-x: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.stock-chart-holdings::-webkit-scrollbar { width: 5px; }
.stock-chart-holdings::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.stock-chart-holdings .stock-holdings-table { margin-top: 4px; }

/* The outer .stock-chart-holdings panel is the scroll boundary (both axes),
   so the tables inside it don't get their own independent scroll — that
   would just create a scrollbar-inside-a-scrollbar. They stay capped and
   independently scrollable everywhere else they're used (the "My Stocks"
   tab table below), just not here. */
.stock-chart-holdings .stock-holdings-table,
.stock-chart-holdings .stock-pending-table {
  max-height: none;
  overflow: visible;
}
.stock-chart-holdings .stock-holdings-table .wallet-history-head,
.stock-chart-holdings .stock-pending-table .wallet-history-head {
  position: static;
}

/* On mobile the chart card stacks above the tabbed Stocks/My Stocks card,
   and Pending Purchases already has its own place in the "My Stocks" tab
   there — so hide the chart card's copy of it below 901px to avoid showing
   the same pending list twice on the page. */
@media (max-width: 900px) {
  .stock-chart-holdings .stock-pending-wrap { display: none; }
}

/* ---- Pending stock purchases — shown above confirmed holdings ---- */
.stock-pending-wrap {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--border);
}
.stock-pending-wrap .stock-pending-table { margin-top: 4px; }
.stock-pending-row { opacity: 0.88; }

/* ---- Holdings + pending purchases (the "My Stocks" tab's own copy, and
   anywhere else these classes appear outside .stock-chart-holdings) scroll
   within a capped height instead of growing the card taller as more rows
   are added. The header row stays pinned while scrolling so the column
   labels never disappear, and the scrollbar is styled thin to match the
   rest of the app instead of the browser default. ---- */
.stock-holdings-table,
.stock-pending-table {
  max-height: min(360px, 46vh);
  min-height: 0;
  overflow-y: auto;
  overflow-x: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.stock-holdings-table .wallet-history-row,
.stock-pending-table .wallet-history-row,
.stock-holdings-table .wallet-history-head,
.stock-pending-table .wallet-history-head {
  min-width: 540px;
}

/* .stock-chart-holdings (the chart card's own copy of these tables) now
   scrolls horizontally too, same as the "My Stocks" tab copy — see the
   overflow-x: auto added on .stock-chart-holdings above. Rows keep their
   540px minimum here as well so long values scroll instead of squishing
   and wrapping the row taller. */

.stock-holdings-table .wallet-history-head,
.stock-pending-table .wallet-history-head {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}

.stock-holdings-table::-webkit-scrollbar,
.stock-pending-table::-webkit-scrollbar { width: 5px; height: 5px; }
.stock-holdings-table::-webkit-scrollbar-thumb,
.stock-pending-table::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: 4px;
}

@media (max-width: 640px) {
  /* Below 640px the rows collapse to a stacked single-column "card" layout
     (see .wallet-history-row rules further down), so the min-width that
     enables horizontal scroll on the desktop grid layout would just leave
     empty space here — turn it off. */
  .stock-holdings-table .wallet-history-row,
  .stock-pending-table .wallet-history-row,
  .stock-holdings-table .wallet-history-head,
  .stock-pending-table .wallet-history-head {
    min-width: 0;
  }
}

/* ---- Desktop: the chart card's own Pending Purchases / Your Holdings
   block already scrolls within its own fixed max-height (see
   .stock-chart-holdings above) at every screen size, so it doesn't need to
   grow/shrink to match the tabbed Stocks/My Stocks card beside it. ---- */
@media (min-width: 901px) {
  .stock-chart-holdings {
    flex: 0 0 auto;
  }
}

/* ---- Holdings filter (All / Gainers / Losers) — sits inline with the
   "Your Holdings" panel heading, right-aligned via .panel-head's own
   flex/space-between layout. ---- */
.stock-holdings-filter {
  display: inline-flex;
  gap: 6px;
  flex-shrink: 0;
}

.stock-holdings-filter button {
  min-width: 40px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(116, 152, 205, .2);
  border-radius: 7px;
  background: rgba(255, 255, 255, .035);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 800;
  white-space: nowrap;
}

.stock-holdings-filter button.active,
.stock-holdings-filter button:hover {
  color: #fff;
  border-color: rgba(107, 147, 230, .46);
  background: rgba(74, 123, 216, .18);
}

@media (max-width: 480px) {
  .stock-holdings-filter button {
    min-width: 0;
    height: 26px;
    padding: 0 8px;
    font-size: 11px;
  }
}

/* ---- Stocks page: chart card lives outside .stock-card ----
   Mobile (default): chart stacks on top, full width, with the tabbed
   stock/holdings card below it.
   Desktop (>=901px): the two containers sit side by side in a flex row. */
.stock-workspace {
  display: flex;
  flex-direction: column;
  gap: var(--dash-row-gap, 22px);
}

.stock-workspace .stock-chart-card {
  margin: 0;
  width: 100%;
  box-shadow: 0 16px 36px rgba(0, 0, 0, .4), 0 2px 8px rgba(0, 0, 0, .25);
}

.stock-workspace .stock-card {
  width: 100%;
  margin-bottom: 0;
}

@media (min-width: 901px) {
  .stock-workspace {
    flex-direction: row;
    align-items: stretch;
  }
  .stock-workspace .stock-chart-card {
    flex: 1.15 1 460px;
    min-width: 0;
    width: auto;
    box-shadow: none;
    display: flex;
    flex-direction: column;
  }
  .stock-workspace .stock-chart-card .stock-chart-holdings {
    min-height: 0;
  }
  .stock-workspace .stock-card {
    flex: 1 1 420px;
    min-width: 0;
    width: auto;
    display: flex;
    flex-direction: column;
  }
  .stock-workspace .stock-card .wallet-panel.active {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .stock-workspace .stock-card .wallet-panel.active .stock-holdings-table,
  .stock-workspace .stock-card .wallet-panel.active .stock-pending-table {
    flex-shrink: 1;
    min-height: 0;
  }
}

.stock-selected-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
}
.stock-selected-banner svg { flex-shrink: 0; }
.stock-selected-banner span { display: flex; flex-direction: column; min-width: 0; }
.stock-selected-banner strong { font-size: 13.5px; font-weight: 800; }
.stock-selected-banner small { font-size: 11.5px; color: var(--text-muted); font-weight: 600; }

.stock-option-change {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.stock-change-up { color: var(--green); background: rgba(61, 184, 138, .14); }
.stock-change-down { color: var(--red); background: rgba(224, 106, 106, .14); }

.stock-buy-error,
.deposit-error {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(224, 106, 106, .12);
  border: 1px solid rgba(224, 106, 106, .35);
  color: #ffb3b3;
  font-size: 13.5px;
  font-weight: 600;
}

.stock-pay-qr {
  width: 180px;
  margin: 0 auto;
  display: none;
}
.stock-pay-qr.active { display: block; }
[data-stock-buy-submit] {
  display: block;
  margin: 22px 0 0 auto;
}

.wallet-tab .count-badge {
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #FFFFFF;
  font-size: 10.5px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
}

/* ---- Portfolio summary cards ---- */
.stock-summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

@media (max-width: 560px) {
  .stock-summary-cards {
    display: flex;
    flex-flow: row nowrap;
    gap: 10px;
  }
  .stock-summary-cards .stat-card {
    flex: 1 1 0;
    min-width: 0;
    padding: 14px 12px;
  }
  .stock-summary-cards .stat-card .value { font-size: 18px; }
}

/* ---- Holdings table (5-column layout: stock / shares / price / value / action) ----
   Each column gets a real pixel minimum (not minmax(0, ...)) so the columns
   stop squishing their content down to nothing — that squish was what made
   long values (crypto pay amounts, "$3,000.00" totals) wrap onto extra
   lines and quietly grow the row taller instead of the table ever
   triggering its own horizontal scrollbar. With real minimums the row can
   now legitimately exceed the table's width, so the overflow-x: auto set
   below actually has something to scroll. */
.stock-holdings-table .wallet-history-row {
  grid-template-columns: minmax(170px, 2fr) minmax(85px, .8fr) minmax(80px, .9fr) minmax(95px, 1fr) minmax(64px, .7fr);
}
.stock-holdings-col-shares,
.stock-holdings-col-price { font-size: 13.5px; color: var(--text-muted); white-space: nowrap; }
.stock-holdings-col-action { text-align: right; white-space: nowrap; }
/* Keep the ticker + crypto-amount / company-name subtitle on one line and
   truncate instead of wrapping — wrapping here was the main driver of rows
   silently growing taller ("stretching") in the type column. */
.stock-holdings-table .wallet-tx-title,
.stock-holdings-table .signal-time,
.stock-pending-table .wallet-tx-title,
.stock-pending-table .signal-time {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stock-badge-icon {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: #fff; font-size: 11.5px; font-weight: 800;
}
.stock-pl-small { font-size: 11.5px; font-weight: 700; opacity: .85; }

/* ---- Stock "logo": tries a real company logo (Clearbit), falls back to a
   monogram badge instantly if it fails to load or while it's loading. Both
   layers sit stacked (position:absolute, inset:0); the fallback paints first
   and the logo image paints over it once loaded, so there's never a blank
   gap and a failed <img> (which removes itself via onerror) just reveals
   the monogram underneath. ---- */
.stock-logo,
.stock-logo-wrap .stock-logo {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, .1);
}
.stock-logo-wrap { display: inline-flex; flex-shrink: 0; }
.stock-logo-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--stock-accent, #3a6ea5);
  color: #fff;
  font-family: Inter, Arial, sans-serif;
  font-weight: 800;
  font-size: 10.5px;
  letter-spacing: .2px;
}
.stock-logo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 15%;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .stock-holdings-table.wallet-history-table .wallet-history-row {
    grid-template-columns: 1fr;
    position: relative;
    padding-right: 66px;
  }
  .stock-holdings-col-shares,
  .stock-holdings-col-price { padding-left: 50px; }
  /* Sell sits top-right, opposite the stock badge/name block. */
  .stock-holdings-col-action {
    position: absolute;
    top: 14px;
    right: 4px;
    padding-left: 0;
    text-align: right;
  }
}

@media (max-width: 640px) {
  .stock-buy-intro { display: none; }
}

/* ---- Buy preview ("You pay / You receive") — clear stacked receipt layout ---- */
.stock-preview.wallet-note { flex-direction: column; align-items: stretch; gap: 0; padding: 14px 16px; }
.stock-preview .wallet-note-icon-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.stock-preview .wallet-note-body { width: 100%; }
.stock-preview .wallet-note-min-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 14px;
  padding: 7px 0;
  border-bottom: 1px dashed rgba(217, 164, 65, .18);
}
.stock-preview .wallet-note-min-row:first-of-type { padding-top: 0; }
.stock-preview .wallet-note-min-row:last-of-type { border-bottom: none; padding-bottom: 10px; }
.stock-preview .wallet-note-min-label {
  flex-shrink: 0;
  font-size: 11.5px;
}
.stock-preview .wallet-note-min-value {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: normal;
  word-break: break-word;
}
.stock-preview .wallet-note-text {
  padding-top: 10px;
  border-top: 1px solid rgba(217, 164, 65, .18);
  font-size: 12px;
  opacity: .85;
}
@media (max-width: 390px) {
  .stock-preview .wallet-note-min-value { font-size: 13.5px; }
}

/* ---- Stocks Overview strip (Buy Stocks panel) ---- */
.stocks-overview {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 14px;
  margin-bottom: 6px;
  scrollbar-width: thin;
}
.stocks-overview::-webkit-scrollbar { height: 5px; }
.stocks-overview::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.stocks-overview-card {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 13px;
  min-width: 148px;
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease;
}
.stocks-overview-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.stocks-overview-card.active { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, var(--surface-2)); }
.stocks-overview-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.stocks-overview-ticker { font-size: 13px; font-weight: 800; color: var(--text); }
.stocks-overview-price { font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.stocks-overview-change { margin-left: auto; font-size: 11px; font-weight: 700; flex-shrink: 0; padding-left: 6px; }

/* ---- "Buy Stocks" CTA (sits opposite the "Stocks" list heading; the
   balance card lives in the page header instead) ---- */
.stock-buy-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

/* ---- Buy Stock modal ----
   Opened via JS (More Stocks button, or a stock row) by adding .open to the
   modal wrapper and .modal-open to <body> (existing site-wide scroll-lock
   pattern — see body.modal-open rules above). Lives outside .stock-card so
   it renders the same way — a real centered overlay — at every screen size. */
.stock-buy-modal {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: none;
  place-items: center;
  padding: 18px;
}
.stock-buy-modal.open {
  display: grid;
}
.stock-buy-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 6, 14, .72);
  backdrop-filter: blur(8px);
}
/* ---- Same shell styling as the deposit .receipt-modal-sheet: bordered
   head with a pinned close button, and a separately-scrolling body with
   consistent gaps between sections instead of ad-hoc inline margins. ---- */
.stock-buy-modal-card {
  position: relative;
  width: min(460px, 100%);
  max-height: min(88dvh, 720px);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(135, 164, 213, .24);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(16, 32, 58, .98), rgba(6, 15, 30, .98));
  box-shadow: 0 28px 80px rgba(0, 0, 0, .42);
  overflow: hidden;
  isolation: isolate;
  animation: sv-fade-in .22s ease;
}
.stock-buy-modal-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 60px 14px 22px;
  border-bottom: 1px solid rgba(135, 164, 213, .14);
  flex-shrink: 0;
}
.stock-buy-modal-head h3 {
  margin: 0;
  color: #fff;
  font-size: 18px;
}
.stock-buy-modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px 22px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.stock-buy-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(135, 164, 213, .24);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.stock-buy-modal-close:hover {
  background: rgba(255, 255, 255, .1);
}

/* Bug fix: body.modal-open sets pointer-events:none on .dash-shell so the
   background can't be clicked while a modal is open. The buy modal lives
   inside .dash-shell in the DOM (fixed positioning still renders it as a
   full-viewport overlay), so that same rule would otherwise cascade onto
   the modal and freeze every button, dropdown, and input inside it. */
body.modal-open .stock-buy-modal {
  pointer-events: auto;
}

@media (max-width: 560px) {
  .stock-buy-modal {
    padding: 0;
  }
  .stock-buy-modal-card {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .stock-buy-modal-head {
    padding: calc(16px + env(safe-area-inset-top)) 52px 12px 18px;
  }
  .stock-buy-modal-body {
    padding: 14px 18px calc(24px + env(safe-area-inset-bottom));
  }
}

/* ==================================================================
   Header icon-button tap animation
   (hamburger menu + notification bell — ripple glow + icon bounce on tap,
   at any screen width. The hamburger button itself is only ever visible
   on mobile via its own display:none/block rules elsewhere.)
   ================================================================== */
.dash-menu-btn,
.topbar-icons .icon-btn:first-child {
  position: relative;
  transition: transform .18s cubic-bezier(.34, 1.56, .64, 1), background .18s ease, border-color .18s ease;
}
/* The hamburger button has no badge sitting on its corner, so it can
   safely clip its own ripple. The notification bell has a .dot badge that
   intentionally pokes out past the button's edge (top:-4px; right:-4px) —
   clipping the whole button was slicing that badge in half. The ripple
   now gets its own inner, rounded clipping layer (.icon-btn-clip) while
   the button itself stays overflow:visible so the badge renders as a
   full circle. */
.dash-menu-btn {
  overflow: hidden;
}
.topbar-icons .icon-btn:first-child .icon-btn-clip {
  overflow: hidden;
  border-radius: inherit;
}
.dash-menu-btn:active,
.topbar-icons .icon-btn:first-child:active {
  transform: scale(.86);
  background: rgba(74, 123, 216, .12);
  border-color: rgba(23, 233, 196, .5);
}
.dash-menu-btn .mobile-icon-ripple,
.topbar-icons .icon-btn:first-child .mobile-icon-ripple {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle, rgba(74, 123, 216, .45) 0%, rgba(74, 123, 216, 0) 70%);
  opacity: 0;
  transform: scale(.4);
  pointer-events: none;
}
.dash-menu-btn.mobile-icon-tapped .mobile-icon-ripple,
.topbar-icons .icon-btn:first-child.mobile-icon-tapped .mobile-icon-ripple {
  animation: mobileIconRipple .5s ease-out;
}
.dash-menu-btn.mobile-icon-tapped svg,
.topbar-icons .icon-btn:first-child.mobile-icon-tapped svg {
  animation: mobileIconBounce .5s cubic-bezier(.34, 1.56, .64, 1);
}
@keyframes mobileIconRipple {
  0% { opacity: .8; transform: scale(.3); }
  100% { opacity: 0; transform: scale(1.6); }
}
@keyframes mobileIconBounce {
  0% { transform: scale(1) rotate(0deg); }
  35% { transform: scale(.72) rotate(-8deg); }
  65% { transform: scale(1.18) rotate(6deg); }
  100% { transform: scale(1) rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
  .dash-menu-btn, .topbar-icons .icon-btn:first-child,
  .dash-menu-btn.mobile-icon-tapped svg, .topbar-icons .icon-btn:first-child.mobile-icon-tapped svg,
  .dash-menu-btn.mobile-icon-tapped .mobile-icon-ripple, .topbar-icons .icon-btn:first-child.mobile-icon-tapped .mobile-icon-ripple {
    animation: none !important;
    transition: none !important;
  }
}


/* ==================================================================
   Toast notifications (top-right, slide-in) — global container lives
   in <body> (includes/header.php) so it always sits above the topbar
   and is never clipped by a card/panel's overflow.
   ================================================================== */
.sv-toast-stack {
  position: fixed;
  top: calc(var(--topbar-h, 76px) + 16px);
  right: 20px;
  z-index: 1300;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.sv-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  background: linear-gradient(180deg, rgba(14, 22, 32, .99), rgba(10, 18, 27, .99));
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--blue);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  padding: 13px 14px;
  opacity: 0;
  transform: translateX(24px) translateY(-6px);
  transition: transform .32s cubic-bezier(.22, .61, .36, 1), opacity .28s ease;
}
.sv-toast.sv-toast-visible { opacity: 1; transform: translateX(0) translateY(0); }
.sv-toast.sv-toast-leaving {
  opacity: 0;
  transform: translateX(24px);
  transition: transform .22s ease, opacity .22s ease;
}
.sv-toast--success { border-left-color: var(--green); }
.sv-toast--error { border-left-color: var(--red); }
.sv-toast--info { border-left-color: var(--blue); }
.sv-toast-icon { flex-shrink: 0; margin-top: 1px; }
.sv-toast--success .sv-toast-icon { color: var(--green); }
.sv-toast--error .sv-toast-icon { color: var(--red); }
.sv-toast--info .sv-toast-icon { color: var(--blue-light); }
.sv-toast-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sv-toast-title { font-size: 13.5px; font-weight: 800; color: var(--text); }
.sv-toast-message { font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.sv-toast-close {
  flex-shrink: 0;
  appearance: none; cursor: pointer;
  background: none; border: none;
  color: var(--text-faint);
  font-size: 18px; line-height: 1;
  padding: 0 0 0 6px;
}
.sv-toast-close:hover { color: var(--text); }

@media (max-width: 560px) {
  .sv-toast-stack {
    top: calc(var(--topbar-h, 76px) + 10px);
    right: 12px;
    width: min(320px, calc(100vw - 24px));
  }

  /* When a full-screen modal (e.g. the Buy Stock modal) is open on mobile,
     it covers the dashboard topbar entirely (see .stock-buy-modal-card at
     this breakpoint), so anchoring the toast to --topbar-h leaves a big,
     pointless gap and makes it look like it's floating "below the header"
     even though no header is actually on screen. Anchor it to the true
     viewport top instead whenever a modal is covering the page. */
  body.modal-open .sv-toast-stack {
    top: calc(env(safe-area-inset-top, 0px) + 12px);
  }
}

.stock-fund-wallet-link { color: var(--blue-light); font-weight: 700; text-decoration: none; }
.stock-fund-wallet-link:hover { text-decoration: underline; }
.stock-buy-error a { color: #ffb3b3; font-weight: 800; text-decoration: underline; }

/* ==================================================================
   Dashboard layout: Trade Performance card opposite the balance card,
   Stocks + TradingView chart row, and Upcoming Events + Forex News
   row — all arranged as flex rows on desktop, stacked on mobile.
   Every row below the welcome header uses the same 22px rhythm, both
   for the gap *between* cards inside a row and the gap *between* rows.
   ================================================================== */
.dash-content { --dash-row-gap: 22px; }

/* ---- Dashboard "sweet web app" polish: rows settle into place one after
   another instead of all popping in at once, and the cards/buttons across
   the page get a light, native-feeling press response. ---- */
.balance-chart-row,
.stocks-events-row {
  animation: dash-row-in .6s cubic-bezier(.22, 1, .36, 1) both;
}
.balance-chart-row { animation-delay: .05s; }
.stocks-events-row { animation-delay: .14s; }
@keyframes dash-row-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .balance-chart-row,
  .stocks-events-row {
    animation: none;
  }
}
.dash-content .card {
  transition: transform .18s ease, box-shadow .18s ease;
}
.dash-content .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(3, 6, 10, .38);
}
.dash-content .deposit-icon-btn:active .deposit-icon-circle {
  transform: scale(.92);
}

/* ---- Balance card + stock chart (moved up from the old Stocks row so it
   sits opposite the balance card on desktop; Trade Performance card removed
   from here entirely — it's still reachable via the "View Trades" modal). ---- */
.balance-chart-row {
  display: block;
  margin-bottom: var(--dash-row-gap);
}
.balance-chart-row .mobile-balance-card { margin-bottom: var(--dash-row-gap); }
.balance-chart-row .dash-trade-history-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin-bottom: 0;
}
.dash-trade-history-head { margin-bottom: 12px; }

@media (min-width: 901px) {
  .balance-chart-row {
    display: flex;
    align-items: stretch;
    gap: var(--dash-row-gap);
  }
  .balance-chart-row .dash-balance-col {
    display: flex;
    flex-direction: column;
    gap: var(--dash-row-gap);
    flex: 1 1 380px;
    min-width: 0;
  }
  .balance-chart-row .dash-balance-col .mobile-balance-card {
    margin-bottom: 0;
  }
  .balance-chart-row .dash-trade-history-wrap {
    flex: 1.4 1 440px;
    min-width: 0;
  }
}

.dash-performance-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.dash-performance-top .trend-badge { margin-bottom: 0; }
.dash-performance-pnl {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  text-align: right;
  line-height: 1.2;
}
.dash-performance-pnl.up { color: var(--green); }
.dash-performance-pnl.down { color: var(--red); }
.dash-performance-pnl small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-faint);
  margin-top: 2px;
}

/* ---- Trade Performance card: win-rate circular progress indicator
   (replaces the old equity-curve sparkline on the dashboard) ---- */
.performance-ring-row {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  padding: 4px 0 2px;
}
.performance-ring-row.is-demo { opacity: .82; }
.performance-ring-wrap {
  position: relative;
  width: 132px;
  height: 132px;
  flex-shrink: 0;
}
.performance-ring { display: block; width: 100%; height: 100%; }
.performance-ring-track { stroke: var(--border); }
.performance-ring-progress {
  transition: stroke-dashoffset .5s ease;
}
.performance-ring-progress.up { stroke: var(--green); }
.performance-ring-progress.down { stroke: var(--red); }
.performance-ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-align: center;
}
.performance-ring-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.performance-ring-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-faint);
}
.performance-ring-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 90px;
}
.performance-ring-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.performance-ring-stat .v {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.performance-ring-stat .v.up { color: var(--green); }
.performance-ring-stat .v.down { color: var(--red); }
.performance-ring-stat .k {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-faint);
}

/* ---- Journal page: Performance chart + Recent Trades row ---- */
.journal-insights-row { display: block; margin-bottom: var(--dash-row-gap); }
.journal-performance-card { margin-bottom: var(--dash-row-gap); }
.journal-recent-trades-card { margin-bottom: var(--dash-row-gap); }

/* Mobile: let both cards bleed out to the edges of .dash-content instead
   of sitting inside its usual side padding — same treatment already used
   for Recent Deposits / Trade History on the Portfolio page (see that
   block further down) — so the Performance chart and Recent Trades list
   both get noticeably more usable width on a phone screen. */
@media (max-width: 900px) {
  .journal-performance-card,
  .journal-recent-trades-card {
    width: calc(100% + 36px);
    margin-left: -18px;
    margin-right: -18px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
}
@media (max-width: 420px) {
  .journal-performance-card,
  .journal-recent-trades-card {
    width: calc(100% + 24px);
    margin-left: -12px;
    margin-right: -12px;
  }
}

@media (min-width: 901px) {
  .journal-insights-row {
    display: flex;
    align-items: stretch;
    gap: var(--dash-row-gap);
  }
  .journal-performance-card {
    flex: 1.3 1 420px;
    min-width: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .journal-recent-trades-card {
    flex: 1 1 340px;
    min-width: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
  }
  .journal-recent-trades-card .trade-pulse {
    flex: 1;
    min-height: 0;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 6px;
  }
}

/* ---- Stocks card + Upcoming Events, same row, equal (stretched) height ---- */
.stocks-events-row {
  display: block;
  margin-bottom: var(--dash-row-gap);
}
.stocks-events-row .card { margin-bottom: var(--dash-row-gap); }
.stocks-events-row .card:last-child { margin-bottom: 0; }

/* .tradingview-chart-card is kept only as a layout/sizing hook within
   .balance-chart-row (flex sizing below) — the card's actual look comes
   entirely from .stock-chart-card, shared with pages/stocks.php. */
.tradingview-chart-card {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}
/* The card used to be the stretched flex item directly inside
   .balance-chart-row; now .dash-trade-history-wrap holds that role (see
   above) with the heading above it, so the card needs to grow to fill
   whatever height the wrap gets stretched to. */
.dash-trade-history-wrap .dash-trade-history-card {
  flex: 1 1 auto;
  min-height: 0;
}

/* Recent Deposits card — desktop-only panel under the balance card (see
   .dash-balance-col in portfolio.php), styled as a compact version of the
   Wallet page's history rows. The heading lives in .dash-recent-deposits-wrap
   above the card (same pattern as Trade History); the wrap grows to fill
   the rest of the column so the card's height matches the Trade History
   card next to it, with the list itself scrolling if it runs long. */
.dash-recent-deposits-wrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.dash-recent-deposits-head { margin-bottom: 12px; }
.dash-recent-deposits-card {
  padding: 18px 20px;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.deposit-history-list { display: flex; flex-direction: column; gap: 8px; overflow: visible; }
.deposit-history-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.deposit-history-row:hover { background: rgba(255, 255, 255, 0.045); border-color: rgba(255, 255, 255, .14); }
.deposit-history-row .wallet-tx-icon { width: 30px; height: 30px; border-radius: 8px; }
.deposit-history-row .wallet-tx-coin-icon { border-radius: 50%; }
.deposit-history-copy { display: flex; flex-direction: column; gap: 3px; min-width: 0; margin-right: auto; }
.deposit-history-copy strong { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.deposit-history-amt { font-size: 13px; font-weight: 800; white-space: nowrap; }
.deposit-history-status {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.deposit-history-status small {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}
.deposit-history-coin {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .3px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, .06);
  padding: 1px 6px;
  border-radius: 999px;
}

/* Crypto coin logo, used in place of the generic in/out arrow icon on
   deposit/withdrawal rows whenever the transaction's coin is known — see
   crypto_coin_logo() in functions/formatters.php. Same artwork already
   used for Trade History pair icons, so the two stay visually consistent. */
.wallet-tx-coin-icon { object-fit: cover; background: rgba(255, 255, 255, .04); border-radius: 50%; }
.wallet-tx-coin-ticker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .3px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, .06);
  padding: 1px 6px;
  border-radius: 999px;
  vertical-align: middle;
}
.tradingview-chart-card .stock-chart-plot { flex: 1; }
/* Shorter fixed height instead of the old 260px min — that forced a tall
   chart with a lot of empty space below the 120px sparkline on both mobile
   and desktop. This still gives the plot room to breathe next to the
   balance card on desktop, without ballooning the card. */
.tradingview-chart-card .stock-chart-plot-main { min-height: 150px; }

/* ---- Mobile: Recent Deposits (now shown on mobile too, see portfolio.php)
   and Trade History read as noticeably smaller than everything else on a
   phone-width screen, since both reuse compact desktop-sized rows. Bump up
   row padding, icon size, and type, and let each card bleed out to the
   edges of .dash-content instead of sitting inside its usual side padding,
   so both feel as wide and prominent as the balance card above them. ---- */
@media (max-width: 900px) {
  .dash-recent-deposits-wrap,
  .balance-chart-row .dash-trade-history-wrap {
    width: calc(100% + 36px);
    margin-left: -18px;
    margin-right: -18px;
  }
  /* Trade History sits directly under the Recent Deposits card once they're
     stacked (mobile-only — .balance-chart-row goes to display:block below
     901px, see above), and neither had its own top/bottom margin, so the
     two ran straight into each other with no breathing room. */
  .balance-chart-row .dash-trade-history-wrap {
    margin-top: 28px;
  }
  .dash-recent-deposits-head,
  .balance-chart-row .dash-trade-history-head {
    padding-left: 18px;
    padding-right: 18px;
  }
  .dash-recent-deposits-card,
  .balance-chart-row .dash-trade-history-card {
    padding: 20px 16px;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .dash-recent-deposits-card .deposit-history-row {
    padding: 12px 14px;
    gap: 12px;
  }
  .dash-recent-deposits-card .deposit-history-row .wallet-tx-icon {
    width: 38px;
    height: 38px;
  }
  .dash-recent-deposits-card .trade-pulse-empty,
  .balance-chart-row .dash-trade-history-card .trade-pulse-empty {
    padding: 18px 2px;
    font-size: 14px;
  }
  .dash-recent-deposits-card .deposit-history-copy strong { font-size: 14.5px; }
  .dash-recent-deposits-card .deposit-history-status small { font-size: 12.5px; }
  .dash-recent-deposits-card .deposit-history-amt { font-size: 14.5px; }
  .balance-chart-row .dash-trade-history-card .trade-pulse-row {
    padding: 14px 14px;
  }
  .balance-chart-row .dash-trade-history-card .trade-pulse-avatar,
  .balance-chart-row .dash-trade-history-card .trade-pulse-flag {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
  .balance-chart-row .dash-trade-history-card .trade-pulse-copy strong { font-size: 15px; }
  .balance-chart-row .dash-trade-history-card .trade-pulse-levels { font-size: 12px; }
  .balance-chart-row .dash-trade-history-card .trade-pulse-amt { font-size: 16px; }
  .balance-chart-row .dash-trade-history-card .trade-pulse-time { font-size: 12px; }

  /* Rows read as separate bordered "tiles" (full border + radius + tinted
     background) on desktop; on mobile that's replaced with a plain
     horizontal-line list — each row divided from the next by a single
     bottom border instead of being its own boxed card. */
  .dash-recent-deposits-card .deposit-history-list,
  .balance-chart-row .dash-trade-history-card .trade-pulse-list {
    gap: 0;
  }
  .dash-recent-deposits-card .deposit-history-row,
  .balance-chart-row .dash-trade-history-card .trade-pulse-row {
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    padding-left: 2px;
    padding-right: 2px;
  }
  .dash-recent-deposits-card .deposit-history-row:last-child,
  .balance-chart-row .dash-trade-history-card .trade-pulse-row:last-child {
    border-bottom: none;
  }
  .dash-recent-deposits-card .deposit-history-row:hover,
  .balance-chart-row .dash-trade-history-card .trade-pulse-row:hover {
    background: rgba(255, 255, 255, 0.03);
  }
}
@media (max-width: 420px) {
  .dash-recent-deposits-wrap,
  .balance-chart-row .dash-trade-history-wrap {
    width: calc(100% + 24px);
    margin-left: -12px;
    margin-right: -12px;
  }
  .dash-recent-deposits-head,
  .balance-chart-row .dash-trade-history-head {
    padding-left: 12px;
    padding-right: 12px;
  }
  .dash-recent-deposits-card,
  .balance-chart-row .dash-trade-history-card {
    padding: 18px 12px;
  }
}

/* ---- Mobile dashboard reflow: Recent Transactions and Trade History
   tables are hidden outright (reachable via .dash-quick-actions buttons
   instead, see portfolio.php), and Hot Market moves up to sit right under
   those buttons — directly below the balance card — instead of staying
   down in .stocks-events-row next to Watchlist. Two copies of the Hot
   Market card exist in the markup (see renderHotMarketCard() in
   portfolio.php) purely so this reorder can happen with plain CSS; only
   one is ever visible at a time. ---- */
.dash-quick-actions { display: none; }
.dash-hotmarket-mobile-slot { display: none; }
@media (max-width: 900px) {
  .dash-recent-deposits-wrap,
  .balance-chart-row .dash-trade-history-wrap {
    display: none;
  }
  .dash-quick-actions {
    display: grid;
    /* All four quick actions in a single row (icon-over-label, see
       .dash-quick-action below) instead of the old 2x2 grid — the
       shorter labels (Recent / Trade / Stocks / Journal) leave enough
       room for that now. */
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 4px 0 20px;
  }
  .dash-quick-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 6px 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text);
    font-size: 11.5px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
  }
  .dash-quick-action:active { transform: scale(.97); }
  .dash-quick-action:hover { background: rgba(255, 255, 255, .045); border-color: rgba(255, 255, 255, .16); }
  .dash-quick-action-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(61, 184, 138, .12);
    color: var(--green);
  }
  .dash-quick-action-label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .dash-hotmarket-mobile-slot {
    display: block;
    margin-bottom: 20px;
  }
  /* The desktop copy (in .stocks-events-row) stays hidden on mobile so it
     doesn't render twice on screen — Watchlist keeps its normal spot
     further down the page. */
  .stocks-events-row .hot-market-card {
    display: none;
  }

  /* Everything below the balance card (quick actions + Hot Market) bleeds
     out to the screen edges on mobile, same as Recent Transactions/Trade
     History just below it (see the "Mobile: Recent Deposits" rules
     further down) — keeps the whole column reading as one consistently
     wide block instead of Hot Market/quick actions looking narrower than
     the rest. The stock Watchlist card further down the page (the other
     half of .stocks-events-row, still visible on mobile) gets the same
     treatment so it reads just as wide as the Hot Market card above it. */
  .dash-quick-actions,
  .dash-hotmarket-mobile-slot,
  .stocks-events-row .dash-watchlist-card {
    width: calc(100% + 36px);
    margin-left: -18px;
    margin-right: -18px;
  }
  .dash-hotmarket-mobile-slot .hot-market-card,
  .stocks-events-row .dash-watchlist-card {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
}
@media (max-width: 420px) {
  .dash-quick-actions,
  .dash-hotmarket-mobile-slot,
  .stocks-events-row .dash-watchlist-card {
    width: calc(100% + 24px);
    margin-left: -12px;
    margin-right: -12px;
  }
}

/* Trade History card, now sharing this row with the balance card. Capped
   and scrollable on desktop so a long list doesn't stretch the row taller
   than the balance card next to it; unconstrained on mobile where it's
   already stacked below. */
.dash-trade-history-card .trade-pulse-list {
  max-height: none;
}
@media (min-width: 901px) {
  .dash-trade-history-card .trade-pulse {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .dash-trade-history-card .trade-pulse-list {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 4px;
  }
}

/* The TradingView embed script sizes its injected iframe against the
   immediate wrapper it's mounted in, so that wrapper always needs an
   explicit (not just min-) height to fill. */
.tradingview-widget-container__widget {
  width: 100%;
  height: 100%;
}

@media (min-width: 901px) {
  .stocks-events-row {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    align-items: stretch;
    gap: var(--dash-row-gap);
  }
  .stocks-events-row .card {
    margin-bottom: 0;
    height: 100%;
  }
  .stocks-events-row .stocks-preview-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
  }
  .stocks-events-row .stocks-preview-card .stocks-preview-body {
    flex: 1;
    max-height: none;
  }
  .stocks-events-row .dash-watchlist-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
  }
  .stocks-events-row .hot-market-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
  }
  .stocks-events-row .hot-market-card .hot-market-list {
    flex: 1;
    max-height: none;
  }
  /* Only Hot Market in the row (e.g. if the watchlist is ever removed
     again) — let it take the full width instead of sitting at a narrow
     column. */
  .stocks-events-row.single-card {
    display: block;
  }
  .stocks-events-row.single-card .hot-market-card {
    height: auto;
  }
}

/* ---- Watchlist card, sharing the Hot Market row. ---- */
.dash-watchlist-card {
  display: flex;
  flex-direction: column;
}
.dash-watchlist-scroll {
  flex: 1;
  max-height: 320px;
  min-width: 0;
}
.dash-watchlist-scroll .watchlist-row {
  text-decoration: none;
  cursor: pointer;
  /* This card's markup only has 2 direct children (.watchlist-row-id,
     which wraps the logo + name together, and .watchlist-price) — not
     the 3 separate logo/name/price children that the shared
     .watchlist-row rule's 3-column grid (auto minmax(0,1fr) auto) was
     built for (see pages/charts.php's watchlist for that 3-child
     version). With only 2 children, price was landing in the flexible
     middle 1fr track instead of a dedicated right-hand column, so it
     drifted out of alignment and got squeezed/truncated whenever the
     name column claimed more space. Override to a proper 2-column grid
     here instead. */
  grid-template-columns: minmax(0, 1fr) auto;
}
.dash-watchlist-scroll .watchlist-row:hover {
  background: var(--surface-2);
  border-radius: 8px;
  margin: 0 -8px;
  padding-left: 8px;
  padding-right: 8px;
  width: calc(100% + 16px);
}
.watchlist-row-id {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.watchlist-logo {
  position: relative;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--stock-accent, #3b82f6) 22%, var(--surface-2));
}
.watchlist-logo-fallback {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--stock-accent, #3b82f6);
  letter-spacing: -.2px;
}
.watchlist-logo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
}
@media (min-width: 901px) {
  .dash-watchlist-scroll {
    max-height: none;
  }
}

/* ==========================================================================
   Settings page — tabs, profile, KYC, and withdrawal wallet settings
   ========================================================================== */
.settings-card { padding: 8px 24px 24px; }
.settings-card-head {
  border-bottom: 1px solid var(--border);
  margin-bottom: 22px;
}
.settings-card-head .settings-tabs { margin-bottom: 0; border-bottom: none; overflow-x: auto; }

.settings-panel-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ---- Avatar ---- */
.settings-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
}
.settings-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.settings-avatar-lg { width: 72px; height: 72px; }
.settings-avatar-fallback {
  font-size: 24px;
  font-weight: 800;
  color: var(--blue-light);
}

/* ---- User Profile (view) panel ---- */
.settings-profile-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.settings-profile-head-copy { flex: 1; min-width: 180px; }
.settings-profile-head-copy h3 { margin: 0 0 2px; font-size: 19px; font-weight: 800; }
.settings-profile-head-copy p { margin: 0 0 10px; color: var(--text-muted); font-size: 14px; }
.settings-profile-stats { display: flex; gap: 22px; flex-wrap: wrap; }
.settings-profile-stat { display: flex; flex-direction: column; gap: 5px; }
.settings-profile-stat-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--text-faint);
}

.settings-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 28px;
}

/* ---- Profile Settings (edit) panel ---- */
.settings-avatar-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.settings-avatar-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.settings-avatar-remove {
  background: none;
  border: none;
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.settings-form { margin: 0; }
.settings-lock-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 193, 7, 0.35);
  background: rgba(255, 193, 7, 0.08);
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 20px;
}
.settings-lock-notice strong { color: var(--text); }
.form-hint {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.5;
  margin: 6px 0 0;
}

/* ---- KYC Status panel ---- */
.settings-kyc-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 22px;
}
.settings-kyc-banner p { margin: 6px 0 0; color: var(--text-muted); font-size: 13.5px; line-height: 1.55; }
.settings-kyc-banner-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  background: rgba(35, 124, 255, .14);
  color: var(--blue-light);
}
.settings-kyc-banner-verified .settings-kyc-banner-icon { background: rgba(61, 184, 138,.14); color: var(--green); }
.settings-kyc-banner-rejected .settings-kyc-banner-icon { background: rgba(224, 106, 106,.14); color: var(--red); }
.settings-kyc-banner-pending .settings-kyc-banner-icon { background: rgba(217,164,65,.14); color: #D9A441; }

.settings-kyc-checklist {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 20px;
}
.settings-kyc-check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--text);
}
.settings-kyc-check-icon {
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--text-faint);
  border: 1.5px solid var(--border-strong);
}
.settings-kyc-check-icon.done {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.settings-kyc-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 6px;
}
.settings-kyc-upload-card { display: flex; flex-direction: column; gap: 10px; }
.settings-kyc-upload-label { font-size: 13.5px; font-weight: 700; color: var(--text); }
.settings-kyc-upload-hint { font-size: 12px; line-height: 1.5; color: var(--text-faint); margin: -2px 0 0; }
.settings-dropzone {
  appearance: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  padding: 28px 16px;
  /* Fixed height regardless of content: the placeholder copy ("Click to
     upload or drag a file here") often wraps to two lines, but a short
     selected filename (e.g. "id.jpg") fits on one — without a min-height
     the button was hugging its content and visibly shrinking the moment a
     file got picked. Locking the height keeps the box a stable size
     whether it's showing the placeholder or a filename. */
  min-height: 128px;
  border-radius: var(--radius);
  border: 1.5px dashed var(--border-strong);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-size: 13px;
  transition: border-color .18s ease, color .18s ease, transform .2s ease, background .18s ease, box-shadow .22s ease;
}
.settings-dropzone:hover {
  border-color: var(--blue); color: var(--text); transform: translateY(-2px);
  background: rgba(74, 123, 216, .04); box-shadow: 0 10px 22px rgba(74,123,216,.12);
}
.settings-dropzone:active { transform: translateY(0) scale(.98); }
.settings-dropzone svg { transition: transform .2s ease; }
.settings-dropzone:hover svg { transform: translateY(-2px) scale(1.08); }
.settings-dropzone.has-file {
  border-style: solid;
  border-color: var(--green);
  color: var(--green);
}
/* Selected filenames get dropped straight into the dropzone text (see
   kyc-verify.js / settings.js), and a long, unbroken filename would either
   wrap the button several lines tall or spill past its edge — both read as
   the upload card "stretching". Force it to a single truncated line
   instead, the same way the receipt-preview filename is already handled. */
.settings-dropzone [data-kyc-onboard-dropzone-text],
.settings-dropzone [data-kyc-dropzone-text],
.settings-dropzone [data-receipt-dropzone-text] {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Compact receipt-image preview shown under a dropzone once a file is chosen
   (deposit receipts, stock-purchase payment proof). */
.receipt-preview {
  display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: rgba(255,255,255,.02);
}
/* The [hidden] attribute must win over the display:flex rule above, or the
   preview row (with no image chosen yet) stays visible and shows a broken
   image icon instead of being hidden until a file is selected. */
.receipt-preview[hidden] { display: none; }
.receipt-preview-thumb {
  position: relative; width: 56px; height: 56px; border-radius: 8px; border: 1px solid var(--border);
  background: rgba(255,255,255,.03); color: var(--text-muted); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.receipt-preview-icon { flex-shrink: 0; }
.receipt-preview-thumb img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 8px;
}
.receipt-preview-thumb img[hidden] { display: none; }
/* Once the image loads and is shown, hide the placeholder icon behind it. */
.receipt-preview-thumb img:not([hidden]) ~ .receipt-preview-icon { display: none; }
.receipt-preview span { font-size: 12.5px; color: var(--text-muted); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.receipt-preview-remove {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.06); color: var(--text-muted); font-size: 16px; line-height: 1; flex-shrink: 0;
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.receipt-preview-remove:hover { background: rgba(224,106,106,.15); color: #ff6b6b; }
.receipt-preview-remove:active { transform: scale(.85); }

/* ==========================================================================
   Standalone KYC verification page (auth/kyc-verification.php) — shown
   right after signup, deliberately separate from the dashboard tab pages
   (no sidebar/topbar chrome) so a brand-new account is guided through one
   focused task before landing in the app. Reuses .settings-kyc-* / form /
   .card styling above for visual consistency with the Settings page's
   Identity Verification panel.
   ========================================================================== */
.kyc-onboard-logout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-muted);
}
.kyc-onboard-logout:hover { color: var(--text); }

/* Floating glass logout pill — page has no header/logo anymore, so this
   sits fixed in the corner on top of everything, glassy and gently
   bobbing to draw the eye without being distracting. */
.kyc-onboard-logout-float {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 40;
  padding: 10px 18px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .16);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .12);
  animation: kyc-logout-float 3.6s ease-in-out infinite;
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.kyc-onboard-logout-float:hover {
  color: var(--text);
  background: rgba(255, 255, 255, .14);
  border-color: rgba(255, 255, 255, .26);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .34), inset 0 1px 0 rgba(255, 255, 255, .16);
  animation-play-state: paused;
  transform: translateY(-2px);
}
@keyframes kyc-logout-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@media (max-width: 560px) {
  .kyc-onboard-logout-float { top: 14px; right: 14px; padding: 9px 14px; font-size: 12.5px; }
}

.kyc-onboard-shell {
  min-height: 100vh;
  padding: 84px 0 64px;
}
.kyc-onboard-container {
  max-width: 620px;
}

/* ---- 3-step progress ---- */
.kyc-onboard-progress {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  margin-bottom: 32px;
}
.kyc-onboard-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 120px;
  text-align: center;
}
.kyc-onboard-progress-step span:last-child {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
}
.kyc-onboard-progress-step.is-done span:last-child,
.kyc-onboard-progress-step.is-active span:last-child { color: var(--text); }
.kyc-onboard-progress-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-faint);
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
}
.kyc-onboard-progress-step.is-done .kyc-onboard-progress-dot {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}
.kyc-onboard-progress-step.is-active .kyc-onboard-progress-dot {
  color: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(74, 123, 216, .14);
}
.kyc-onboard-progress-line {
  width: 56px;
  height: 1.5px;
  background: var(--border-strong);
  margin-top: 15px;
  flex-shrink: 0;
}
.kyc-onboard-progress-line.is-done { background: var(--green); }
@media (max-width: 560px) {
  .kyc-onboard-progress-step { width: 84px; }
  .kyc-onboard-progress-line { width: 26px; }
}

/* ---- Step fade transition (goToStep in kyc-verify.js) ---- */
.kyc-onboard-step { animation: none; }
.kyc-onboard-step.kyc-step-fade-out { animation: kyc-step-fade-out .18s ease both; }
.kyc-onboard-step.kyc-step-fade-in { animation: kyc-step-fade-in .18s ease both; }
@keyframes kyc-step-fade-out { from { opacity: 1; transform: translateY(0); } to { opacity: 0; transform: translateY(-6px); } }
@keyframes kyc-step-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Card ---- */
.kyc-onboard-card { padding: 32px 30px; }
.kyc-onboard-head { text-align: center; margin-bottom: 26px; }
.kyc-onboard-head h1 { font-size: 23px; font-weight: 800; margin: 0 0 8px; }
.kyc-onboard-head p { color: var(--text-muted); font-size: 14px; line-height: 1.6; max-width: 460px; margin: 0 auto; }
.kyc-onboard-section-head { margin-top: 28px; }
.kyc-onboard-step-label {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 4px;
}
.kyc-onboard-confirm-row { margin-top: 4px; }
.kyc-onboard-actions { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 6px; }
.kyc-onboard-actions-spaced { margin-top: 28px; }
.kyc-onboard-actions-row { flex-direction: row; align-items: center; justify-content: space-between; }
.kyc-onboard-actions-row .btn { display: inline-flex; align-items: center; gap: 8px; }
.kyc-onboard-actions-row .btn-primary { margin-left: auto; }
@media (max-width: 480px) {
  .kyc-onboard-actions-row .btn span,
  .kyc-onboard-actions-row .btn { font-size: 13.5px; padding-left: 16px; padding-right: 16px; }
}
.kyc-onboard-skip { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.kyc-onboard-skip:hover { color: var(--text); }

/* ---- Document type dropdown (Step 2) ---- */
.kyc-doctype-dropdown { position: relative; }
.kyc-doctype-trigger {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  appearance: none; cursor: pointer;
  padding: 12px 14px 12px 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14.5px; font-weight: 600;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.25s ease;
}
.kyc-doctype-trigger .field-icon { position: absolute; left: 14px; color: var(--text-faint); display: flex; }
.kyc-doctype-trigger [data-kyc-doctype-selected] { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kyc-doctype-trigger .coin-dropdown-chevron { flex-shrink: 0; color: var(--text-faint); transition: transform 0.18s ease, color 0.18s ease; }
.kyc-doctype-dropdown.has-value .kyc-doctype-trigger [data-kyc-doctype-selected] { color: var(--text); }
.kyc-doctype-trigger:hover {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(74, 123, 216, 0.1);
}
.kyc-doctype-trigger:hover .field-icon { color: var(--blue-light); }
.kyc-doctype-dropdown.open .kyc-doctype-trigger {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(74, 123, 216, 0.16);
}
.kyc-doctype-dropdown.open .kyc-doctype-trigger .field-icon,
.kyc-doctype-dropdown.open .coin-dropdown-chevron { color: var(--blue); }
.kyc-doctype-dropdown.open .coin-dropdown-chevron { transform: rotate(180deg); }
.kyc-doctype-dropdown.doctype-field-invalid .kyc-doctype-trigger {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(224, 106, 106, .14);
}

.kyc-doctype-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 18px 40px rgba(0,0,0,.35);
  display: none;
  flex-direction: column;
  gap: 2px;
}
.kyc-doctype-dropdown.open .kyc-doctype-menu { display: flex; animation: sv-fade-in .16s ease; }

.kyc-doctype-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%;
  appearance: none; cursor: pointer;
  background: none;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 13.5px; font-weight: 600;
  text-align: left;
  transition: background .15s ease, color .15s ease;
}
.kyc-doctype-option:hover { background: var(--surface-2); }
.kyc-doctype-option.active {
  background: color-mix(in srgb, var(--blue) 14%, var(--surface-2));
  color: #fff;
}
.kyc-doctype-option .coin-dropdown-check { flex-shrink: 0; color: var(--blue-light); opacity: 0; }
.kyc-doctype-option.active .coin-dropdown-check { opacity: 1; }

/* ---- Success state ---- */
.kyc-onboard-success { text-align: center; padding: 12px 8px 4px; }
.kyc-onboard-success-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--green);
  background: rgba(61, 184, 138, .14);
  margin-bottom: 16px;
}
.kyc-onboard-success h2 { font-size: 21px; font-weight: 800; margin: 0 0 10px; }
.kyc-onboard-success p { color: var(--text-muted); font-size: 14px; line-height: 1.6; max-width: 420px; margin: 0 auto 22px; }

.kyc-onboard-footnote { text-align: center; margin-top: 22px; font-size: 13px; color: var(--text-muted); }
.kyc-onboard-footnote a { color: var(--blue-light); font-weight: 700; }

@media (max-width: 560px) {
  .kyc-onboard-card { padding: 26px 18px; }
}

/* Mobile KYC form should fill the screen like the sign in / sign up containers */
@media (max-width: 700px) {
  .kyc-page .kyc-onboard-shell {
    min-height: 100vh;
    padding: 0;
  }

  .kyc-page .kyc-onboard-container {
    width: 100%;
    max-width: none;
    padding: 0;
  }

  .kyc-page .kyc-onboard-progress {
    padding: 56px 12px 0;
  }

  .kyc-page .kyc-onboard-card {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 18px 12px 28px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .kyc-page .kyc-onboard-head { margin-bottom: 18px; }
  .kyc-page .kyc-onboard-head h1 { font-size: 21px; }

  .kyc-page .form-row {
    gap: 9px;
    margin: 0;
  }

  .kyc-page .form-group {
    min-width: 0;
    margin-bottom: 13px;
  }

  .kyc-page .form-group label {
    font-size: 11px;
    margin-bottom: 5px;
  }

  .kyc-page .input-wrap input,
  .kyc-page .input-wrap select {
    min-height: 43px;
    font-size: 12px;
  }

  .kyc-page .settings-kyc-upload-grid {
    grid-template-columns: 1fr;
  }

  .kyc-page .kyc-onboard-footnote { padding: 0 12px; }
}

@media (max-width: 360px) {
  .kyc-page .kyc-onboard-card {
    padding-left: 9px;
    padding-right: 9px;
  }

  .kyc-page .form-row {
    gap: 7px;
  }

  .kyc-page .input-wrap input,
  .kyc-page .input-wrap select {
    font-size: 11px;
  }
}

/* ---- Withdrawal Settings panel — arranged list ---- */
.settings-wallets-list { display: flex; flex-direction: column; }
.settings-wallet-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--border);
}
.settings-wallet-row:last-child { border-bottom: none; }

.settings-wallet-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.settings-wallet-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.settings-wallet-icon { flex-shrink: 0; display: flex; }
.settings-wallet-icon-lg svg { width: 36px; height: 36px; }
.settings-wallet-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.settings-wallet-copy strong { font-size: 14.5px; font-weight: 700; color: var(--text); }
.settings-wallet-copy strong small { font-weight: 600; color: var(--text-muted); }
.settings-wallet-copy small { font-size: 12.5px; color: var(--text-muted); }
.settings-wallet-edit-btn { flex-shrink: 0; }

.settings-wallet-address-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font-mono);
  overflow: hidden;
}
.settings-wallet-address-line svg { flex-shrink: 0; }
.settings-wallet-address-line span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- Withdrawal Address modal — coin header ---- */
.settings-wallet-modal-coin {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 22px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

/* ---- Billing panel — plan cards ---- */
.billing-plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}
.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color .18s ease, transform .18s ease;
}
.plan-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.plan-card-featured {
  border-color: var(--blue);
  background: linear-gradient(180deg, rgba(74, 123, 216, 0.08) 0%, rgba(255, 255, 255, 0.02) 55%);
  box-shadow: var(--shadow-glow);
}
.plan-card-current { border-color: var(--gold); }

.plan-card-tag {
  position: absolute;
  top: -11px;
  left: 20px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .3px;
  text-transform: uppercase;
  color: #06110d;
  background: var(--grad-blue);
}
.plan-card-tag-current { color: #211703; background: var(--gold); }

.plan-card-head h4 { margin: 0 0 4px; font-size: 18px; font-weight: 800; }
.plan-card-tagline { margin: 0; font-size: 12.5px; color: var(--text-muted); }

.plan-card-price { display: flex; align-items: baseline; gap: 6px; }
.plan-card-price-amt { font-family: var(--font-display); font-size: 30px; font-weight: 700; color: var(--text); }
.plan-card-price-cycle { font-size: 12.5px; color: var(--text-faint); }

.plan-card-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.plan-card-features li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}
.plan-card-features li svg { flex-shrink: 0; margin-top: 2px; color: var(--blue); }

.plan-card-btn { width: 100%; justify-content: center; margin-top: auto; }
.plan-card-btn[disabled] { opacity: .55; cursor: default; }

/* ---- Wallet deposit panel — billing plan banner ---- */
.wallet-deposit-plan-banner[hidden] { display: none; }
.wallet-deposit-plan-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid rgba(74, 123, 216, 0.28);
  background: rgba(74, 123, 216, 0.08);
  margin-bottom: 18px;
}
.wallet-deposit-plan-banner > div:first-child {
  flex: 1 1 auto;
  min-width: 0;
}
.wallet-deposit-plan-banner strong { display: block; font-size: 14px; color: var(--text); line-height: 1.35; white-space: normal; word-wrap: break-word; }
.wallet-deposit-plan-banner [data-deposit-plan-amount] {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .wallet-deposit-plan-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px 12px;
    gap: 6px;
  }
  .wallet-deposit-plan-banner [data-deposit-plan-amount] {
    align-self: flex-start;
  }
}

/* ---- Deposit panel — payment receipt modal ---- */
.receipt-modal {
  position: fixed;
  inset: 0;
  /* Needs to sit above .stock-buy-modal (z-index 1250) since on the Buy
     Stock flow this receipt modal opens as a second layer on top of it. */
  z-index: 1300;
  display: none;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}
.receipt-modal.open {
  display: block;
}
.receipt-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(8px);
}
.receipt-modal-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(440px, calc(100vw - 32px));
  max-height: min(600px, calc(100vh - 48px));
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(135, 164, 213, .26);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(15, 32, 58, .98), rgba(15, 22, 35, .98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .5);
  overflow: hidden;
  isolation: isolate;
  overscroll-behavior: contain;
  touch-action: auto;
}
.receipt-modal-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 60px 14px 20px;
  border-bottom: 1px solid rgba(135, 164, 213, .14);
}
.receipt-modal-head h3 {
  margin: 0;
  color: #fff;
  font-size: 17px;
}
.receipt-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 5;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid rgba(135, 164, 213, .24);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  font-size: 20px;
  line-height: 1;
}
.receipt-modal-close:hover {
  background: rgba(255, 255, 255, .1);
}
.receipt-modal-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.receipt-modal-sub {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-muted);
}
.receipt-modal-amount {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, .02);
  font-size: 13px;
  color: var(--text-muted);
}
.receipt-modal-amount strong { color: var(--text); font-size: 14px; }
.receipt-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}
.receipt-modal-actions .btn { flex: 1; justify-content: center; }

@media (max-width: 480px) {
  .receipt-modal-head { padding: 16px 52px 12px 16px; }
  .receipt-modal-body { padding: 14px 16px 16px; }
}

@media (max-width: 900px) {
  .billing-plans { grid-template-columns: 1fr; }
}

/* ---- Pricing page (standalone — was Settings > Billing) ---- */
.pricing-card { margin-bottom: var(--dash-row-gap); }
.pricing-card .panel-head { margin-bottom: 22px; }
.pricing-compare-card,
.pricing-faq-card { margin-bottom: var(--dash-row-gap); }

.pricing-compare-table { width: 100%; overflow-x: auto; }
.pricing-compare-row {
  display: grid;
  grid-template-columns: 2fr repeat(3, 0.7fr);
  align-items: center;
  gap: 10px;
  padding: 13px 6px;
  border-bottom: 1px solid var(--border);
  min-width: 480px;
}
.pricing-compare-row:last-child { border-bottom: none; }
.pricing-compare-head {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.pricing-compare-head span:not(.pricing-compare-feature) { text-align: center; }
.pricing-compare-feature { font-size: 13.5px; color: var(--text); }
.pricing-compare-cell { display: flex; align-items: center; justify-content: center; }
.pricing-compare-yes { color: var(--green); }
.pricing-compare-no { color: var(--text-faint); opacity: .5; }

/* On mobile, simplify the Pricing header: keep the title and the Total
   Balance card side by side (see the shared .pricing-welcome rules in the
   900px breakpoint above), hide the subtitle copy and the "Your Plan"
   badge row. On desktop the balance card stays opposite the title via the
   base .dash-welcome flex row (justify-content: space-between). */
@media (max-width: 900px) {
  .pricing-welcome p { display: none; }
  .pricing-welcome .balance-card-slim { display: flex; }
  .pricing-card .panel-head { display: none; }
}

@media (max-width: 860px) {
  .settings-info-grid,
  .settings-kyc-checklist,
  .settings-kyc-upload-grid {
    grid-template-columns: 1fr;
  }

  /* Single-column layout above stretches the dropzone to the full card
     width — a dashed box that wide, with only a small icon + line of text
     centered inside, reads as oversized rather than inviting. Cap and
     center it instead, like a compact tap target.
     NOTE: an auto cross-axis margin on a flex item cancels align-items:
     stretch, so without an explicit width the box would go back to
     shrink-to-fit — wide for the placeholder copy, then narrow the moment
     a short filename replaces it. Pairing width:100% with max-width keeps
     it capped AND fixed. */
  .settings-kyc-upload-grid .settings-dropzone {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    padding: 26px 16px;
    /* Slightly taller than the desktop min-height — on mobile the dropzone
       is also the tap target, so a bit more room here makes it easier to
       hit and keeps it from feeling cramped next to the bigger padding. */
    min-height: 136px;
  }
}

@media (max-width: 560px) {
  /* Keep the plan / KYC status pair as a compact label+badge row instead
     of stacking, so they don't eat vertical space on small screens. */
  .settings-profile-stat {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }
  .settings-profile-stats { flex-direction: column; gap: 10px; }
}

/* ==========================================================================
   Full-screen modal (Profile Settings) — lives outside .dash-shell in the
   DOM so body.modal-open's pointer-events:none on .dash-shell doesn't
   cascade onto it and freeze its inputs/buttons.
   ========================================================================== */
.fullscreen-modal {
  position: fixed;
  inset: 0;
  z-index: 1250;
  display: none;
  background: var(--bg, #0F1623);
  overflow-y: auto;
}
.fullscreen-modal.open { display: block; }

.fullscreen-modal-inner {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100%;
  padding: 0 24px 60px;
}

.fullscreen-modal-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 0;
  background: var(--bg, #0F1623);
  border-bottom: 1px solid var(--border);
  margin-bottom: 26px;
}
.fullscreen-modal-head h2 { margin: 0; font-size: 20px; font-weight: 800; color: var(--text); }
.fullscreen-modal-close {
  appearance: none;
  cursor: pointer;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text);
  flex-shrink: 0;
  transition: border-color .18s ease;
}
.fullscreen-modal-close:hover { border-color: var(--blue); }

@media (max-width: 560px) {
  .fullscreen-modal-inner { padding: 0 16px 40px; }
  .fullscreen-modal-head { padding: 16px 0; }
}

/* ---- Change Password CTA (User Profile panel) ---- */
.settings-password-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
.settings-password-cta p { margin: 0; font-size: 13.5px; color: var(--text-muted); }

.settings-forgot-pw-link {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 0 0;
  color: var(--blue-light);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.settings-forgot-pw-link:hover { color: var(--blue); }
.settings-forgot-pw-link:disabled { opacity: .6; cursor: default; text-decoration: none; }

/* ---- Forgot Password modal — sits stacked above Change Password ---- */
.fullscreen-modal-stacked { z-index: 1260; }
.fullscreen-modal-inner-narrow { max-width: 480px; }

.fp-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 26px;
}
.fp-step {
  height: 4px;
  flex: 1;
  border-radius: 999px;
  background: var(--surface-2);
}
.fp-step.active { background: var(--grad-blue, var(--blue)); }

.fp-panel { display: none; }
.fp-panel.active { display: block; animation: sv-fade-in .22s ease; }
.fp-panel h3 { margin: 0 0 6px; font-size: 17px; font-weight: 800; color: var(--text); }

.fp-code-row {
  display: flex;
  gap: 10px;
  margin: 18px 0 6px;
}
.fp-code-input {
  width: 100%;
  aspect-ratio: 1 / 1;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.fp-code-input:focus { outline: none; border-color: var(--blue); }
.fp-code-error {
  margin: 4px 0 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--red, #E06A6A);
}

.fp-success { text-align: center; padding: 20px 0 4px; }
.fp-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  margin-bottom: 16px;
  background: rgba(61, 184, 138, .14);
  color: var(--green);
}
.fp-success h3 { margin-bottom: 6px; }
.fp-success .settings-panel-actions { justify-content: center; }

/* ==========================================================================
   Support page (pages/support.php)
   ========================================================================== */
.support-contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.support-contact-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  font-family: inherit;
}
button.support-contact-card {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  width: 100%;
}
.support-contact-card strong { font-size: 15px; color: #fff; }
.support-contact-card p { margin: 0; font-size: 13px; color: var(--text-muted); word-break: break-word; }

.support-contact-icon {
  background: rgba(74, 123, 216, .14);
  color: var(--blue-light);
  margin-bottom: 6px;
  position: relative;
}

/* Small unread-count badge for the Live Chat card — a reply the user
   hasn't opened the chat to see yet. Server-rendered from
   SupportTicket::unreadForUser() and kept live by support.js's
   watchUnreadSupportMessages() poll (no page reload needed). */
.support-contact-unread-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger, #ef4444);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  /* Center the number with flex instead of relying on line-height to match
     the box height exactly — the line-height trick depends on the active
     font's ascender/descender metrics, which differ between the desktop
     font stack and mobile system fonts, so the digit rendered visibly
     high/low inside the red circle on phones even though the box itself
     was positioned correctly. Flex centering is metric-independent, so it
     stays centered on every screen size. */
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid var(--bg, #0b1220);
  animation: supportUnreadPop .22s ease;
}
.support-contact-unread-dot[hidden] { display: none !important; }
@keyframes supportUnreadPop {
  from { transform: scale(.4); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.support-contact-icon-whatsapp {
  background: rgba(37, 211, 102, .16);
  color: #25d366;
}
.support-contact-card-whatsapp:hover .support-contact-icon-whatsapp,
.support-contact-card-whatsapp:focus-visible .support-contact-icon-whatsapp {
  background: rgba(37, 211, 102, .26);
}

.input-wrap textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14.5px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  min-height: 96px;
  transition: border-color 0.15s ease;
}
.input-wrap textarea::placeholder { color: var(--text-faint); }
.input-wrap textarea:focus { border-color: var(--blue); outline: none; }

.support-tickets-list {
  display: flex;
  flex-direction: column;
}

.support-ticket-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 2px;
  border-bottom: 1px solid rgba(116, 152, 205, .12);
  width: 100%;
  background: none;
  border-left: none;
  border-right: none;
  border-top: none;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s ease;
}
.support-ticket-row:hover { background: rgba(255, 255, 255, .03); }
.support-ticket-row:last-child { border-bottom: none; }

.support-ticket-row.is-new {
  animation: support-ticket-in .4s ease;
}
@keyframes support-ticket-in {
  from { opacity: 0; transform: translateY(-6px); background: rgba(107, 147, 230, .1); }
  to   { opacity: 1; transform: translateY(0); }
}

.support-ticket-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.support-ticket-main strong { font-size: 14px; color: #fff; }
.support-ticket-main small { font-size: 12px; color: var(--text-faint); }

.support-tickets-empty { padding: 32px 4px; color: var(--text-faint); font-size: 13.5px; }
.support-tickets-empty p { margin: 0; }

@media (max-width: 560px) {
  .support-ticket-row { align-items: flex-start; }
}

/* ---- Live Chat modal (Request Support + Chat panel) ----
   Centered dialog on desktop; full-screen sheet on mobile, mirroring the
   .history-modal pattern. Lives outside .dash-shell in the DOM so
   body.modal-open's pointer-events:none doesn't disable it. */
.support-chat-modal {
  position: fixed;
  inset: 0;
  z-index: 1120;
  display: none;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
}
.support-chat-modal.open { display: block; }

.support-chat-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .68);
  backdrop-filter: blur(8px);
}

.support-chat-modal-sheet {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(560px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 48px));
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(135, 164, 213, .26);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(15, 32, 58, .98), rgba(15, 22, 35, .98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, .5);
  overflow: hidden;
  isolation: isolate;
  overscroll-behavior: contain;
  touch-action: auto;
}

.support-chat-modal-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(135, 164, 213, .14);
}
.support-chat-modal-head-title {
  flex: 1;
  min-width: 0;
}
.support-chat-modal-eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.support-chat-modal-eyebrow[hidden] { display: none; }
.support-chat-modal-agent {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.support-chat-modal-agent[hidden] { display: none; }
.support-chat-modal-head h3 {
  margin: 0;
  color: #fff;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* ---- Live indicator — a small green dot with a "beeping" glow pulse,
   shown next to the "Live Chat" title only while the ticket is actually
   connected (not for the idle "Talk to Us" state, and not once the
   ticket's been resolved/closed/cancelled). ---- */
.support-chat-live-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(61, 184, 138, .55);
  animation: support-chat-live-beep 1.6s ease-in-out infinite;
}
.support-chat-live-dot[hidden] { display: none; }
@keyframes support-chat-live-beep {
  0%   { box-shadow: 0 0 0 0 rgba(61, 184, 138, .55); }
  70%  { box-shadow: 0 0 0 7px rgba(61, 184, 138, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 184, 138, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .support-chat-live-dot { animation: none; }
}
/* ---- Back (left) — only shown once the chat is connected ---- */
.support-chat-modal-back {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(135, 164, 213, .24);
  border-radius: 50%;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  cursor: pointer;
}
.support-chat-modal-back:hover { background: rgba(255, 255, 255, .1); }
.support-chat-modal-back[hidden] { display: none; }

/* ---- Close (X) — default state; swapped for End Chat once connected ---- */
.support-chat-modal-close {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(135, 164, 213, .24);
  border-radius: 10px;
  background: rgba(255, 255, 255, .04);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.support-chat-modal-close:hover { background: rgba(255, 255, 255, .1); }
.support-chat-modal-close[hidden] { display: none; }

/* ---- End Chat (right) — only shown once the chat is connected ---- */
.support-chat-modal-end {
  flex: 0 0 auto;
  white-space: nowrap;
  border-radius: 999px;
}
.support-chat-modal-end[hidden] { display: none; }

.support-chat-modal-tabs {
  display: flex;
  gap: 6px;
  padding: 14px 22px 0;
  flex: 0 0 auto;
}
.support-chat-modal-tab {
  appearance: none;
  cursor: pointer;
  padding: 9px 16px;
  border: 1px solid rgba(135, 164, 213, .2);
  border-radius: 10px;
  background: rgba(255, 255, 255, .03);
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 700;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.support-chat-modal-tab.active {
  background: var(--grad-blue);
  border-color: transparent;
  color: #FFFFFF;
}

.support-chat-modal-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 22px 22px;
}

.support-chat-modal-panel { display: none; flex: 1; min-height: 0; flex-direction: column; }
.support-chat-modal-panel.active { display: flex; animation: sv-fade-in .3s ease; }

/* ---- Chat "connecting" empty state (shown until an agent is connected) ---- */
.support-chat-loading {
  flex: 1;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13.5px;
  animation: sv-fade-in .3s ease;
}
.support-chat-loading[hidden] {
  display: none;
}
.support-chat-loading-visual {
  width: 52px;
  height: 52px;
}

/* ---- Connected chat group (head bar + thread + input) ---- */
.support-chat-active {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  animation: sv-fade-in .3s ease;
}
.support-chat-active[hidden] {
  display: none;
}
/* ---- Chat ended empty state ---- */
.support-chat-ended {
  flex: 1;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  animation: sv-fade-in .3s ease;
}
.support-chat-ended[hidden] {
  display: none;
}
.support-chat-ended svg { color: var(--text-faint); }
.support-chat-ended p { margin: 0; font-size: 13.5px; }

/* ---- Chat thread ---- */
.support-chat-thread-wrap {
  position: relative;
  flex: 1;
  min-height: 220px;
  display: flex;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(5, 8, 20, .78), rgba(5, 8, 20, .88)),
    url('../images/backgrounds/support-chat-bg.png') center / cover no-repeat;
}
.support-chat-thread {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding: 4px 2px 20px;
}
.support-chat-thread[hidden] {
  display: none;
}

/* Floating "jump to latest" button — appears once the thread is scrolled
   up and there are messages below the fold, so a person reading back
   through history can snap back down in one tap instead of dragging the
   scrollbar. Stays mounted at all times; visibility is a class toggle
   (not [hidden]) so it can fade/slide in and out smoothly. */
.support-chat-scroll-btn {
  position: absolute;
  right: 14px;
  bottom: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(135, 164, 213, .24);
  background: rgba(11, 22, 41, .92);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35);
  opacity: 0;
  transform: translateY(6px) scale(.9);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease, background .15s ease;
}
.support-chat-scroll-btn.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.support-chat-scroll-btn:hover { background: rgba(11, 22, 41, 1); }
.support-chat-scroll-btn:active { transform: scale(.92); }
/* Small unread dot — lit up only while there are new messages that landed
   below the fold since the person scrolled away from the bottom. */
.support-chat-scroll-btn::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
  border: 2px solid rgba(11, 22, 41, .92);
  opacity: 0;
  transform: scale(.6);
  transition: opacity .15s ease, transform .15s ease;
}
.support-chat-scroll-btn.has-unread::after {
  opacity: 1;
  transform: scale(1);
}
.support-chat-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 86%;
}
.support-chat-msg-agent { align-self: flex-start; }
.support-chat-msg-user { align-self: flex-end; flex-direction: row-reverse; }

.support-chat-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}
.support-chat-msg-agent .support-chat-bubble {
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(135, 164, 213, .18);
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.support-chat-msg-user .support-chat-bubble {
  background: var(--grad-blue);
  color: #FFFFFF;
  font-weight: 600;
  border-bottom-right-radius: 4px;
}

/* ---- Chat meta row: timestamp + read-receipt tick under user bubbles ---- */
.support-chat-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-faint);
}
.support-chat-msg-user .support-chat-meta { justify-content: flex-end; }
.msg-tick { display: inline-flex; align-items: center; color: var(--text-faint); transition: color .2s ease; }
.msg-tick.seen { color: var(--blue-light, #6B93E6); }

/* ---- "Agent/user is typing…" bubble: reuses the message bubble look with
   animated dots instead of text (see .sv-loading-dots below). ---- */
.support-chat-msg-typing .support-chat-bubble {
  display: flex;
  align-items: center;
  padding: 12px 16px;
}
.support-chat-typing-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-faint);
  padding: 2px 2px 8px;
}

.support-chat-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  flex: 0 0 auto;
}
.support-chat-input-row[hidden] {
  display: none;
}
.support-chat-input {
  flex: 1;
  min-width: 0;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.support-chat-input::placeholder { color: var(--text-faint); }
.support-chat-input:focus { border-color: var(--blue); outline: none; }
.support-chat-input-row .btn { flex: 0 0 auto; }

.support-chat-send {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--grad-blue);
  color: #FFFFFF;
  box-shadow: 0 8px 20px rgba(74, 123, 216, 0.3);
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.1s ease;
}
.support-chat-send svg { transform: translateX(-1px); }
.support-chat-send:hover { box-shadow: 0 10px 26px rgba(74, 123, 216, 0.4); }
.support-chat-send:active { transform: scale(0.94); }
.support-chat-send:disabled { opacity: 0.5; cursor: default; box-shadow: none; }

/* Swapped in for the input row once a ticket is resolved/closed/cancelled —
   no more replying, just a confirmation the thread is wrapped up. */
.support-chat-resolved-stamp {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex: 0 0 auto;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt, rgba(74,123,216,.08));
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 600;
}
.support-chat-resolved-stamp svg { flex: 0 0 auto; color: var(--accent, #4A7BD8); }
.support-chat-resolved-stamp[hidden] { display: none; }

/* ---- End Chat confirmation (Yes/No) — sits above the chat modal itself,
   same card styling as the sidebar's logout-confirm-modal. ---- */
.support-end-confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  place-items: center;
  padding: 18px;
}
.support-end-confirm-modal.open { display: grid; }

@media (max-width: 720px) {
  .support-chat-modal-sheet {
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    max-height: none;
    height: 100%;
    height: 100dvh;
    transform: none;
    border-radius: 0;
    border: none;
    background: #0F1623;
  }
  .support-chat-modal-head {
    padding: 14px 16px;
    padding-top: max(14px, env(safe-area-inset-top));
  }
  .support-chat-modal-tabs { padding: 14px 16px 0; }
  .support-chat-modal-body {
    padding: 16px 16px max(24px, env(safe-area-inset-bottom));
  }
  /* The Request Support panel is a plain scrollable form — fine to let
     the body handle its scroll as on desktop. The chat panel is a proper
     chat window though (header + scrolling thread + input pinned at the
     bottom): letting the *body* scroll there too meant that on short
     mobile viewports the whole panel — input row included — could get
     swallowed into that outer scroll instead of just the thread, so the
     message box looked cut off / the input drifted out of view. Turning
     off the body's own scroll for the chat panel and letting the min-
     height:0 chain below do its job keeps the thread as the only
     scrolling area and the input pinned exactly where it belongs. */
  .support-chat-modal-body:has(.support-chat-modal-panel[data-support-chat-modal-panel="chat"].active) {
    overflow-y: hidden;
  }
  .support-chat-active,
  .support-chat-thread-wrap,
  .support-chat-loading,
  .support-chat-ended {
    min-height: 0;
  }
  /* Center the Request Support submit button on mobile. */
  .support-chat-modal-panel .settings-panel-actions {
    justify-content: center;
  }
  .support-chat-modal-panel .settings-panel-actions .btn {
    width: 100%;
    max-width: 320px;
  }
}

/* ---- Reusable ring spinner (used by pending request + chat connecting) ---- */
.sv-spinner {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.sv-spinner::before,
.sv-spinner::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
}
.sv-spinner::before {
  border: 1px solid rgba(107, 147, 230, .16);
}
.sv-spinner::after {
  background: conic-gradient(from 0deg, rgba(107, 147, 230, 0) 0%, rgba(107, 147, 230, .95) 20%, rgba(107, 147, 230, 0) 42%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  animation: sv-spinner-rotate 1.3s linear infinite;
}
.sv-spinner-icon {
  position: relative;
  z-index: 1;
  color: var(--blue-light, #6B93E6);
  animation: sv-spinner-icon-pulse 2s ease-in-out infinite;
}
@keyframes sv-spinner-rotate { to { transform: rotate(360deg); } }
@keyframes sv-spinner-icon-pulse {
  0%, 100% { opacity: .75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

/* ---- Animated "..." used next to pending / connecting copy ---- */
.sv-loading-dots {
  display: inline-flex;
  gap: 3px;
  margin-left: 5px;
  vertical-align: middle;
}
.sv-loading-dots span {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: .3;
  animation: sv-loading-dot-bounce 1.1s ease-in-out infinite;
}
.sv-loading-dots span:nth-child(2) { animation-delay: .15s; }
.sv-loading-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes sv-loading-dot-bounce {
  0%, 80%, 100% { opacity: .3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* ---- "Request pending" state (shown after submitting) ---- */
.support-request-pending {
  flex: 1;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 32px 20px;
  text-align: center;
  animation: sv-fade-in .3s ease;
}
.support-request-pending[hidden] {
  display: none;
}
.support-request-pending-visual {
  width: 52px;
  height: 52px;
}
.support-request-pending-title {
  margin: 0;
  color: #fff;
  font-size: 14.5px;
  font-weight: 700;
}
.support-request-pending-sub {
  margin: 0;
  max-width: 320px;
  font-size: 13px;
  color: var(--text-muted);
}
.support-request-pending .btn { flex: 0 0 auto; margin-top: 4px; }

/* Accepted: swap the spinner for a static success ring and offer to jump into chat */
.support-request-pending.is-accepted .sv-spinner::after {
  animation: none;
  background: none;
}
.support-request-pending.is-accepted .sv-spinner::before {
  border-color: rgba(61, 184, 138, .4);
  background: rgba(61, 184, 138, .1);
}
.support-request-pending.is-accepted .sv-spinner-icon {
  color: var(--green);
  animation: none;
}

@media (max-width: 560px) {
  .support-request-pending .btn { width: 100%; max-width: 220px; }
}

/* ==========================================================================
   Header logo — one consistent size across every page that uses the public
   navbar (Home, Sign In, Sign Up, Forgot Password). Mobile size matches the
   dashboard's mobile topbar logo (54px tall); desktop is sized generously
   to make the mark the clear anchor of the header.
   ========================================================================== */
.logo-link,
.drawer-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: auto;
  height: auto;
  overflow: visible;
}
.logo-link img,
.drawer-logo-link img {
  width: auto;
  height: 100%;
  max-height: 112px;
  object-fit: contain;
}
.logo-text,
.drawer-logo-text {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -.2px;
  color: #fff;
  white-space: nowrap;
}
.logo-text-shark {
  color: #2f8fff;
}
.drawer-logo-link { gap: 12px; }
.drawer-logo-link .drawer-logo { max-height: 44px; }

@media (max-width: 900px) {
  /* The mobile header keeps the wordmark next to the mark (matching the
     dashboard's mobile topbar), sized down to fit the centered slot. */
  .logo-text {
    display: inline;
    font-size: 15px;
    line-height: 1;
  }
  .drawer-logo-text { font-size: 15px; }
  .logo-link img { max-height: 44px; }
  .drawer-logo-link img { max-height: 44px; }
}

@media (max-width: 390px) {
  .logo-text { font-size: 12.5px; }
}

/* ==========================================================================
   Mobile logo scale and fixed header height
   ========================================================================== */
@media (max-width: 900px) {
  .navbar-inner,
  .dashboard-page .topbar {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: center;
    justify-items: center;
    height: 64px;
    min-height: 64px;
    max-height: 64px;
    overflow: visible;
  }

  .dashboard-page .topbar {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    align-items: center;
  }

  .navbar-inner {
    padding-top: 0;
    padding-bottom: 0;
  }

  .navbar-inner .nav-burger-mobile-first,
  .navbar-inner .mobile-header-spacer {
    justify-self: center;
  }

  .navbar-inner .nav-burger-mobile-first {
    display: inline-grid;
    place-items: center;
  }

  .navbar-inner .navbar-actions {
    justify-self: center;
    justify-content: center;
    width: 40px;
  }

  .dashboard-page .topbar {
    padding-top: 0;
    padding-bottom: 0;
  }

  .navbar-inner .logo-link {
    grid-column: 2;
    justify-self: center;
    align-self: center;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    max-width: min(70vw, 220px);
    height: 100%;
    overflow: visible;
  }

  .navbar-inner .logo-link img {
    display: block;
    margin: 0;
    width: auto;
    height: 100%;
    max-height: 44px;
    max-width: 100%;
    flex: 0 0 auto;
    object-fit: contain;
    object-position: center;
  }

  .mobile-drawer-head .drawer-logo-link {
    width: auto;
    max-width: min(76vw, 272px);
    height: 70px;
    overflow: visible;
  }

  .mobile-drawer-head .drawer-logo {
    width: auto;
    height: 100%;
    max-height: 64px;
    max-width: 100%;
    object-fit: contain;
    object-position: center;
  }

  .dashboard-page .topbar-mobile-logo {
    grid-column: 2;
    justify-self: center;
    align-self: center;
    margin-inline: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(58vw, 196px);
    height: 56px;
    line-height: 0;
    overflow: hidden;
  }

  .dashboard-page .topbar-mobile-logo img {
    display: block;
    margin-inline: auto;
    width: 100%;
    height: auto;
    max-height: none;
    flex: 0 0 auto;
    object-fit: contain;
    object-position: center;
  }

  .dashboard-page .dash-menu-btn,
  .dashboard-page .topbar-icons .icon-btn:first-child {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    line-height: 0;
  }

  .dashboard-page .topbar-icons {
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: end;
    width: 40px;
    height: 100%;
  }

  .dashboard-page .topbar-icons .icon-btn:first-child .icon-btn-clip {
    display: grid;
    place-items: center;
  }

  .dashboard-page .dash-menu-btn svg,
  .dashboard-page .topbar-icons .icon-btn:first-child svg {
    display: block;
  }

  .dash-mobile-drawer .sidebar-logo {
    gap: 7px;
    padding-bottom: 6px;
  }

  .dash-mobile-drawer .sidebar-logo-mark {
    width: 38px;
    height: 38px;
  }

  .dash-mobile-drawer .sidebar-logo-text strong {
    font-size: 14px;
  }
}

@media (max-width: 560px) {
  .navbar-inner,
  .dashboard-page .topbar {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
    height: 62px;
    min-height: 62px;
    max-height: 62px;
  }

  .dashboard-page .topbar {
    padding-left: 10px;
    padding-right: 10px;
  }

  .navbar-inner .logo-link {
    max-width: min(52vw, 166px);
    height: 100%;
  }

  .navbar-inner .logo-link img {
    max-height: 48px;
  }

  .mobile-drawer-head .drawer-logo-link {
    max-width: min(80vw, 258px);
    height: 66px;
  }

  .mobile-drawer-head .drawer-logo {
    max-height: 58px;
  }

  .dashboard-page .topbar-mobile-logo {
    width: min(58vw, 186px);
    height: 54px;
  }

  .dash-mobile-drawer .sidebar-logo-mark {
    width: 36px;
    height: 36px;
  }
}

@media (max-width: 390px) {
  .navbar-inner,
  .dashboard-page .topbar {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    height: 60px;
    min-height: 60px;
    max-height: 60px;
  }

  .dashboard-page .topbar {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    padding-left: 8px;
    padding-right: 8px;
  }

  .navbar-inner .logo-link {
    max-width: min(50vw, 154px);
    height: 100%;
  }

  .navbar-inner .logo-link img {
    max-height: 46px;
  }

  .mobile-drawer-head .drawer-logo-link {
    max-width: min(82vw, 238px);
    height: 62px;
  }

  .mobile-drawer-head .drawer-logo {
    max-height: 54px;
  }

  .dashboard-page .topbar-mobile-logo {
    width: min(56vw, 174px);
    height: 52px;
  }

  .dashboard-page .dash-menu-btn,
  .dashboard-page .topbar-icons .icon-btn:first-child {
    width: 36px;
    height: 36px;
  }

  .dashboard-page .topbar-icons {
    width: 38px;
  }

  .dash-mobile-drawer .sidebar-logo-mark {
    width: 34px;
    height: 34px;
  }
}

/* ==========================================================================
   Logo sizing — final pass (intentionally last so it wins over every
   earlier logo rule above; nothing below this should touch logo sizing).

   1) Public header (Home / Sign In / Sign Up / Forgot Password) desktop
      logo: brought down from the old 112px mark to a normal header size.
   2) Dashboard + Admin mobile topbar logo: sized to match the public
      mobile header logo exactly, and hidden on desktop — the sidebar
      already carries the brand mark there, so it shouldn't also render in
      the topbar on desktop widths.
   3) Dashboard + Admin sidebar "menu" logo: shows the full mark (no more
      132% zoom + circular crop that was cutting off the fin/nose), sized
      to match the public mobile drawer's logo scale.
   ========================================================================== */

/* --- 1) Public header — reduced desktop logo size --- */
@media (min-width: 901px) {
  .logo-link img,
  .drawer-logo-link img {
    height: auto;
    max-height: 56px;
  }
}

/* --- 2) Dashboard/Admin mobile topbar logo — match public header, hide on desktop --- */
.dashboard-page .topbar-mobile-logo {
  display: none;
}

.dashboard-page .topbar-mobile-logo-text {
  display: none;
}

@media (max-width: 900px) {
  .dashboard-page .topbar-mobile-logo {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    width: auto;
    height: 50px;
    overflow: visible;
  }

  .dashboard-page .topbar-mobile-logo img {
    width: auto;
    height: 100%;
    max-height: 50px;
    object-fit: contain;
    object-position: center;
    flex: 0 0 auto;
  }

  .dashboard-page .topbar-mobile-logo-text {
    display: block;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -.01em;
    color: var(--text);
    white-space: nowrap;
    line-height: 1;
  }
}

@media (max-width: 560px) {
  .dashboard-page .topbar-mobile-logo {
    height: 48px;
  }

  .dashboard-page .topbar-mobile-logo img {
    max-height: 48px;
  }

  .dashboard-page .topbar-mobile-logo-text {
    font-size: 14px;
  }
}

@media (max-width: 390px) {
  .dashboard-page .topbar-mobile-logo {
    height: 46px;
  }

  .dashboard-page .topbar-mobile-logo img {
    max-height: 46px;
  }

  .dashboard-page .topbar-mobile-logo-text {
    font-size: 12.5px;
  }
}

/* --- 3) Dashboard/Admin sidebar menu logo — show the full mark, no crop --- */
.sidebar-logo-mark {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  overflow: visible;
  background: transparent;
}

.sidebar .sidebar-logo img,
.dash-mobile-drawer .sidebar-logo img {
  position: static;
  top: auto;
  left: auto;
  transform: none;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center;
  border-radius: 0;
}

.dash-mobile-drawer .sidebar-logo-mark {
  width: 44px;
  height: 44px;
}

/* ==========================================================================
   Signup form — single-column (flex-col) layout on mobile
   ----------------------------------------------------------------------
   The many separate mobile media queries above (700/560/430/390/360px)
   used to fight over grid-template-columns for the First/Last Name,
   Phone/Country, and Password/Confirm pairs — several conflicting values
   stacked up over time, all fighting to force a cramped 2-column layout.
   Those dead declarations have been removed; this is now the single rule
   controlling this layout: every paired row stacks into one flex column
   below 700px, same as the rest of the form. Kept at the end of the file
   with !important as the deliberate single source of truth for this
   layout, since font-size/padding tuning for other signup elements still
   lives in the breakpoint-specific blocks above. ==========================================================================*/
@media (max-width: 700px) {
  .signup-page .form-row,
  .signup-page .name-row,
  .signup-page .contact-row,
  .signup-page .password-row {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: unset !important;
    gap: 14px !important;
  }

  /* The shrunken font-sizes/padding from the old 2-column squeeze are no
     longer needed now each field gets the full row width to itself. */
  .signup-page .form-group label {
    font-size: 13px !important;
    white-space: normal !important;
  }

  .signup-page .input-wrap input,
  .signup-page .input-wrap select,
  .signup-page .phone-code {
    font-size: 14px !important;
    padding-left: 38px !important;
  }

  .signup-page .name-row input,
  .signup-page .contact-row input,
  .signup-page .contact-row select,
  .signup-page .password-row input {
    padding-left: 38px !important;
    padding-right: 12px !important;
  }
}

/* ==========================================================================
   Signup page — mobile "scroll down" cue
   ----------------------------------------------------------------------
   Fixed circular button with a bouncing down-chevron, hinting there's more
   of the form below the fold. Hidden on desktop/tablet — the two-column
   layout there doesn't need it. Fades out via .is-hidden (see the inline
   script in auth/register.php) once the person scrolls or nears the
   bottom of the page. ==========================================================================*/
.scroll-down-indicator {
  display: none;
}

@media (max-width: 900px) {
  .signup-page .scroll-down-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: var(--grad-blue, linear-gradient(135deg, #4A7BD8, #3594ff));
    color: #FFFFFF;
    box-shadow: 0 8px 20px rgba(74, 123, 216, 0.35);
    z-index: 60;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.25s ease, transform 0.25s ease;
    animation: scrollDownBounce 1.8s ease-in-out infinite;
  }

  .signup-page .scroll-down-indicator.is-hidden {
    opacity: 0;
    pointer-events: none;
    animation: none;
    transform: translateX(-50%) translateY(10px);
  }
}

@keyframes scrollDownBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%      { transform: translateX(-50%) translateY(6px); }
}

/* Country trigger icon slot (globe by default, flag once a country is chosen) */
.country-trigger-icon {
  width: 21px;
  flex: 0 0 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.country-trigger-icon .flag { margin: 0; }
.country-picker-option .flag { flex: 0 0 21px; }

/* ==========================================================================
   Signup — phone code selector (mobile polish)
   Dial-code button sits flush against the phone input as one joined control.
   Flag was removed from the button, so it is now: [ +234 ˅ ][ phone number ]
   ========================================================================== */
.phone-code-shell::after {
  content: '';
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-right: 2px solid #9FABC1;
  border-bottom: 2px solid #9FABC1;
  transform: translateY(-2px) rotate(45deg);
}

@media (max-width: 700px) {
  .signup-page .phone-group {
    display: flex !important;
    align-items: stretch;
    gap: 0;
    width: 100%;
    min-width: 0;
  }

  .signup-page .phone-code-shell {
    flex: 0 0 96px;
    width: 96px;
    min-height: 48px;
    height: 48px;
    padding: 0 12px 0 14px;
    gap: 8px;
    justify-content: flex-start;
    border-radius: 10px 0 0 10px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .signup-page .phone-code-display {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .2px;
    line-height: 1;
  }

  .signup-page .phone-group .input-wrap {
    flex: 1 1 auto;
    min-width: 0;
  }

  .signup-page .phone-group .input-wrap input,
  .signup-page .contact-row .phone-group input {
    height: 48px;
    min-height: 48px;
    padding: 0 14px !important;
    font-size: 16px !important; /* stops iOS zooming in on focus */
    border-radius: 0 10px 10px 0 !important;
  }

  .signup-page .country-select-trigger {
    min-height: 48px;
    height: 48px;
    border-radius: 10px;
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
}

/* Very narrow phones: keep the number field usable */
@media (max-width: 360px) {
  .signup-page .phone-code-shell {
    flex-basis: 86px;
    width: 86px;
    padding: 0 10px 0 11px;
    gap: 6px;
  }

  .signup-page .phone-code-display {
    font-size: 13px;
  }
}

/* ==========================================================================
   Dashboard mobile + tablet (<= 900px)
   1) One page header only: the small duplicate label above the title and the
      subtitle line below it are hidden.
   2) Related stat cards share ONE container, stacked with a horizontal
      divider between them (same arrangement as the admin panel):
          [icon] Label ............ value
          note / delta underneath
   ========================================================================== */
@media (max-width: 900px) {
  /* ---- single page header ---- */
  .dash-welcome .mobile-welcome-small { display: none; }
  .dash-welcome .welcome-copy .mobile-welcome-small { display: block; } /* home greeting keeps its "Welcome back," */
  .dash-welcome > div:first-child > p,
  .dash-welcome .welcome-copy > p { display: none !important; }

  /* ---- stats: one container, horizontal dividers ---- */
  .stat-cards.journal-stat-cards,
  .stock-summary-cards {
    display: flex;
    flex-direction: column;
    flex-flow: column nowrap;
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
  }

  .journal-stat-cards .stat-card,
  .stock-summary-cards .stat-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 0;
    row-gap: 8px;
    align-items: center;
    flex: none;
    min-width: 0;
    padding: 16px 18px;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: none;
  }
  .journal-stat-cards .stat-card + .stat-card,
  .stock-summary-cards .stat-card + .stat-card {
    border-top: 1px solid var(--border);
  }

  /* flatten the inner wrappers so icon / label / value become grid cells */
  .journal-stat-cards .stat-card .top-row,
  .journal-stat-cards .stat-card .top-row > div,
  .stock-summary-cards .stat-card .top-row { display: contents; }

  .journal-stat-cards .stat-card .icon-box {
    grid-column: 1; grid-row: 1;
    width: 34px; height: 34px; border-radius: 10px;
    margin-right: 12px;
  }
  .journal-stat-cards .stat-card .icon-box svg { width: 17px; height: 17px; }

  .journal-stat-cards .stat-card .label,
  .stock-summary-cards .stat-card .label {
    grid-column: 2; grid-row: 1;
    font-size: 13px; line-height: 1.3; min-width: 0; margin: 0;
  }
  .stock-summary-cards .stat-card .label { grid-column: 1 / 3; }

  .journal-stat-cards .stat-card .value,
  .stock-summary-cards .stat-card .value {
    grid-column: 3; grid-row: 1;
    margin: 0; padding-left: 12px; text-align: right;
    font-size: 22px; line-height: 1.1;
  }

  .journal-stat-cards .stat-card .delta {
    grid-column: 1 / -1; grid-row: 2;
    justify-self: start; margin: 0;
  }
}

/* ==========================================================================
   Portfolio balance card: 3D perspective grid backdrop
   A tilted grid plane scrolls toward the viewer. Efficiency notes:
   - only `transform` is animated (compositor-only, no layout/paint per frame)
   - the plane is a single element with a CSS-gradient grid (no images/canvas)
   - cells + plane are smaller on phones, and the loop is slower
   - paused while off-screen (.is-offscreen, toggled in portfolio.php) and
     removed entirely for prefers-reduced-motion
   The old chart backdrop (.balance-card-trend) is hidden here; its markup is
   still in the page if you ever want it back.
   ========================================================================== */
.mobile-balance-card .balance-card-trend { display: none; }

.balance-grid3d {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  perspective: 320px;
  perspective-origin: 50% 0%;
  contain: layout paint size;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, .55) 26%, #000 62%);
          mask-image: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, .55) 26%, #000 62%);
}
.balance-grid3d::after {            /* soft glow along the horizon */
  content: "";
  position: absolute;
  left: 0; right: 0; top: 18%;
  height: 46%;
  background: radial-gradient(ellipse at 50% 0%, rgba(107, 147, 230, .22), transparent 70%);
}
.balance-grid3d-plane {
  position: absolute;
  left: -60%;
  width: 220%;
  top: 22%;
  height: 260%;
  background-image:
    linear-gradient(rgba(107, 147, 230, .55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(107, 147, 230, .55) 1px, transparent 1px);
  background-size: 44px 44px;
  transform-origin: 50% 0%;
  transform: rotateX(70deg) translate3d(0, 0, 0);
  backface-visibility: hidden;
  will-change: transform;
  animation: balance-grid-scroll 3.4s linear infinite;
}
@keyframes balance-grid-scroll {
  from { transform: rotateX(70deg) translate3d(0, 0, 0); }
  to   { transform: rotateX(70deg) translate3d(0, 44px, 0); }  /* one cell = seamless loop */
}
.mobile-balance-card.is-offscreen .balance-grid3d-plane { animation-play-state: paused; }

@media (max-width: 900px) {
  .balance-grid3d { perspective: 240px; }
  .balance-grid3d-plane {
    left: -40%;
    width: 180%;
    height: 200%;
    background-size: 34px 34px;
    animation-duration: 4.4s;
  }
  @keyframes balance-grid-scroll {
    from { transform: rotateX(70deg) translate3d(0, 0, 0); }
    to   { transform: rotateX(70deg) translate3d(0, 34px, 0); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .balance-grid3d-plane { animation: none; }
}

/* ==========================================================================
   Journal > Recent Trades card layout
   Header: title + "N trades · xW / yL" on the left, streak pill on the right
   (same row). Rows: [icon] pair + BUY/SELL tag + TP/SL  ........  P/L + time
   ========================================================================== */
.journal-recent-head {
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}
.journal-recent-title { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.journal-recent-title small { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.journal-recent-head .trade-streak-badge { margin: 0; flex-shrink: 0; }

.journal-recent-trades-card .trade-pulse-row {
  padding: 13px 4px;
  gap: 14px;
  align-items: center;
}
.journal-recent-trades-card .trade-pulse-id { gap: 12px; }
.journal-recent-trades-card .trade-pulse-copy { gap: 4px; }
.journal-recent-trades-card .trade-pulse-amt-col { gap: 3px; min-width: 84px; }
.journal-recent-trades-card .trade-pulse-amt { font-size: 15px; }
.journal-recent-trades-card .trade-pulse-flag,
.journal-recent-trades-card .trade-pulse-avatar { width: 38px; height: 38px; }

@media (max-width: 900px) {
  .journal-recent-trades-card .trade-pulse-row { padding: 14px 2px; }
  .journal-recent-trades-card .trade-pulse-amt-col { min-width: 0; }
}
@media (max-width: 420px) {
  .journal-recent-head { flex-wrap: nowrap; }
  .journal-recent-trades-card .trade-pulse-flag,
  .journal-recent-trades-card .trade-pulse-avatar { width: 34px; height: 34px; }
  .journal-recent-trades-card .trade-pulse-levels { font-size: 10.5px; }
}


/* ==========================================================================
   Layout pass: stocks logo (mobile), Journal stat cards + trade detail modal
   (desktop), Settings profile header (mobile)
   ========================================================================== */

/* ---- Stocks logo: keep it a fixed, perfect circle on phones. Inside the
   horizontally scrollable stock list the logo could get squeezed/clipped,
   and the lazy-loaded <img> never loaded on mobile browsers (absolutely
   positioned lazy images inside overflow scrollers), leaving a blank white
   circle. ---- */
.stock-logo {
  flex: 0 0 auto;
  min-width: 0;
  aspect-ratio: 1 / 1;
}
.stock-logo-img { display: block; }
@media (max-width: 900px) {
  .stock-list-row .stock-logo { width: 34px !important; height: 34px !important; min-width: 34px; }
  .stock-chart-id .stock-logo { width: 38px !important; height: 38px !important; min-width: 38px; }
  .stock-logo-fallback { font-size: 10px; }
}

@media (min-width: 901px) {
  /* Trade Detail modal: entry / exit / result as a vertical flex column */
  .trade-detail-modal-card .trade-detail-stats {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 4px 16px;
  }
  .trade-detail-modal-card .trade-detail-stat {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
  }
  .trade-detail-modal-card .trade-detail-stat + .trade-detail-stat {
    border-top: 1px solid rgba(255, 255, 255, .08);
  }
}

/* ---- Settings > User Profile: avatar + name + email on ONE row on mobile;
   plan / KYC badges and Edit Profile sit underneath ---- */
@media (max-width: 640px) {
  .settings-profile-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "avatar name"
      "avatar email"
      "stats  stats"
      "edit   edit";
    column-gap: 14px;
    row-gap: 0;
    align-items: center;
  }
  .settings-profile-head > .settings-avatar { grid-area: avatar; width: 60px; height: 60px; }
  .settings-profile-head-copy { display: contents; }
  .settings-profile-head-copy h3 {
    grid-area: name;
    align-self: end;
    margin: 0;
    font-size: 17px;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .settings-profile-head-copy > p {
    grid-area: email;
    align-self: start;
    margin: 2px 0 0;
    font-size: 13px;
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .settings-profile-head .settings-profile-stats { grid-area: stats; margin-top: 16px; }
  .settings-profile-head > .btn { grid-area: edit; width: 100%; margin-top: 16px; }
}

/* ---- Journal stat cards: tablet uses the same stacked, divided arrangement
   as mobile (desktop keeps the original grid) ---- */
@media (min-width: 901px) and (max-width: 1180px) {
  .stat-cards.journal-stat-cards {
    display: flex; flex-direction: column; flex-flow: column nowrap; gap: 0;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); overflow: hidden;
  }
  .journal-stat-cards .stat-card {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 0; row-gap: 8px; align-items: center; flex: none; min-width: 0;
    padding: 16px 18px; background: transparent; border: 0; border-radius: 0;
    box-shadow: none; transform: none;
  }
  .journal-stat-cards .stat-card + .stat-card { border-top: 1px solid var(--border); }
  .journal-stat-cards .stat-card .top-row,
  .journal-stat-cards .stat-card .top-row > div { display: contents; }
  .journal-stat-cards .stat-card .icon-box {
    grid-column: 1; grid-row: 1; width: 34px; height: 34px; border-radius: 10px; margin-right: 12px;
  }
  .journal-stat-cards .stat-card .icon-box svg { width: 17px; height: 17px; }
  .journal-stat-cards .stat-card .label { grid-column: 2; grid-row: 1; font-size: 13px; margin: 0; }
  .journal-stat-cards .stat-card .value {
    grid-column: 3; grid-row: 1; margin: 0; padding-left: 12px; text-align: right; font-size: 22px; line-height: 1.1;
  }
  .journal-stat-cards .stat-card .delta { grid-column: 1 / -1; grid-row: 2; justify-self: start; margin: 0; }
}

/* ==========================================================================
   TABLET LAYOUT — user dashboard tabs
   (landscape tablets 901–1180px: slim icon-rail sidebar;
    portrait tablets 641–900px: roomier content + bottom nav)
   ========================================================================== */

/* ---- Landscape tablet: collapse the 270px sidebar into an icon rail so the
   content gets the width back instead of being squeezed to ~750px ---- */
@media (min-width: 901px) and (max-width: 1180px) {
  .dashboard-page { --sidebar-w: 84px; }

  .dashboard-page .sidebar {
    padding: 18px 12px 20px;
    align-items: center;
    overflow-x: hidden;
  }
  .dashboard-page .sidebar-logo { padding: 0 0 18px; justify-content: center; }
  .dashboard-page .sidebar-logo-text,
  .dashboard-page .sidebar .upgrade-card { display: none; }

  .dashboard-page .sidebar .side-nav { width: 100%; align-items: center; gap: 8px; }
  .dashboard-page .sidebar .side-nav li { width: 100%; display: flex; justify-content: center; }
  .dashboard-page .sidebar .side-nav a {
    position: relative;
    width: 52px;
    height: 52px;
    min-height: 52px;
    padding: 0;
    justify-content: center;
    gap: 0;
    border-radius: 14px;
  }
  .dashboard-page .sidebar .side-nav a > span:not(.count-badge):not(.nav-live-beacon):not(.nav-badge) {
    /* label becomes a visually hidden (screen-reader only) text */
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
  }
  .dashboard-page .sidebar .side-nav a svg { width: 22px; height: 22px; }
  .dashboard-page .sidebar .side-nav .count-badge {
    position: absolute; top: 4px; right: 2px; margin: 0;
    min-width: 17px; padding: 1px 5px; font-size: 10px;
  }
  .dashboard-page .sidebar .side-nav .nav-live-beacon {
    position: absolute; top: 8px; right: 8px; margin: 0;
  }
  .dashboard-page .sidebar .side-nav .nav-badge { display: none; }

  .dashboard-page .topbar { padding: 0 24px; }
  .dashboard-page .dash-content {
    padding: 26px 26px 36px;
    max-width: none;
  }
}

/* ---- Portrait tablet: keep the bottom nav, but give content proper tablet
   spacing, multi-column stat rows and un-bleed the full-width mobile cards ---- */
@media (min-width: 641px) and (max-width: 900px) {
  .dashboard-page .topbar { padding: 0 24px; }
  .dashboard-page .dash-content {
    padding: 24px 24px 104px;
    max-width: none;
  }

  /* stat rows: use the width (3 across) instead of the 2-col phone grid */
  .dashboard-page .stat-cards:not(.journal-stat-cards):not(.wallet-stat-cards):not(.stock-summary-cards) {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

  /* two-up grids for dashboard widgets */
  .dashboard-page .dash-grid-3 { grid-template-columns: 1fr 1fr; }
  .dashboard-page .dash-grid-3 .mini-card:last-child { grid-column: span 2; }

  /* Journal: cards sit inside the page padding like normal cards, not
     bleeding edge-to-edge as on a phone */
  .journal-performance-card,
  .journal-recent-trades-card {
    width: auto;
    margin-left: 0;
    margin-right: 0;
    border-radius: var(--radius);
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  /* Bottom nav: larger, centered tap targets */
  .mobile-bottom-nav { padding: 10px 40px calc(12px + env(safe-area-inset-bottom)); }
  .mobile-bottom-nav a { font-size: 12px; gap: 4px; min-width: 72px; }
  .mobile-bottom-nav a svg { width: 22px; height: 22px; }

  /* Settings profile header: avatar + name/email on one row, badges and
     Edit Profile on the next, with enough room to breathe */
  .settings-profile-head { gap: 16px 20px; }
  .settings-info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

}

/* ==========================================================================
   AUTH PAGES — Login / Sign up / Admin sign in
   Final, authoritative sizing for full page + form on desktop and tablet.
   (Phones keep the existing full-bleed rules, ≤700px.)
   ========================================================================== */

/* Inputs: 16px+ so iPad/iPhone Safari never zooms in on focus */
.auth-page .input-wrap input,
.auth-page .input-wrap select { font-size: 16px; }

/* ---------- Desktop (≥1181px) ---------- */
@media (min-width: 1181px) {
  .auth-page .auth-shell {
    min-height: calc(100vh - 96px);
    padding: 40px 0 56px;
    justify-content: center;
  }
  .auth-page .auth-main.container {
    max-width: 1240px;
    margin-left: auto;
    margin-right: auto;
    grid-template-columns: minmax(0, 1fr) minmax(500px, 580px);
    gap: 72px;
    align-items: center;
  }
  .auth-page .auth-visual { min-height: 0; padding: 40px 0; }
  .auth-page .auth-visual h1 { font-size: clamp(40px, 3.6vw, 56px); max-width: 560px; }

  .auth-page .auth-form-panel {
    width: 100%;
    max-width: 580px;
    justify-self: end;
    padding: 44px 46px;
    border-radius: 20px;
  }
  .auth-page .login-panel { max-width: 560px; justify-self: end; }

  /* Sign up has more fields: give it a wider card */
  .signup-page .auth-main.container { grid-template-columns: minmax(0, 1fr) minmax(560px, 660px); }
  .signup-page .auth-form-panel { max-width: 660px; }

  .auth-page .auth-form-panel .form-head h2 { font-size: 32px; }
  .auth-page .input-wrap input,
  .auth-page .input-wrap select { padding-top: 13px; padding-bottom: 13px; }
}

/* Very large monitors: scale the page up instead of leaving it small */
@media (min-width: 1600px) {
  .auth-page .auth-main.container { max-width: 1400px; gap: 96px; }
  .auth-page .auth-form-panel { max-width: 620px; }
  .signup-page .auth-form-panel { max-width: 700px; }
}

/* ---------- Landscape tablet (901–1180px): two columns, tighter ---------- */
@media (min-width: 901px) and (max-width: 1180px) {
  .auth-page .auth-shell {
    min-height: calc(100vh - 88px);
    padding: 32px 0 48px;
    justify-content: center;
  }
  .auth-page .auth-main.container {
    max-width: 1100px;
    width: 100%;
    padding-left: 28px;
    padding-right: 28px;
    grid-template-columns: minmax(0, 1fr) minmax(400px, 480px);
    gap: 40px;
    align-items: center;
  }
  .signup-page .auth-main.container { grid-template-columns: minmax(0, .8fr) minmax(460px, 560px); }
  .auth-page .auth-visual { min-height: 0; padding: 24px 0; }
  .auth-page .auth-visual h1 { font-size: clamp(32px, 3.9vw, 42px); }
  .auth-page .auth-visual p { font-size: 15px; max-width: 420px; }
  .auth-page .auth-perks { max-width: 420px; }

  .auth-page .auth-form-panel,
  .auth-page .login-panel {
    width: 100%;
    max-width: 480px;
    justify-self: end;
    padding: 36px 34px;
    border-radius: 18px;
  }
  .signup-page .auth-form-panel { max-width: 560px; }
  .auth-page .auth-form-panel .form-head h2 { font-size: 30px; }
}

/* ---------- Portrait tablet (701–900px): one centred card ---------- */
@media (min-width: 701px) and (max-width: 900px) {
  .auth-page .auth-shell {
    min-height: calc(100vh - 64px);
    padding: 40px 24px 56px;
    justify-content: center;
  }
  .auth-page .auth-main.container,
  .auth-page .login-auth-main {
    display: block;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 0;
  }
  .auth-page .auth-visual { display: none; }

  .auth-page .auth-form-panel,
  .auth-page .login-panel {
    width: 100%;
    max-width: 640px;
    margin: 0 auto;
    padding: 40px 40px 44px;
    border: 1px solid rgba(164, 188, 231, .22);
    border-radius: 20px;
    background: rgba(15, 22, 35, .72);
    backdrop-filter: blur(14px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
  }
  .auth-page .login-panel { max-width: 560px; }
  .auth-page .auth-form-panel .form-head h2 { font-size: 30px; }

  /* keep two-column field rows on tablet (they collapse only on phones) */
  .auth-page .form-row { grid-template-columns: 1fr 1fr; gap: 16px 20px; }
  .signup-page .account-row { grid-template-columns: 1fr 1fr; }
  .auth-page .input-wrap input,
  .auth-page .input-wrap select { padding-top: 14px; padding-bottom: 14px; }
}

/* 701–720: the old ≤700 full-bleed card rules end here; nothing to undo */

/* ---- Portfolio quick actions: each icon gets its own soft colour
   (green is kept for profit only) ---- */
.dash-quick-action:nth-child(1) .dash-quick-action-icon { background: rgba(74, 123, 216, .16);  color: #7FA2EC; } /* Recent  - blue   */
.dash-quick-action:nth-child(2) .dash-quick-action-icon { background: rgba(155, 138, 230, .16); color: #A898EA; } /* Trade   - violet */
.dash-quick-action:nth-child(3) .dash-quick-action-icon { background: rgba(79, 179, 200, .16);  color: #6CC3D6; } /* Stocks  - cyan   */
.dash-quick-action:nth-child(4) .dash-quick-action-icon { background: rgba(224, 149, 107, .16); color: #E8A57F; } /* Journal - peach  */

/* ---- Charts order ticket: shown when the user has no balance ---- */
.ct-fund-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 12px;
  background: rgba(217, 164, 65, .1);
  border: 1px solid rgba(217, 164, 65, .3);
  color: var(--gold);
}
.ct-fund-notice svg { flex-shrink: 0; }
.ct-fund-notice > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ct-fund-notice strong { font-size: 13.5px; color: var(--text); }
.ct-fund-notice span { font-size: 12px; color: var(--text-muted); }
.ct-fund-notice .btn { flex-shrink: 0; white-space: nowrap; }
.chart-terminal-order.is-unfunded [data-ct-amount],
.chart-terminal-order.is-unfunded [data-ct-preset] { opacity: .5; pointer-events: none; }
.chart-terminal-order.is-unfunded .hm-submit-btn[disabled] { opacity: .45; cursor: not-allowed; }
@media (max-width: 480px) {
  .ct-fund-notice { flex-wrap: wrap; }
  .ct-fund-notice .btn { width: 100%; }
}

/* ---- Charts: open trades list (follows the live market, close any time) ---- */
.ct-positions { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.ct-positions-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ct-positions-head h4 { margin: 0; font-size: 14px; font-weight: 800; }
.ct-positions-count {
  min-width: 20px; padding: 1px 7px; border-radius: 999px; text-align: center;
  font-size: 11px; font-weight: 800; background: var(--surface-2); color: var(--text-muted);
}
.ct-positions-list { display: flex; flex-direction: column; gap: 8px; }
.ct-positions-empty { font-size: 12.5px; line-height: 1.5; color: var(--text-muted); }
.ct-position {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .03); border: 1px solid rgba(255, 255, 255, .08);
}
.ct-position-main { min-width: 0; display: grid; grid-template-columns: auto auto; justify-content: start; align-items: center; column-gap: 8px; row-gap: 2px; }
.ct-position-main strong { font-size: 13.5px; }
.ct-position-main small { grid-column: 1 / -1; font-size: 11.5px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-position-side { font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 6px; }
.ct-position-side.is-buy { color: var(--green); background: rgba(61, 184, 138, .14); }
.ct-position-side.is-sell { color: var(--red); background: rgba(224, 106, 106, .14); }
.ct-position-pnl { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ct-position-pnl.is-up { color: var(--green); }
.ct-position-pnl.is-down { color: var(--red); }
.ct-position-close { white-space: nowrap; }
@media (max-width: 480px) {
  .ct-position { grid-template-columns: minmax(0, 1fr) auto; }
  .ct-position-close { grid-column: 1 / -1; width: 100%; }
}


/* ==========================================================================
   Trade Detail modal - redesigned layout
   Desktop/tablet: centered dialog. Phones (<= 640px): bottom sheet with a
   big net-result figure, an entry -> exit card and a roomy chart.
   ========================================================================== */
.trade-detail-grabber { display: none; }
.trade-detail-done { display: none; }

.trade-detail-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  margin: 0 0 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid rgba(255, 255, 255, .08);
}
.trade-detail-hero-k {
  flex-basis: 100%;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-faint);
}
.trade-detail-hero .trade-detail-pnl {
  font-size: 32px;
  line-height: 1.1;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: -.5px;
}
.trade-detail-result-pill {
  margin-left: auto;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
}
.trade-detail-result-pill.is-up { background: rgba(61, 184, 138, .15); color: var(--green); }
.trade-detail-result-pill.is-down { background: rgba(224, 106, 106, .15); color: #E06A6A; }
.trade-detail-stat-arrow { display: none; }

/* Entry / Exit / Move: three tidy rows on desktop */
.trade-detail-modal-card .trade-detail-stats {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 4px 16px;
}
.trade-detail-modal-card .trade-detail-stat {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}
.trade-detail-modal-card .trade-detail-stat + .trade-detail-stat {
  border-top: 1px solid rgba(255, 255, 255, .08);
}

@media (max-width: 640px) {
  .trade-modal.trade-detail-modal {
    padding: 0;
    align-items: end;
    place-items: end stretch;
  }
  .trade-detail-modal-card {
    width: 100%;
    height: auto;
    max-height: 92dvh;
    border-radius: 22px 22px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 8px 18px calc(18px + env(safe-area-inset-bottom));
    animation: sv-trade-sheet-up .28s cubic-bezier(.2, .8, .2, 1);
  }
  @keyframes sv-trade-sheet-up {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
  }
  .trade-detail-grabber {
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .22);
    margin: 4px auto 14px;
  }
  .trade-detail-modal-card .trade-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    float: none;
    width: 36px;
    height: 36px;
  }
  .trade-detail-header { margin: 0 0 14px; padding-right: 44px; align-items: center; }
  .hot-market-coin.trade-detail-logo { width: 48px; height: 48px; }
  .trade-detail-heading h3 { font-size: 20px; margin-bottom: 6px; }
  .trade-detail-hero { padding: 16px; }
  .trade-detail-hero .trade-detail-pnl { font-size: 36px; }

  /* Entry -> Exit side by side with an arrow, Price move underneath */
  .trade-detail-modal-card .trade-detail-stats {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    column-gap: 10px;
    row-gap: 0;
    padding: 14px 16px 0;
  }
  .trade-detail-modal-card .trade-detail-stat {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px;
    padding: 0 0 14px;
    min-width: 0;
  }
  .trade-detail-modal-card .trade-detail-stat + .trade-detail-stat { border-top: none; }
  .trade-detail-modal-card .trade-detail-stat .v { font-size: 17px; overflow-wrap: anywhere; }
  .trade-detail-stat-arrow {
    display: block;
    color: var(--text-faint);
    font-size: 18px;
    padding-bottom: 14px;
  }
  .trade-detail-modal-card .trade-detail-stat-move {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
  }
  .trade-detail-modal-card .trade-detail-stat-move + .trade-detail-stat-move { border-top: 1px solid rgba(255, 255, 255, .08); }

  .trade-detail-modal-card .trade-detail-chart { padding: 28px 12px 8px; margin-bottom: 14px; }
  .trade-detail-chart-svg { height: 120px; }
  .trade-detail-tags { margin-bottom: 14px; }
  .trade-detail-done { display: block; width: 100%; min-height: 48px; border-radius: 14px; font-weight: 800; }
}

/* A global img { display:block } reset was beating the [hidden] attribute, leaving a blank white circle over the pair's initial. */
.hot-market-coin-img[hidden] { display: none; }
/* Keep the price tags inside the chart card on narrow screens */
.trade-detail-chart-price-tag-exit { transform: translate(-85%, -135%); }
.trade-detail-chart-price-tag-entry { transform: translate(-15%, -135%); }
@keyframes sv-trade-tag-in {
  from { opacity: 0; margin-top: 6px; }
  to   { opacity: 1; margin-top: 0; }
}
