:root {
  --ct-surface: #ffffff;
  --ct-surface-soft: #f5f7fb;
  --ct-border: #dce3ed;
  --ct-text: #101828;
  --ct-muted: #64748b;
  --ct-brand: #3b82f6;
  --ct-brand-dark: #2563eb;
  --ct-accent: #22c55e;
}

.theme-toggle {
  appearance: none;
  -webkit-appearance: none;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  place-items: center;
  flex: 0 0 42px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--ct-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  color: var(--ct-text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  vertical-align: middle;
  transform: translateY(0);
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease;
}

.theme-toggle:hover {
  border-color: var(--ct-brand);
  background: #ffffff;
  transform: translateY(-1px);
}

.theme-toggle:focus-visible {
  outline: 3px solid rgba(59, 130, 246, .24);
  outline-offset: 2px;
}

.bp-header-actions .theme-toggle,
.subscription-actions .theme-toggle,
.auth-top .theme-toggle,
header .theme-toggle {
  align-self: center;
}

.theme-toggle span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1em;
  height: 1em;
}

.theme-toggle .theme-light-icon { display: none; }
.dark-theme .theme-toggle .theme-light-icon { display: inline-flex; }
.dark-theme .theme-toggle .theme-dark-icon { display: none; }

.dark-theme {
  color-scheme: dark;
  --ct-surface: #151d2b;
  --ct-surface-soft: #0b111d;
  --ct-border: #273348;
  --ct-text: #f1f5f9;
  --ct-muted: #94a3b8;
}

.dark-theme .theme-toggle {
  background: #101827;
  border-color: #273348;
  color: #e2e8f0;
}

.dark-theme .theme-toggle:hover {
  background: #172033;
  border-color: #3b82f6;
}

.dark-theme body,
.dark-theme .bp-page {
  background: #0b111d !important;
  color: var(--ct-text) !important;
}

.dark-theme .bp-header.scrolled,
.dark-theme .card,
.dark-theme .bp-stats-card,
.dark-theme .bp-testimonial-card,
.dark-theme .bp-pricing-card,
.dark-theme .bp-faq-item,
.dark-theme .bp-preview-card,
.dark-theme .bp-media-card,
.dark-theme .trade-panel,
.dark-theme .day-panel,
.dark-theme .account-card,
.dark-theme .analytics-card,
.dark-theme .projection-result,
.dark-theme .calendar-card,
.dark-theme .calendar-weekdays,
.dark-theme .calendar-day,
.dark-theme .form-section,
.dark-theme input,
.dark-theme select,
.dark-theme textarea {
  background: #151d2b !important;
  color: var(--ct-text) !important;
  border-color: var(--ct-border) !important;
}

