/* palette.css - the command palette (static/js/palette.js). Own file: app.css is at its size cap.
 * Every rule is under .pkp-* or #pk-pal, so deleting the script tag leaves the page as it was (C3).
 * Theme tokens only; spacing 4/8/12/16/24, type 12/13/15, 2px gold focus ring (DESIGN.md). */

.pkp-overlay {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12vh 16px 16px;
  background: rgba(0, 0, 0, .55);
}
.pkp-overlay[hidden] { display: none; }
.pkp-dialog {
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: min(70vh, 560px);
  border: 1px solid var(--border2);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 16px 48px rgba(0, 0, 0, .35);
  overflow: hidden;
}
.pkp-top {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 12px 16px;
  border-bottom: 1px solid var(--border);
}
.pkp-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
.pkp-input::placeholder { color: var(--muted); }
.pkp-input:focus { outline: none; }
.pkp-x {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--dim);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.pkp-x:hover { background: var(--s2); color: var(--text); }
.pkp-x:focus-visible,
.pkp-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.pkp-dialog:focus-within .pkp-top { border-bottom-color: var(--gold); }

.pkp-list {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 8px;
  list-style: none;
  overflow-y: auto;
}
.pkp-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}
.pkp-opt.is-active { background: var(--gold-bg); color: var(--text); box-shadow: inset 2px 0 0 var(--gold); }
.pkp-opt-label { min-width: 0; overflow-wrap: anywhere; }
.pkp-opt-tag {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--muted);
}
.pkp-foot {
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

/* The search icon in the tab bar, right after Insights, on every screen. Under 700px the bar
   scrolls sideways, so the icon is sticky to its right edge and stays in view. */
.pkp-btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0 0 0 4px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--dim);
  cursor: pointer;
  transition: color .15s, background .15s, border-color .15s;
}
.pkp-btn svg { width: 16px; height: 16px; }
.pkp-btn:hover { color: var(--gold); background: var(--s2); border-color: var(--border); }
@media (max-width: 700px) {
  .pkp-btn {
    position: sticky;
    right: 0;
    z-index: 2;
    background: var(--s1);
    border-color: var(--border);
  }
}
@media (max-width: 600px) {
  .pkp-overlay { padding-top: 8vh; }
  .pkp-input { font-size: 16px; }   /* iOS zooms into anything smaller */
}
@media (prefers-reduced-motion: no-preference) {
  .pkp-overlay:not([hidden]) .pkp-dialog { animation: pkp-in .12s ease-out both; }
  @keyframes pkp-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
}
