/* ==========================================================================
   fix 5 Part 3.4: one rule for selected and focus states, site-wide (bonfium-fix5/PROMPT.md).
   Loaded on every page, the auth pages included, last in the head (app/fix3.php fix3_head()).

   - A mouse click never leaves a ring: :focus draws nothing.
   - The keyboard gets one soft 3 px ring with no offset gap: ink at 18 % on light ground, white at 45 % on a field
     or another dark ground. No outline, no outline-offset, so no second ring.
   - Selected chips (ink fill, white text), selected segmented items (white, soft shadow) and selected menu rows
     (assets/fix5/pop.css) carry no ring of their own.
   The ring's colour is one custom property, --bf-ring, set by the ground it sits on (the nearest one wins).
   The untouched home sections (the hero, the listing stack, "What moves", the 15 000 band) keep their own rules.
   ========================================================================== */

:focus:not(:is(section.hero, #listing, #moves, .v4h-cta) *){outline:none!important}
:focus-visible:not(:is(section.hero, #listing, #moves, .v4h-cta) *):not(:is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="file"]),textarea,select)){outline:none!important;outline-offset:0!important;
  box-shadow:var(--bf-ring, 0 0 0 3px rgba(14,20,23,.18))!important}

/* dark grounds: a colour field, the header at rest on a field, dark bands (the footer is light since fix 6) */
.on-dark,.bf-field,.v3 .field,.v3 .stage,.v4-hdr.is-top,.bf-nav-shell.header--on-field:not(.bf-nav-scrolled),.f4-dark,.v5h-dark,.bf-errpage,[data-field]{
  --bf-ring:0 0 0 3px rgba(255,255,255,.45)}
/* light glass and paper inside them: ink again */
.sheet,.sheet-glass,.pit-sheet,.pf-glass,.glass,.v4-card,.v5-card,.bf-pop,.v3-sheetpanel,.v3-pop,dialog,.bf-cc-card,.f4-seg,.v3-hdr:not(.is-top),.bf-nav-shell.bf-nav-scrolled{
  --bf-ring:0 0 0 3px rgba(14,20,23,.18)}
/* text fields never get a ring, at rest or while typing: the caret shows where you type (Vilius, 14 Oct: "remove all of the
   grey rings for entering in the containers"). Buttons, tabs and links keep the keyboard ring above. */
html body :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="file"]),textarea,select):is(:focus,:focus-visible){outline:none!important}
/* a field drawn as a row around its input (the code field): the row shows the focus, the input draws nothing */
.bf-code-row input,.h5-code-row input,.f3b-inrow input{--bf-ring:none}

/* selected chips and segmented items: no ring, whatever the older rules drew on top of the fill */
:is(.chip,.v5-pill,.f4-seg>*,[role="radio"],[role="tab"],[aria-pressed]):is(.on,.is-on,[aria-checked="true"],[aria-selected="true"],[aria-pressed="true"],[aria-current]):not(:focus-visible):not(:is(section.hero, #listing, #moves, .v4h-cta) *){
  outline:none!important;outline-offset:0!important}

/* a radio or checkbox drawn as the chip next to it (label > input + span): the chip shows the keyboard ring, never an outline */
input:is([type="radio"],[type="checkbox"]):focus-visible + span:not(:is(section.hero, #listing, #moves, .v4h-cta) *){outline:none!important;outline-offset:0!important;
  box-shadow:var(--bf-ring, 0 0 0 3px rgba(14,20,23,.18))!important}
input:is([type="radio"],[type="checkbox"]):focus:not(:focus-visible) + span:not(:is(section.hero, #listing, #moves, .v4h-cta) *){outline:none!important}
