/* ==============================================================================
   CRYPTO MARKET INTELLIGENCE TERMINAL - GLASSMORPHIC STYLING SYSTEM
   ============================================================================== */

:root {
  --bg-dark: #0a0e17;
  --bg-card: rgba(18, 24, 38, 0.94);
  --bg-card-hover: rgba(26, 34, 52, 0.96);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 240, 255, 0.5);

  --text-main: #f0f4fc;
  --text-muted: #8a99b5;
  --text-dim: #54627a;

  --accent-cyan: #00f0ff;
  --accent-green: #00e676;
  --accent-red: #ff1744;
  --accent-purple: #7c4dff;
  --accent-amber: #ffab00;

  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --glass-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.28);
  --glass-blur: none;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(0, 240, 255, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(124, 77, 255, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app-authenticated-view {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Glassmorphism Panel - Optimized for High-Performance Rendering without GPU Layer Explosions */
.glass-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--glass-shadow);
  box-sizing: border-box;
}

/* Restrict hardware-accelerated backdrop blur ONLY to actual floating overlays */
.modal-card,
.coin-drawer,
.app-header,
.ui-toast,
.modal-backdrop {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Optimize browser memory and compositor layout for heavy card lists */
.table-card,
.watchlist-grid,
.rule-card {
  contain: content;
}

/* App Shell Layout (Sidebar + Main Content) */
.app-layout {
  display: flex;
  min-height: calc(100vh - 65px);
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  position: relative;
}

/* Sidebar Navigation */
.app-sidebar {
  width: 250px;
  min-width: 250px;
  flex: 0 0 250px;
  background: rgba(10, 14, 23, 0.95);
  border-right: 1px solid var(--border-color);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), min-width 0.22s ease, max-width 0.22s ease, padding 0.22s ease;
  overflow: hidden;
}

.sidebar-nav-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-right: 2px;
}

.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-heading {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 6px 12px;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.sidebar-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
}

.sidebar-tab-icon {
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
}

.sidebar-tab-text {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-tab.active {
  color: #fff;
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.3);
}

.sidebar-badge {
  margin-left: auto;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
}

/* Sidebar Footer & Collapse Action */
.sidebar-footer {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.sidebar-collapse-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.78rem;
  font-family: var(--font-sans);
  font-weight: 500;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
}

.sidebar-collapse-btn:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.collapse-icon {
  font-size: 0.75rem;
  transition: transform 0.25s ease;
}

/* Collapsed Desktop State (§Fold / Expand) */
.app-sidebar.collapsed {
  width: 68px !important;
  min-width: 68px !important;
  max-width: 68px !important;
  flex: 0 0 68px !important;
  padding: 16px 8px !important;
}

.app-layout.sidebar-collapsed .app-main {
  width: calc(100% - 68px) !important;
  max-width: calc(100% - 68px) !important;
}

.app-sidebar.collapsed .sidebar-tab-text,
.app-sidebar.collapsed .sidebar-badge,
.app-sidebar.collapsed .collapse-text {
  display: none !important;
}

.app-sidebar.collapsed .sidebar-heading {
  font-size: 0 !important;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 6px 4px;
  padding: 0 !important;
  border: none;
}

.app-sidebar.collapsed .sidebar-tab {
  justify-content: center !important;
  padding: 10px 0 !important;
  position: relative;
}

.app-sidebar.collapsed .sidebar-tab-icon {
  font-size: 1.25rem !important;
  min-width: unset;
}

.app-sidebar.collapsed .collapse-icon {
  transform: rotate(180deg);
}

/* Tooltip on Hover for Collapsed Navigation */
.app-sidebar.collapsed .sidebar-tab:hover::after {
  content: attr(title);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: rgba(10, 14, 23, 0.98);
  border: 1px solid var(--accent-cyan);
  color: #fff;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 1090;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.75);
  pointer-events: none;
}

/* Heartbeat Status Bar */
.scanner-heartbeat-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.heartbeat-stat {
  display: flex;
  align-items: center;
  gap: 8px;
}


.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(10, 14, 23, 0.8);
  backdrop-filter: var(--glass-blur);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-pulse {
  width: 10px;
  height: 10px;
  background-color: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 12px var(--accent-cyan);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.logo-title {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #fff, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.version-tag {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  font-family: var(--font-mono);
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-tab:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  color: #fff;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.feed-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: rgba(0, 230, 118, 0.1);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid rgba(0, 230, 118, 0.25);
  color: var(--accent-green);
}

.live-dot {
  width: 6px;
  height: 6px;
  background-color: var(--accent-green);
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

#auth-controls, .user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-primary-outline, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
  user-select: none;
  line-height: 1.2;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #00a8ff);
  color: #050b14;
  padding: 8px 16px;
  border: none;
}

.btn-primary:hover {
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.45);
  transform: translateY(-1px);
}

.btn-primary:active, .btn-secondary:active, .btn-primary-outline:active {
  transform: translateY(0);
}

.btn-primary-outline {
  background: transparent;
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.45);
  padding: 7px 14px;
}

.btn-primary-outline:hover {
  background: rgba(0, 240, 255, 0.12);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 7px 14px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 10px;
}

.btn-ghost:hover {
  color: var(--accent-red);
  background: rgba(255, 68, 68, 0.08);
}

.full-width {
  width: 100%;
}

/* Filter Pills & Interactive Selectors */
.filter-pills {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.pill {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  user-select: none;
  white-space: nowrap;
}

.pill:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.pill:active {
  transform: translateY(0);
}

.pill.active {
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent-cyan);
  border-color: rgba(0, 240, 255, 0.5);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
  font-weight: 600;
}

.signal-filter-pill[data-filter="BULLISH"].active {
  background: rgba(0, 230, 118, 0.16);
  color: var(--accent-green);
  border-color: rgba(0, 230, 118, 0.6);
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.25);
}

.signal-filter-pill[data-filter="BEARISH"].active {
  background: rgba(255, 23, 68, 0.16);
  color: var(--accent-red);
  border-color: rgba(255, 23, 68, 0.6);
  box-shadow: 0 0 12px rgba(255, 23, 68, 0.25);
}

.signal-risk-pill[data-risk="low"].active {
  background: rgba(0, 230, 118, 0.16);
  color: var(--accent-green);
  border-color: rgba(0, 230, 118, 0.6);
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.25);
}

.signal-risk-pill[data-risk="medium"].active {
  background: rgba(255, 171, 0, 0.16);
  color: var(--accent-amber);
  border-color: rgba(255, 171, 0, 0.6);
  box-shadow: 0 0 12px rgba(255, 171, 0, 0.25);
}

.signal-risk-pill[data-risk="high"].active {
  background: rgba(255, 23, 68, 0.16);
  color: var(--accent-red);
  border-color: rgba(255, 23, 68, 0.6);
  box-shadow: 0 0 12px rgba(255, 23, 68, 0.25);
}

/* Metric Score Breakdown & Tooltips */
.score-cell-container {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.score-inspect-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: transform 0.15s ease;
}

.score-inspect-btn:hover {
  transform: scale(1.04);
}

.score-mini-breakdown {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-family: var(--font-mono);
  white-space: nowrap;
}

.score-calculation-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 12px;
}

/* Action Badges for Buy/Sell Signals based on Score */
.action-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  white-space: nowrap;
}

.action-badge.action-buy {
  background: rgba(0, 230, 118, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 230, 118, 0.4);
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.2);
}

.action-badge.action-sell {
  background: rgba(255, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(255, 68, 68, 0.4);
  box-shadow: 0 0 8px rgba(255, 68, 68, 0.2);
}

.action-badge.action-neutral {
  background: rgba(255, 179, 0, 0.12);
  color: var(--accent-amber);
  border: 1px solid rgba(255, 179, 0, 0.35);
}

/* Tooltips & Info Triggers */
.stat-info-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
  line-height: 1;
  margin-left: 5px;
  vertical-align: middle;
}

.stat-info-trigger:hover {
  background: var(--accent-cyan);
  color: #050b14;
}

.stat-info-trigger .tooltip-box {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  width: 250px;
  background: #0d1424;
  border: 1px solid rgba(0, 240, 255, 0.3);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.8);
  color: var(--text-main);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1.4;
  text-transform: none;
  pointer-events: none;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  z-index: 1000;
  text-align: left;
}

.stat-info-trigger .tooltip-box strong {
  color: var(--accent-cyan);
  display: block;
  margin-bottom: 3px;
}

.stat-info-trigger:hover .tooltip-box {
  visibility: visible;
  opacity: 1;
}

/* Auth Lockscreen */
.auth-lockscreen {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, rgba(0, 240, 255, 0.08) 0%, rgba(10, 14, 23, 0.98) 70%);
  padding: 24px;
  position: relative;
  z-index: 999;
}

.auth-lockscreen-card {
  max-width: 480px;
  width: 100%;
  background: rgba(13, 20, 36, 0.92);
  border: 1px solid rgba(0, 240, 255, 0.25);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 30px rgba(0, 240, 255, 0.12);
  border-radius: 16px;
  padding: 36px 32px;
  backdrop-filter: blur(20px);
}

/* Main */
.app-main {
  flex: 1 1 auto;
  min-width: 0;
  width: calc(100% - 250px);
  max-width: calc(100% - 250px);
  padding: 24px 28px;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Ticker Marquee */
.ticker-marquee {
  overflow: hidden;
  white-space: nowrap;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 16px;
  margin-bottom: 24px;
}

.marquee-track {
  display: inline-flex;
  gap: 30px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.ticker-item .sym { color: var(--text-muted); margin-right: 6px; }
.ticker-item .val { font-weight: 600; margin-right: 6px; }
.ticker-item .up { color: var(--accent-green); }
.ticker-item .down { color: var(--accent-red); }
.ticker-item .neutral { color: var(--text-dim); }

/* Tab Content */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.section-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 14px;
}

.section-toolbar h2 {
  font-size: 1.4rem;
  font-weight: 600;
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.search-input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  min-width: 280px;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

/* Table */
.table-card {
  overflow-x: auto;
}

/* Enhanced Table Box & Container */
.table-card {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: rgba(10, 14, 23, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  margin-bottom: 24px;
  position: relative;
}

.table-card::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}
.table-card::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.35);
  border-radius: 4px;
}
.table-card::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.25);
  border-radius: 4px;
}
.table-card::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.5);
}

.data-table {
  width: 100%;
  min-width: 1020px;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
}

#overview-alpha-table {
  min-width: 780px;
}

.drawer-metrics-table {
  width: 100% !important;
  min-width: 0 !important;
  border-collapse: collapse;
}

.drawer-metrics-table td {
  padding: 8px 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.85rem;
}

.rules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

.drawer-analysis-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
  width: 100%;
  box-sizing: border-box;
}

.drawer-quant-card {
  border: 1px solid rgba(0, 229, 255, 0.25);
  background: linear-gradient(135deg, rgba(17, 24, 39, 0.75) 0%, rgba(13, 20, 36, 0.9) 100%);
}

.drawer-action-banner {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
}

.drawer-interval-banner {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
}

.drawer-formula-banner {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
}

.drawer-stat-mini-card {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
}

.row-cat-select {
  background: #0c101d;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--accent-cyan);
}

.data-table thead th {
  padding: 12px 16px;
  font-size: 0.74rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 2px solid rgba(0, 240, 255, 0.2);
  background: #0d121f;
  position: sticky;
  top: 0;
  z-index: 5;
  white-space: nowrap;
}

.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}

.sortable-th:hover {
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08) !important;
}

.sortable-th.sort-active {
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.12) !important;
  border-bottom: 2px solid var(--accent-cyan) !important;
}

.sort-icon {
  display: inline-block;
  margin-left: 4px;
  font-size: 0.75rem;
  opacity: 0.5;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.sortable-th:hover .sort-icon {
  opacity: 0.9;
}

.sortable-th.sort-active .sort-icon {
  opacity: 1;
  color: var(--accent-cyan);
  font-weight: 700;
}

/* Table Subtoolbar: Quick Sort & Limit */
.table-subtoolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 12px;
}

.quick-sort-container, .table-limit-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.subtoolbar-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.screener-quick-sort, .screener-limit-pill {
  font-size: 0.74rem;
  padding: 4px 10px;
}

.screener-quick-sort.active, .screener-limit-pill.active {
  background: rgba(0, 240, 255, 0.2) !important;
  color: var(--accent-cyan) !important;
  border-color: var(--accent-cyan) !important;
  font-weight: 600;
}

.data-table td {
  padding: 12px 16px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--font-mono);
}

.data-table tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* Score Pills */
.score-pill {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.75rem;
}

