/* Theme enhancement: light is unchanged; dark is explicit, never a color filter. */
:root {
  color-scheme: light;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #cbd4c6;
  border-radius: 7px;
  background: #fafcf6;
  color: #344c39;
  font-size: 10px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  flex: 0 0 auto;
}

.theme-toggle:hover {
  background: #e7eddf;
  border-color: #8ba17e;
}

.theme-toggle:focus-visible {
  outline: 3px solid #567c40;
  outline-offset: 4px;
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon--moon {
  display: none;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #111813;
  --white: #1a251c;
  --ink: #edf4e8;
  --muted: #b4c4ae;
  --green: #afd696;
  --lime: #c6e39d;
  --line: #344635;
  --shadow: 0 18px 50px #00000030;
}

html[data-theme="dark"] .theme-toggle {
  background: #1c2b20;
  border-color: #5e7656;
  color: #d5eac5;
}

html[data-theme="dark"] .theme-toggle:hover {
  background: #2b4030;
  border-color: #a2c389;
}

html[data-theme="dark"] .theme-icon--sun {
  display: none;
}

html[data-theme="dark"] .theme-icon--moon {
  display: block;
}

html[data-theme="dark"] :is(button, a, summary, [tabindex]):focus-visible {
  outline-color: #c6e39d;
}

html[data-theme="dark"] .preview-banner {
  background: #223b28;
  color: #d8e9cd;
}

html[data-theme="dark"] .status-dot {
  background: #b6dd8f;
}

html[data-theme="dark"] :is(.language-switch a, .hero-notes) {
  color: #bdcbb5;
}

html[data-theme="dark"] .language-switch a[aria-current="page"] {
  background: #2d432d;
  color: #e7f3da;
}

html[data-theme="dark"] :is(.desktop-nav a:hover, .text-link:hover) {
  color: #c6e39d;
}

html[data-theme="dark"] .hero-lead {
  color: #c7d4bf;
}

html[data-theme="dark"] .hero-notes i {
  color: #c6e39d;
}

html[data-theme="dark"] .hero-visual::before {
  border-color: #304c35;
}

html[data-theme="dark"] .hero-visual::after {
  background: radial-gradient(ellipse, #547b3233, transparent 69%);
}

html[data-theme="dark"] .chart-card {
  background: #17231b;
  border-color: #40553c;
}

html[data-theme="dark"] :is(.chart-topline, .chart-bottomline) {
  border-color: #344635;
}

html[data-theme="dark"] :is(
  .chart-brand span,
  .chart-timeframe,
  .chart-bottomline,
  .visual-caption,
  .chip-bottom div > span
) {
  color: #b7c9ad;
}

html[data-theme="dark"] .chart-bottomline > span:last-child {
  color: #c6e39d;
}

html[data-theme="dark"] .floating-chip {
  background: #263b29;
  border-color: #53714a;
  box-shadow: 0 8px 28px #00000024;
}

html[data-theme="dark"] :is(.chip-icon, .principle-index, .method-number) {
  color: #b8d99a;
}

html[data-theme="dark"] .button-dark {
  background: #c6e39d;
  color: #18251a;
}

html[data-theme="dark"] .button-dark:hover {
  background: #d8f3b1;
}

html[data-theme="dark"] .skip-link {
  background: #c6e39d;
  color: #18251a;
}

html[data-theme="dark"] .button-outline {
  color: #edf4e8;
  border-color: #6c865f;
}

html[data-theme="dark"] .button-outline:hover {
  background: #293e2c;
}

html[data-theme="dark"] .interactive-demo {
  background: #1a271e;
}

html[data-theme="dark"] :is(.demo-controls, .demo-canvas) {
  border-color: #344635;
}

html[data-theme="dark"] .demo-canvas {
  background: #142019;
}

html[data-theme="dark"] .demo-tabs button {
  color: #bccdb3;
}

html[data-theme="dark"] .demo-tabs button[aria-selected="true"] {
  background: #304731;
  color: #e9f4df;
  border-color: #73945d;
}

html[data-theme="dark"] :is(.demo-label, .canvas-caption, .demo-warning) {
  color: #bccdb3;
}

html[data-theme="dark"] .demo-warning > span:first-child {
  color: #b8d99a;
}

html[data-theme="dark"] .step-pill {
  background: #2b432e;
  color: #d4e9c2;
  border-color: #58774a;
}

html[data-theme="dark"] :is(.tools-section, .site-footer) {
  background: #17231a;
  border-color: #344635;
}

html[data-theme="dark"] .tool-card {
  background: #1b2a20;
  border-color: #40573a;
}

html[data-theme="dark"] .tool-featured {
  background: #2a402b;
  border-color: #607f4f;
}

html[data-theme="dark"] .tool-featured::after {
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 38px,
    #9dbc7630 39px,
    #9dbc7630 40px
  );
}

html[data-theme="dark"] :is(.tool-number, .tool-symbol) {
  color: #bedba5;
}

html[data-theme="dark"] .tool-outcome {
  color: #d6e4cc;
  border-color: #49613e;
}

html[data-theme="dark"] .tool-card small {
  color: #bdcdb3;
}

html[data-theme="dark"] .tool-featured .tool-outcome {
  border-color: #65804f;
}

html[data-theme="dark"] :is(.plans-status, .plan-kicker, .price-period) {
  color: #bccdb0;
}

html[data-theme="dark"] .billing-toggle {
  background: #1c2b1e;
  border-color: #49603e;
}

html[data-theme="dark"] .billing-toggle button {
  color: #bed0b1;
}

html[data-theme="dark"] .billing-toggle button[aria-pressed="true"] {
  background: #3b5536;
  color: #f0f7e9;
  box-shadow: 0 1px 4px #00000030;
}

html[data-theme="dark"] .billing-save {
  background: #243820;
  color: #d1e9b8;
}

html[data-theme="dark"] .price-card {
  background: #1b2a1f;
  border-color: #48613d;
}

html[data-theme="dark"] .price-featured {
  background: #243b26;
  border-color: #94b76e;
  box-shadow: 0 10px 30px #00000020;
}

html[data-theme="dark"] .recommended {
  background: #c6e39d;
  color: #1b2b19;
}

html[data-theme="dark"] .plan-features li {
  color: #d3e2c8;
}

html[data-theme="dark"] .plan-features li::before,
html[data-theme="dark"] .compatibility-icon {
  color: #bddc9d;
}

html[data-theme="dark"] .plan-compatibility {
  color: #bfceb3;
  border-color: #48613d;
}

html[data-theme="dark"] .pricing-footnote a {
  color: #c6e39d;
}

html[data-theme="dark"] .scope-section {
  background: #1b2d20;
  color: #edf4e8;
  border-block: 1px solid #344635;
}

html[data-theme="dark"] .scope-grid .eyebrow {
  color: #c7d9b9;
}

html[data-theme="dark"] .scope-list li {
  color: #c1d0b7;
  border-color: #405737;
}

html[data-theme="dark"] .scope-list h3 > span:first-child {
  color: #c6e39d;
}

html[data-theme="dark"] .faq-list summary::after {
  color: #b8d99a;
}

html[data-theme="dark"] .closing-mark {
  background: #30472b;
  color: #d4edb6;
  border-color: #65804e;
}

html[data-theme="dark"] :is(.footer-top > span, .risk-notice, .footer-bottom) {
  color: #b9cbb0;
}

html[data-theme="dark"] .risk-notice {
  border-color: #3b5033;
}

html[data-theme="dark"] dialog {
  background: #1b2a20;
  color: #edf4e8;
  border-color: #68805a;
  box-shadow: 0 30px 150px #00000075;
}

html[data-theme="dark"] dialog::backdrop {
  background: #030a06b8;
}

html[data-theme="dark"] :is(.dialog-close, .dialog-eyebrow) {
  color: #c6dfb1;
}

html[data-theme="dark"] .dialog-plan {
  background: #2c442c;
  color: #dcebd0;
}

/* Chart palettes preserve bullish green and bearish red in either theme. */
html[data-theme="dark"] :is(.market-chart, .analysis-chart) [stroke="#e5eae3"],
html[data-theme="dark"] :is(.market-chart, .analysis-chart) [stroke="#e2e7df"] {
  stroke: #344635;
}

html[data-theme="dark"] .market-chart [stop-color="#95d6a0"] {
  stop-color: #74b989;
}

html[data-theme="dark"] :is(.market-chart, .analysis-chart) [fill="#dbb9b0"],
html[data-theme="dark"] :is(.market-chart, .analysis-chart) [fill="#d9b4aa"] {
  fill: #975e58;
}

html[data-theme="dark"] .market-chart [fill="#77bc84"],
html[data-theme="dark"] .analysis-chart [fill="#78a883"] {
  fill: #71af81;
}

html[data-theme="dark"] .analysis-chart [fill="#9bbda1"] {
  fill: #5d9770;
}

html[data-theme="dark"] .market-chart [stroke="#a87f72"] {
  stroke: #d89d8a;
}

html[data-theme="dark"] .market-chart [stroke="#4f8e5b"],
html[data-theme="dark"] .analysis-chart [stroke="#8caa92"] {
  stroke: #9fc6a4;
}

html[data-theme="dark"] .market-chart [stroke="#47705a"] {
  stroke: #9ac6a3;
}

html[data-theme="dark"] .market-chart [fill="#3e8057"] {
  fill: #8ec895;
  stroke: #8ec895;
}

html[data-theme="dark"] .market-chart [fill="#bd7664"] {
  fill: #d58b7a;
  stroke: #d58b7a;
}

html[data-theme="dark"] .market-chart [stroke="#203c32"],
html[data-theme="dark"] .analysis-chart [stroke="#244c39"] {
  stroke: #d6e8b8;
}

html[data-theme="dark"] .market-chart [fill="#203c32"],
html[data-theme="dark"] .analysis-chart [fill="#224831"] {
  fill: #283e2c;
  stroke: #87a56d;
  stroke-width: 1px;
}

html[data-theme="dark"] .analysis-chart [stroke="#224831"] {
  stroke: #b4d29a;
}

html[data-theme="dark"] .analysis-chart [stroke="#a87454"] {
  stroke: #d89c7d;
}

html[data-theme="dark"] .analysis-chart [stroke="#2d8655"] {
  stroke: #94d2a6;
}

html[data-theme="dark"] .analysis-chart [stroke="#5b6f99"] {
  stroke: #a5b6e5;
}

html[data-theme="dark"] .analysis-chart [fill="#fcfdf9"] {
  fill: #24382a;
  stroke: #607e53;
}

html[data-theme="dark"] .analysis-chart [fill="#637164"] {
  fill: #c1d0b9;
}

html[data-theme="dark"] .analysis-chart [fill="#344b3a"] {
  fill: #e0edcf;
}

html[data-theme="dark"] .analysis-chart [stroke="#e0e6dd"] {
  stroke: #5b7550;
}

html[data-theme="dark"] .analysis-chart [fill="#7ca68c"] {
  fill: #96ce9e;
}

html[data-theme="dark"] .analysis-chart [fill="#be907a"] {
  fill: #dea28b;
}

@media (max-width: 1050px) {
  .header-actions {
    gap: 12px;
  }
}

@media (max-width: 600px) {
  .header-actions {
    gap: 8px;
  }

  .theme-toggle {
    width: 44px;
    padding-inline: 10px;
  }

  .theme-toggle [data-theme-label] {
    display: none;
  }
}
