/* ⌘K command palette — modal overlay centered near the top of the
   viewport, Raycast-shaped. The dialog itself is unstyled by the
   browser (we override .cmdk-dlg directly); inside we render a
   "shell" card with the input row, results, and a footer of keyboard
   hints. */

.cmdk-dlg {
  border: 0;
  padding: 0;
  background: transparent;
  max-width: 640px;
  width: 90%;
  margin-top: 10vh;
  /* Use auto margins to keep the dialog centered horizontally */
  margin-left: auto;
  margin-right: auto;
  /* Default dialog rendering has a tight max-height; loosen it. */
  max-height: 80vh;
  overflow: visible;
}
.cmdk-dlg::backdrop {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
}
.cmdk-shell {
  background: var(--bg);
  color: var(--fg);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  max-height: 70vh;
  overflow: hidden;
}

.cmdk-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px;
  border-bottom: 1px solid var(--border);
}
.cmdk-search-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: var(--fg-muted);
}
.cmdk-input {
  flex: 1 1 auto;
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: var(--fg);
  min-width: 0;
}
.cmdk-input::placeholder { color: var(--fg-muted); }
.cmdk-hint {
  flex: 0 0 auto;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-soft);
  color: var(--fg-muted);
  border: 1px solid var(--border);
  font-family: inherit;
}

.cmdk-list {
  list-style: none;
  margin: 0;
  padding: 4px;
  overflow-y: auto;
  max-height: 50vh;
}
.cmdk-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}
.cmdk-row-selected {
  background: rgba(99, 102, 241, 0.12);
}
.cmdk-row-text {
  flex: 1 1 auto;
  min-width: 0;
}
.cmdk-row-title {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmdk-row-sub {
  font-size: 11px;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cmdk-row-path {
  margin-left: auto;
  font-size: 10px;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 40%;
}

.cmdk-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.cmdk-icon-img { background: var(--bg-soft); padding: 2px; }
.cmdk-icon-img img { width: 100%; height: 100%; object-fit: contain; border-radius: 4px; }
.cmdk-icon-emoji { background: transparent; color: inherit; font-size: 22px; }
.cmdk-icon-letter { color: #fff; }
.cmdk-icon-svg { padding: 4px; }
.cmdk-icon-svg svg { width: 100%; height: 100%; }

.cmdk-chip {
  display: inline-block;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 1px 5px;
  border-radius: 3px;
  background: var(--bg-soft);
  color: var(--fg-muted);
  text-transform: uppercase;
  flex: 0 0 auto;
}
.cmdk-chip-link { background: #dbeafe; color: #1e40af; }
.cmdk-chip-browse { background: #fef3c7; color: #92400e; }
.cmdk-chip-serve { background: #dcfce7; color: #15803d; }
.cmdk-chip-prompt { background: #fce7f3; color: #9d174d; }

.cmdk-empty {
  padding: 30px 18px;
  text-align: center;
  color: var(--fg-muted);
}

.cmdk-foot {
  display: flex;
  gap: 14px;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--fg-muted);
  font-size: 10px;
}
.cmdk-foot kbd {
  display: inline-block;
  padding: 1px 4px;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 3px;
  font-family: inherit;
  font-size: 10px;
  margin-right: 2px;
}