.score-high { background: rgba(0, 230, 118, 0.15); color: var(--accent-green); border: 1px solid rgba(0, 230, 118, 0.3); }
.score-mid { background: rgba(255, 171, 0, 0.15); color: var(--accent-amber); border: 1px solid rgba(255, 171, 0, 0.3); }
.score-low { background: rgba(255, 23, 68, 0.15); color: var(--accent-red); border: 1px solid rgba(255, 23, 68, 0.3); }

/* Integration Cards */
.integrations-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.integration-card {
  padding: 24px;
}

.integration-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.badge {
  font-size: 0.65rem;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.badge-free { background: rgba(0, 230, 118, 0.15); color: var(--accent-green); }

.card-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 18px;
  line-height: 1.4;
}

.integration-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.test-result {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  overflow-y: auto;
  box-sizing: border-box;
}

.modal-backdrop.hidden {
  display: none !important;
}

.modal-card {
  width: 100%;
  max-width: 580px;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 24px;
  border-radius: 16px;
  margin: auto;
  box-sizing: border-box;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.1);
  scrollbar-width: thin;
  scrollbar-color: var(--accent-cyan) rgba(255, 255, 255, 0.05);
}

.modal-card::-webkit-scrollbar,
.modal-body-scroll::-webkit-scrollbar {
  width: 6px;
}

.modal-card::-webkit-scrollbar-track,
.modal-body-scroll::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.modal-card::-webkit-scrollbar-thumb,
.modal-body-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.35);
  border-radius: 8px;
}

.modal-card::-webkit-scrollbar-thumb:hover,
.modal-body-scroll::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Scrollable Modern Modal Card with Pinned Header and Sticky Footer */
.modal-card-scrollable {
  max-height: min(92vh, 880px) !important;
  max-height: min(92dvh, 880px) !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
  padding: 0 !important;
}

.modal-card-scrollable .modal-header {
  padding: 18px 24px 14px;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
}

.modal-card-scrollable form {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
  min-height: 0;
  margin: 0;
}

.modal-card-scrollable .modal-body-scroll {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--accent-cyan) rgba(255, 255, 255, 0.05);
}

.modal-card-scrollable .modal-footer-sticky {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  align-items: center;
  padding: 14px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 17, 32, 0.95);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
  z-index: 10;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.btn-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 1.25rem;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.btn-close:hover {
  background: rgba(255, 68, 68, 0.18);
  color: #ff5252;
  border-color: rgba(255, 68, 68, 0.4);
  transform: scale(1.05);
}

.btn-close:active {
  transform: scale(0.95);
}

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

.form-group label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  font-family: var(--font-sans);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-cyan);
}

.tier-pill {
  font-size: 0.65rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-purple), #536dfe);
  padding: 3px 8px;
  border-radius: 4px;
}

.hidden {
  display: none !important;
}

/* Expansive Deep Dive Coin Analysis Terminal Modal */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1100;
  padding: 20px;
  transition: opacity 0.25s ease;
}

.drawer-panel {
  width: 95vw;
  max-width: 1380px;
  height: 94vh;
  max-height: 94vh;
  overflow-y: auto;
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 16px;
  padding: 28px 36px;
  background: rgba(8, 14, 26, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.92), 0 0 40px rgba(0, 240, 255, 0.08);
  animation: modalScaleIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  transition: all 0.25s ease;
}

