#command-palette {
  width: min(42rem, calc(100% - 24px));
  max-height: min(43rem, calc(100dvh - 24px));
  margin: min(12vh, 6rem) auto auto;
  border-radius: 12px;
  background: var(--surface, var(--white, #fff));
  overflow: hidden;
}
#command-palette[open] {
  display: flex;
  flex-direction: column;
  animation: command-enter var(--motion-standard, 200ms) var(--ease-enter, cubic-bezier(.16, 1, .3, 1)) both;
}
.command-head,
.command-query {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
}
.command-head {
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.command-head h2 { margin: 0; font-size: 1.125rem; }
.command-head .close-button {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--ink);
  background: transparent;
}
.command-query .icon { flex: 0 0 20px; color: var(--muted); }
.command-query input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface, var(--white, #fff));
  color: var(--ink);
}
.command-status {
  margin: 0 16px 8px;
  color: var(--muted);
  font-size: .875rem;
}
.command-status:empty { margin-bottom: 0; }
.command-results {
  min-height: 0;
  overflow: auto;
  padding: 0 8px;
}
.command-group h3 {
  margin: 8px 8px 4px;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 700;
}
.command-group ul { margin: 0; padding: 0; list-style: none; }
.command-row { display: flex; align-items: center; gap: 2px; }
.command-row button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: start;
  transition: background-color var(--motion-fast, 140ms);
}
.command-row button:hover,
.command-row button:focus-visible {
  border-color: var(--line);
  background: var(--canvas);
}
.command-row button:first-child { width: 100%; min-width: 0; }
.command-row .icon { flex: 0 0 18px; color: var(--muted); }
.command-row span, .command-row strong { min-width: 0; overflow-wrap: anywhere; }
.command-row strong { display: block; font-size: .95rem; }
.command-row small { display: block; color: var(--muted); font-size: .813rem; }
.command-row .command-star {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  padding: 0;
  font-size: 1.25rem;
}
#command-palette footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
  padding: 8px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .813rem;
}
#command-palette kbd {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--ink);
}
@keyframes command-enter {
  from { opacity: 0; transform: translateY(6px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (max-width: 600px), (max-height: 600px) {
  #command-palette { margin: 12px auto auto; }
}
@media (prefers-reduced-motion: reduce) {
  #command-palette[open] { animation: none; }
  .command-row button { transition: none; }
}
