.shorthand-completions {
  position: fixed;
  z-index: 50;
  overflow: auto;
  overscroll-behavior: contain;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 5px;
  box-shadow: 0 4px 16px #382b1b2b;
  font: 13px/1.3 var(--sans);
}
.shorthand-completions ul, .shorthand-results {
  list-style: none;
  padding: 0;
  margin: 0;
}
.shorthand-completions li, .shorthand-results li {
  display: grid;
  align-items: center;
  column-gap: .8rem;
}
.shorthand-completions li {
  grid-template-columns: minmax(4.6rem, auto) 1fr;
  padding: .42rem .75rem;
  cursor: pointer;
}
.shorthand-completions [aria-selected="true"] {
  background: var(--selected);
  box-shadow: inset 3px 0 var(--accent);
}
.shorthand-completions li:hover { background: var(--rail); }
.shorthand-completions code, .shorthand-reference code {
  font: .88em/1.35 var(--mono);
  overflow-wrap: anywhere;
}
.shorthand-completions .shorthand-name, .shorthand-reference .shorthand-name {
  font-weight: 600;
  color: var(--accent);
}
.shorthand-completions > small {
  display: block;
  padding: .35rem .75rem;
  border-top: 1px solid var(--hair);
  color: var(--muted);
}
.custom-dialog[open]:has(> .shorthand-reference) {
  display: flex;
  flex-direction: column;
  max-height: min(82dvh, 700px);
  overflow: hidden;
}
.shorthand-reference {
  display: flex;
  flex-direction: column;
  gap: .65rem;
  min-height: 0;
}
.shorthand-reference p { margin: 0; }
.shorthand-search {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.shorthand-search :is(input, select) {
  min-height: 2rem;
  padding: .35rem .55rem;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.shorthand-search input { flex: 3 1 14rem; }
.shorthand-search select { flex: 1 1 8rem; }
.shorthand-count, .shorthand-meaning small { color: var(--muted); }
.shorthand-results {
  overflow: auto;
  overscroll-behavior: contain;
  min-height: 0;
  scrollbar-width: thin;
}
.shorthand-results li {
  grid-template-columns: minmax(4.5rem, .9fr) minmax(2.2rem, .5fr) minmax(0, 2.8fr);
  border-top: 1px solid var(--hair);
  padding: .5rem .2rem;
}
.shorthand-meaning { display: grid; gap: .1rem; }
.shorthand-glyph { display: grid; place-items: center; }
.shorthand-glyph img { display: block; max-width: 100%; height: auto; max-height: 2rem; }
.shorthand-reference > button { align-self: start; border-color: var(--rule); }
.shorthand-field-glyph {
  display: block;
  max-width: 100%;
  max-height: 3.5rem;
  height: auto;
  object-fit: contain;
  object-position: left;
  margin: .15rem .2rem;
}
@media (forced-colors: active) {
  .shorthand-completions [aria-selected="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
}
