@layer surfaces {

/* ============================================================================
   ⌘K palette (EditorPalette) — fixed overlay, top-anchored panel. The window
   must stay the scroll container (virtualized renderer), so there is NO body
   scroll lock; only the result list scrolls, internally.
   ========================================================================= */

.editor-palette-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--backdrop);
}

.editor-palette-panel {
  position: fixed;
  z-index: 61;
  top: 15vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 2rem));
  display: flex;
  flex-direction: column;
  border: 1px solid var(--c-gray-200);
  border-radius: 10px;
  background: var(--c-white);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}

.editor-palette-input {
  border: 0;
  border-bottom: 1px solid var(--c-gray-200);
  padding: 0.75rem 1rem;
  font-size: 0.9375rem;
  background: transparent;
  color: var(--c-gray-900);
  outline: none;
}

.editor-palette-input::placeholder {
  color: var(--c-gray-500);
}

.editor-palette-list {
  max-height: 50vh;
  overflow-y: auto;
  padding: 0.375rem;
}

.editor-palette-group {
  padding: 0.5rem 0.625rem 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: var(--ls-kicker);
  text-transform: uppercase;
  /* gray-600, not 500: small text must clear AA contrast on the is-active
     gray-200 row background too (axe gate). */
  color: var(--c-gray-600);
}

.editor-palette-option {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.4rem 0.625rem;
  padding-left: calc(0.625rem + (var(--palette-indent, 0) * 0.875rem));
  border-radius: 7px;
  cursor: pointer;
}

.editor-palette-option.is-active {
  background: var(--c-gray-200);
}

.editor-palette-option-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.875rem;
  color: var(--c-gray-900);
}

.editor-palette-option-subtitle {
  flex: none;
  font-size: 0.75rem;
  color: var(--c-gray-600);
}

.editor-palette-empty {
  padding: 1rem 0.75rem;
  font-size: 0.875rem;
  color: var(--c-gray-500);
  text-align: center;
}

/* The friction recorder (⌘⇧.): palette-family chrome — one quiet line, low on the
   screen so it never covers the sentence that caused the note. */
.editor-friction-capture {
  position: fixed;
  left: 50%;
  bottom: 4.5rem;
  transform: translateX(-50%);
  width: min(34rem, calc(100vw - 2rem));
  z-index: 60;
}

.editor-friction-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--c-gray-300);
  border-radius: 0.5rem;
  /* --c-white flips with the theme (light-dark token); a literal #fff here left the
     dark theme's light text on a light box — punch list #300-era note, 2026-08-06. */
  background: var(--c-white);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
  font-size: 0.9375rem;
  color: var(--c-gray-900);
}

.editor-friction-input::placeholder {
  color: var(--c-gray-500);
}

.editor-friction-input:focus {
  outline: 2px solid var(--c-accent);
  outline-offset: -1px;
}

.editor-friction-flash {
  position: fixed;
  left: 50%;
  bottom: 4.5rem;
  transform: translateX(-50%);
  padding: 0.375rem 0.75rem;
  border-radius: 0.375rem;
  background: var(--c-gray-900);
  color: var(--c-white);
  font-size: 0.8125rem;
  z-index: 60;
  pointer-events: none;
}

}
