/* Profitalyzer V49.11 — dark selected states + interaction clarity */
:root[data-theme="dark"]{
  --pf11-select:#7657ff;
  --pf11-select-2:#9c86ff;
  --pf11-select-bg:#2b2148;
  --pf11-select-bg-strong:#6b4df3;
  --pf11-select-border:#8067f2;
  --pf11-select-text:#f7f3ff;
}
/* Selected controls must remain unmistakable in dark mode. */
:root[data-theme="dark"] button.on,
:root[data-theme="dark"] button.active,
:root[data-theme="dark"] button.selected,
:root[data-theme="dark"] [role="tab"][aria-selected="true"],
:root[data-theme="dark"] button[aria-pressed="true"],
:root[data-theme="dark"] .pbmode.on,
:root[data-theme="dark"] .pbmo.on,
:root[data-theme="dark"] .v17horizon button.on,
:root[data-theme="dark"] .v17metrictabs button.on,
:root[data-theme="dark"] .v49seriesbuttons button.on,
:root[data-theme="dark"] .v49typebuttons button.on,
:root[data-theme="dark"] .chart-types button.on,
:root[data-theme="dark"] .metric-toggles button.on,
:root[data-theme="dark"] .chart-pills button.on,
:root[data-theme="dark"] .mt-type-tabs button.on,
:root[data-theme="dark"] .pf-work-tab.on,
:root[data-theme="dark"] .iascale button.on,
:root[data-theme="dark"] .iachoicebar button.on {
  background:linear-gradient(135deg,var(--pf11-select-bg-strong),#5637d8)!important;
  border-color:var(--pf11-select-2)!important;
  color:var(--pf11-select-text)!important;
  box-shadow:0 0 0 1px rgba(159,135,255,.22),0 7px 20px rgba(78,48,174,.28)!important;
}
:root[data-theme="dark"] button.on b,
:root[data-theme="dark"] button.active b,
:root[data-theme="dark"] button.selected b,
:root[data-theme="dark"] .iachoicebar button.on b{color:var(--pf11-select-text)!important}

/* Card-style choices get a visible purple surface without flattening their content. */
:root[data-theme="dark"] .v11biz.selected,
:root[data-theme="dark"] .v11goal.selected,
:root[data-theme="dark"] .v3comparegrid article.on,
:root[data-theme="dark"] .source.selected,
:root[data-theme="dark"] .source-primary,
:root[data-theme="dark"] .step.active{
  background:linear-gradient(135deg,#2a2142,#211b31)!important;
  border-color:var(--pf11-select-border)!important;
  box-shadow:0 0 0 1px rgba(150,125,255,.16),0 8px 24px rgba(0,0,0,.18)!important;
}
:root[data-theme="dark"] .v11biz.selected strong,
:root[data-theme="dark"] .v11goal.selected strong{color:#f7f3ff!important}

/* Native check/radio choices need a visible purple state too. */
:root[data-theme="dark"] input[type="checkbox"],
:root[data-theme="dark"] input[type="radio"]{accent-color:var(--pf11-select)!important}
:root[data-theme="dark"] input[type="checkbox"]:checked,
:root[data-theme="dark"] input[type="radio"]:checked{filter:drop-shadow(0 0 4px rgba(127,96,255,.45))}

/* Selected option rows / labels used by some calculators. */
:root[data-theme="dark"] label:has(> input[type="radio"]:checked),
:root[data-theme="dark"] label:has(> input[type="checkbox"]:checked){
  border-color:color-mix(in srgb,var(--pf11-select-border) 70%,transparent);
}

/* Keep focus and selected states visually distinct. */
:root[data-theme="dark"] button:focus-visible,
:root[data-theme="dark"] a:focus-visible,
:root[data-theme="dark"] input:focus-visible,
:root[data-theme="dark"] select:focus-visible,
:root[data-theme="dark"] textarea:focus-visible{
  outline:2px solid var(--pf11-select-2)!important;
  outline-offset:2px!important;
}
