/* Keyboard shortcuts: the key drawn on a control that answers to it (`ApplicationHelper#hotkey_hint`) and the footer switch that
   turns the single-key shortcuts off (`shared/_shortcuts_switch`; WCAG 2.1.4 Character Key Shortcuts).

   Tokens only, so both read in both modes on both surfaces. The key takes the button's own text color, so it has the
   button's own contrast (1.4.3) and is drawn with a line as well as a letter, so it is not mistaken for part of the
   name (it is hidden from the accessible name, and `aria-keyshortcuts` carries the key). The switch's target is 44px
   (`--target-min`), over WCAG 2.5.8's 24, and its focus ring is drawn on the label that holds it. Logical properties
   only. */

.hotkey-hint {
  display: inline-block;
  margin-inline-start: 0.5rem;
  padding: 0 0.4rem;
  border: 1px solid currentColor;
  border-radius: 0.25rem;
  font: inherit;
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1.45;
}
.hotkey-hint[hidden] {
  display: none;
}

/* A device whose person has no keyboard to press it on is not shown the key. (A device's pointer is coarse when touch is
   how it is used; a keyboard attached to it still works, and `aria-keyshortcuts` still says so.) */
@media (pointer: coarse) {
  .hotkey-hint {
    display: none;
  }
}

/* The footer's tools are the appearance switch and this one, side by side, wrapping on a narrow screen. */
.shell-foot-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
}

.shortcuts-switch {
  display: inline-flex;
}

.shortcuts-switch-option {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-block-size: var(--target-min);
  padding-inline: 0.25rem;
  border-radius: 0.5rem;
  color: var(--fg2);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
}

.shortcuts-switch-option:hover {
  color: var(--fg1);
}

.shortcuts-switch-input {
  flex: none;
  inline-size: 1.5rem;
  block-size: 1.5rem;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.shortcuts-switch-option:has(.shortcuts-switch-input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (forced-colors: active) {
  .hotkey-hint {
    border-color: ButtonText;
  }
}
