.selectionKeyGuideOverlay {
  position: fixed;
  z-index: 64;
  width: min(304px, calc(100vw - 16px));
  pointer-events: none;
  color: var(--text, var(--txt, #172840));
  font-family: inherit;
}

.selectionKeyGuideOverlay[hidden] { display: none !important; }

.selectionKeyGuidePanel {
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  pointer-events: none;
}

.selectionKeyGuidePinned {
  padding: 0 4px 5px;
  pointer-events: auto;
}

.selectionKeyGuideList {
  max-height: min(246px, calc(100vh - 96px));
  margin: 0;
  padding: 1px 3px 6px 4px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--text, #172840) 10%, transparent) transparent;
  pointer-events: auto;
}

.selectionKeyGuidePanel:hover .selectionKeyGuideList,
.selectionKeyGuidePanel:focus-within .selectionKeyGuideList {
  scrollbar-color: color-mix(in srgb, var(--text, #172840) 90%, transparent) transparent;
}

.selectionKeyGuideList::-webkit-scrollbar { width: 6px; }
.selectionKeyGuideOverlay.is-compact .selectionKeyGuideList { scrollbar-width: auto; }
.selectionKeyGuideOverlay.is-compact .selectionKeyGuideList::-webkit-scrollbar { width: 9px; }
.selectionKeyGuideList::-webkit-scrollbar-track { background: transparent; }
.selectionKeyGuideList::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 8px;
  background: color-mix(in srgb, var(--text, #172840) 10%, transparent);
  background-clip: padding-box;
}
.selectionKeyGuidePanel:hover .selectionKeyGuideList::-webkit-scrollbar-thumb,
.selectionKeyGuidePanel:focus-within .selectionKeyGuideList::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--text, #172840) 90%, transparent);
  background-clip: padding-box;
}

.selectionKeyGuideRow {
  display: grid;
  grid-template-columns: minmax(132px, 1.25fr) minmax(92px, 1fr);
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 27px;
  margin: 0;
  padding: 3px 5px;
  border: 0;
  border-radius: 7px;
  background: color-mix(in srgb, var(--muted, #66768a) 8%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--muted, #66768a) 7%, transparent);
  color: inherit;
  font: inherit;
  list-style: none;
  text-align: left;
  transition: background-color .48s ease, box-shadow .48s ease;
}

button.selectionKeyGuideRow { cursor: pointer; }
button.selectionKeyGuideRow.is-priority {
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.selectionKeyGuideOverlay.is-dragging button.selectionKeyGuideRow.is-priority { cursor: grabbing; }
.selectionKeyGuideRow + .selectionKeyGuideRow { margin-top: 1px; }
.selectionKeyGuideRow.is-group-start { margin-top: 7px; }
.selectionKeyGuideRow:hover {
  background: color-mix(in srgb, var(--muted, #66768a) 17%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--muted, #66768a) 14%, transparent);
  transition-duration: .14s;
}

.selectionKeyGuideRow.is-priority {
  border: 0;
  background: color-mix(in srgb, var(--muted, #66768a) 8%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--muted, #66768a) 7%, transparent);
}

.selectionKeyGuideRow.is-priority:focus-visible {
  outline: none;
}

.selectionKeyGuideRow.is-priority .selectionKeyGuideKeycap {
  border-color: color-mix(in srgb, var(--warn, #c89632) 76%, var(--line, #bccada));
  background: color-mix(in srgb, var(--surface, #fff) 94%, var(--warn, #c89632) 6%);
  box-shadow: 0 0 8px color-mix(in srgb, var(--warn, #c89632) 30%, transparent);
}

.selectionKeyGuideControls {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
  overflow: visible;
}

.selectionKeyGuideCombo {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
}

.selectionKeyGuideKeycap {
  display: inline-grid;
  min-width: 21px;
  width: max-content;
  height: 20px;
  padding: 0 5px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--line, #bccada) 88%, transparent);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--surface, #fff) 91%, var(--text, #172840) 9%);
  color: var(--text, #172840);
  font: 700 9px/1 system-ui, sans-serif;
  box-sizing: border-box;
  flex: 0 0 auto;
  white-space: nowrap;
}

.selectionKeyGuideJoin,
.selectionKeyGuideSeparator {
  color: var(--muted, #66768a);
  font-size: 8px;
  font-weight: 800;
}

.selectionKeyGuideSeparator { margin: 0 1px; }

.selectionKeyGuideMouse {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 15px;
  height: 21px;
  border: 1.4px solid currentColor;
  border-radius: 8px 8px 7px 7px;
  color: var(--text, #172840);
  opacity: .88;
  box-sizing: border-box;
}

.selectionKeyGuideMouse::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 7px;
  background: currentColor;
}

.selectionKeyGuideMouse i {
  position: absolute;
  top: 3px;
  left: 50%;
  width: 2px;
  height: 4px;
  border-radius: 2px;
  background: currentColor;
  transform: translateX(-50%);
}

.selectionKeyGuideMouse.is-drag::after {
  content: "↔";
  position: absolute;
  left: 18px;
  top: 4px;
  color: var(--muted, #66768a);
  font: 700 9px/1 system-ui, sans-serif;
}

.selectionKeyGuideMouse.is-drag { margin-right: 12px; }
.selectionKeyGuideMouse.is-right { background: linear-gradient(90deg, transparent 50%, color-mix(in srgb, var(--pri, #15788a) 28%, transparent) 50%); }

.selectionKeyGuideLabel {
  min-width: 0;
  overflow: visible;
  color: var(--muted, #66768a);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}

.selectionKeyGuideRow.is-priority .selectionKeyGuideLabel { color: var(--muted, #66768a); }

@media (max-width: 720px) {
  .selectionKeyGuideOverlay { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .selectionKeyGuideOverlay *,
  .selectionKeyGuideOverlay *::before,
  .selectionKeyGuideOverlay *::after { transition: none !important; animation: none !important; }
}