.drawer-panel.fullscreen {
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  max-height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  padding: 24px 32px !important;
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.96) translateY(14px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

/* Interactive Table Row Hover */
.clickable-row {
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

.clickable-row:hover {
  background-color: rgba(0, 240, 255, 0.08) !important;
}

/* Phase 3: Screener Presets, Rules Grid & Instant Back-Preview */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.preset-card {
  padding: 18px;
  border-radius: 12px;
  background: rgba(14, 20, 32, 0.7);
  border: 1px solid var(--border-color);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.preset-card:hover {
  border-color: rgba(0, 240, 255, 0.4);
  background: rgba(20, 28, 48, 0.85);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.1);
}

.preset-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.preset-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.preset-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 14px;
  flex-grow: 1;
}

.preset-footer {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.expectancy-stat-box {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 14px;
  text-align: center;
}

.expectancy-stat-val {
  font-size: 1.35rem;
  font-weight: 700;
  font-family: var(--font-mono);
  display: block;
  margin-bottom: 4px;
}

.expectancy-stat-lbl {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Phase 4: Live WebSocket Alert Stream Cards */
.alert-stream-card {
  padding: 16px 20px;
  border-radius: 10px;
  background: rgba(14, 20, 32, 0.85);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-cyan);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.2s ease;
  animation: alertArrival 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.alert-stream-card:hover {
  background: rgba(20, 28, 48, 0.95);
  border-color: rgba(0, 240, 255, 0.4);
  transform: translateX(3px);
}

.alert-stream-card.category-price_change { border-left-color: var(--accent-green); }
.alert-stream-card.category-open_interest { border-left-color: var(--accent-amber); }
.alert-stream-card.category-funding_rate { border-left-color: var(--accent-purple); }
.alert-stream-card.category-liquidations { border-left-color: var(--accent-red); }
.alert-stream-card.category-turnover_change { border-left-color: #00bcd4; }
.alert-stream-card.category-compound_custom { border-left-color: #ff4081; }

@keyframes alertArrival {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.alert-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.alert-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
}

.alert-headline {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.4;
}

.alert-card-body {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.alert-expectancy-pill {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: rgba(0, 230, 118, 0.08);
  color: var(--accent-green);
  border: 1px solid rgba(0, 230, 118, 0.25);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ai-catalyst-tag {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(124, 77, 255, 0.12);
  color: #b388ff;
  border: 1px solid rgba(124, 77, 255, 0.3);
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-block;
}

/* Phase 4: Interactive Market Heatmap */
.heatmap-sector-block {
  background: rgba(10, 14, 24, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
}

.heatmap-sector-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

.heatmap-tiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.heatmap-tile {
  padding: 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 78px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.heatmap-tile:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  filter: brightness(1.15);
}

.heatmap-tile-sym {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
}

.heatmap-tile-price {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-mono);
}

.heatmap-tile-delta {
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

/* Phase 4: Leaderboards Grid */
.leaderboard-column {
  background: rgba(12, 18, 30, 0.7);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
}

.leaderboard-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.leaderboard-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.leaderboard-row:hover {
  background-color: rgba(0, 240, 255, 0.06);
}

/* Phase 5: Cross-Exchange Arbitrage Matrix & Microstructure */
.arb-badge-high {
  background: rgba(0, 230, 118, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 230, 118, 0.35);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.arb-badge-moderate {
  background: rgba(255, 179, 0, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(255, 179, 0, 0.35);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.arb-badge-low {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.dom-wall-bid {
  background: rgba(0, 230, 118, 0.12);
  color: #69f0ae;
  border: 1px solid rgba(0, 230, 118, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dom-wall-ask {
  background: rgba(255, 23, 68, 0.12);
  color: #ff5252;
  border: 1px solid rgba(255, 23, 68, 0.3);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Phase 5: Backtester Studio Elements */
.trade-pill-win {
  background: rgba(0, 230, 118, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 230, 118, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.trade-pill-loss {
  background: rgba(255, 23, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(255, 23, 68, 0.3);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.bt-chart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.bt-chart-grid line {
  stroke: rgba(255, 255, 255, 0.05);
  stroke-dasharray: 3 3;
}

.bt-chart-axis text {
  fill: var(--text-dim);
  font-size: 10px;
  font-family: var(--font-mono);
}

.bt-tooltip {
  position: absolute;
  padding: 6px 10px;
  background: rgba(5, 10, 20, 0.95);
  border: 1px solid var(--accent-cyan);
  border-radius: 6px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: #fff;
  pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.6);
  z-index: 10;
  transition: opacity 0.15s ease;
}

/* ==============================================================================
   RESPONSIVE AUTO-FIT ENGINE (DESKTOP / IPAD / TABLET / MOBILE)
   ============================================================================== */

.sidebar-toggle-btn {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1.25rem;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  user-select: none;
}

.sidebar-toggle-btn:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}

/* Screener Rule Cards Design System */
.rule-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 195px;
  padding: 16px 18px;
  border-radius: 10px;
  background: rgba(13, 20, 36, 0.75);
  border: 1px solid rgba(0, 240, 255, 0.18);
  box-sizing: border-box;
  transition: all 0.2s ease;
  position: relative;
}

.rule-card:hover {
  border-color: rgba(0, 240, 255, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

.rule-card.is-active {
  border-color: rgba(0, 230, 118, 0.5);
  background: linear-gradient(180deg, rgba(0, 230, 118, 0.05) 0%, rgba(13, 20, 36, 0.85) 100%);
  box-shadow: 0 4px 18px rgba(0, 230, 118, 0.12);
}

.rule-card.is-paused {
  border-color: rgba(255, 171, 0, 0.5);
  background: linear-gradient(180deg, rgba(255, 171, 0, 0.05) 0%, rgba(13, 20, 36, 0.85) 100%);
}

.rule-card.is-disabled {
  border-color: rgba(255, 255, 255, 0.08);
  opacity: 0.88;
}

.rule-badge-active {
  background: rgba(0, 230, 118, 0.18);
  border: 1px solid #00e676;
  color: #00e676;
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 0 10px rgba(0, 230, 118, 0.25);
  white-space: nowrap;
}

.rule-badge-paused {
  background: rgba(255, 171, 0, 0.18);
  border: 1px solid #ffab00;
  color: #ffab00;
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.rule-badge-disabled {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-dim);
  font-size: 0.68rem;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.rule-criteria-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px 0;
  min-height: 28px;
}

.rule-criterion-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.71rem;
  font-family: var(--font-mono);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.2);
  color: var(--text-main);
  white-space: normal;
  word-break: break-word;
  max-width: 100%;
}

.rule-desc-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 6px;
  padding: 7px 10px;
  margin: 6px 0 10px 0;
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.45;
  word-break: break-word;
}

/* Action button states for rules */
.btn-action-start.active-state {
  background: #00e676 !important;
  color: #04101e !important;
  border-color: #00e676 !important;
  font-weight: 700 !important;
  box-shadow: 0 0 12px rgba(0, 230, 118, 0.6) !important;
}

.btn-action-pause.active-state {
  background: #ffab00 !important;
  color: #04101e !important;
  border-color: #ffab00 !important;
  font-weight: 700 !important;
  box-shadow: 0 0 12px rgba(255, 171, 0, 0.6) !important;
}

.btn-action-disable.active-state {
  background: rgba(255, 82, 82, 0.22) !important;
  border-color: #ff5252 !important;
  color: #ff5252 !important;
  font-weight: 700 !important;
  box-shadow: 0 0 10px rgba(255, 82, 82, 0.3) !important;
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1040;
  transition: opacity 0.25s ease;
}

.sidebar-overlay.hidden {
  display: none;
}

/* Responsive Grid Auto-fit Defaults */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  width: 100%;
  box-sizing: border-box;
}

/* ==============================================================================
   COMPACT DESKTOP & LAPTOP ADAPTATION (<= 1400px)
   ============================================================================== */
@media (max-width: 1400px) {
  .app-main {
    padding: 20px 20px;
  }
  .scanner-heartbeat-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .rules-grid, #overview-screener-rules, #screener-rules-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* ==============================================================================
   TABLET & IPAD ADAPTATION (<= 1024px)
   ============================================================================== */
@media (max-width: 1024px) {
  .sidebar-toggle-btn {
    display: inline-flex !important;
    position: relative;
    z-index: 1001;
    touch-action: manipulation;
  }

  .mobile-sidebar-header {
    display: flex !important;
  }

  .app-sidebar {
    position: fixed !important;
    top: 0 !important;
    bottom: 0 !important;
    left: -320px !important;
    width: 280px !important;
    min-width: 280px !important;
    max-width: 85vw !important;
    z-index: 9999 !important;
    background: rgba(10, 14, 23, 0.98) !important;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.85);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    padding: 0 0 20px 0 !important;
    overflow-y: auto !important;
  }

  .app-sidebar.open {
    left: 0 !important;
  }

  .sidebar-overlay {
    z-index: 9998 !important;
  }

  .app-main {
    width: 100% !important;
    max-width: 100% !important;
    padding: 18px 14px;
  }

  .scanner-heartbeat-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    font-size: 0.75rem;
  }

  .drawer-panel {
    max-width: 95vw;
    width: 95vw;
    max-height: 92vh;
    padding: 24px 20px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px;
  }

  .rules-grid, #overview-screener-rules, #screener-rules-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  .table-subtoolbar {
    gap: 10px;
  }
}

/* ==============================================================================
   MOBILE & SMALL TABLET ADAPTATION (<= 768px)
   ============================================================================== */
@media (max-width: 768px) {
  .app-header {
    padding: 10px 14px;
  }

  .header-center {
    display: none !important;
  }

  .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
  }

  .header-right {
    gap: 8px;
  }

  .logo-title {
    font-size: 0.95rem;
    letter-spacing: 0.5px;
  }

  .feed-status {
    padding: 3px 6px;
    font-size: 0.68rem;
  }

  .feed-status .status-text {
    display: none;
  }

  .app-main {
    padding: 12px 8px;
    width: 100% !important;
    max-width: 100% !important;
  }

  .section-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .section-toolbar h2 {
    font-size: 1.15rem;
  }

  .toolbar-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .toolbar-actions input, 
  .toolbar-actions button, 
  .toolbar-actions a,
  .toolbar-actions .timeframe-selector {
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    justify-content: center;
  }

  .timeframe-selector {
    display: flex !important;
    justify-content: space-around;
    padding: 4px;
  }

  .filter-pills {
    overflow-x: auto;
    flex-wrap: nowrap;
    width: 100%;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .filter-pills::-webkit-scrollbar {
    display: none;
  }

  .pill {
    flex-shrink: 0;
    font-size: 0.74rem;
    padding: 5px 10px;
  }

  .table-subtoolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .quick-sort-container {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .quick-sort-container::-webkit-scrollbar {
    display: none;
  }

  .table-limit-container {
    width: 100%;
    justify-content: space-between;
  }

  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .rules-grid, #overview-screener-rules, #screener-rules-grid {
    grid-template-columns: 1fr !important;
  }

  .scanner-heartbeat-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px 14px;
  }

  .heartbeat-stat {
    justify-content: space-between;
  }

  .drawer-backdrop {
    padding: 0 !important;
  }

  .drawer-panel {
    max-width: 100vw !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    padding: 16px 12px !important;
    top: 0;
    left: 0;
  }

  .drawer-grid, .drawer-calc-grid, .drawer-derivatives-grid, .drawer-analysis-grid {
    grid-template-columns: 1fr !important;
    gap: 10px;
  }

  .glass-panel {
    padding: 16px 12px !important;
  }

  .modal-card {
    max-width: 96vw;
    width: 96vw;
    padding: 18px 14px;
    margin: 0 auto;
  }

  .modal-card-scrollable {
    max-width: 96vw !important;
    width: 96vw !important;
    max-height: 94dvh !important;
    max-height: 94vh !important;
    padding: 0 !important;
  }

  .modal-card-scrollable .modal-header {
    padding: 14px 16px 12px;
  }

  .modal-card-scrollable .modal-body-scroll {
    padding: 14px 16px;
  }

  .modal-card-scrollable .modal-footer-sticky {
    padding: 12px 16px;
  }

  .auth-lockscreen-card {
    max-width: 96vw;
    width: 96vw;
    padding: 22px 14px;
  }

  .data-table th, .data-table td {
    padding: 8px 10px;
    font-size: 0.76rem;
  }

  .ticker-marquee {
    padding: 6px 10px;
    margin-bottom: 14px;
  }

  #user-profile .user-email {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.75rem;
  }
}

/* ==============================================================================
   COMPACT PHONE ADAPTATION (<= 480px)
   ============================================================================== */
@media (max-width: 480px) {
  .modal-backdrop {
    padding: 8px !important;
  }

  .modal-card-scrollable {
    max-width: 100% !important;
    width: 100% !important;
    max-height: 96dvh !important;
    max-height: 96vh !important;
    border-radius: 12px !important;
  }

  .modal-card-scrollable .modal-header {
    padding: 12px 14px 10px;
  }

  .modal-card-scrollable .modal-body-scroll {
    padding: 12px 14px;
  }

  .modal-card-scrollable .modal-footer-sticky {
    padding: 10px 14px;
    gap: 8px;
  }

  .app-header {
    padding: 8px 10px;
  }

  .logo-title {
    font-size: 0.88rem;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-value {
    font-size: 1.25rem;
  }

  .stat-title {
    font-size: 0.75rem;
  }

  .btn-primary, .btn-secondary, .btn-primary-outline {
    font-size: 0.75rem;
    padding: 6px 12px;
  }
}

/* Screener Rule Status Badges & Action Controls */
.rule-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 6px;
  text-transform: uppercase;
}

.rule-status-badge.status-active {
  background: rgba(0, 230, 118, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 230, 118, 0.4);
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.2);
}

.rule-status-badge.status-paused {
  background: rgba(255, 171, 0, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(255, 171, 0, 0.4);
}

.rule-status-badge.status-disabled {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border: 1px solid var(--border-color);
}

.btn-rule-action {
  padding: 3px 9px;
  font-size: 0.72rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.btn-rule-action.active-state {
  border-color: var(--accent-cyan) !important;
  background: rgba(0, 240, 255, 0.18) !important;
  color: #fff !important;
  font-weight: 700;
}

/* =========================================================
   Global Market Catalysts & High-Impact Wire (SPEC §4)
   ========================================================= */

.catalysts-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 992px) {
  .catalysts-layout-grid {
    grid-template-columns: 1fr;
  }
}

.catalysts-column {
  background: rgba(12, 18, 30, 0.75);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.catalysts-column-header {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.02);
}

.catalysts-items-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  max-height: 520px;
  overflow-y: auto;
}

/* Custom scrollbar for catalysts container */
.catalysts-items-container::-webkit-scrollbar {
  width: 6px;
}
.catalysts-items-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

/* Event Card */
.catalyst-event-card {
  background: rgba(18, 25, 40, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 14px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.catalyst-event-card:hover {
  border-color: rgba(0, 240, 255, 0.45);
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.09);
  transform: translateY(-1px);
}

.event-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.event-countdown-pill {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.event-countdown-pill.urgent {
  background: rgba(255, 23, 68, 0.18);
  border-color: rgba(255, 23, 68, 0.45);
  color: #ff5252;
}

.event-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f0f4fc;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.15s ease;
  display: inline-block;
}

.event-title:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.catalyst-redirect-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 4px;
  padding: 3px 8px;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.catalyst-redirect-link:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--accent-cyan);
  color: #ffffff;
  transform: translateY(-1px);
}

.event-schedule-timezones {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(8, 14, 26, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.schedule-tz-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.schedule-tz-badge .tz-label {
  font-weight: 700;
  color: var(--accent-cyan);
  font-size: 0.68rem;
  letter-spacing: 0.5px;
}

.schedule-tz-badge.edt .tz-label {
  color: #ffb300;
}

.schedule-tz-badge .tz-val {
  color: #f1f5f9;
  font-weight: 600;
}

.event-schedule-timezones .tz-sep {
  color: rgba(255, 255, 255, 0.2);
  font-size: 0.7rem;
}

.event-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.74rem;
  font-family: var(--font-mono);
}

.event-metric-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.event-metric-label {
  color: var(--text-dim);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.event-metric-val {
  color: var(--text-main);
  font-weight: 600;
}

.event-implication {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
  border-left: 2px solid var(--accent-cyan);
  padding-left: 8px;
}

.event-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 2px;
}

/* News Card */
.catalyst-news-card {
  background: rgba(18, 25, 40, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 14px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.catalyst-news-card:hover {
  border-color: rgba(0, 230, 118, 0.45);
  box-shadow: 0 6px 20px rgba(0, 230, 118, 0.09);
  transform: translateY(-1px);
}

.news-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.news-headline {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f0f4fc;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.15s ease;
}

.news-headline:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.news-summary {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.news-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.impact-meter-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.impact-meter-bar {
  width: 50px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.impact-meter-fill {
  height: 100%;
  border-radius: 3px;
}

/* Severity & Sentiment Tags */
.catalyst-badge {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.catalyst-badge.sev-critical {
  background: rgba(255, 23, 68, 0.18);
  color: #ff1744;
  border: 1px solid rgba(255, 23, 68, 0.45);
}

.catalyst-badge.sev-high {
  background: rgba(255, 145, 0, 0.18);
  color: #ff9100;
  border: 1px solid rgba(255, 145, 0, 0.45);
}

.catalyst-badge.sev-medium {
  background: rgba(0, 240, 255, 0.15);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.35);
}

.catalyst-badge.bias-bullish {
  background: rgba(0, 230, 118, 0.15);
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.35);
}

.catalyst-badge.bias-bearish {
  background: rgba(255, 23, 68, 0.15);
  color: #ff5252;
  border: 1px solid rgba(255, 23, 68, 0.35);
}

.catalyst-badge.bias-volatility {
  background: rgba(255, 214, 0, 0.15);
  color: #ffd600;
  border: 1px solid rgba(255, 214, 0, 0.35);
}

/* Interactive Ticker Pills */
.catalyst-coin-tag {
  padding: 2px 7px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(0, 240, 255, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.25);
  cursor: pointer;
  transition: all 0.15s ease;
}

.catalyst-coin-tag:hover {
  background: rgba(0, 240, 255, 0.25);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

/* ==============================================================================
   WHALE & OPEN INTEREST RADAR (MULTI-TIMEFRAME 15m - 1h)
   ============================================================================== */

/* Flow Type Badges */
.flow-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.flow-badge-accumulation {
  background: rgba(0, 230, 118, 0.15);
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.35);
}

.flow-badge-dump {
  background: rgba(255, 23, 68, 0.15);
  color: #ff5252;
  border: 1px solid rgba(255, 23, 68, 0.35);
}

.flow-badge-derivatives {
  background: rgba(0, 229, 255, 0.15);
  color: #00e5ff;
  border: 1px solid rgba(0, 229, 255, 0.35);
}

/* Institutional Regime Pills */
.regime-pill {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.regime-long-acc {
  background: rgba(0, 230, 118, 0.15);
  color: #00e676;
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.regime-short-sqz {
  background: rgba(255, 171, 0, 0.18);
  color: #ffab00;
  border: 1px solid rgba(255, 171, 0, 0.35);
  box-shadow: 0 0 10px rgba(255, 171, 0, 0.2);
}

.regime-short-acc {
  background: rgba(255, 23, 68, 0.15);
  color: #ff5252;
  border: 1px solid rgba(255, 23, 68, 0.3);
}

.regime-long-liq {
  background: rgba(255, 82, 82, 0.2);
  color: #ff8a80;
  border: 1px solid rgba(255, 82, 82, 0.4);
}

.regime-neutral {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Whale Transaction Wire Card */
.whale-tx-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-radius: 10px;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  flex-wrap: wrap;
  gap: 12px;
}

.whale-tx-card:hover {
  background: rgba(24, 34, 53, 0.85);
  border-color: rgba(0, 240, 255, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.whale-tx-card.tx-accumulation {
  border-left: 4px solid #00e676;
}

.whale-tx-card.tx-dump {
  border-left: 4px solid #ff5252;
}

.whale-tx-card.tx-derivatives {
  border-left: 4px solid var(--accent-cyan);
}

.whale-tx-wallet-tag {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

/* CVD and Ratio Bars */
.cvd-bar-track {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: flex;
  margin-top: 4px;
}

.cvd-bar-fill-buy {
  background: var(--accent-green);
  height: 100%;
}

.cvd-bar-fill-sell {
  background: var(--accent-red);
  height: 100%;
}

/* =========================================================
   CUSTOM ALERT RULES & NOTIFICATION CENTER (Phase 5 SPEC)
   ========================================================= */

.alert-presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.preset-card {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 12px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.preset-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent-cyan);
  opacity: 0.8;
}

.preset-card.preset-amber::before { background: var(--accent-amber); }
.preset-card.preset-purple::before { background: #b388ff; }
.preset-card.preset-green::before { background: var(--accent-green); }
.preset-card.preset-red::before { background: var(--accent-red); }
.preset-card.preset-gold::before { background: #ffd700; }

.preset-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 240, 255, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.preset-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}

.preset-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.preset-metric-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.2);
  padding: 4px 8px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.preset-desc {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.45;
  margin-bottom: 12px;
}

.preset-rationale {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 14px;
  padding-left: 8px;
  border-left: 2px solid rgba(255, 255, 255, 0.15);
}

.preset-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.notification-stream {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.notification-stream-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
  font-size: 0.8rem;
}

.notification-stream-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.notif-badge-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

.notif-badge-high {
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.notif-badge-critical {
  background: rgba(255, 23, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(255, 23, 68, 0.3);
}

.notif-badge-market {
  background: rgba(0, 230, 118, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(0, 230, 118, 0.3);
}

/* In-terminal floating toast alert */
.terminal-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  min-width: 320px;
  max-width: 420px;
  padding: 16px 20px;
  border-radius: 10px;
  background: rgba(14, 18, 27, 0.95);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8), 0 0 20px rgba(0, 240, 255, 0.2);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: slideToastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideToastIn {
  from { transform: translateY(100px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.btn-coin-chip {
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  font-family: var(--font-mono);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-coin-chip:hover {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.3);
  color: #fff;
  transform: translateY(-1px);
}

.btn-coin-chip.active {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
}

.metric-toggle-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  padding: 12px 14px;
  transition: all 0.2s ease;
}

.metric-toggle-box:hover {
  border-color: rgba(0, 240, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
}

.metric-toggle-box.active {
  border-color: rgba(0, 240, 255, 0.4);
  background: rgba(0, 240, 255, 0.04);
}

/* ==============================================================================
   GLOBAL ASSET SEARCH & CROSS-APP SEARCH STYLES
   ============================================================================== */
.header-center {
  flex: 1;
  max-width: 580px;
  margin: 0 20px;
  position: relative;
}

.global-search-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  background: rgba(14, 20, 32, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 3px 14px;
  transition: all 0.25s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.global-search-container:focus-within {
  border-color: var(--accent-cyan);
  background: rgba(10, 16, 28, 0.95);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.25), inset 0 1px 2px rgba(0, 0, 0, 0.5);
}

.global-search-icon {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-right: 8px;
  pointer-events: none;
}

.global-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  padding: 6px 0;
}

.global-search-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.82rem;
}

.global-search-hints {
  display: flex;
  align-items: center;
  gap: 6px;
}

.search-kbd {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  pointer-events: none;
  user-select: none;
}

.search-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  padding: 2px 6px;
  border-radius: 50%;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-clear-btn:hover {
  color: #fff;
}

.global-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(11, 17, 28, 0.96);
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 24px rgba(0, 240, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 1000;
  max-height: 480px;
  overflow-y: auto;
  padding: 8px;
  animation: dropdownFade 0.18s ease;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.search-result-item {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: all 0.15s ease;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.02);
}

.search-result-item:hover, .search-result-item.selected {
  background: rgba(0, 240, 255, 0.08);
  border-color: rgba(0, 240, 255, 0.3);
}

.search-action-btn {
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.search-action-btn:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--accent-cyan);
  color: #fff;
  transform: translateY(-1px);
}

.search-action-btn.btn-search-fav {
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.search-action-btn.btn-search-fav:hover {
  background: rgba(245, 158, 11, 0.2);
  border-color: #f59e0b;
  color: #fff;
}

.search-action-btn.btn-search-fav.is-fav {
  background: rgba(245, 158, 11, 0.22);
  border-color: #f59e0b;
  color: #fbbf24;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.search-action-btn.btn-search-add-list {
  border-color: rgba(168, 85, 247, 0.35);
  color: #c084fc;
}

.search-action-btn.btn-search-add-list:hover {
  background: rgba(168, 85, 247, 0.22);
  border-color: #a855f7;
  color: #fff;
}

/* Star Favorite Icon */
.btn-star-fav {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  color: rgba(255, 255, 255, 0.22);
  transition: transform 0.15s ease, color 0.15s ease;
  padding: 0 4px;
}

.btn-star-fav:hover {
  transform: scale(1.3);
  color: #fbbf24;
}

.btn-star-fav.active {
  color: #f59e0b;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.7);
}

/* Heatmap Tile Highlight Focus */
.heatmap-tile.highlight-active {
  border: 2px solid var(--accent-cyan) !important;
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.85) !important;
  transform: scale(1.08);
  z-index: 15;
  position: relative;
  animation: pulseCyanGlow 1.5s infinite alternate;
}

@keyframes pulseCyanGlow {
  0% { box-shadow: 0 0 15px rgba(0, 240, 255, 0.6); }
  100% { box-shadow: 0 0 28px rgba(0, 240, 255, 0.95); }
}

.heatmap-tile.dimmed-tile {
  opacity: 0.22 !important;
  filter: grayscale(85%) !important;
}

.table-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.table-search-box .search-input {
  padding-left: 30px;
  padding-right: 26px;
  min-width: 220px;
  font-size: 0.8rem;
  height: 34px;
  background: rgba(0, 0, 0, 0.35);
}

.table-search-box .search-box-icon {
  position: absolute;
  left: 9px;
  color: var(--text-muted);
  font-size: 0.8rem;
  pointer-events: none;
}

.table-search-box .search-clear-btn {
  position: absolute;
  right: 6px;
  font-size: 0.75rem;
}

.quick-filter-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.quick-filter-chips .pill {
  font-size: 0.72rem;
  padding: 2px 8px;
}

.quick-filter-chips .pill.active {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* ==============================================================================
   QUICK COIN FILTER & SEARCH COMPONENT
   ============================================================================== */
.quick-coin-bar {
  background: rgba(18, 24, 38, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.quick-coin-sector-tabs {
  display: inline-flex;
  gap: 3px;
  background: rgba(0, 0, 0, 0.4);
  padding: 2px 4px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.quick-coin-sector-tabs .qf-sector-btn {
  font-size: 0.68rem;
  padding: 3px 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.quick-coin-sector-tabs .qf-sector-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
}

.quick-coin-sector-tabs .qf-sector-btn.active {
  background: rgba(0, 240, 255, 0.2);
  color: var(--accent-cyan);
  font-weight: 700;
}

.quick-chips-horizontal-row {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.quick-chips-horizontal-row .pill {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.quick-chips-horizontal-row .pill:hover {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.4);
  color: #fff;
}

.quick-chips-horizontal-row .pill.active {
  background: rgba(0, 240, 255, 0.25);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
}

.quick-coin-select {
  font-size: 0.75rem;
  padding: 5px 10px;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font-mono);
}

.quick-coin-select:focus {
  border-color: var(--accent-cyan);
  outline: none;
}

.qf-search-box {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.qf-search-box .qf-search-icon {
  position: absolute;
  left: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  pointer-events: none;
}

.qf-search-input {
  font-size: 0.75rem;
  padding: 5px 26px 5px 24px;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: 6px;
  width: 165px;
  font-family: var(--font-mono);
  transition: all 0.2s ease;
}

.qf-search-input:focus {
  width: 210px;
  border-color: var(--accent-cyan);
  outline: none;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.25);
}

.qf-search-clear {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 2px 4px;
}

.qf-search-clear:hover {
  color: #fff;
}

.modal-cat-tab {
  font-size: 0.72rem;
  padding: 4px 10px;
  white-space: nowrap;
}

.modal-cat-tab.active {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 700;
}

.row-cat-select {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--accent-cyan);
  font-size: 0.72rem;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}

.row-cat-select:focus {
  border-color: var(--accent-cyan);
  outline: none;
}

/* ==============================================================================
   ASSET UNIVERSE & TRACKED COINS MANAGER
   ============================================================================== */
.btn-manage-coins {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--accent-cyan);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-manage-coins:hover {
  background: rgba(0, 240, 255, 0.18);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.25);
  transform: translateY(-1px);
}

.btn-manage-coins .badge-count {
  background: var(--accent-cyan);
  color: #000;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 10px;
  line-height: 1.2;
}

.btn-manage-coins-inline {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 240, 255, 0.06);
  border: 1px dashed rgba(0, 240, 255, 0.35);
  color: var(--accent-cyan);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-manage-coins-inline:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
}

.asset-toggle-switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
  vertical-align: middle;
}

.asset-toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.asset-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 18px;
}

.asset-toggle-slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.asset-toggle-switch input:checked + .asset-toggle-slider {
  background-color: var(--accent-green);
}

.asset-toggle-switch input:checked + .asset-toggle-slider:before {
  transform: translateX(16px);
}

.badge-sector {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ddd;
}

.badge-sector.l1 {
  background: rgba(0, 240, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.25);
  color: var(--accent-cyan);
}

.badge-sector.meme {
  background: rgba(255, 170, 0, 0.1);
  border-color: rgba(255, 170, 0, 0.25);
  color: #ffaa00;
}

.badge-sector.defi {
  background: rgba(147, 51, 234, 0.1);
  border-color: rgba(147, 51, 234, 0.25);
  color: #c084fc;
}

.badge-sector.ai {
  background: rgba(0, 230, 153, 0.1);
  border-color: rgba(0, 230, 153, 0.25);
  color: var(--accent-green);
}

.badge-sector.rwa {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.25);
  color: #60a5fa;
}

/* User Management Hub Styling */
.badge-role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-role.admin {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.35);
  color: #c084fc;
}

.badge-role.analyst {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.3);
  color: var(--accent-cyan);
}

.badge-role.trader {
  background: rgba(0, 230, 153, 0.12);
  border-color: rgba(0, 230, 153, 0.3);
  color: var(--accent-green);
}

.badge-role.risk_manager {
  background: rgba(255, 170, 0, 0.15);
  border-color: rgba(255, 170, 0, 0.35);
  color: #fbbf24;
}

.user-avatar-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.25), rgba(168, 85, 247, 0.3));
  border: 1px solid rgba(0, 240, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

/* Coin Management Sector Breakdown Cards */
.sector-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.sector-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sector-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(0, 240, 255, 0.3);
  transform: translateY(-1px);
}

.sector-card.active {
  background: rgba(0, 240, 255, 0.06);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.12);
}

.sector-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

.sector-count-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: var(--font-mono);
}

.sector-sub {
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==============================================================================
   DAYLIGHT MODE SYSTEM (High Contrast Financial Palette)
   ============================================================================== */

/* Button Theme Toggle */
.btn-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.btn-theme-toggle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.theme-icon {
  font-size: 0.95rem;
  line-height: 1;
  display: inline-block;
  transition: transform 0.3s ease;
}

.btn-theme-toggle:hover .theme-icon {
  transform: rotate(25deg) scale(1.12);
}

/* Asset Pair Typography (Tables, Drawer, Tickers) */
.asset-pair-name {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.92rem;
  letter-spacing: -0.2px;
  color: var(--text-main);
}

.asset-pair-sub {
  color: var(--text-dim);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-dark: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --border-color: rgba(0, 0, 0, 0.1);
  --border-focus: rgba(2, 132, 199, 0.7);

  --text-main: #0f172a;
  --text-muted: #334155;
  --text-dim: #64748b;

  --accent-cyan: #0284c7;
  --accent-green: #059669;
  --accent-red: #dc2626;
  --accent-purple: #7c3aed;
  --accent-amber: #d97706;

  --glass-shadow: 0 4px 18px 0 rgba(0, 0, 0, 0.05), 0 1px 3px 0 rgba(0, 0, 0, 0.03);
  --glass-blur: blur(8px);
}

/* Base Body in Light Mode */
[data-theme="light"] body {
  background-color: #f1f5f9;
  color: #0f172a;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(2, 132, 199, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(124, 58, 237, 0.04) 0%, transparent 40%);
}

/* Universal Typography & Headings */
[data-theme="light"] h1, 
[data-theme="light"] h2, 
[data-theme="light"] h3, 
[data-theme="light"] h4, 
[data-theme="light"] h5, 
[data-theme="light"] h6 {
  color: #0f172a !important;
}

[data-theme="light"] strong {
  color: #0f172a !important;
}

/* Header & Sidebar in Light Mode */
[data-theme="light"] .app-header {
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .app-sidebar {
  background: #ffffff;
  border-right: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .logo-title {
  background: linear-gradient(90deg, #0f172a, #0284c7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="light"] .btn-theme-toggle {
  background: #f1f5f9;
  border: 1px solid rgba(0, 0, 0, 0.14);
  color: #0f172a;
}

[data-theme="light"] .btn-theme-toggle:hover {
  background: #e2e8f0;
  border-color: #0284c7;
}

[data-theme="light"] .btn-manage-coins {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.14);
  color: #0f172a;
}

[data-theme="light"] .btn-manage-coins:hover {
  background: #f8fafc;
  border-color: #0284c7;
}

[data-theme="light"] .badge-count {
  background: rgba(2, 132, 199, 0.12);
  color: #0284c7;
}

[data-theme="light"] .feed-status {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, 0.1);
  color: #334155;
}

/* Global Command Palette / Search */
[data-theme="light"] .global-search-container {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.16);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .global-search-input {
  color: #0f172a;
}

[data-theme="light"] .global-search-input::placeholder {
  color: #94a3b8;
}

[data-theme="light"] .search-kbd {
  background: #f1f5f9;
  border: 1px solid rgba(0, 0, 0, 0.14);
  color: #475569;
}

[data-theme="light"] .global-search-dropdown {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .search-result-item:hover {
  background: #f8fafc;
}

[data-theme="light"] .search-result-item strong {
  color: #0f172a !important;
}

[data-theme="light"] .search-result-item span {
  color: #334155;
}

[data-theme="light"] .search-action-btn {
  background: #f1f5f9;
  border-color: rgba(0, 0, 0, 0.12);
  color: #334155;
}

[data-theme="light"] .search-action-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

/* Sidebar Elements in Light Mode */
[data-theme="light"] .sidebar-heading {
  color: #64748b;
}

[data-theme="light"] .sidebar-tab {
  color: #334155;
}

[data-theme="light"] .sidebar-tab:hover {
  background: #f1f5f9;
  color: #0284c7;
}

[data-theme="light"] .sidebar-tab.active {
  background: rgba(2, 132, 199, 0.1);
  border-color: rgba(2, 132, 199, 0.4);
  color: #0284c7;
}

[data-theme="light"] .sidebar-collapse-btn {
  background: #f8fafc;
  border-color: rgba(0, 0, 0, 0.1);
  color: #475569;
}

[data-theme="light"] .sidebar-collapse-btn:hover {
  background: #f1f5f9;
  border-color: #0284c7;
  color: #0284c7;
}

/* Glass Panels & General Containers */
[data-theme="light"] .glass-panel {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.09);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

/* Tables in Light Mode (Main, Screener, Alpha, Universe, Leaderboards) */
[data-theme="light"] table,
[data-theme="light"] .data-table {
  color: #0f172a;
}

[data-theme="light"] table thead th,
[data-theme="light"] .data-table thead th {
  background: #f8fafc !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  border-bottom: 2px solid #cbd5e1 !important;
}

[data-theme="light"] .sortable-th:hover {
  background: #f1f5f9 !important;
  color: #0284c7 !important;
}

[data-theme="light"] table tbody td,
[data-theme="light"] .data-table tbody td {
  color: #1e293b !important;
  border-bottom: 1px solid #f1f5f9 !important;
}

[data-theme="light"] table tbody tr:hover,
[data-theme="light"] .data-table tbody tr:hover {
  background: rgba(2, 132, 199, 0.05) !important;
}

[data-theme="light"] table tbody tr strong,
[data-theme="light"] .data-table tbody tr strong,
[data-theme="light"] .clickable-screener-row strong,
[data-theme="light"] .asset-pair-name {
  color: #0f172a !important;
  font-weight: 700 !important;
}

[data-theme="light"] .asset-pair-sub {
  color: #64748b !important;
}

[data-theme="light"] table tbody tr span,
[data-theme="light"] .data-table tbody tr span {
  color: #334155;
}

[data-theme="light"] .score-mini-breakdown {
  color: #475569 !important;
  font-weight: 600 !important;
}

/* Stat Cards & Market Pulse */
[data-theme="light"] .stat-card,
[data-theme="light"] .pulse-card,
[data-theme="light"] .market-pulse-card {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.09);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .stat-title,
[data-theme="light"] .pulse-label {
  color: #64748b !important;
  font-weight: 600 !important;
}

[data-theme="light"] .stat-value,
[data-theme="light"] .pulse-val {
  color: #0f172a !important;
  font-weight: 700 !important;
}

[data-theme="light"] .stat-sub {
  color: #475569 !important;
}

/* Screener Automation Rule Cards */
[data-theme="light"] .rule-card {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .rule-card:hover {
  border-color: #0284c7 !important;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.12) !important;
}

[data-theme="light"] .rule-card.is-active {
  background: #ffffff !important;
  border: 1px solid #059669 !important;
  box-shadow: 0 4px 16px rgba(5, 150, 105, 0.1) !important;
}

[data-theme="light"] .rule-card.is-paused {
  background: #ffffff !important;
  border: 1px solid #d97706 !important;
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.1) !important;
}

[data-theme="light"] .rule-card.is-disabled {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  opacity: 0.85;
}

[data-theme="light"] .rule-card strong,
[data-theme="light"] .rule-card .rule-title {
  color: #0f172a !important;
  font-weight: 700 !important;
}

[data-theme="light"] .rule-card span {
  color: #334155 !important;
}

[data-theme="light"] .rule-card span[style*="var(--text-dim)"] {
  color: #64748b !important;
}

[data-theme="light"] .rule-criterion-tag {
  background: #f1f5f9 !important;
  border: 1px solid rgba(2, 132, 199, 0.25) !important;
  color: #0369a1 !important;
  font-weight: 600 !important;
}

[data-theme="light"] .rule-badge-active {
  background: rgba(5, 150, 105, 0.12) !important;
  border: 1px solid #059669 !important;
  color: #047857 !important;
  box-shadow: none !important;
}

[data-theme="light"] .rule-badge-paused {
  background: rgba(217, 119, 6, 0.12) !important;
  border: 1px solid #d97706 !important;
  color: #b45309 !important;
}

[data-theme="light"] .rule-badge-disabled {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #64748b !important;
}

/* Live Alert Stream Cards */
[data-theme="light"] .alert-stream-card {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .alert-stream-card:hover {
  background: #f8fafc !important;
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.08) !important;
}

[data-theme="light"] .alert-stream-card strong,
[data-theme="light"] .alert-stream-card .alert-headline {
  color: #0f172a !important;
}

[data-theme="light"] .alert-stream-card span {
  color: #334155 !important;
}

[data-theme="light"] .alert-expectancy-pill {
  background: #f0fdf4 !important;
  border: 1px solid rgba(5, 150, 105, 0.25) !important;
  color: #065f46 !important;
}

[data-theme="light"] .alert-expectancy-pill strong {
  color: #065f46 !important;
}

[data-theme="light"] .ai-catalyst-tag {
  background: #f5f3ff !important;
  border: 1px solid rgba(124, 58, 237, 0.25) !important;
  color: #6d28d9 !important;
}

/* Filter Pills across Terminal */
[data-theme="light"] .pill {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

[data-theme="light"] .pill:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border-color: #94a3b8 !important;
}

[data-theme="light"] .pill.active {
  background: #0284c7 !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.25) !important;
}

[data-theme="light"] .timeframe-selector {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] .timeframe-selector span {
  color: #475569 !important;
}

/* Deep Inspection Drawer */
[data-theme="light"] #asset-deep-drawer,
[data-theme="light"] .drawer {
  background: #ffffff !important;
  color: #0f172a !important;
  border-left: 1px solid #cbd5e1 !important;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .drawer-header {
  background: #ffffff !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .drawer-header h2,
[data-theme="light"] .drawer-header strong,
[data-theme="light"] #drawer-token-symbol {
  color: #0f172a !important;
}

[data-theme="light"] #drawer-token-name {
  color: #475569 !important;
}

[data-theme="light"] .btn-close-drawer {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #475569 !important;
}

[data-theme="light"] .btn-close-drawer:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="light"] .drawer-quant-card {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .drawer-action-banner,
[data-theme="light"] .drawer-interval-banner {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .drawer-formula-banner {
  background: #f0f9ff !important;
  border: 1px solid #bae6fd !important;
  color: #0369a1 !important;
}

[data-theme="light"] #drawer-formula-result {
  color: #0284c7 !important;
  font-weight: 700 !important;
}

[data-theme="light"] .drawer-stat-mini-card {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .drawer-stat-mini-card span {
  color: #0f172a !important;
}

[data-theme="light"] .drawer-stat-mini-card span[style*="var(--text-muted)"],
[data-theme="light"] .drawer-stat-mini-card span[style*="var(--text-dim)"] {
  color: #64748b !important;
}

[data-theme="light"] .score-metric-card {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02) !important;
}

[data-theme="light"] .score-metric-card div[style*="overflow:hidden"] {
  background: #e2e8f0 !important;
}

[data-theme="light"] .drawer-metrics-table tr {
  border-bottom: 1px solid #f1f5f9 !important;
}

[data-theme="light"] .drawer-metrics-table td:first-child {
  color: #475569 !important;
}

[data-theme="light"] .drawer-metrics-table td:last-child {
  color: #0f172a !important;
  font-weight: 700 !important;
}

[data-theme="light"] #drawer-options-notice {
  background: #f5f3ff !important;
  border: 1px solid #ddd6fe !important;
  color: #4c1d95 !important;
}

[data-theme="light"] #drawer-notice-token {
  color: #6d28d9 !important;
}

/* Whale Radar & Order Flow Cards */
[data-theme="light"] .whale-tx-card {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .whale-tx-card:hover {
  background: #f8fafc !important;
  border-color: #0284c7 !important;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.08) !important;
}

[data-theme="light"] .whale-tx-card span,
[data-theme="light"] .whale-tx-card strong,
[data-theme="light"] .whale-tx-card div {
  color: #0f172a !important;
}

[data-theme="light"] .whale-tx-card span[style*="var(--text-muted)"],
[data-theme="light"] .whale-tx-card div[style*="var(--text-dim)"] {
  color: #64748b !important;
}

[data-theme="light"] .whale-tx-wallet-tag {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

[data-theme="light"] .whale-summary-card,
[data-theme="light"] .leaderboard-col,
[data-theme="light"] .leaderboard-column {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .leaderboard-row {
  border-bottom: 1px solid #f1f5f9 !important;
}

[data-theme="light"] .leaderboard-row:hover {
  background: #f8fafc !important;
}

/* Market Heatmap */
[data-theme="light"] .heatmap-sector-block {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .heatmap-sector-title strong {
  color: #0f172a !important;
}

[data-theme="light"] .heatmap-tile {
  border: 1px solid rgba(0, 0, 0, 0.09) !important;
}

[data-theme="light"] .heatmap-tile-sym {
  color: #0f172a !important;
}

[data-theme="light"] .heatmap-tile-price {
  color: #475569 !important;
}

/* Coin Management & Dropdown Controls */
[data-theme="light"] .row-cat-select,
[data-theme="light"] select.form-select,
[data-theme="light"] select {
  background-color: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] .row-cat-select option,
[data-theme="light"] select option {
  background-color: #ffffff !important;
  color: #0f172a !important;
}

[data-theme="light"] .table-search-box {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
}

[data-theme="light"] .table-search-box .search-input {
  color: #0f172a !important;
}

[data-theme="light"] .table-search-box .search-input::placeholder {
  color: #94a3b8 !important;
}

[data-theme="light"] .btn-star-fav {
  color: #94a3b8;
}

[data-theme="light"] .btn-star-fav.active,
[data-theme="light"] .btn-star-fav.is-fav {
  color: #f59e0b !important;
}

[data-theme="light"] .score-calculation-box {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .score-calculation-box div[style*="background:rgba(255,255,255,0.03)"] {
  background: #ffffff !important;
  border: 1px solid #e2e8f0 !important;
}

[data-theme="light"] .integration-card {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  color: #0f172a !important;
}

[data-theme="light"] .integration-card h3 {
  color: #0f172a !important;
}

[data-theme="light"] .integration-card .card-desc {
  color: #475569 !important;
}

[data-theme="light"] .integration-card div[style*="background:rgba(0, 240, 255, 0.06)"] {
  background: #f0f9ff !important;
  border: 1px solid #bae6fd !important;
  color: #0369a1 !important;
}

[data-theme="light"] .terminal-toast {
  background: #ffffff !important;
  border: 1px solid #cbd5e1 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12) !important;
  color: #0f172a !important;
}

[data-theme="light"] .notification-stream-item {
  background: #ffffff !important;
  border-bottom: 1px solid #f1f5f9 !important;
  color: #0f172a !important;
}

[data-theme="light"] .notification-stream-item strong {
  color: #0f172a !important;
}

[data-theme="light"] .notification-stream-item p {
  color: #475569 !important;
}

/* Badges, Score Pills & Action Badges */
[data-theme="light"] .badge-free,
[data-theme="light"] .badge-outline {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

[data-theme="light"] .version-tag {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #0284c7 !important;
}

[data-theme="light"] .score-pill.score-high {
  background: rgba(5, 150, 105, 0.12) !important;
  border: 1px solid rgba(5, 150, 105, 0.35) !important;
  color: #047857 !important;
}

[data-theme="light"] .score-pill.score-mid {
  background: rgba(2, 132, 199, 0.12) !important;
  border: 1px solid rgba(2, 132, 199, 0.35) !important;
  color: #0369a1 !important;
}

[data-theme="light"] .score-pill.score-low {
  background: rgba(220, 38, 38, 0.12) !important;
  border: 1px solid rgba(220, 38, 38, 0.35) !important;
  color: #b91c1c !important;
}

[data-theme="light"] .action-badge.action-buy {
  background: rgba(5, 150, 105, 0.12) !important;
  border: 1px solid rgba(5, 150, 105, 0.35) !important;
  color: #047857 !important;
}

[data-theme="light"] .action-badge.action-sell {
  background: rgba(220, 38, 38, 0.12) !important;
  border: 1px solid rgba(220, 38, 38, 0.35) !important;
  color: #b91c1c !important;
}

[data-theme="light"] .action-badge.action-neutral {
  background: rgba(100, 116, 139, 0.12) !important;
  border: 1px solid rgba(100, 116, 139, 0.3) !important;
  color: #334155 !important;
}

/* Action Buttons */
[data-theme="light"] .btn-primary {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  color: #ffffff !important;
}

[data-theme="light"] .btn-primary-outline {
  background: #ffffff !important;
  border: 1px solid #0284c7 !important;
  color: #0284c7 !important;
}

[data-theme="light"] .btn-primary-outline:hover {
  background: #0284c7 !important;
  color: #ffffff !important;
}

[data-theme="light"] .btn-secondary {
  background: #f1f5f9 !important;
  border: 1px solid #cbd5e1 !important;
  color: #334155 !important;
}

[data-theme="light"] .btn-secondary:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
}

[data-theme="light"] .btn-ghost {
  color: #475569 !important;
}

[data-theme="light"] .btn-ghost:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

/* Heartbeat & Ticker Bar in Light Mode */
[data-theme="light"] .heartbeat-bar {
  background: #ffffff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .scanner-heartbeat-bar {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  color: #334155 !important;
}

[data-theme="light"] .ticker-marquee {
  background: #f8fafc !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .ticker-item {
  color: #0f172a !important;
}

[data-theme="light"] .ticker-item .sym {
  color: #0f172a !important;
}

[data-theme="light"] .ticker-item .val {
  color: #334155 !important;
}

/* Upcoming Catalysts & News Wire in Light Mode */
[data-theme="light"] .catalysts-column {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.09) !important;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04) !important;
}

[data-theme="light"] .catalysts-column-header {
  background: #f8fafc !important;
  border-bottom: 1px solid rgba(0, 0, 0, 0.09) !important;
}

[data-theme="light"] .catalysts-column-header h4 {
  color: #0f172a !important;
}

[data-theme="light"] .catalyst-event-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.09) !important;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .catalyst-event-card:hover {
  border-color: #0284c7 !important;
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.12) !important;
}

[data-theme="light"] .event-title {
  color: #0f172a !important;
}

[data-theme="light"] .event-title:hover {
  color: #0284c7 !important;
}

[data-theme="light"] .catalyst-redirect-link {
  background: #f0f9ff !important;
  border-color: #bae6fd !important;
  color: #0284c7 !important;
}

[data-theme="light"] .catalyst-redirect-link:hover {
  background: #e0f2fe !important;
  border-color: #0284c7 !important;
  color: #0369a1 !important;
}

[data-theme="light"] .event-metrics-grid {
  background: #f8fafc !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

[data-theme="light"] .event-metric-val {
  color: #0f172a !important;
}

[data-theme="light"] .event-schedule-timezones {
  background: #f8fafc !important;
  border: 1px solid rgba(0, 0, 0, 0.08) !important;
}

[data-theme="light"] .schedule-tz-badge .tz-val {
  color: #0f172a !important;
}

[data-theme="light"] .event-schedule-timezones .tz-sep {
  color: rgba(0, 0, 0, 0.2) !important;
}

[data-theme="light"] .event-implication {
  color: #334155 !important;
  border-left-color: #0284c7 !important;
}

[data-theme="light"] .event-countdown-pill {
  background: #f1f5f9 !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: #0f172a !important;
}

[data-theme="light"] .catalyst-news-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.09) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

[data-theme="light"] .catalyst-news-card:hover {
  border-color: #059669 !important;
  box-shadow: 0 6px 18px rgba(5, 150, 105, 0.12) !important;
}

[data-theme="light"] .news-headline {
  color: #0f172a !important;
}

[data-theme="light"] .news-headline:hover {
  color: #0284c7 !important;
}

[data-theme="light"] .news-summary {
  color: #475569 !important;
}

[data-theme="light"] .news-top-row span,
[data-theme="light"] .news-footer-row span {
  color: #64748b !important;
}

[data-theme="light"] .catalyst-coin-tag {
  background: #f1f5f9 !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  color: #0284c7 !important;
}

[data-theme="light"] .catalysts-filter-btn {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #475569 !important;
}

[data-theme="light"] .catalysts-filter-btn.active {
  background: rgba(2, 132, 199, 0.1) !important;
  border-color: #0284c7 !important;
  color: #0284c7 !important;
}

[data-theme="light"] .catalysts-filter-select {
  background: #ffffff !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #0f172a !important;
}

/* Modals & Forms */
[data-theme="light"] .modal-content,
[data-theme="light"] .modal-card,
[data-theme="light"] .auth-modal-card {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.12) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.14) !important;
  color: #0f172a !important;
}

[data-theme="light"] .form-input,
[data-theme="light"] .form-select,
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="email"],
[data-theme="light"] select,
[data-theme="light"] textarea {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.16) !important;
  color: #0f172a !important;
}




/* ===== Shared UX layer (ux.js) ===== */
.ui-toast-stack { position: fixed; top: 76px; right: 20px; z-index: 10050; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.ui-toast { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: 10px; font-size: 0.84rem; line-height: 1.45; color: var(--text-main); background: rgba(14, 18, 27, 0.97); border: 1px solid var(--border-color); border-left-width: 4px; box-shadow: 0 10px 30px rgba(0,0,0,0.45); animation: slideToastIn 0.25s ease-out; }
.ui-toast > span:nth-child(2) { flex: 1; word-break: break-word; }
.ui-toast-success { border-left-color: var(--accent-green); }
.ui-toast-error { border-left-color: var(--accent-red); }
.ui-toast-warn { border-left-color: var(--accent-amber); }
.ui-toast-close { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.8rem; padding: 0 2px; }
[data-theme="light"] .ui-toast { background: #fff; box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
#ui-confirm { z-index: 10060; }
.btn-danger { background: var(--accent-red) !important; border-color: var(--accent-red) !important; color: #fff !important; }
button.is-busy { opacity: 0.6; cursor: progress; }

/* Module sub-navigation (multiple pages within a module) */
.module-subnav { display: flex; gap: 4px; border-bottom: 1px solid var(--border-color); margin-bottom: 16px; overflow-x: auto; }
.module-subnav-btn { background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-muted); padding: 10px 16px; font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.module-subnav-btn:hover { color: var(--text-main); }
.module-subnav-btn.active { color: var(--accent-cyan); border-bottom-color: var(--accent-cyan); }
.module-subpage { display: none; }
.module-subpage.active { display: block; }

/* Accessibility: visible keyboard focus everywhere */
:focus-visible { outline: 2px solid var(--accent-cyan); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } .marquee-track { animation: none !important; } }

/* Mobile: let wide forms/tables breathe */
@media (max-width: 768px) {
  #page-form-add-asset, #page-form-bulk-add { grid-template-columns: 1fr !important; }
  .tab-content table { display: block; overflow-x: auto; }
  #user-manager-search-input { width: 100% !important; }
}

/* ===== Sign-in, Alerts states & field validation ===== */
.auth-inline-error { margin: 4px 0 8px; padding: 8px 12px; border-radius: 6px; font-size: 0.8rem; color: var(--accent-red); background: rgba(255, 59, 92, 0.08); border: 1px solid rgba(255, 59, 92, 0.35); }
.alerts-state { padding: 22px 16px; text-align: center; font-size: 0.82rem; color: var(--text-muted); border: 1px dashed var(--border-color); border-radius: 8px; }
.alerts-state-error { color: var(--accent-red); border-color: rgba(255, 59, 92, 0.35); }
.alerts-spinner { display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -2px; border: 2px solid var(--border-color); border-top-color: var(--accent-cyan); border-radius: 50%; animation: alertsSpin 0.8s linear infinite; }
@keyframes alertsSpin { to { transform: rotate(360deg); } }
.field-invalid { border-color: var(--accent-red) !important; box-shadow: 0 0 0 2px rgba(255, 59, 92, 0.2) !important; }
.field-error-msg { margin-top: 4px; font-size: 0.72rem; color: var(--accent-red); }
button[aria-busy="true"] { opacity: 0.65; cursor: progress; }

/* ===== UX pass: empty states, table states, user menu ===== */
.empty-state-rich { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 18px; }
.empty-state-title { font-size: 0.95rem; font-weight: 700; color: var(--text-main); }
.empty-state-msg { max-width: 460px; font-size: 0.8rem; color: var(--text-muted); line-height: 1.45; }
.empty-state-cta { margin-top: 8px; font-size: 0.78rem; padding: 6px 16px; }
.table-state-row td { text-align: center; background: transparent !important; }
.table-state-row:hover td { background: transparent !important; }
.settings-retry-btn { margin-left: 6px; }

.user-menu { position: relative; }
.user-menu-trigger { display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px; }
.user-menu-avatar { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-size: 0.72rem; font-weight: 700; background: rgba(0, 240, 255, 0.15); color: var(--accent-cyan); border: 1px solid rgba(0, 240, 255, 0.35); }
.user-menu-caret { font-size: 0.7rem; color: var(--text-muted); }
.user-menu-dropdown { position: absolute; right: 0; top: calc(100% + 6px); min-width: 220px; z-index: 1000; padding: 6px; border-radius: 10px; background: var(--bg-dark); border: 1px solid var(--border-color); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45); }
.user-menu-header { padding: 8px 10px 10px; border-bottom: 1px solid var(--border-color); margin-bottom: 4px; }
.user-menu-name { font-size: 0.85rem; font-weight: 700; color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-role { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: none; border-radius: 6px; background: none; color: var(--text-main); font: inherit; font-size: 0.82rem; text-align: left; cursor: pointer; }
.user-menu-item:hover, .user-menu-item:focus-visible { background: var(--bg-card-hover); }
.user-menu-item-danger { color: var(--accent-red); }

/* Header feed indicator: grey, non-pulsing dot when the live feed is down */
.live-dot.feed-dot-down { background: var(--text-dim) !important; box-shadow: none !important; animation: none !important; }

/* ===== Confluence breakdown on alert cards ===== */
.confluence-box { margin-top: 8px; font-size: 0.74rem; border: 1px solid var(--border-color); border-radius: 6px; padding: 5px 10px; background: rgba(0,0,0,0.18); }
.confluence-box summary { cursor: pointer; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; list-style: none; }
.confluence-box summary::-webkit-details-marker { display: none; }
.confluence-score { font-weight: 800; font-family: var(--font-mono); }
.confluence-sub { color: var(--text-muted); }
.confluence-list { list-style: none; margin: 8px 0 2px; padding: 0; display: grid; gap: 3px; }
.confluence-list li { display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-mono); }
.confluence-list em { color: var(--text-dim); font-style: normal; }
.cf-pass { color: var(--accent-green); }
.cf-fail { color: var(--accent-red); }
.cf-na { color: var(--text-dim); }
[data-theme="light"] .confluence-box { background: rgba(0,0,0,0.03); }

/* ===== Strategy Research ===== */
.rs-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.rs-kpis > div { border: 1px solid var(--border-color); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.rs-kpis span { font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.rs-kpis strong { font-size: 1.15rem; font-family: var(--font-mono); }
.rs-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.rs-charts h4 { margin: 0 0 6px; font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.rs-chart { width: 100%; height: auto; border: 1px solid var(--border-color); border-radius: 8px; }
.rs-chart-grid { stroke: var(--border-color); stroke-dasharray: 3 3; }
.rs-chart-lbl { font-size: 9px; fill: var(--text-muted); font-family: var(--font-mono); }
.rs-chart-val { font-size: 10px; fill: var(--text-main); font-family: var(--font-mono); font-weight: 700; }
.rs-note { font-size: 0.76rem; color: var(--text-muted); margin: 8px 0; line-height: 1.5; }
.rs-table td small { color: var(--text-dim); }
.rs-chip { display: inline-block; padding: 1px 7px; margin: 1px 0; border-radius: 10px; font-size: 0.7rem; border: 1px solid var(--border-color); }

/* ===== Coin Trading Reports ===== */
.rpt-panel { padding: 18px; }
.rpt-body { display: flex; flex-direction: column; gap: 12px; }
.rpt-plan-controls { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); }
.rpt-plan-controls label { display: flex; flex-direction: column; gap: 4px; font-size: 0.72rem; color: var(--text-muted); }
.rpt-plan-controls input { width: 150px; }
.rpt-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.rpt-kpi { border: 1px solid var(--border-color); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rpt-kpi span { font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.rpt-kpi strong { font-size: 1.02rem; font-family: var(--font-mono); overflow-wrap: anywhere; }
.rpt-kpi small { font-size: 0.7rem; color: var(--text-dim); }
.rpt-verdict { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--border-color); border-left-width: 4px; }
.rpt-verdict strong { font-size: 1rem; }
.rpt-verdict span { font-size: 0.8rem; color: var(--text-muted); }
.rpt-verdict-long { border-left-color: var(--accent-green); }
.rpt-verdict-short { border-left-color: var(--accent-red); }
.rpt-verdict-none { border-left-color: var(--accent-amber); }
.rpt-h { margin: 6px 0 0; font-size: 0.82rem; color: var(--text-muted); font-weight: 600; }
.rpt-muted { color: var(--text-muted); font-size: 0.76rem; line-height: 1.5; }
.rpt-warnings { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 8px; background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.35); font-size: 0.8rem; }
.rpt-table td, .rpt-table th { white-space: nowrap; }
.rpt-price-row td { text-align: center; font-weight: 700; color: var(--accent-cyan); background: rgba(0, 240, 255, 0.05); }
.rpt-bars { display: flex; flex-direction: column; gap: 6px; }
.rpt-bar-row { display: grid; grid-template-columns: 150px 1fr 70px; gap: 10px; align-items: center; font-size: 0.78rem; }
.rpt-bar { height: 10px; border-radius: 5px; background: var(--border-color); overflow: hidden; }
.rpt-bar > div { height: 100%; background: var(--accent-cyan); }
.rpt-disclaimer { font-size: 0.72rem; color: var(--text-dim); text-align: center; margin: 14px 0 0; }
@media (max-width: 600px) { .rpt-bar-row { grid-template-columns: 1fr 70px; } .rpt-bar-row .rpt-bar { grid-column: 1 / -1; order: 3; } }
.rpt-chart-wrap { margin-bottom: 14px; }
.rpt-chart-wrap:empty { display: none; }
.rpt-scan-row { cursor: pointer; }
.rpt-scan-row:hover td { background: var(--bg-card-hover, rgba(255,255,255,0.04)); }
.rpt-quality { font-family: var(--font-mono); font-weight: 800; font-size: 1rem; }
.rpt-notes { white-space: normal !important; min-width: 200px; font-size: 0.74rem; color: var(--text-muted); }
.rpt-chart-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; font-size: 0.82rem; }
.rpt-chart-legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.72rem; color: var(--text-muted); }
.rpt-chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.rpt-chart-legend i { display: inline-block; width: 12px; height: 3px; border-radius: 2px; }
.rpt-chart-legend i.dash { height: 0; border-top: 2px dashed; background: none !important; }
.rpt-chart-scroll { overflow-x: auto; border: 1px solid var(--border-color); border-radius: 8px; }
.rpt-chart-svg { display: block; width: 100%; min-width: 620px; height: auto; }
.rpt-signals td { white-space: normal !important; vertical-align: top; }
.rpt-signals td:first-child { font-family: var(--font-mono); width: 48px; }

/* TradingView chart */
.tv-chart-box { width: 100%; height: 420px; border: 1px solid var(--border-color); border-radius: 8px; overflow: hidden; }
.tv-tf-pills { display: flex; gap: 4px; }
.tv-tf-pills .pill { padding: 3px 10px; font-size: 0.72rem; }
.tv-chart-foot { font-size: 0.7rem; margin-top: 4px; }
@media (max-width: 600px) { .tv-chart-box { height: 320px; } }

/* Chart toolbar: new tab / full screen */
.tv-chart-actions { display: flex; gap: 6px; margin-left: auto; }
.tv-chart-actions .btn-ghost { font-size: 0.75rem; padding: 4px 10px; border: 1px solid var(--border-color); border-radius: 6px; }
.tv-chart-wrap:fullscreen, .tv-chart-wrap:-webkit-full-screen, .tv-chart-wrap.tv-pseudo-fs {
  background: var(--bg-main, #0b0e14); padding: 12px 16px; display: flex; flex-direction: column; box-sizing: border-box;
}
.tv-chart-wrap.tv-pseudo-fs { position: fixed; inset: 0; z-index: 10070; padding-top: max(12px, env(safe-area-inset-top)); }
.tv-chart-wrap:fullscreen .tv-chart-box, .tv-chart-wrap:-webkit-full-screen .tv-chart-box, .tv-chart-wrap.tv-pseudo-fs .tv-chart-box { flex: 1; height: auto; }

/* Market Regime */
.regime-hero { display:flex; gap:24px; padding:20px 22px; flex-wrap:wrap; align-items:center; margin-bottom:16px; }
.regime-hero-main { flex:1 1 320px; }
.regime-label { font-size:1.8rem; font-weight:700; margin:4px 0 12px; }
.regime-meter { position:relative; height:8px; border-radius:4px; background:linear-gradient(90deg,#ef4444,#f59e0b 50%,#22c55e); }
.regime-meter span { position:absolute; top:-5px; width:6px; height:18px; border-radius:3px; transform:translateX(-50%); box-shadow:0 0 0 2px var(--bg-main,#0b0e14); }
.regime-meter-scale { display:flex; justify-content:space-between; font-size:0.7rem; color:var(--text-muted); margin-top:6px; }
.regime-hero-side { display:flex; gap:22px; flex-wrap:wrap; }
.regime-hero-side > div { display:flex; flex-direction:column; gap:4px; }
.regime-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:16px; }
.regime-h { font-size:1rem; margin:0 0 10px; }
.regime-rules { margin:0; padding-left:18px; display:flex; flex-direction:column; gap:6px; font-size:0.86rem; }
.regime-rotation { margin-top:12px; font-size:0.82rem; color:var(--accent-cyan); }
.regime-factors { width:100%; border-collapse:collapse; font-size:0.82rem; }
.regime-factors td { padding:6px 6px; border-bottom:1px solid var(--border-color); vertical-align:top; }
.regime-factors .muted, .macro-regime .muted { color:var(--text-muted); }
.rpt-regime { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:10px; margin-bottom:16px; }
.rpt-regime-cell { display:flex; flex-direction:column; gap:3px; padding:10px 12px; border:1px solid var(--border-color); border-left-width:4px; border-radius:8px; }
.rpt-regime-cell strong { font-size:1.05rem; }

/* Market data providers */
.dp-table td, .dp-table th { white-space: nowrap; }
.dp-row-primary { background: rgba(0, 240, 255, 0.06); }
.dp-primary-badge { color: var(--accent-cyan); font-weight: 600; font-size: 0.8rem; }

/* Fibonacci Retracement */
.fib-section { margin-top: 24px; padding: 18px 20px; border-radius: 10px; border: 1px solid rgba(147, 51, 234, 0.3); background: rgba(147, 51, 234, 0.03); }
.fib-section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; flex-wrap: wrap; gap: 8px; }
.fib-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }
.fib-col { display: flex; flex-direction: column; gap: 12px; }
.fib-levels-block { border: 1px solid var(--border-color); border-radius: 8px; padding: 12px 14px; background: var(--bg-card, rgba(255,255,255,0.02)); }
.fib-info-row { display: flex; gap: 14px; font-size: 0.76rem; color: var(--text-muted); margin-bottom: 8px; flex-wrap: wrap; }
.fib-info-row strong { color: var(--text-color, #e2e8f0); }
.fib-table td, .fib-table th { padding: 6px 10px; font-size: 0.78rem; font-family: var(--font-mono); }
.fib-table td strong { font-weight: 700; }
.fib-row-current { background: rgba(0, 240, 255, 0.1) !important; font-weight: bold; }
.fib-marker { font-size: 0.7rem; color: var(--accent-cyan); font-weight: 700; letter-spacing: 0.05em; animation: pulse 2s infinite; }
.fib-scenario { border: 1px solid var(--border-color); border-radius: 8px; padding: 12px 14px; background: var(--bg-card, rgba(255,255,255,0.02)); }
.fib-scenario-header { display: flex; justify-content: space-between; align-items: center; padding-bottom: 6px; border-bottom: 1px solid var(--border-color); font-size: 0.85rem; }

/* Multi-Timeframe Chart Patterns & Trend Matrix */
.rpt-pattern-section {
  margin-top: 20px;
  margin-bottom: 24px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(8px);
}
.rpt-pattern-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 10px;
}
.rpt-pattern-synthesis-bar {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 10px 0 16px 0;
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.rpt-pattern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.rpt-pattern-card {
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px;
  background: var(--bg-card, rgba(255, 255, 255, 0.02));
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rpt-pattern-card:hover {
  border-color: rgba(0, 240, 255, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.rpt-pattern-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.rpt-pattern-tf-badge {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--accent-cyan);
}
.rpt-trend-pill {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  text-transform: capitalize;
}
.rpt-trend-pill.bull {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.rpt-trend-pill.bear {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.rpt-trend-pill.neutral {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.rpt-pattern-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.rpt-pattern-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
}
.rpt-pattern-status-badge {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
}
.rpt-pattern-status-badge.breakout {
  background: var(--accent-green);
  color: #000;
}
.rpt-pattern-status-badge.forming {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-color, #e2e8f0);
}
.rpt-pattern-levels {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.2);
  padding: 6px 10px;
  border-radius: 6px;
  justify-content: space-between;
}
.rpt-pattern-candle-row {
  font-size: 0.76rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.rpt-pattern-narrative {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin: 0;
}

/* Custom Tracked Lists Interactive Styling */
.watchlist-card {
  padding: 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}
.watchlist-card:hover {
  border-color: rgba(0, 240, 255, 0.4);
  transform: translateY(-2px);
}
.watchlist-card.active-list-card {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.25);
  background: rgba(18, 24, 38, 0.98);
}

.chip-coin-toggle {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.76rem;
  font-family: var(--font-mono);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.chip-coin-toggle:hover {
  background: rgba(0, 240, 255, 0.1);
  color: #fff;
  border-color: rgba(0, 240, 255, 0.3);
}
.chip-coin-toggle.selected {
  background: rgba(0, 240, 255, 0.2);
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

.staged-coin-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(0, 240, 255, 0.12);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--accent-cyan);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 700;
}
.staged-coin-pill .btn-remove-stage {
  cursor: pointer;
  background: transparent;
  border: none;
  color: var(--accent-red);
  font-size: 0.8rem;
  padding: 0;
  line-height: 1;
}

/* =========================================================
   PRO TRADING CUSTOM TRACKED LISTS WORKSPACE
   ========================================================= */
.wl-pro-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}

@media (max-width: 1080px) {
  .wl-pro-layout {
    grid-template-columns: 1fr;
  }
}

.wl-master-sidebar {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
}

.wl-master-header {
  margin-bottom: 14px;
}

.wl-cat-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-top: 4px;
}

.wl-cat-pill {
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.wl-cat-pill:hover,
.wl-cat-pill.active {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.wl-master-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - 280px);
  overflow-y: auto;
  padding-right: 4px;
}

.wl-master-list::-webkit-scrollbar {
  width: 5px;
}
.wl-master-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 4px;
}

/* Watchlist Navigator Card */
.watchlist-card {
  padding: 14px 16px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  position: relative;
}

.watchlist-card:hover {
  border-color: rgba(0, 240, 255, 0.35);
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.04);
}

.watchlist-card.active-list-card {
  border-color: var(--accent-cyan);
  border-left: 4px solid var(--accent-cyan);
  box-shadow: 0 4px 20px rgba(0, 240, 255, 0.15);
  background: rgba(0, 240, 255, 0.05);
}

.wl-card-roi-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
}
.wl-card-roi-badge.up {
  color: var(--accent-green);
  background: rgba(0, 230, 118, 0.12);
}
.wl-card-roi-badge.down {
  color: var(--accent-red);
  background: rgba(255, 23, 68, 0.12);
}
.wl-card-roi-badge.neutral {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06);
}

/* Detail Workspace */
.wl-detail-workspace {
  min-width: 0;
}

.wl-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 18px;
  margin-bottom: 20px;
}

.wl-avatar-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.wl-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Basket KPI Grid */
.wl-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.wl-kpi-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  padding: 12px 14px;
  transition: all 0.2s ease;
}

.wl-kpi-card:hover {
  border-color: rgba(0, 240, 255, 0.25);
  background: rgba(255, 255, 255, 0.04);
}

.wl-kpi-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}

.wl-kpi-val {
  font-size: 1.25rem;
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.wl-kpi-sub {
  font-size: 0.7rem;
  color: var(--text-dim);
  display: block;
}

/* Table Controls */
.wl-table-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.wl-inline-add-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  padding: 2px 6px;
  max-width: 320px;
  flex: 1;
}

.wl-inline-add-box:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.25);
}

.wl-inline-add-box input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.8rem;
  padding: 4px 6px;
  width: 100%;
  outline: none;
}

.wl-view-toggle {
  display: flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.wl-view-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.wl-view-btn:hover {
  color: #fff;
}

.wl-view-btn.active {
  background: var(--accent-cyan);
  color: #000;
  font-weight: 700;
}

/* Bulk Actions Toolbar */
.wl-bulk-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.35);
  border-radius: 8px;
  padding: 10px 16px;
  margin-bottom: 16px;
  animation: fadeIn 0.2s ease;
}

/* Cards Grid View */
.wl-coins-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.wl-coin-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 14px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wl-coin-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 240, 255, 0.4);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.wl-alert-toggle-badge {
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.wl-alert-toggle-badge:hover {
  opacity: 0.85;
  transform: scale(1.05);
}

/* ==============================================================================
   INSTITUTIONAL OPTION CHAIN & OPEN INTEREST TRACKING MODULE
   ============================================================================== */

.opt-chain-table {
  border-spacing: 0;
}

.opt-super-header th {
  padding: 8px 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  font-size: 0.78rem;
}

.opt-column-header th {
  padding: 8px 10px;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  background: rgba(15, 23, 42, 0.75);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.opt-chain-row td {
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.035);
  vertical-align: middle;
}

.opt-chain-row:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.opt-chain-row.is-atm-row td {
  background: rgba(0, 240, 255, 0.07) !important;
  border-top: 1px solid rgba(0, 240, 255, 0.35);
  border-bottom: 1px solid rgba(0, 240, 255, 0.35);
}

.opt-chain-row.is-max-pain-row td {
  background: rgba(245, 158, 11, 0.06);
}

.oi-cell-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  height: 26px;
  min-height: 26px;
}

.oi-cell-wrapper.call-side {
  justify-content: flex-end;
}

.oi-cell-wrapper.put-side {
  justify-content: flex-start;
}

.oi-bar {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0.8;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.oi-bar.call-bar {
  right: 0;
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.05), rgba(16, 185, 129, 0.35));
  border-right: 2px solid #10b981;
}

