/* ==========================================================================
   DG Power AI - Precision Quantitative Terminal Stylesheet
   Supports Seamless Dark / Light High-Contrast Themes
   ========================================================================== */

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

:root, [data-theme="dark"] {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #151e2e;
  --bg-card-hover: #1c273b;
  --bg-input: #0d131f;
  --bg-glass: rgba(21, 30, 46, 0.85);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --border-color: #222f44;
  --border-light: #2d3e58;
  
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-green: #10b981;
  --accent-green-bg: rgba(16, 185, 129, 0.12);
  --accent-red: #ef4444;
  --accent-red-bg: rgba(239, 68, 68, 0.12);
  --accent-amber: #f59e0b;
  --accent-amber-bg: rgba(245, 158, 11, 0.12);
  
  --nav-bg: rgba(10, 14, 23, 0.92);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
  --glow-cyan: 0 0 20px rgba(6, 182, 212, 0.35);
  --glow-blue: 0 0 25px rgba(59, 130, 246, 0.3);
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-input: #ffffff;
  --bg-glass: rgba(255, 255, 255, 0.96);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #475569;
  
  --border-color: #cbd5e1;
  --border-light: #94a3b8;
  
  --accent-cyan: #0284c7;
  --accent-blue: #1d4ed8;
  --accent-indigo: #4338ca;
  --accent-green: #047857;
  --accent-green-bg: rgba(4, 120, 87, 0.12);
  --accent-red: #b91c1c;
  --accent-red-bg: rgba(185, 28, 28, 0.12);
  --accent-amber: #b45309;
  --accent-amber-bg: rgba(180, 83, 9, 0.12);
  
  --nav-bg: rgba(255, 255, 255, 0.98);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --glow-cyan: 0 0 16px rgba(2, 132, 199, 0.2);
  --glow-blue: 0 0 20px rgba(29, 78, 216, 0.2);
}

/* Base Reset & Setup */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  transition: background-color 0.25s ease, border-color 0.25s ease, color 0.15s ease;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

code, pre, .mono {
  font-family: 'JetBrains Mono', monospace;
}

/* ==========================================================================
   Top Sticky Navigation Bar
   ========================================================================== */
.top-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1650px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
}

.brand-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: var(--glow-cyan);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, var(--text-primary) 30%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tagline {
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 0.75rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap; /* Keep on single line across all pages */
}

.nav-link:hover {
  color: var(--text-primary);
  background-color: var(--bg-card-hover);
}

.nav-link.active {
  color: var(--accent-cyan);
  background: var(--accent-green-bg);
  font-weight: 600;
  white-space: nowrap;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s ease;
}

.theme-toggle-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.mobile-toggle {
  display: none;
}

/* Primary Action Button */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #ffffff;
  border: none;
  padding: 0.55rem 1.25rem;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.45);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.55rem 1.25rem;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Mobile Menu Toggle */
.mobile-toggle {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ==========================================================================
   Layout Containers & Grid
   ========================================================================== */
.main-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem 1.5rem;
}

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.glass-card:hover {
  border-color: var(--border-light);
}

/* ==========================================================================
   Hero Section (Home Landing Page)
   ========================================================================== */
.hero-section {
  padding: 4rem 0 3rem 0;
  text-align: center;
  max-width: 960px;
  margin: 0 auto;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-green-bg);
  border: 1px solid var(--accent-green);
  color: var(--accent-green);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 1rem;
  border-radius: 9999px;
  margin-bottom: 1.5rem;
}

.hero-title {
  font-size: 3.25rem;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  font-weight: 800;
}

.hero-gradient {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 2.25rem;
}

.hero-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Interactive Metric Badges & Status Indicators
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
}

