/* An inset stays visible at the edge of a scroll pane or a group of buttons.
   currentColor follows the control's own light, dark or selected surface. */
:root {
  --focus-line: 3px solid currentColor;
  --focus-inset: -4px;
  --focus-paper: #fffcf6;
  --focus-ink: #603449;
}
:root :focus-visible {
  outline: var(--focus-line);
  outline-offset: var(--focus-inset);
  scroll-margin: .5rem;
}
:root :is(input, textarea, select):focus-visible { box-shadow: none; }
:root :where(input[type="checkbox"], input[type="radio"]):focus-visible { outline-offset: 2px; }

/* Highlight wrapped prose links across lines. Controls use the shared outline. */
:root :where(p, dd, figcaption) :where(a[href]:not(:has(img, svg))):focus-visible {
  background-color: #f0e2e6;
  color: var(--focus-ink);
  outline-width: 2px;
  outline-offset: 1px;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
@media (forced-colors: active) {
  :root { --focus-line: 3px solid Highlight; --focus-ink: Highlight; --focus-paper: Canvas; }
}