.oi-bar.put-bar {
  left: 0;
  background: linear-gradient(270deg, rgba(239, 68, 68, 0.05), rgba(239, 68, 68, 0.35));
  border-left: 2px solid #ef4444;
}

.oi-val {
  position: relative;
  z-index: 2;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0 4px;
}

.strike-badge-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.strike-num {
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
  font-size: 0.85rem;
}

.badge-atm {
  background: rgba(0, 240, 255, 0.2);
  color: #00f0ff;
  border: 1px solid rgba(0, 240, 255, 0.5);
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.badge-maxpain {
  background: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.6);
  font-size: 0.65rem;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.badge-wall.call {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.5);
  font-size: 0.65rem;
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 800;
}

.badge-wall.put {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
  font-size: 0.65rem;
  padding: 1px 4px;
  border-radius: 4px;
  font-weight: 800;
}

.btn-opt-alert {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.45;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 0.95rem;
  padding: 2px 4px;
}

.btn-opt-alert:hover {
  opacity: 1;
  transform: scale(1.3);
  filter: drop-shadow(0 0 6px #00f0ff);
}

.buildup-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.buildup-tag.bullish {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.buildup-tag.bearish {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.buildup-tag.caution {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.buildup-tag.neutral {
  color: var(--text-muted);
  opacity: 0.4;
}

.delta-oi-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.delta-oi-badge.bullish {
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
}

.delta-oi-badge.bearish {
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
}

.delta-flat {
  color: var(--text-muted);
  opacity: 0.4;
}

#btn-refresh-options.rotating {
  transform: rotate(360deg);
  transition: transform 0.6s ease;
}

/* Mobile Option Column Pills */
.mobile-opt-col-pills {
  display: none;
}

@media (max-width: 1024px) {
  .mobile-opt-col-pills {
    display: inline-flex;
  }
}

/* Mobile-First Option Chain & GUI Adjustments */
@media (max-width: 768px) {
  #tab-options .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }

  #tab-options .section-toolbar {
    gap: 12px;
  }

  .opt-chain-table {
    font-size: 0.72rem;
  }

  .opt-chain-row td {
    padding: 4px 6px;
  }

  .strike-num {
    font-size: 0.78rem;
  }

  .oi-val {
    font-size: 0.72rem;
  }

  .buildup-tag {
    font-size: 0.62rem;
    padding: 1px 4px;
  }

  #modal-opt-strike-alert .glass-panel {
    width: 95% !important;
    max-width: 95vw !important;
    padding: 18px !important;
  }
}

@media (max-width: 480px) {
  #tab-options .stats-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ==============================================================================
   Meme Coin 1000% Supercycle & Crash Predictor Styles
   ============================================================================== */
.chain-solana {
  background: rgba(168, 85, 247, 0.15) !important;
  color: #c084fc !important;
  border: 1px solid rgba(168, 85, 247, 0.3) !important;
}

.chain-base {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #60a5fa !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
}

.chain-ethereum {
  background: rgba(99, 102, 241, 0.15) !important;
  color: #818cf8 !important;
  border: 1px solid rgba(99, 102, 241, 0.3) !important;
}

.chain-bsc {
  background: rgba(245, 158, 11, 0.15) !important;
  color: #fbbf24 !important;
  border: 1px solid rgba(245, 158, 11, 0.3) !important;
}

.rotating {
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 768px) {
  #tab-meme-predictor .section-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .mobile-col-toggle {
    display: none !important;
  }

  #meme-table-container {
    display: none !important;
  }

  #modal-meme-deep-dive .modal-card {
    padding: 16px !important;
    max-width: 95vw !important;
  }

  #tab-derivatives .section-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  #deriv-table-container {
    display: none !important;
  }

  #modal-deriv-coin-breakdown .modal-card {
    padding: 16px !important;
    max-width: 95vw !important;
  }
}

