/* Competitor-informed enhancements: theme switch, target progress and calculation transparency. */

.theme-toggle {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  font-weight: 800;
  white-space: nowrap;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: var(--blue);
  outline: none;
  transform: translateY(-1px);
}

.theme-toggle-icon {
  width: 1.25rem;
  text-align: center;
  font-size: 1rem;
}

.preset-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.preset-card.sample-card {
  border-color: rgba(134, 239, 172, 0.35);
  background: rgba(22, 101, 52, 0.12);
}

.hero-result {
  gap: 12px;
}

.target-progress {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 9px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.target-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.target-progress-head span {
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.target-progress-head strong {
  color: var(--text);
  font-size: 0.95rem;
  letter-spacing: 0;
}

.progress-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
}

.progress-track > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--accent));
  transition: width 220ms ease;
}

.target-progress small {
  color: var(--muted);
  font-size: 0.82rem;
}

.result-insights {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.3fr);
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card);
}

.insight-target,
.calculation-breakdown {
  min-width: 0;
}

.insight-label {
  display: block;
  margin-bottom: 6px;
  color: var(--soft);
  font-size: 0.76rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.insight-target strong {
  display: block;
  color: var(--text);
  font-size: clamp(1.2rem, 2.5vw, 1.75rem);
  line-height: 1.15;
}

.insight-target p,
.calculation-breakdown p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.calculation-breakdown h3 {
  margin: 0;
  color: var(--text);
  font-size: 1rem;
}

.breakdown-list {
  display: grid;
  gap: 7px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.breakdown-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--field);
  color: var(--muted);
  font-size: 0.86rem;
}

.breakdown-list strong {
  color: var(--text);
  white-space: nowrap;
}

.formula-line {
  overflow-wrap: anywhere;
  padding: 10px;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: rgba(250, 204, 21, 0.07);
  color: var(--muted);
  font-size: 0.82rem;
}

/* Light theme */
html[data-theme="light"] {
  color-scheme: light;
  --page: #f4f7fb;
  --header: #ffffff;
  --card: #ffffff;
  --card-strong: #f8fafc;
  --field: #f8fafc;
  --line: #d9e2ee;
  --line-strong: #c7d3e1;
  --text: #111827;
  --muted: #465568;
  --soft: #667085;
  --accent: #eab308;
  --blue: #1d4ed8;
  --red: #be123c;
  --red-soft: #fff1f2;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --accent-strong: #facc15;
  --accent-ink: #251a00;
  --surface-soft: rgba(255, 255, 255, 0.88);
  --surface-glass: rgba(255, 255, 255, 0.94);
  --success: #15803d;
}

html[data-theme="light"] body {
  background:
    radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.09), transparent 30rem),
    radial-gradient(circle at 88% 7%, rgba(234, 179, 8, 0.08), transparent 26rem),
    var(--page);
}

html[data-theme="light"] .site-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom-color: rgba(15, 23, 42, 0.08);
}

html[data-theme="light"] .button,
html[data-theme="light"] .icon-button,
html[data-theme="light"] .preset-card,
html[data-theme="light"] .steps-grid article,
html[data-theme="light"] .feature-grid article,
html[data-theme="light"] .blog-card {
  background: #ffffff;
}

html[data-theme="light"] .button:hover,
html[data-theme="light"] .icon-button:hover,
html[data-theme="light"] .button:focus-visible,
html[data-theme="light"] .icon-button:focus-visible,
html[data-theme="light"] .preset-card:hover,
html[data-theme="light"] .preset-card:focus-visible {
  background: #f1f5f9;
}

html[data-theme="light"] .preset-card.sample-card {
  background: rgba(22, 163, 74, 0.07);
  border-color: rgba(22, 163, 74, 0.26);
}

html[data-theme="light"] .hero-result,
html[data-theme="light"] .blog-hero {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(238, 244, 252, 0.98));
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.12);
}

html[data-theme="light"] .hero-result::after {
  background: rgba(234, 179, 8, 0.14);
}

html[data-theme="light"] .hero-result-meta,
html[data-theme="light"] .target-progress {
  border-top-color: rgba(15, 23, 42, 0.1);
}

html[data-theme="light"] .trust-list li {
  border-color: rgba(71, 85, 105, 0.18);
  background: rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] .summary-panel {
  background: rgba(244, 247, 251, 0.9);
}

html[data-theme="light"] .module-row {
  background: rgba(255, 255, 255, 0.82);
}

html[data-theme="light"] .components-header {
  color: var(--muted);
}

html[data-theme="light"] .content-page h3,
html[data-theme="light"] .article-body h3 {
  color: #1e3a8a;
}

html[data-theme="light"] .privacy-chip {
  background: rgba(22, 163, 74, 0.08);
  color: #166534;
}

html[data-theme="light"] .final-cta {
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.9), rgba(255, 255, 255, 0.96));
}

html[data-theme="light"] .article-callout,
html[data-theme="light"] .article-cta,
html[data-theme="light"] .formula-line {
  background: rgba(234, 179, 8, 0.08);
}

@media (prefers-color-scheme: light) {
  html:not([data-theme]) {
    color-scheme: light;
    --page: #f4f7fb;
    --header: #ffffff;
    --card: #ffffff;
    --card-strong: #f8fafc;
    --field: #f8fafc;
    --line: #d9e2ee;
    --line-strong: #c7d3e1;
    --text: #111827;
    --muted: #465568;
    --soft: #667085;
    --accent: #eab308;
    --blue: #1d4ed8;
    --red: #be123c;
    --red-soft: #fff1f2;
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  }
}

@media (max-width: 980px) {
  .preset-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .preset-grid,
  .result-insights {
    grid-template-columns: 1fr;
  }

  .theme-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .theme-toggle {
    width: 40px;
    justify-content: center;
    padding-inline: 8px;
  }
}

/* Keep the calculator summary in normal document flow so it never covers entered details. */
.summary-panel {
  position: static;
  top: auto;
  z-index: auto;
}
