.charts {
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-select: none;
    left: 0;
    user-select: none;
    width: 100%;
}
.charts {
    height: 100%;
    position: absolute;
    top: 0;
}

.layout-container {
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
    height: 100%;
}
.layout-container {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
}

.layout-container .chart-item {
    -webkit-box-flex: 1;
    -webkit-flex: 1 1 100%;
    flex: 1 1 100%;
    height: 100%;
    position: relative;
}

.charts.single .chart {
    height: 100%;
    width: 100%;
}
.charts .chart {
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-user-select: none;
    cursor: default;
    display: block;
    position: absolute;
    user-select: none;
}

.charts .chart .chart-container {
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
}

.drop-down-modal-wrap {
    background: transparent;
    bottom: 0;
    content: "";
    cursor: default;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 11;
}

.chart,
.chart-container {
    width: 100%;
    height: 100%;
}

.input-control__hint p {
    margin-top: 0;
}

.overlay {
    opacity: 0.3;
}

/* Sleek Chart blink effect when toggling between Live & Demo */
@keyframes chartBlinkEffect {
  0% {
    opacity: 1;
    filter: brightness(1) blur(0px);
  }
  35% {
    opacity: 0.25;
    filter: brightness(1.4) blur(1.5px);
  }
  100% {
    opacity: 1;
    filter: brightness(1) blur(0px);
  }
}

.chart-blink-active {
  animation: chartBlinkEffect 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes chartSpinnerSpin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   WALLET PAGE REDESIGN STYLES — Gain EX Theme Compatible
   ============================================================ */

/* ── Available Balances Card Left-Alignment and Layout ── */
.wallet-balance-card {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  padding: 24px 28px !important;
  min-height: 110px !important;
}

.wallet-balance-banner-left {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
}

.wallet-balance-sub {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 12px !important;
  font-size: 13px !important;
  color: var(--text-secondary) !important;
}

.wallet-balance-divider {
  width: 1px !important;
  height: 14px !important;
  background-color: var(--border-color) !important;
  display: inline-block !important;
  flex-shrink: 0 !important;
}

.wallet-balance-icon-wrap {
  position: absolute !important;
  right: 28px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 60px !important;
  height: 60px !important;
  background-color: var(--primary-light) !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: var(--primary) !important;
  flex-shrink: 0 !important;
}

/* ── Form Steps and Vertical Spacing ── */
.wallet-form-layout {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.wallet-step-group {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
}

.wallet-step-label {
  font-weight: 700 !important;
  font-size: 14px !important;
  color: var(--text-primary) !important;
  margin-bottom: 2px !important;
  display: block !important;
}

/* ── Mode Selection Buttons (Dark/Light Responsive) ── */
.wallet-mode-row {
  display: flex !important;
  gap: 14px !important;
  width: 100% !important;
}

.wallet-mode-btn {
  flex: 1 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 12px 18px !important;
  border-radius: var(--radius-sm) !important;
  background-color: rgba(255, 255, 255, 0.03) !important;
  border: 1.5px solid var(--border-color) !important;
  color: var(--text-secondary) !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  transition: var(--transition) !important;
  font-family: var(--font-family) !important;
  outline: none !important;
}

/* Dark active mode */
.wallet-mode-btn.wallet-mode-btn--active {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  background-color: var(--primary-light) !important;
}

/* Light theme button background overrides */
body.light-theme .wallet-mode-btn {
  background-color: rgba(0, 0, 0, 0.02) !important;
  border: 1.5px solid rgba(0, 0, 0, 0.08) !important;
  color: #64748b !important;
}

body.light-theme .wallet-mode-btn.wallet-mode-btn--active {
  background-color: rgba(26, 183, 109, 0.06) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}

.wallet-mode-btn:hover:not(.wallet-mode-btn--active) {
  border-color: rgba(255, 255, 255, 0.22) !important;
  color: var(--text-primary) !important;
}

body.light-theme .wallet-mode-btn:hover:not(.wallet-mode-btn--active) {
  border-color: rgba(0, 0, 0, 0.18) !important;
  color: #0f172a !important;
}

/* Radio buttons nested inside mode buttons */
.wallet-mode-radio {
  width: 17px !important;
  height: 17px !important;
  border-radius: 50% !important;
  border: 2px solid var(--text-muted) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  transition: var(--transition) !important;
}

.wallet-mode-radio--active {
  border-color: var(--primary) !important;
}

body.light-theme .wallet-mode-radio {
  border-color: #cbd5e1 !important;
}

body.light-theme .wallet-mode-radio--active {
  border-color: var(--primary) !important;
}

.wallet-mode-radio-dot {
  width: 7px !important;
  height: 7px !important;
  border-radius: 50% !important;
  background-color: transparent !important;
  transition: background-color 0.2s !important;
}

.wallet-mode-radio--active .wallet-mode-radio-dot {
  background-color: var(--primary) !important;
}

/* ── Amount Input Suffix ── */
.wallet-amount-input-wrap {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  width: 100% !important;
}

.wallet-amount-input {
  width: 100% !important;
  padding-right: 56px !important;
}

.wallet-amount-suffix {
  position: absolute !important;
  right: 16px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  color: var(--text-secondary) !important;
  pointer-events: none !important;
  user-select: none !important;
}

/* ── Info Hint Box ── */
.wallet-info-hint {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  background-color: var(--primary-light) !important;
  border: 1px solid rgba(26, 183, 109, 0.18) !important;
  border-radius: var(--radius-sm) !important;
  padding: 13px 15px !important;
  font-size: 13px !important;
  color: var(--text-secondary) !important;
  line-height: 1.5 !important;
}

body.light-theme .wallet-info-hint {
  background-color: rgba(26, 183, 109, 0.05) !important;
  border-color: rgba(26, 183, 109, 0.15) !important;
  color: #334155 !important;
}

.wallet-info-hint svg {
  flex-shrink: 0 !important;
  margin-top: 1px !important;
  color: var(--primary) !important;
}

/* Hide broken QR Code box on initial invoice render */
#invoice-qr-code[src=""] {
  display: none !important;
}

/* ── Cancel Button Overrides ── */
.wallet-cancel-btn {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  transition: var(--transition) !important;
}

.wallet-cancel-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}