/* ==============================================================================
   PRO CHART STUDIO & PINE SCRIPT LAB STYLES
   ============================================================================== */
.chart-studio-tab-btn {
  background: transparent;
  color: var(--text-muted);
}
.chart-studio-tab-btn.active {
  background: var(--accent-cyan);
  color: #030712;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
}
.pine-code-editor {
  width: 100%;
  height: 100%;
  background: #040813;
  color: #38bdf8;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.76rem;
  line-height: 1.5;
  border: 1px solid rgba(0, 240, 255, 0.15);
  border-radius: 6px;
  padding: 8px 10px;
  resize: none;
  tab-size: 4;
  outline: none;
}
.pine-code-editor:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}
.pine-console-output {
  white-space: pre-wrap;
  word-break: break-all;
}
.btn-open-chart {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: var(--accent-cyan);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
  white-space: nowrap;
}
.btn-open-chart:hover {
  background: rgba(0, 240, 255, 0.2);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
  transform: translateY(-1px);
}
@media (max-width: 900px) {
  #cs-view-pinescript {
    flex-direction: column !important;
  }
  .pine-editor-pane {
    width: 100% !important;
    max-width: 100% !important;
    height: 300px !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .chart-studio-window {
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0 !important;
  }
}

.pine-library-card {
  transition: all 0.2s ease-in-out;
}
.pine-library-card:hover {
  border-color: rgba(0, 240, 255, 0.45) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  transform: translateY(-1px);
}
.pine-library-card.active-script-card {
  background: rgba(0, 240, 255, 0.04) !important;
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.2);
}

