/* One focus indicator per control. Shared by Home, Inbox and administration. */
body {
  --hub-focus-color:var(--accent,#2563eb);
  --hub-focus-ring:2px solid var(--hub-focus-color);
  --hub-focus-offset:2px;
}
:where(button,a[href],input,textarea,select,summary,[tabindex]:not([tabindex="-1"])):focus-visible {
  outline:var(--hub-focus-ring);
  outline-offset:var(--hub-focus-offset);
}

/* App search delegates focus to its visible field. */
.spotlight-input:focus-visible { outline:none }
.spotlight-input-row:has(.spotlight-input:focus) {
  box-shadow:inset 0 -2px 0 var(--hub-focus-color);
}

/* Row links and their favourite action share the complete row's indicator. */
.nh-inbox-row:has(:focus-visible) {
  outline:var(--hub-focus-ring);
  outline-offset:-2px;
}
.nh-inbox-row a:focus-visible,.nh-inbox-row-actions button:focus-visible,
.nh-inbox-splitter:focus-visible { outline:none }

/* Keep dropdown focus inside the scrollable menu instead of clipping it. */
.custom-select-option:focus-visible {
  outline:var(--hub-focus-ring);
  outline-offset:-2px;
}

/* Cards and background choices delegate to one visible surface. */
.launcher-grid-shell .app:focus-visible,.background-choice:focus-visible { outline:none }
.launcher-grid-shell .app-card:focus-visible>.appbody,
.launcher-grid-shell .app:not(.app-card):focus-visible :is(.appicon,.foldericon),
.background-choice:focus-visible .background-preview,
.background-choice[aria-pressed=true] .background-preview {
  outline:var(--hub-focus-ring);
  outline-offset:var(--hub-focus-offset);
}

/* Box shadows disappear in forced-colors mode; retain a visible focus cue. */
@media (forced-colors:active) {
  body { --hub-focus-color:Highlight }
  .spotlight-input-row:has(.spotlight-input:focus) {
    outline:var(--hub-focus-ring);
    outline-offset:-2px;
    box-shadow:none;
  }
}
