/* ONE focus style for the whole portal. Every other stylesheet is forbidden to set an outline (test/ui-focus-ring.test.mjs parses the CSS).
 *
 *   keyboard focus (:focus-visible) on a button, link, select, checkbox, tab, menu item ...  ->  a soft ring in the workspace accent that
 *     follows the element's own border radius (a box-shadow, so it never draws a square box inside a rounded one)
 *   a text field (input, textarea, contenteditable)  ->  nothing on the field itself; a plain field tints its own border, and a composite
 *     field (composer, search box) tints its container on :focus-within (listed below), so typing never shows a box
 *   a mouse click  ->  nothing (the ring is :focus-visible only); programmatic focus on a heading or region (tabindex="-1") shows nothing
 *   forced-colors (high contrast): the system outline comes back, because shadows are not drawn there. */
:root {
  --s1-focus-ring: 0 0 0 3px color-mix(in srgb, var(--s1-accent, #8a1538) 30%, transparent);
  --s1-focus-ring-on-dark: 0 0 0 3px rgb(255 255 255 / .55);
  --s1-focus-border: color-mix(in srgb, var(--s1-accent, #8a1538) 60%, var(--s1-line, #d7dbe2));
}
:where(*):focus { outline: none; }
:where(*):focus-visible { outline: none; box-shadow: var(--s1-focus-ring) !important; }
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]), textarea, [contenteditable="true"], [contenteditable=""]):focus-visible { box-shadow: none !important; }
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]), textarea, select):focus { border-color: var(--s1-focus-border); }
:where([tabindex="-1"]):focus-visible { box-shadow: none !important; }
:where(.rail, .s1-rail, .s1-dark, .anx-rail) :where(*):focus-visible { box-shadow: var(--s1-focus-ring-on-dark) !important; }
/* composite fields: the input inside shows nothing, the container takes the tint */
.s1ag-composer:focus-within, .k-picker:focus-within, .s1p-search:focus-within, .s1rq-search:focus-within, .s1cc-find:focus-within, .search:focus-within { border-color: var(--s1-focus-border); }
@media (forced-colors: active) { :focus-visible { outline: 2px solid Highlight; } }