/* TradingView On-Chart Legend & Action Bar */
.tv-legend-overlay {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 4px;
  pointer-events: auto;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.72rem;
  background: rgba(11, 15, 25, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 4px 10px;
  max-width: calc(100% - 24px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  user-select: none;
  transition: all 0.2s ease;
}
.tv-legend-symbol-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.2;
}
.tv-legend-sym {
  font-weight: 800;
  color: #fff;
  font-size: 0.8rem;
  letter-spacing: 0.3px;
}
.tv-legend-tf {
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 700;
}
.tv-legend-venue {
  color: var(--text-dim);
  font-size: 0.65rem;
}
.tv-legend-ohlc {
  color: var(--text-muted);
  font-size: 0.7rem;
  display: inline-flex;
  gap: 6px;
  margin-left: 4px;
}
.tv-legend-ohlc .val {
  font-weight: 700;
  color: var(--text-main);
}
.tv-legend-toggle-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  padding: 2px 7px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 6px;
  transition: all 0.18s ease;
}
.tv-legend-toggle-btn:hover,
.tv-legend-toggle-btn.active {
  background: rgba(0, 240, 255, 0.16);
  border-color: var(--accent-cyan);
  color: #fff;
}
.tv-legend-indicators-list {
  display: none;
  flex-direction: column;
  gap: 3px;
  margin-top: 6px;
  padding: 6px 10px;
  background: rgba(8, 12, 22, 0.96);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(0, 240, 255, 0.25);
  border-radius: 8px;
  max-height: 180px;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}
