/* BPF 12.5.12.47.31 — Universal interaction-state clarity.
   Cosmetic only. Adds immediate press feedback and a strong persistent selected state
   wherever an existing control already exposes active/selected/current semantics. */
:root{
  --bpf-active-cyan:#66e6ff;
  --bpf-active-cyan-soft:rgba(102,230,255,.22);
  --bpf-active-cyan-line:rgba(102,230,255,.92);
  --bpf-active-inner:rgba(3,24,38,.72);
}

/* Fast tactile visual response. No behavior or routing changes. */
button,
[role="button"],
a.btn,
a.button,
label[role="button"]{
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
  transition:transform .08s ease,filter .08s ease,border-color .10s ease,box-shadow .10s ease,background-color .10s ease!important;
}
button:not(:disabled):active,
[role="button"]:not([aria-disabled="true"]):active,
a.btn:active,
a.button:active,
label[role="button"]:active{
  transform:translateY(1px) scale(.985)!important;
  filter:brightness(1.10)!important;
}

/* Keyboard clarity. */
button:focus-visible,
[role="button"]:focus-visible,
a.btn:focus-visible,
a.button:focus-visible,
input:focus-visible,
select:focus-visible{
  outline:3px solid var(--bpf-active-cyan)!important;
  outline-offset:3px!important;
}

/* Persistent state: only applies when the page already marks the control selected. */
button.active:not(.danger):not(.stop):not(.destructive):not(.delete):not(.remove):not(.critical),
button.selected:not(.danger):not(.stop):not(.destructive):not(.delete):not(.remove):not(.critical),
button.is-selected:not(.danger):not(.stop):not(.destructive):not(.delete):not(.remove):not(.critical),
button.on:not(.danger):not(.stop):not(.destructive):not(.delete):not(.remove):not(.critical),
button.sel:not(.danger):not(.stop):not(.destructive):not(.delete):not(.remove):not(.critical),
button[aria-pressed="true"]:not(.danger):not(.stop):not(.destructive):not(.delete):not(.remove):not(.critical),
button[aria-selected="true"]:not(.danger):not(.stop):not(.destructive):not(.delete):not(.remove):not(.critical),
button[aria-current="true"]:not(.danger):not(.stop):not(.destructive):not(.delete):not(.remove):not(.critical),
button[data-selected="true"]:not(.danger):not(.stop):not(.destructive):not(.delete):not(.remove):not(.critical),
button[data-active="true"]:not(.danger):not(.stop):not(.destructive):not(.delete):not(.remove):not(.critical),
[role="button"].active:not(.danger):not(.stop),
[role="button"].selected:not(.danger):not(.stop),
[role="button"][aria-pressed="true"]:not(.danger):not(.stop),
[role="button"][aria-selected="true"]:not(.danger):not(.stop),
a.btn.active:not(.danger):not(.stop),
a.btn.selected:not(.danger):not(.stop),
a.btn[aria-current="page"]:not(.danger):not(.stop),
a.button.active:not(.danger):not(.stop),
a.button.selected:not(.danger):not(.stop){
  border-color:var(--bpf-active-cyan-line)!important;
  outline:2px solid var(--bpf-active-cyan-line)!important;
  outline-offset:2px!important;
  box-shadow:0 0 0 5px var(--bpf-active-cyan-soft), inset 0 0 0 1px rgba(255,255,255,.14)!important;
  filter:brightness(1.06) saturate(1.06)!important;
}

/* Common selected wrappers and native choices. */
label.active,
label.selected,
label:has(input[type="radio"]:checked),
label:has(input[type="checkbox"]:checked){
  border-color:var(--bpf-active-cyan-line)!important;
  box-shadow:0 0 0 4px var(--bpf-active-cyan-soft)!important;
}
input[type="radio"]:checked,
input[type="checkbox"]:checked{
  accent-color:var(--bpf-active-cyan)!important;
}

/* Current bottom/tab navigation should read as current without changing navigation behavior. */
.bnav-item.active,
.bnav-item[aria-current="page"],
.tab.active,
.tab[aria-selected="true"],
.nav-pill.active,
.nav-pill[aria-current="page"]{
  border-color:var(--bpf-active-cyan-line)!important;
  box-shadow:0 0 0 3px var(--bpf-active-cyan-soft), inset 0 0 0 1px rgba(255,255,255,.12)!important;
}

/* Disabled must remain unmistakably disabled even if stale state classes are present. */
button:disabled,
[role="button"][aria-disabled="true"]{
  transform:none!important;
  outline:none!important;
  filter:saturate(.72)!important;
  box-shadow:none!important;
}

@media (prefers-reduced-motion:reduce){
  button,[role="button"],a.btn,a.button,label[role="button"]{transition:none!important}
}
