.tr-command-trigger {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 34px;
  padding: .35rem .55rem;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 9px;
  background: rgba(15, 23, 42, .5);
  color: inherit;
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.tr-command-trigger:hover,
.tr-command-trigger:focus-visible {
  border-color: rgba(103, 232, 249, .45);
  background: rgba(103, 232, 249, .08);
  outline: none;
}

.tr-command-trigger--floating {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 8500;
  background: rgba(9, 11, 16, .94);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .32);
}

.tr-command-trigger span {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tr-command-trigger kbd,
.tr-command-palette kbd {
  font: inherit;
  font-size: .72rem;
  color: rgba(226, 232, 240, .78);
}

.tr-command-palette[hidden] {
  display: none !important;
}

.tr-command-palette {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: start center;
  padding: min(14vh, 8rem) 1rem 1rem;
}

.tr-command-palette__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, .72);
  backdrop-filter: blur(10px);
}

.tr-command-palette__dialog {
  position: relative;
  width: min(680px, 100%);
  max-height: min(72vh, 700px);
  overflow: hidden;
  border: 1px solid rgba(103, 232, 249, .22);
  border-radius: 18px;
  background: rgba(9, 11, 16, .98);
  box-shadow: 0 28px 90px rgba(0, 0, 0, .45);
  transform: translateY(-8px) scale(.99);
  opacity: 0;
  transition: opacity 120ms ease, transform 120ms ease;
}

.tr-command-palette.is-open .tr-command-palette__dialog {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.tr-command-palette__header,
.tr-command-palette__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 1rem;
  color: rgba(203, 213, 225, .7);
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tr-command-palette__header {
  border-bottom: 1px solid rgba(148, 163, 184, .12);
}

.tr-command-palette__footer {
  border-top: 1px solid rgba(148, 163, 184, .12);
  text-transform: none;
  letter-spacing: 0;
}

.tr-command-palette__search {
  display: block;
  padding: .85rem 1rem .45rem;
}

.tr-command-palette__search input {
  width: 100%;
  box-sizing: border-box;
  padding: .9rem 1rem;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 12px;
  outline: none;
  background: rgba(15, 23, 42, .72);
  color: #f8fafc;
  font: inherit;
  font-size: 1rem;
}

.tr-command-palette__search input:focus {
  border-color: rgba(103, 232, 249, .7);
  box-shadow: 0 0 0 3px rgba(103, 232, 249, .1);
}

.tr-command-palette__list {
  display: grid;
  gap: .3rem;
  max-height: 48vh;
  overflow-y: auto;
  padding: .45rem 1rem 1rem;
}

.tr-command-palette__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem .9rem;
  border: 1px solid transparent;
  border-radius: 11px;
  color: inherit;
  text-decoration: none;
}

.tr-command-palette__item:hover,
.tr-command-palette__item:focus-visible {
  border-color: rgba(103, 232, 249, .25);
  background: rgba(103, 232, 249, .07);
  outline: none;
}

.tr-command-palette__item > span:first-child {
  display: grid;
  gap: .2rem;
}

.tr-command-palette__item small {
  color: rgba(203, 213, 225, .65);
}

.tr-command-palette__empty {
  margin: 0;
  padding: 1rem;
  color: rgba(203, 213, 225, .68);
}

.tr-command-palette__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html.tr-command-open,
html.tr-command-open body {
  overflow: hidden;
}

@media (max-width: 720px) {
  .tr-command-trigger {
    padding-inline: .45rem;
  }

  .tr-command-trigger--floating {
    right: .75rem;
    bottom: .75rem;
  }

  .tr-command-palette {
    padding-top: 8vh;
  }

  .tr-command-palette__dialog {
    max-height: 80vh;
  }

  .tr-command-palette__footer {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tr-command-palette__dialog {
    transition: none;
    transform: none;
  }
}