.tv-legend-indicators-list.expanded {
  display: flex !important;
}
.tv-legend-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 5px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.68rem;
}
.tv-legend-mini-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 3px;
  padding: 1px 6px;
  font-size: 0.64rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
}
.tv-legend-mini-action:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}
.tv-legend-minimize-btn {
  background: rgba(0, 240, 255, 0.12);
  border-color: rgba(0, 240, 255, 0.35);
  color: var(--accent-cyan);
}
.tv-legend-minimize-btn:hover {
  background: rgba(0, 240, 255, 0.25);
  color: #fff;
}
.cs-quick-indicators-bar {
  transition: all 0.2s ease;
}
.cs-quick-indicators-bar.minimized {
  padding: 4px 14px !important;
  background: #050914 !important;
}
.cs-quick-indicators-bar.minimized .cs-quick-ind-list {
  display: none !important;
}
.cs-quick-indicators-bar.minimized .cs-quick-ind-min-summary {
  display: inline-flex !important;
}
.tv-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 1px 0;
  font-size: 0.72rem;
}
.tv-legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tv-legend-name {
  color: var(--text-main);
  white-space: nowrap;
}
.tv-legend-actions {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 6px;
}
.tv-leg-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0 4px;
  font-size: 0.72rem;
  line-height: 1;
  transition: all 0.15s ease;
  border-radius: 3px;
}
.tv-leg-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.tv-leg-btn-close:hover {
  color: var(--accent-red, #ff5252) !important;
  background: rgba(255, 82, 82, 0.15) !important;
}

/* Timeframe Pills */
.btn-tf-pill {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-tf-pill:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}
.btn-tf-pill.active {
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.15);
  box-shadow: 0 0 6px rgba(0, 240, 255, 0.25);
}

