/* Command palette modal (CR-091). BEM-style block/element naming
   matching the rest of the asset surface. Inherits colours via the
   existing CSS variables from themes.css — no new colour tokens. */

.cmd-palette {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 1rem 1rem;
  background: color-mix(in oklab, var(--bg) 60%, transparent);
  font-family: inherit;
}

.cmd-palette[data-open="1"] {
  display: flex;
}

.cmd-palette__card {
  width: 100%;
  max-width: 640px;
  background: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 6px;
  box-shadow: 0 12px 48px color-mix(in oklab, var(--bg) 80%, transparent);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}

.cmd-palette__input {
  width: 100%;
  padding: 0.85rem 1rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  color: var(--bright);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.95rem;
  outline: none;
  caret-color: var(--accent);
}

.cmd-palette__input::placeholder {
  color: var(--dim);
  font-style: italic;
}

.cmd-palette__results {
  flex: 1;
  overflow-y: auto;
  padding: 0.25rem 0;
}

.cmd-palette__section {
  padding: 0.5rem 1rem 0.25rem;
  color: var(--bright);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cmd-palette__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 1rem;
  color: var(--fg);
  cursor: pointer;
  min-height: 36px;
  line-height: 1.4;
}

.cmd-palette__row:hover,
.cmd-palette__row[aria-selected="true"] {
  background: var(--line);
}

.cmd-palette__row[aria-selected="true"] {
  outline: 1px solid var(--accent-dim);
  outline-offset: -1px;
}

.cmd-palette__icon {
  color: var(--dim);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.8rem;
  min-width: 1.5rem;
  text-align: center;
}

.cmd-palette__title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cmd-palette__title mark {
  background: var(--accent);
  color: var(--bg);
  padding: 0 1px;
  border-radius: 2px;
}

.cmd-palette__hint {
  color: var(--dim);
  font-size: 0.7rem;
  padding: 0.5rem 1rem;
  border-top: 1px solid var(--line-strong);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.cmd-palette__hint kbd {
  background: var(--line);
  color: var(--bright);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 0 0.35rem;
  font-family: inherit;
  font-size: 0.7rem;
}

.cmd-palette__empty {
  padding: 1.25rem 1rem;
  color: var(--dim);
  font-style: italic;
  text-align: center;
}