body.light-theme .wallet-cancel-btn {
  background: #f1f5f9 !important;
  color: #475569 !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

body.light-theme .wallet-cancel-btn:hover {
  background: #e2e8f0 !important;
  color: #1e293b !important;
}

/* ── Centered and Constrained Profile Tabs on Desktop ── */
@media (min-width: 768px) {
  .profile-main-tabs {
    justify-content: center !important;
  }
  
  .profile-tab-pill {
    flex: none !important;
    width: auto !important;
    min-width: 140px !important;
    max-width: 180px !important;
  }
}

/* ── Google Sign-in SDK Centering overrides ── */
#google-signin-btn-login iframe,
#google-signin-btn-signup iframe {
  margin: 0 auto !important;
  display: block !important;
}

/* ── Prevent Mobile Double-Tap Zoom ── */
html, body {
  touch-action: pan-x pan-y !important;
}

/* ── Notifications Dropdown Popup ── */
.notifications-dropdown {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.notifications-dropdown::-webkit-scrollbar {
  width: 4px;
}
.notifications-dropdown::-webkit-scrollbar-track {
  background: transparent;
}
.notifications-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
}
.notification-history-item {
  transition: background-color 0.2s ease;
  cursor: default;
  margin: 0 !important;
  border-radius: 0 !important;
  border-bottom: 1px solid rgba(255,255,255,0.03) !important;
  background: transparent !important;
}
.notification-history-item:hover {
  background: rgba(255, 255, 255, 0.02) !important;
}

/* Light theme overrides for dropdown */
body.light-theme .notifications-dropdown {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1) !important;
}
body.light-theme .notifications-dropdown > div {
  background: #ffffff !important;
  border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}
body.light-theme .notifications-dropdown span {
  color: #0f172a !important;
}
body.light-theme .notifications-dropdown-list div {
  color: #64748b !important;
}
body.light-theme .notification-history-item {
  border-bottom-color: rgba(0, 0, 0, 0.04) !important;
}
body.light-theme .notification-history-item:hover {
  background: rgba(0, 0, 0, 0.02) !important;
}

/* ── Center and Constrain Logout Button on Desktop ── */
@media (min-width: 768px) {
  .settings-logout-btn {
    width: 200px !important;
    margin: 16px auto 24px auto !important;
    display: flex !important;
  }
}

@keyframes otp-digit-pop {
  0% { transform: scale(1); box-shadow: none; }
  50% { transform: scale(1.15); border-color: var(--primary) !important; box-shadow: 0 0 14px rgba(26, 183, 109, 0.3); text-shadow: 0 0 6px rgba(26, 183, 109, 0.5); }
  100% { transform: scale(1); box-shadow: none; }
}

/* ── Modals Theme Adaptability and Contrast Fixes ── */
#email-change-modal, 
#password-change-modal {
  color: var(--text-primary) !important;
}
#email-change-modal h3, 
#password-change-modal h3 {
  color: var(--text-primary) !important;
  font-weight: 700 !important;
}
#email-change-modal p, 
#password-change-modal p {
  color: var(--text-secondary) !important;
}
#email-change-modal .form-label, 
#password-change-modal .form-label {
  color: var(--text-muted) !important;
}

