/*
 * Shared styling for the keyboard <dialog> overlays — the "?" shortcuts
 * cheat-sheet, the "g k" client switcher, and the "/" call finder.
 *
 * Lives in a standalone stylesheet (rather than inline in
 * navigation/_keyboard_shortcuts.html) so the call finder renders correctly on
 * the calls page even when the KEYBOARD_SHORTCUTS feature flag — and therefore
 * that template — is off. Linked from layouts/_base_root.html.
 */
.kbd-overlay {
  width: min(34rem, calc(100% - 2rem));
  padding: 0;
  border: none;
  border-radius: .75rem;
  box-shadow: 0 1.5rem 3rem rgba(0, 0, 0, .25);
  color: inherit;
}
.kbd-overlay::backdrop {
  background: rgba(0, 0, 0, .45);
}
.kbd-overlay--palette {
  margin-top: 12vh;
}
.kbd-overlay__card {
  padding: 1.25rem 1.5rem;
}
.kbd-overlay__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
}
.kbd-overlay__title {
  font-size: 1.1rem;
  margin: 0;
}
.kbd-list__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .35rem 0;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.kbd-list__row:last-child {
  border-bottom: none;
}
.kbd-list__keys {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  white-space: nowrap;
}
.kbd-list__then {
  font-size: .75rem;
  color: #6c757d;
}
.kbd-overlay kbd {
  display: inline-block;
  min-width: 1.5rem;
  padding: .1rem .4rem;
  font-size: .8rem;
  text-align: center;
  color: #212529;
  background: #f1f3f5;
  border: 1px solid #ced4da;
  border-radius: .3rem;
  box-shadow: 0 1px 0 #ced4da;
}
.kbd-palette__list {
  margin: .75rem 0 0;
  max-height: 50vh;
  overflow-y: auto;
}
.kbd-palette__option {
  padding: .5rem .75rem;
  border-radius: .4rem;
  cursor: pointer;
}
.kbd-palette__option[aria-selected="true"],
.kbd-palette__option:hover {
  background: #e7f1ff;
}
.kbd-palette__option--current::after {
  content: "current";
  float: right;
  font-size: .75rem;
  color: #6c757d;
}
.kbd-palette__empty {
  padding: .5rem .75rem;
  color: #6c757d;
}

/*
 * Call-finder breadcrumb + action-menu colour swatches. Each action row carries
 * a left border in its button's Bootstrap colour, so the green Play / blue Edit
 * / yellow Connect-without-avatar semantics from the page survive into the menu.
 */
.kbd-palette__breadcrumb {
  display: block;
  font-size: .8rem;
  color: #6c757d;
  margin-bottom: .5rem;
  min-height: 1rem;
}
.kbd-palette__breadcrumb:empty {
  display: none;
}
/*
 * Action rows lead with the source button's own feather icon, tinted with the
 * button's Bootstrap colour so the green Play / blue Edit / etc. cues carry over
 * without the heavier coloured bar.
 */
.kbd-palette__option--action {
  display: flex;
  align-items: center;
  gap: .6rem;
}
.kbd-palette__icon {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  color: #6c757d;
}
.kbd-palette__icon svg {
  width: 1rem;
  height: 1rem;
}
.kbd-palette__option--success .kbd-palette__icon {
  color: #198754;
}
.kbd-palette__option--primary .kbd-palette__icon {
  color: #0d6efd;
}
.kbd-palette__option--warning .kbd-palette__icon {
  color: #ffc107;
}
.kbd-palette__option--info .kbd-palette__icon {
  color: #0dcaf0;
}
.kbd-palette__option--dark .kbd-palette__icon {
  color: #212529;
}
.kbd-palette__option--secondary .kbd-palette__icon {
  color: #6c757d;
}
.kbd-palette__option--purple .kbd-palette__icon {
  color: #6610f2;
}
