/* Shared focus policy. Brand/link accents are separate from keyboard focus. */
:root {
  --focus-ring: #525252;
  --focus-border: #d2d2d2;
  --control-accent: #525252;
}
html[data-theme="dark"] {
  --focus-ring: #c7c7c7;
  --focus-border: #484848;
  --control-accent: #c7c7c7;
}
* { -webkit-tap-highlight-color: transparent; }
/* Low specificity supplies rounded geometry only to controls with no own radius. */
:where(button, a, summary, select, [role="button"], [role="tab"], [role="menuitem"], [tabindex]) {
  border-radius: 4px;
}
:focus { outline: none !important; }
:focus-visible {
  outline: 1.5px solid var(--focus-ring) !important;
  outline-offset: 2px;
}
/* Programmatic focus after a pointer action must not inherit an editor's focus-visible heuristic. */
html[data-focus-modality="pointer"] :focus-visible { outline: none !important; }
:where(textarea, input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="button"]):not([type="submit"]):not([type="reset"]), [contenteditable]:not([contenteditable="false"])):is(:focus, :focus-visible) {
  outline: none !important;
  box-shadow: none !important;
  caret-color: inherit;
}
:where(input[type="checkbox"], input[type="radio"], input[type="range"]) {
  accent-color: var(--control-accent) !important;
}
:where(.composer, .image-composer, .video-composer, .studio-prompt-box, .support-composer):focus-within {
  border-color: var(--focus-border) !important;
}
/* Clipped gallery controls keep their keyboard ring inside the existing rounded tile. */
:where(.cropus-gallery-open, .video-gallery-open):focus-visible { outline-offset: -2px; }

:where(input[type="checkbox"]) { border-radius: 3px; }
:where(input[type="radio"]) { border-radius: 50%; }
:where(input[type="range"]) { border-radius: 999px; }
button::-moz-focus-inner { border: 0; }