/* ── Forgot Password Modal Explicit Dark Styling (Auth Screen Isolation) ── */
#forgot-password-modal > div {
  background: #111A13 !important;
  border: 1px solid #1F3323 !important;
}
#forgot-password-modal h3 {
  color: #D4EFD9 !important;
  font-weight: 700 !important;
}
#forgot-password-modal p, 
#forgot-password-modal p.text-secondary,
#forgot-password-modal .text-secondary {
  color: #8AADA0 !important; /* clear readable gray-green secondary text */
}
#forgot-password-modal .form-label {
  color: #8AADA0 !important;
}

/* ── OTP Field Styling ── */
.otp-field {
  background: rgba(255, 255, 255, 0.04) !important;
  border: 1.5px solid var(--border-color, rgba(255, 255, 255, 0.15)) !important;
  color: var(--text-primary, #ffffff) !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}
body.light-theme .otp-field {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #0c1a0f !important;
}
.otp-field:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 10px rgba(26, 183, 109, 0.25) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  transform: translateY(-2px);
  color: var(--text-primary, #ffffff) !important;
}
body.light-theme .otp-field:focus {
  background: #ffffff !important;
  color: #0c1a0f !important;
}
.otp-field.has-value {
  animation: otp-digit-pop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: rgba(26, 183, 109, 0.1) !important;
  border-color: var(--primary) !important;
  color: var(--primary) !important;
}
body.light-theme .otp-field.has-value {
  background: rgba(26, 183, 109, 0.06) !important;
  color: #1a7a4a !important;
}

/* Force dark style on Forgot Password inputs & OTP fields regardless of body theme */
#forgot-password-modal .form-control {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
}
#forgot-password-modal .form-control::placeholder {
  color: rgba(255, 255, 255, 0.3) !important;
}
#forgot-password-modal .otp-field {
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.15) !important;
  color: #ffffff !important;
}
#forgot-password-modal .otp-field:focus {
  border-color: #22c55e !important;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.25) !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}
#forgot-password-modal .otp-field.has-value {
  background: rgba(34, 197, 94, 0.1) !important;
  border-color: #22c55e !important;
  color: #22c55e !important;
}

@keyframes success-wave {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.05); border-color: #22c55e; box-shadow: 0 4px 14px rgba(34, 197, 94, 0.45); }
}
.otp-inputs-wrapper.otp-complete .otp-field {
  border-color: #22c55e !important;
  background: rgba(34, 197, 94, 0.08) !important;
  color: #22c55e !important;
}
body.light-theme .otp-inputs-wrapper.otp-complete .otp-field {
  background: rgba(34, 197, 94, 0.04) !important;
}
.otp-inputs-wrapper.otp-complete .otp-field:nth-child(1) { animation: success-wave 0.45s ease 0s; }
.otp-inputs-wrapper.otp-complete .otp-field:nth-child(2) { animation: success-wave 0.45s ease 0.05s; }
.otp-inputs-wrapper.otp-complete .otp-field:nth-child(3) { animation: success-wave 0.45s ease 0.1s; }
.otp-inputs-wrapper.otp-complete .otp-field:nth-child(4) { animation: success-wave 0.45s ease 0.15s; }
.otp-inputs-wrapper.otp-complete .otp-field:nth-child(5) { animation: success-wave 0.45s ease 0.2s; }
.otp-inputs-wrapper.otp-complete .otp-field:nth-child(6) { animation: success-wave 0.45s ease 0.25s; }

@keyframes tick-pop-spin {
  0% { transform: scale(0.3) rotate(-45deg); opacity: 0; }
  70% { transform: scale(1.25) rotate(10deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.otp-success-badge {
  display: none;
  align-items: center;
  justify-content: center;
  margin: 12px auto 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #22c55e;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  transform: scale(0.5);
  box-shadow: 0 4px 10px rgba(34, 197, 94, 0.3);
}
.otp-inputs-wrapper.otp-complete + .otp-success-badge {
  display: flex;
  animation: tick-pop-spin 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ── Leaderboard Enhancements ── */
.leaderboard-trader-name {
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  max-width: 140px !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  vertical-align: middle !important;
}
.profile-streak-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  padding: 2px 5px !important;
  border-radius: 5px !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  height: 14px !important;
  vertical-align: middle !important;
  line-height: 1 !important;
}
.user-rank-banner {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
.user-rank-banner:hover {
  transform: translateY(-1px) !important;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2) !important;
}
body.light-theme .user-rank-banner {
  background: rgba(26, 183, 109, 0.05) !important;
  border-color: rgba(26, 183, 109, 0.25) !important;
}

/* Restrict padding and disable horizontal scrolling on desktop slide-out drawer */
.desktop-leaderboard-drawer .drawer-content {
  padding: 12px 8px !important;
  overflow-x: hidden !important;
}
.desktop-leaderboard-drawer .leaderboard-trader-name {
  max-width: 90px !important; /* truncate trader name dynamically in drawer view */
}

/* Responsive constraints on mobile viewports to prevent horizontal overflow */
@media (max-width: 767px) {
  .leaderboard-trader-name {
    max-width: 90px !important;
  }
}