.badge-green {
  background: var(--accent-green-bg);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-red {
  background: var(--accent-red-bg);
  color: var(--accent-red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-amber {
  background: var(--accent-amber-bg);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-blue {
  background: rgba(59, 130, 246, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-cyan {
  background: rgba(6, 182, 212, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.badge-purple {
  background: rgba(168, 85, 247, 0.12);
  color: #9333ea;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

[data-theme="dark"] .badge-purple,
:root:not([data-theme="light"]) .badge-purple {
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

/* ==========================================================================
   Features Deep-Dive Grid
   ========================================================================== */
.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.section-title {
  font-size: 2.1rem;
  margin-bottom: 0.5rem;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 650px;
  margin: 0 auto;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3.5rem;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-cyan);
  box-shadow: var(--shadow-md);
}

.feature-icon-box {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

.feature-title {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.feature-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  flex-grow: 1;
}

.feature-bullets {
  list-style: none;
  margin-top: 1rem;
  border-top: 1px solid var(--border-color);
  padding-top: 0.85rem;
}

.feature-bullets li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  padding: 0.25rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   Table & Financial Data Presentation
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.data-table th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  padding: 0.85rem 1rem;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border-color);
}

.data-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

.data-table tr:hover td {
  background: var(--bg-card-hover);
}

.clickable-row {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.clickable-row:hover td {
  background: var(--bg-card-hover) !important;
}

.sector-chevron {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--accent-cyan);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.sector-chevron.open {
  transform: rotate(90deg);
}

.sector-drawer {
  background: var(--bg-secondary);
}

.sector-drawer td {
  border-bottom: 2px solid var(--accent-cyan) !important;
  background: var(--bg-secondary) !important;
  padding: 0.75rem !important;
}

/* ==========================================================================
   Form System & Input Controls
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.15rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.input-icon-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-icon-prefix {
  position: absolute;
  left: 0.95rem;
  font-size: 1rem;
  pointer-events: none;
  color: var(--text-muted);
  user-select: none;
  z-index: 1;
}

.form-input {
  width: 100%;
  padding: 0.82rem 1rem 0.82rem 2.6rem;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.92rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.form-input.no-icon {
  padding-left: 1rem;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent-cyan);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.18), inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.form-input::placeholder {
  color: var(--text-muted);
  opacity: 0.8;
}

select.form-input {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.1rem;
  padding-right: 2.5rem;
}

.input-password-toggle {
  position: absolute;
  right: 0.85rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.35rem;
  border-radius: 6px;
  transition: color 0.15s ease;
  line-height: 1;
}

.input-password-toggle:hover {
  color: var(--accent-cyan);
}

.form-hint {
  display: block;
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

/* Progress bar */
.bar-track {
  width: 100%;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.page-footer {
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 1.5rem;
  background: var(--bg-secondary);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Auth Visibility Helpers */
.mobile-only-auth {
  display: none !important;
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Drawer
   ========================================================================== */
@media (max-width: 1240px) {
  .brand-tagline {
    display: none;
  }
  .nav-link {
    font-size: 0.84rem;
    padding: 0.4rem 0.55rem;
  }
  .nav-links {
    gap: 0.2rem;
  }
}

@media (max-width: 992px) {
  .hero-title {
    font-size: 2.5rem;
  }
  .nav-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .theme-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 9px;
  }
  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 9px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.35rem;
    cursor: pointer;
    line-height: 1;
    transition: all 0.2s ease;
  }
  .mobile-toggle:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-cyan);
  }
  .nav-links {
    display: none;
  }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 70px;
    left: 0;
    width: 100%;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    box-shadow: var(--shadow-lg);
    gap: 0.5rem;
    z-index: 999;
  }
  .nav-links.open li {
    width: 100%;
  }
  .nav-links.open .nav-link {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border-radius: 9px;
  }
  .desktop-only-auth {
    display: none !important;
  }
  .mobile-only-auth {
    display: block !important;
  }
}

@media (max-width: 600px) {
  .hero-title {
    font-size: 1.9rem;
  }
  .hero-subtitle {
    font-size: 0.95rem;
  }
  .main-wrapper {
    padding: 1.25rem 1rem;
  }
  .brand-title {
    font-size: 1.15rem;
  }
  .brand-tagline {
    display: none;
  }
}

/* ==========================================================================
   Modern Minimalist Glassmorphic Scrollbar (Universal)
   ========================================================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
  transition: background 0.2s ease, transform 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}

/* ==========================================================================
   Institutional Trading & Quantitative Microstructure Design Tokens
   Engineered for Perfect Visual Contrast in Both Dark and Light Themes
   ========================================================================== */

/* Universal High Contrast Light Theme Assurance */
[data-theme="light"] .glass-card,
[data-theme="light"] .setup-card,
[data-theme="light"] .feature-card {
  background: #ffffff !important;
  border-color: #cbd5e1 !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06) !important;
  color: #0f172a !important;
}

[data-theme="light"] .stat-pill,
[data-theme="light"] .blueprint-grid {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
}

[data-theme="light"] .stat-pill-label,
[data-theme="light"] .blueprint-label {
  color: #475569 !important;
  font-weight: 700 !important;
}

[data-theme="light"] .stat-pill-value,
[data-theme="light"] .blueprint-val {
  color: #0f172a !important;
}

[data-theme="light"] .telugu-guidance-box,
[data-theme="light"] .telugu-box {
  background: #f0fdf4 !important;
  border-left-color: #059669 !important;
  color: #064e3b !important;
  border: 1px solid #bbf7d0 !important;
  border-left-width: 4px !important;
}

[data-theme="light"] .data-table th {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  font-weight: 700 !important;
  border-bottom: 2px solid #cbd5e1 !important;
}

[data-theme="light"] .data-table td {
  color: #0f172a !important;
  border-bottom: 1px solid #e2e8f0 !important;
}

/* Minervini VCP & Stage 2 Trend Badges */
.vcp-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  background: rgba(6, 182, 212, 0.14);
  color: #0284c7;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

[data-theme="dark"] .vcp-badge,
:root:not([data-theme="light"]) .vcp-badge {
  color: #38bdf8;
  background: rgba(6, 182, 212, 0.16);
  border-color: rgba(56, 189, 248, 0.4);
}

/* Volume Dry-Up (VDU) Badge */
.vdu-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  background: rgba(16, 185, 129, 0.14);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

[data-theme="dark"] .vdu-badge,
:root:not([data-theme="light"]) .vdu-badge {
  color: #34d399;
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(52, 211, 153, 0.4);
}

/* Mansfield Relative Strength (RS Rating) Badge */
.rs-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(147, 51, 234, 0.14);
  color: #7e22ce;
  border: 1px solid rgba(147, 51, 234, 0.35);
}

[data-theme="dark"] .rs-badge,
:root:not([data-theme="light"]) .rs-badge {
  color: #c084fc;
  background: rgba(147, 51, 234, 0.16);
  border-color: rgba(192, 132, 252, 0.4);
}

/* Stage 2 Momentum Leader Badge */
.stage2-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(245, 158, 11, 0.14);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

[data-theme="dark"] .stage2-badge,
:root:not([data-theme="light"]) .stage2-badge {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(251, 191, 36, 0.4);
}

/* CPR Width Theta Shield Banner for F&O */
.cpr-shield-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  margin-bottom: 1.25rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.cpr-shield-narrow {
  background: rgba(16, 185, 129, 0.12);
  border: 1.5px solid #10b981;
  color: #047857;
}

[data-theme="dark"] .cpr-shield-narrow,
:root:not([data-theme="light"]) .cpr-shield-narrow {
  background: rgba(16, 185, 129, 0.14);
  border-color: #10b981;
  color: #34d399;
}

.cpr-shield-wide {
  background: rgba(239, 68, 68, 0.12);
  border: 1.5px solid #ef4444;
  color: #b91c1c;
}

[data-theme="dark"] .cpr-shield-wide,
:root:not([data-theme="light"]) .cpr-shield-wide {
  background: rgba(239, 68, 68, 0.14);
  border-color: #ef4444;
  color: #f87171;
}

/* 0-DTE Gamma Blast Radar Indicator */
.gamma-blast-pulse {
  animation: gammaPulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes gammaPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.02);
  }
}

/* ==========================================================================
   DG Power AI - Smart Auto-Hide Floating AI Assistant Widget & Drawer
   - Desktop: Sleek glassmorphic floating pill with pulse status
   - Mobile: 36px mini dot that auto-hides when scrolling down
   ========================================================================== */

.dg-ai-fab-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1080;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 1.15rem;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(6, 182, 212, 0.45);
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 0 14px rgba(6, 182, 212, 0.25);
  cursor: pointer;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  user-select: none;
  font-family: inherit;
  outline: none;
}

[data-theme="light"] .dg-ai-fab-btn {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(2, 132, 199, 0.45);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 0 12px rgba(2, 132, 199, 0.18);
}

.dg-ai-fab-btn:hover {
  transform: translateY(-2px) scale(1.02);
  border-color: var(--accent-cyan);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), 0 0 22px rgba(6, 182, 212, 0.5);
}

.dg-ai-fab-btn:active {
  transform: scale(0.96);
}

.dg-fab-icon {
  font-size: 1.15rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 4px rgba(6, 182, 212, 0.6));
}

.dg-fab-text {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text-primary);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.dg-fab-status {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: dgFabStatusPulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
  flex-shrink: 0;
}

@keyframes dgFabStatusPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.85);
  }
}