/* ==============================================================================
   TRADINGVIEW BOTTOM DOCKED PANEL & DRAWER STYLES
   ============================================================================== */
.tv-bottom-dock {
  transition: height 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.45);
  z-index: 25;
}
.tv-dock-tabstrip {
  user-select: none;
}
.tv-dock-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted, #94a3b8);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0 14px;
  height: 100%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}
.tv-dock-tab-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
}
.tv-dock-tab-btn.active {
  color: var(--accent-cyan, #00f0ff);
  border-bottom-color: var(--accent-cyan, #00f0ff);
  background: rgba(0, 240, 255, 0.06);
}
.tv-dock-ctrl-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.15s ease;
}
.tv-dock-ctrl-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--accent-cyan);
}
.tv-tab-pane {
  width: 100%;
  height: 100%;
}
.tv-tab-pane.active {
  display: flex !important;
}

.pine-code-editor {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  background: #030712;
  color: #38bdf8;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-size: 0.78rem;
  line-height: 1.55;
  border: none;
  padding: 10px 14px;
  resize: none;
  tab-size: 4;
  outline: none;
}
.pine-code-editor:focus {
  background: #040916;
}

/* Real-Time & Auto-Refresh Chart Feed Dot */
.chart-feed-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-green, #00e676);
  box-shadow: 0 0 8px rgba(0, 230, 118, 0.7);
  display: inline-block;
  transition: all 0.25s ease;
}
.chart-feed-dot.pulsing {
  animation: chartDotPulse 0.45s ease-out;
}
.chart-feed-dot.polling {
  background: var(--accent-cyan, #00f0ff) !important;
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.7) !important;
}
.chart-feed-dot.paused {
  background: #f59e0b !important;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.6) !important;
}
.chart-feed-dot.offline {
  background: #ff5252 !important;
  box-shadow: 0 0 6px rgba(255, 82, 82, 0.6) !important;
}
@keyframes chartDotPulse {
  0% { transform: scale(1); filter: brightness(1); }
  50% { transform: scale(1.6); filter: brightness(1.7); }
  100% { transform: scale(1); filter: brightness(1); }
}
.rotate-spin {
  animation: spinRefresh 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes spinRefresh {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}




