/* ============================================================
   The command palette (js/palette.js): ⌘K / Ctrl K or "/" anywhere, or the
   sidebar's Search box. One centred card: the search line, the results in
   small labelled sections, and a quiet line of key hints underneath.
   ============================================================ */
.pal-root { position: fixed; inset: 0; z-index: 140; }
.pal-backdrop { position: absolute; inset: 0; background: rgba(12, 18, 27, .42); animation: pal-fade .12s ease-out; }
.pal {
  position: absolute; left: 50%; top: 12vh; transform: translateX(-50%);
  width: min(640px, calc(100vw - 32px)); max-height: min(560px, 76vh);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 24px 64px rgba(8, 14, 22, .32), 0 2px 6px rgba(8, 14, 22, .08);
  animation: pal-in .14s ease-out;
}
@keyframes pal-fade { from { opacity: 0; } }
@keyframes pal-in { from { opacity: 0; transform: translateX(-50%) translateY(-6px) scale(.985); } }
@media (prefers-reduced-motion: reduce) { .pal, .pal-backdrop { animation: none; } }

.pal-search {
  display: flex; align-items: center; gap: 10px; flex: none;
  padding: 0 14px 0 16px; height: 54px; border-bottom: 1px solid var(--line-soft);
}
.pal-search > svg { width: 18px; height: 18px; flex: none; color: var(--faint); }
.pal-stroke { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pal-input {
  flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none;
  font: inherit; font-size: 15px; color: var(--ink);
}
.pal-input::placeholder { color: var(--faint); }
.pal-esc {
  flex: none; cursor: pointer; font: inherit; font-size: 10.5px; font-weight: 650; color: var(--muted);
  padding: 2px 7px; border-radius: 6px; background: var(--grey-bg); border: 1px solid var(--line);
}
.pal-esc:hover { color: var(--ink); }

.pal-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; overscroll-behavior: contain; }
.pal-sec {
  padding: 10px 10px 4px; font-size: 10.5px; font-weight: 700; color: var(--faint);
  text-transform: uppercase; letter-spacing: .08em;
}
.pal-sec:first-child { padding-top: 6px; }
.pal-row {
  display: flex; align-items: center; gap: 11px; padding: 7px 10px; min-height: 44px;
  border-radius: 9px; cursor: pointer; user-select: none;
}
.pal-row.on { background: var(--blue-bg); }
.pal-ico {
  width: 28px; height: 28px; flex: none; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--grey-bg); color: var(--muted);
}
.pal-ico svg { width: 15px; height: 15px; fill: currentColor; }
.pal-row.on .pal-ico { background: #fff; color: var(--blue); box-shadow: 0 0 0 1px var(--blue-line); }
/* a client's row leads with her own initials disc, as in the lists */
.pal-ico-client { background: none; box-shadow: none !important; }
.pal-ico-client .cl-avatar { width: 28px; height: 28px; font-size: 10px; }
.pal-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.pal-label, .pal-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.pal-sub { font-size: 11.5px; color: var(--muted); }
.pal-txt mark { background: none; color: var(--blue); font-weight: 700; }
.pal-go {
  flex: none; display: none; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 650; color: var(--blue);
}
.pal-row.on .pal-go { display: inline-flex; }
.pal-go kbd, .pal-foot kbd {
  font: inherit; font-size: 10.5px; font-weight: 650; line-height: 1;
  min-width: 18px; padding: 3px 5px; border-radius: 5px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); box-shadow: 0 1px 0 var(--line);
  color: var(--muted);
}
.pal-go kbd { border-color: var(--blue-line); color: var(--blue); box-shadow: none; }

.pal-empty { padding: 34px 16px 38px; text-align: center; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.pal-empty span { display: block; margin-top: 4px; font-size: 12px; font-weight: 500; color: var(--muted); }

.pal-foot {
  display: flex; gap: 16px; flex-wrap: wrap; flex: none;
  padding: 9px 16px; border-top: 1px solid var(--line-soft); background: #fafbfd;
  font-size: 11.5px; color: var(--faint);
}
.pal-foot span { display: inline-flex; align-items: center; gap: 4px; }

@media (max-width: 700px) {
  .pal { top: 10px; max-height: calc(100vh - 20px); border-radius: 12px; }
  .pal-foot { display: none; }
  .pal-row { min-height: 48px; }
}
