/* One inset state line per persistent control. The engraving belongs inside
   its button, with room between the light and the outer bottom edge. */
body[data-theme] button.control-toggle {
  position:relative;
  --toggle-line-color:var(--sd-glass-groove,var(--control-rail));
  --toggle-line-glow:none;
  --toggle-line-opacity:.7;
  --toggle-line-inset:auto 7px 3px;
}
body[data-theme] button.control-toggle:is(.material-glass-button,.material-abs-button):not(.control-push)::after {
  content:""!important;
  display:block!important;
  position:absolute!important;
  inset:var(--toggle-line-inset)!important;
  width:auto!important;
  height:2px!important;
  border:0!important;
  border-radius:1px!important;
  background:var(--toggle-line-color)!important;
  box-shadow:var(--toggle-line-glow)!important;
  opacity:var(--toggle-line-opacity)!important;
  transform:none!important;
  pointer-events:none!important;
}
body[data-theme] button.control-toggle:is(.material-glass-button,.material-abs-button):is(
  [aria-pressed="true"],
  [aria-selected="true"],
  [aria-checked="true"],
  .is-open,
  .is-active:not([aria-pressed]):not([aria-selected]):not([aria-checked])
) {
  --toggle-line-color:color-mix(in srgb,var(--state-tone,var(--ui-neutral)) 86%,var(--sd-glass-text) 14%);
  --toggle-line-glow:0 0 4px color-mix(in srgb,var(--state-tone,var(--ui-neutral)) 45%,transparent);
  --toggle-line-opacity:1;
}
/* Explicit false state wins over stale visual classes. Open app launchers
   keep their light even when another window has keyboard focus. */
body[data-theme] button.control-toggle:is(.material-glass-button,.material-abs-button):not(.is-open):is(
  [aria-pressed="false"],
  [aria-selected="false"],
  [aria-checked="false"]
) {
  --toggle-line-color:var(--sd-glass-groove,var(--control-rail));
  --toggle-line-glow:none;
  --toggle-line-opacity:.7;
}
/* Flat navigation and choice rows use only the shared bottom indicator.
   Legacy selection shadows on the left otherwise add a second state marker
   in Places, Notes, application categories and Overview project/results. */
body[data-theme] button.control-toggle:is(.material-glass-button,.material-abs-button):is(.nav-choice,.launcher-category,.overview-project,.universal-result) {
  --toggle-line-inset:auto 7px 3px;
  border:0!important;
  box-shadow:none!important;
}
/* Reuse the shared inset engraving for tabs and choices; remove their old
   state shadow, while retaining all four edges of the button frame. */
body[data-theme] button.control-toggle:is(.material-glass-button,.material-abs-button):is(.workspace-tab,[data-package-mode]) {
  box-shadow:none!important;
}
/* Overview tasks used a separate child light before receiving the shared rail. */
body[data-theme] button.overview-task.control-toggle>i {
  display:none!important;
}
body[data-theme] button.control-push::after {
  content:none!important;
  display:none!important;
}
