:root {
  --dw-theme-page-bg: #ffffff;
  --dw-theme-surface: #f8fafc;
  --dw-theme-surface-strong: #ffffff;
  --dw-theme-border: #dbe3ea;
  --dw-theme-accent: #0f766e;
  --dw-theme-accent-hover: #115e59;
  --dw-theme-focus: rgba(15, 118, 110, 0.35);
}


  /*
   * Sprint 7.5A v1.0.3: conservative dim mode with approved soft blue-gray background.
   * Only background/surface colors are adjusted.
   * Text colors are intentionally NOT overridden here, so existing site/card typography stays intact.
   */

html[data-dw-theme="dark"] {
  --dw-theme-page-bg: #b3c0cd;
  --dw-theme-surface: #eef3f7;
  --dw-theme-surface-strong: #ffffff;
  --dw-theme-border: #9aabba;
  --dw-theme-accent: #007c74;
  --dw-theme-accent-hover: #005f59;
  --dw-theme-focus: rgba(0, 124, 116, 0.38);

  --dw-bg: var(--dw-theme-page-bg);
  --dw-surface: var(--dw-theme-surface);
  --dw-card: var(--dw-theme-surface);
  --dw-border: var(--dw-theme-border);
  --dw-accent: var(--dw-theme-accent);
  --dw-primary: var(--dw-theme-accent);
}

.dw-theme-toggle-wrapper {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  vertical-align: middle;
}

.dw-theme-toggle {
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  color: var(--dw-theme-accent);
  font: inherit;
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none !important;
  text-shadow: none;
  transition: transform 160ms ease, color 160ms ease, opacity 160ms ease;
  -webkit-appearance: none;
  appearance: none;
}

.dw-theme-toggle:hover {
  color: var(--dw-theme-accent-hover);
  transform: scale(1.08);
}

.dw-theme-toggle:active {
  transform: scale(0.98);
}

.dw-theme-toggle:focus,
.dw-theme-toggle:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/*
 * Keep keyboard accessibility without the visible square frame.
 * Focus is shown through the icon itself instead of a box around it.
 */
.dw-theme-toggle:focus-visible {
  color: var(--dw-theme-accent-hover);
  text-shadow: 0 0 0.35rem var(--dw-theme-focus);
  transform: scale(1.08);
}

/* Conservative theme mode: page/background surfaces only. Header is intentionally not forced. */
html[data-dw-theme="dark"],
html[data-dw-theme="dark"] body,
html[data-dw-theme="dark"] .wp-site-blocks,
html[data-dw-theme="dark"] main,
html[data-dw-theme="dark"] .entry-content {
  background-color: var(--dw-theme-page-bg);
}

/* Do not force text color. Only soften card/surface backgrounds and borders. */
html[data-dw-theme="dark"] .has-base-background-color,
html[data-dw-theme="dark"] .has-background:not(.has-accent-background-color):not(.has-primary-background-color),
html[data-dw-theme="dark"] .dw-card,
html[data-dw-theme="dark"] .dw-calculator,
html[data-dw-theme="dark"] .dw-result-card,
html[data-dw-theme="dark"] .dw-report,
html[data-dw-theme="dark"] .dw-report-shell,
html[data-dw-theme="dark"] .dw-benchmark-card,
html[data-dw-theme="dark"] .dw-benchmark-preview,
html[data-dw-theme="dark"] .dw-stat-card,
html[data-dw-theme="dark"] .wp-block-column.has-background,
html[data-dw-theme="dark"] .wp-block-group.has-background {
  background-color: var(--dw-theme-surface) !important;
  border-color: var(--dw-theme-border) !important;
}

html[data-dw-theme="dark"] input,
html[data-dw-theme="dark"] select,
html[data-dw-theme="dark"] textarea {
  background-color: var(--dw-theme-surface-strong);
  border-color: var(--dw-theme-border);
}

html[data-dw-theme="dark"] table,
html[data-dw-theme="dark"] th,
html[data-dw-theme="dark"] td,
html[data-dw-theme="dark"] .dw-card *,
html[data-dw-theme="dark"] .dw-calculator *,
html[data-dw-theme="dark"] .dw-result-card *,
html[data-dw-theme="dark"] .dw-report *,
html[data-dw-theme="dark"] .dw-benchmark-preview *,
html[data-dw-theme="dark"] .dw-benchmark-card *,
html[data-dw-theme="dark"] .dw-stat-card * {
  border-color: var(--dw-theme-border);
}

@media (prefers-reduced-motion: reduce) {
  .dw-theme-toggle {
    transition: none;
  }
}

@media print {
  html,
  html[data-dw-theme="dark"],
  body,
  html[data-dw-theme="dark"] body,
  .wp-site-blocks,
  .dw-report,
  .dw-report-shell,
  .dw-card,
  .dw-result-card {
    background: #ffffff !important;
    color: #111827 !important;
    color-scheme: light !important;
    box-shadow: none !important;
  }

  html[data-dw-theme="dark"] a,
  a {
    color: #111827 !important;
  }

  .dw-theme-toggle-wrapper {
    display: none !important;
  }
}