/* Mobile Smart Auto-Hide & Compact 36px Mini Dot */
@media (max-width: 768px) {
  .dg-ai-fab-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    bottom: 18px !important;
    right: 16px !important;
    justify-content: center !important;
    opacity: 0.85 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4), 0 0 8px rgba(6, 182, 212, 0.25) !important;
  }

  .dg-ai-fab-btn .dg-fab-text,
  .dg-ai-fab-btn .dg-fab-status {
    display: none !important;
  }

  .dg-ai-fab-btn .dg-fab-icon {
    font-size: 15px !important;
  }

  /* Auto-hide state triggered when user scrolls down */
  .dg-ai-fab-btn.dg-fab-hidden {
    transform: translateY(65px) scale(0.65) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

/* Slide-over Backdrop */
.dg-ai-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.dg-ai-backdrop.open {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* Slide-over AI Drawer / Panel */
.dg-ai-drawer {
  position: fixed;
  top: 0;
  right: -480px;
  width: 440px;
  max-width: 92vw;
  height: 100vh;
  height: 100dvh;
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.55);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  transition: right 0.32s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.dg-ai-drawer.open {
  right: 0 !important;
}

/* Mobile Bottom Sheet Layout */
@media (max-width: 768px) {
  .dg-ai-drawer {
    top: auto !important;
    bottom: -100% !important;
    right: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 86vh !important;
    height: 86dvh !important;
    border-radius: 20px 20px 0 0 !important;
    border-left: none !important;
    border-top: 1px solid var(--border-color) !important;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.65) !important;
    transition: bottom 0.32s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .dg-ai-drawer.open {
    bottom: 0 !important;
    right: 0 !important;
  }
}

.dg-drawer-handle {
  display: none;
  width: 38px;
  height: 4px;
  border-radius: 9999px;
  background: var(--border-light);
  margin: 8px auto 4px auto;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .dg-drawer-handle {
    display: block;
  }
}

.dg-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.dg-header-title-box {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.dg-header-icon-wrap {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.35);
  flex-shrink: 0;
}

.dg-header-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.dg-header-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 2px;
}

.dg-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
  display: inline-block;
}