.dark-theme .bp-header.scrolled { background: rgba(11, 17, 29, .94) !important; }
.dark-theme .bp-page {
  --bp-bg: #0b111d;
  --bp-bg-alt: #151d2b;
  --bp-bg-soft: #101827;
  --bp-bg-card: #151d2b;
  --bp-border: #273348;
  --bp-text: #f1f5f9;
  --bp-text-muted: #94a3b8;
  --bp-text-primary: #f1f5f9;
  --bp-text-secondary: #94a3b8;
}
.dark-theme .bp-logo,
.dark-theme .bp-section-title,
.dark-theme .bp-feature-title,
.dark-theme .bp-pricing-name,
.dark-theme .panel-title,
.dark-theme h1,
.dark-theme h2,
.dark-theme h3,
.dark-theme th,
.dark-theme td { color: var(--ct-text) !important; }
.dark-theme .score-row strong,
.dark-theme .equity-summary strong,
.dark-theme .account-balance strong,
.dark-theme .account-stat strong { color: var(--ct-text) !important; }
.dark-theme .bp-section-desc,
.dark-theme .bp-hero-sub,
.dark-theme .bp-hero-lead,
.dark-theme .bp-nav a,
.dark-theme .sub,
.dark-theme .metric-label,
.dark-theme .field label { color: var(--ct-muted) !important; }
.dark-theme main { background: #0b111d; }
.dark-theme .calendar-day.outside,
.dark-theme .calendar-summary,
.dark-theme .account-stat,
.dark-theme .equity-chart-wrap,
.dark-theme .projection-chart-wrap,
.dark-theme .mini-calendar-day,
.dark-theme .trade-panel header,
.dark-theme .day-panel header,
.dark-theme .upload-box { background: #101827 !important; }
.dark-theme .calendar-day.profit { background: #123629 !important; color: #6ee7b7 !important; }
.dark-theme .calendar-day.loss { background: #3a1821 !important; color: #fda4af !important; }
.dark-theme .calendar-day.breakeven { background: #263143 !important; color: #cbd5e1 !important; }
.dark-theme .mini-calendar-day.profit { background: #123629 !important; color: #6ee7b7 !important; border-color: #245b46 !important; }
.dark-theme .mini-calendar-day.loss { background: #3a1821 !important; color: #fda4af !important; border-color: #6b2634 !important; }
.dark-theme .mini-calendar-day.breakeven { background: #263143 !important; color: #cbd5e1 !important; }
.dark-theme .weekday-track { background: #273348; }
.dark-theme .score-breakdown { border-color: var(--ct-border); }
.dark-theme .risk-mode span { background: #151d2b; border-color: var(--ct-border); color: var(--ct-muted); }
.dark-theme .risk-mode input:checked + span { background: #172554; border-color: #3b82f6; color: #bfdbfe; }
.dark-theme .secondary-btn,
.dark-theme .calendar-nav,
.dark-theme .calendar-today,
.dark-theme .btn.secondary { background: #1a2435 !important; color: var(--ct-text) !important; border-color: var(--ct-border) !important; }
.dark-theme .auth-panel .card { background: rgba(21, 29, 43, .96) !important; }
.dark-theme .auth-brand { background: #0b111d; }
.dark-theme aside { background: #0a1020 !important; border-right-color: #1f2a3d !important; }
.dark-theme aside nav a.active,
.dark-theme aside nav a:hover { background: #1d2a40 !important; color: #f8fafc !important; }
.dark-theme .calendar-summary-item,
.dark-theme .account-stat,
.dark-theme .projection-result { background: #101827 !important; }
.dark-theme .day-trade,
.dark-theme .image-preview,
.dark-theme .day-trade-image { border-color: var(--ct-border) !important; }
.dark-theme .day-trade-comment { color: #cbd5e1 !important; }
.dark-theme .trade-date-display { background: #172554 !important; color: #bfdbfe !important; }
.dark-theme .close-modal { background: #263143 !important; color: #f8fafc !important; }
.dark-theme .bp-section,
.dark-theme .bp-feature-showcase,
.dark-theme .bp-cta,
.dark-theme .bp-footer { background: #0b111d !important; }
.dark-theme .bp-tab,
.dark-theme .bp-btn-outline,
.dark-theme .bp-pricing-btn-outline { background: #151d2b !important; color: #e2e8f0 !important; border-color: #273348 !important; }
.dark-theme .bp-tab.active { background: #172554 !important; color: #bfdbfe !important; border-color: #3b82f6 !important; }
.dark-theme .bp-feature-item,
.dark-theme .bp-pricing-feature,
.dark-theme .bp-faq-answer-inner,
.dark-theme .bp-footer-link { color: #a8b3c4 !important; }
.dark-theme .bp-badge { color: #93c5fd !important; background: rgba(59, 130, 246, .12) !important; border-color: rgba(96, 165, 250, .35) !important; }
.dark-theme .auth-panel label { color: #cbd5e1 !important; }
.dark-theme .auth-panel input { background: #101827 !important; color: #f8fafc !important; border-color: #334155 !important; }
.dark-theme .auth-brand .logo { color: #f8fafc !important; }
