/* Canterivo 1.9.4.5 — isolated WCAG contrast corrections.
   This layer changes colors only. It must remain last in the stylesheet order. */

/* Classic: AA text contrast and 3:1 boundaries/focus on both main surfaces. */
:root:not([data-theme]),
:root[data-theme="classic"]{
  --muted:#596963;
  --line:#657c73;
  --gold:#825916;
}

:root:not([data-theme]) :where(a,button,input,select,textarea,summary,[tabindex]):focus-visible,
:root[data-theme="classic"] :where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{
  outline-color:#825916;
}

:root:not([data-theme]) :is(input,textarea,select):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
:root[data-theme="classic"] :is(input,textarea,select):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
:root:not([data-theme]) :is(.button.secondary,.theme-choice,.dialog-close,.modal-close,[data-dialog-close],[data-modal-close]),
:root[data-theme="classic"] :is(.button.secondary,.theme-choice,.dialog-close,.modal-close,[data-dialog-close],[data-modal-close]){
  border-color:#657c73;
}

/* Noir and Platinum: control boundaries reach at least 3:1 on soft surfaces. */
:root[data-theme="noir"]{--theme-border:#667a6e;--line:#667a6e}
:root[data-theme="platinum"]{--theme-border:#788c95;--line:#788c95}

:root:is([data-theme="noir"],[data-theme="platinum"]) :where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{
  outline-color:var(--theme-focus);
}

/* Disabled controls are exempt from WCAG contrast criteria, but remain legible. */
.button:disabled,
.button[aria-disabled="true"]{opacity:.74}

@media (forced-colors:active){
  :where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid Highlight}
  :is(input,textarea,select,.button.secondary,.theme-choice){border-color:ButtonText}
}