.dg-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dg-sym-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid var(--accent-cyan);
  color: var(--accent-cyan);
  letter-spacing: 0.04em;
  font-family: 'JetBrains Mono', monospace;
}

.dg-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.15s ease;
  line-height: 1;
}

.dg-close-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ef4444;
}

/* Quick Chips */
.dg-quick-chips {
  display: flex;
  gap: 0.4rem;
  padding: 0.6rem 1rem;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.dg-quick-chips::-webkit-scrollbar {
  display: none;
}

.dg-chip {
  flex-shrink: 0;
  padding: 0.28rem 0.65rem;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 9999px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.dg-chip:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
}

/* Chat Messages */
.dg-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(6, 182, 212, 0.3) transparent;
}

.dg-chat-messages::-webkit-scrollbar {
  width: 5px;
}

.dg-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.dg-chat-msg {
  max-width: 90%;
  padding: 0.85rem 1.05rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.55;
  word-break: break-word;
  overflow-wrap: break-word;
}

.dg-user-msg {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #ffffff;
  border-bottom-right-radius: 3px;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.25);
}

.dg-bot-msg {
  align-self: flex-start;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-bottom-left-radius: 3px;
  width: 100%;
  max-width: 96%;
}

.dg-bot-badge {
  color: var(--accent-cyan);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-block;
  margin-bottom: 0.4rem;
}

.dg-telugu-hint {
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.dg-telugu-card {
  margin-top: 0.75rem;
  padding: 0.75rem 0.9rem;
  border-radius: 8px;
  background: rgba(6, 182, 212, 0.08);
  border-left: 3px solid var(--accent-cyan);
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--text-primary);
}

.dg-telugu-card strong {
  color: var(--accent-cyan);
}

/* Drawer Footer / Input Bar */
.dg-drawer-footer {
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.dg-chat-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}

.dg-chat-input {
  flex: 1;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  padding: 0 0.85rem;
  font-size: 0.88rem;
  outline: none;
  font-family: inherit;
  min-width: 0;
}

.dg-chat-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 2px rgba(6, 182, 212, 0.2);
}

.dg-send-btn {
  height: 42px;
  padding: 0 1rem;
  border-radius: 8px;
  border: none;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #ffffff;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.35);
  transition: all 0.2s ease;
  font-family: inherit;
}

.dg-send-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.dg-send-btn:active {
  transform: scale(0.97);
}


