.command-trigger {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.command-trigger:hover,
.command-trigger:focus-visible {
  color: var(--ink);
  border-color: rgba(210, 135, 147, 0.42);
  background: rgba(143, 31, 50, 0.2);
}

.command-trigger:focus-visible {
  outline: 2px solid var(--wine-soft);
  outline-offset: 3px;
}

.command-trigger-label {
  font-size: 0.75rem;
  font-weight: 700;
}

.command-trigger-shortcut,
.command-palette kbd {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #c8bfbc;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 700;
}

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

.command-palette {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-items: start center;
  padding: min(12vh, 104px) 16px 24px;
}

.command-palette-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: rgba(4, 3, 4, 0.78);
  backdrop-filter: blur(8px);
  cursor: default;
}

.command-palette-dialog {
  position: relative;
  width: min(680px, 100%);
  max-height: min(720px, calc(100vh - min(12vh, 104px) - 32px));
  overflow: hidden;
  border: 1px solid rgba(210, 135, 147, 0.25);
  border-radius: 18px;
  color: #f4efeb;
  background:
    radial-gradient(circle at 85% 0, rgba(143, 31, 50, 0.18), transparent 34%),
    #151112;
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.72);
}

.command-palette-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 14px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  color: #d28793;
  background: rgba(8, 6, 7, 0.6);
  transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.command-palette-back {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  color: #d9a4b2;
  background: rgba(181, 49, 73, 0.16);
}

.command-palette-back[hidden] {
  display: none;
}

.command-palette-back:hover,
.command-palette-back:focus-visible {
  color: #fff;
  background: rgba(181, 49, 73, 0.34);
  outline: 2px solid rgba(210, 135, 147, 0.45);
  outline-offset: 2px;
}

.command-palette.is-searching-module .command-palette-search > .bi-search {
  display: none;
}

.command-palette-search:focus-within {
  background: rgba(20, 15, 17, 0.96);
  box-shadow:
    inset 3px 0 0 #b53149,
    0 0 0 3px rgba(181, 49, 73, 0.13);
}

.command-palette-search input {
  width: 100%;
  min-height: 54px;
  padding: 0;
  border: 0;
  outline: 0;
  color: #f4efeb;
  background: transparent;
  box-shadow: none;
  font-size: 1rem;
}

.command-palette-search input:focus,
.command-palette-search input:focus-visible {
  border: 0;
  outline: 0;
  box-shadow: none;
}

.command-palette-search input::placeholder {
  color: #81777b;
}

.command-palette-search input::-webkit-search-cancel-button {
  filter: invert(1);
  opacity: 0.55;
}

.command-palette-meta {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px 10px;
  color: #8f8582;
  font-size: 0.7rem;
}

.command-palette-meta kbd {
  margin-inline: 2px;
  padding: 2px 5px;
}

.command-palette-results {
  max-height: min(520px, calc(100vh - 250px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 10px 12px;
  scrollbar-color: rgba(181, 49, 73, 0.65) transparent;
  scrollbar-width: thin;
}

.command-palette-group {
  padding: 12px 12px 6px;
  color: #756c6a;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.command-palette-option {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  min-height: 58px;
  align-items: center;
  gap: 11px;
  margin: 2px 0;
  padding: 9px 12px;
  border-radius: 11px;
  color: #b9afac;
  cursor: pointer;
  scroll-margin: 8px;
}

.command-palette-option::before {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 0;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.command-palette-option.is-active {
  color: #f4efeb;
  background: rgba(181, 49, 73, 0.16);
}

.command-palette-option.is-active::before {
  background: #d28793;
}

.command-palette-option-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: #d9a4b2;
  background: rgba(255, 255, 255, 0.045);
  font-size: 1rem;
}

.command-palette-option.is-active .command-palette-option-icon {
  color: #fff;
  background: rgba(143, 31, 50, 0.55);
}

.command-palette-option-copy {
  min-width: 0;
}

.command-palette-option-title {
  overflow: hidden;
  color: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-palette-option.is-active .command-palette-option-title {
  font-weight: 800;
}

.command-palette-option-description {
  overflow: hidden;
  margin-top: 3px;
  color: #8f8582;
  font-size: 0.72rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-palette-option-route {
  max-width: 150px;
  overflow: hidden;
  color: #756c6a;
  font-size: 0.65rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.command-palette-empty {
  display: grid;
  min-height: 190px;
  place-items: center;
  padding: 28px;
  color: #8f8582;
  text-align: center;
}

.command-palette-empty strong {
  display: block;
  margin-bottom: 5px;
  color: #f4efeb;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  font-weight: 400;
}

.command-palette-search-hint {
  min-height: 150px;
}

body.command-palette-open {
  overflow: hidden !important;
}

@media (max-width: 760px) {
  .command-trigger {
    width: 44px;
    height: 44px;
    min-height: 44px;
    justify-content: center;
    padding: 0;
    color: #fff;
    border-color: rgba(210, 135, 147, 0.4);
    background: rgba(143, 31, 50, 0.38);
  }

  .command-trigger-label,
  .command-trigger-shortcut {
    display: none;
  }

  .command-palette {
    align-items: start;
    padding: 8px;
  }

  .command-palette-dialog {
    width: 100%;
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }

  .command-palette-search {
    margin: 10px;
  }

  .command-palette-search input {
    min-height: 50px;
    font-size: 16px;
  }

  .command-palette-meta {
    padding-inline: 14px;
  }

  .command-palette-meta > span:last-child {
    display: none;
  }

  .command-palette-results {
    max-height: calc(100dvh - 132px);
    padding-inline: 6px;
  }

  .command-palette-option {
    grid-template-columns: 38px minmax(0, 1fr);
    min-height: 62px;
  }

  .command-palette-option-route {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .command-palette *,
  .command-trigger {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
