/* Spotlight command palette (js/spotlight.js). Shared by NexGen and Rescue:
   colours come from the brand.css tokens both apps define, with dark brand
   defaults for anything a page does not set. */
.spotlight-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: transparent; border: 1px solid var(--chrome-line, rgba(255, 255, 255, 0.18));
  color: var(--chrome-ink, inherit); border-radius: 8px; cursor: pointer;
  padding: 0.35rem 0.6rem; font: inherit; font-size: 0.9rem; line-height: 1; margin-left: 0.25rem;
}
.spotlight-btn:hover { background: color-mix(in srgb, var(--chrome-ink, #fff) 10%, transparent); }
.spotlight-btn:focus-visible { outline: 3px solid var(--product-accent, #4f9cf9); outline-offset: 2px; }
.spotlight-btn kbd {
  font: inherit; font-size: 0.72rem; opacity: 0.75;
  border: 1px solid currentColor; border-radius: 4px; padding: 0.05rem 0.3rem;
}
@media (max-width: 720px) { .spotlight-btn kbd { display: none; } }

html.spotlight-open { overflow: hidden; }

.spotlight[hidden] { display: none; }
.spotlight {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; justify-content: center; align-items: flex-start;
  padding: 12vh 1rem 1rem;
}
.spotlight-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  animation: spotlight-fade 140ms ease-out;
}
.spotlight-card {
  position: relative; width: 100%; max-width: 580px; max-height: 72vh;
  display: flex; flex-direction: column; overflow: hidden;
  background: color-mix(in srgb, var(--card, #1a2332) 92%, transparent);
  color: var(--ink, #e6edf6);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.12));
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  animation: spotlight-pop 160ms cubic-bezier(0.2, 0.9, 0.3, 1.2);
}

.spotlight-bar {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.85rem 1rem; border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.12));
}
.spotlight-mag { font-size: 1.25rem; color: var(--muted, #94a3b8); line-height: 1; }
.spotlight-input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  color: inherit; font: inherit; font-size: 1.05rem; padding: 0.2rem 0;
}
.spotlight .spotlight-input,
.spotlight .spotlight-input:focus,
.spotlight .spotlight-input:focus-visible { border: 0; outline: 0; box-shadow: none; width: auto; border-radius: 0; background: transparent; padding: 0.2rem 0; }
.spotlight-bar:focus-within { box-shadow: inset 0 -2px 0 var(--product-accent, #4f9cf9); }
.spotlight-input::placeholder { color: var(--muted, #94a3b8); }
.spotlight-card kbd {
  font-family: inherit; font-size: 0.75rem; font-weight: 600;
  padding: 0.1rem 0.4rem; border-radius: 5px;
  border: 1px solid var(--line, rgba(255, 255, 255, 0.18));
  background: color-mix(in srgb, var(--ink, #e6edf6) 6%, transparent);
  color: var(--muted, #94a3b8);
}

.spotlight-status[hidden], .spotlight-list[hidden], .spotlight-cheat[hidden] { display: none; }
.spotlight-status { margin: 0; padding: 0.5rem 1rem 0; font-size: 0.82rem; color: var(--muted, #94a3b8); }

.spotlight-list { list-style: none; margin: 0; padding: 0.35rem 0.4rem 0.5rem; overflow-y: auto; }
.spotlight-section {
  padding: 0.6rem 0.65rem 0.25rem; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted, #94a3b8);
}
.spotlight-item {
  display: flex; align-items: flex-start; gap: 0.7rem;
  padding: 0.55rem 0.65rem; border-radius: 9px; cursor: pointer;
  border-left: 3px solid transparent;
}
.spotlight-item.is-active {
  background: color-mix(in srgb, var(--product-accent, #4f9cf9) 16%, transparent);
  border-left-color: var(--product-accent, #4f9cf9);
}
.spotlight-icon { width: 1.4rem; flex: none; text-align: center; font-size: 1rem; line-height: 1.4; }
.spotlight-body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.spotlight-title { font-weight: 600; color: var(--heading, inherit); }
.spotlight-meta { font-size: 0.8rem; color: var(--muted, #94a3b8); }
.spotlight-snippet {
  font-size: 0.82rem; color: var(--muted, #94a3b8);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.spotlight-lock { flex: none; font-size: 0.85rem; opacity: 0.8; }

.spotlight-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.55rem 1rem; font-size: 0.78rem; color: var(--muted, #94a3b8);
  border-top: 1px solid var(--line, rgba(255, 255, 255, 0.12));
}
.spotlight-link {
  background: none; border: 0; padding: 0.2rem 0.3rem; border-radius: 6px; cursor: pointer;
  font: inherit; color: var(--product-accent-strong, var(--product-accent, #4f9cf9)); font-weight: 600;
}
.spotlight-link:focus-visible { outline: 2px solid var(--product-accent, #4f9cf9); }

.spotlight-cheat { padding: 0.9rem 1rem 0.6rem; overflow-y: auto; }
.spotlight-cheat-h { margin: 0 0 0.75rem; font-size: 1rem; color: var(--heading, inherit); }
.spotlight-cheat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem 1.5rem; }
.spotlight-cheat-col h3 {
  margin: 0 0 0.4rem; font-size: 0.72rem; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--muted, #94a3b8);
}
.spotlight-cheat-col dl { display: grid; grid-template-columns: auto 1fr; gap: 0.45rem 0.8rem; margin: 0; align-items: center; }
.spotlight-cheat-col dt { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem; white-space: nowrap; }
.spotlight-cheat-col dd { margin: 0; font-size: 0.88rem; }
.spotlight-or { font-size: 0.72rem; color: var(--muted, #94a3b8); margin: 0 0.15rem; }
.spotlight-cheat-note { margin: 0.9rem 0 0; font-size: 0.78rem; color: var(--muted, #94a3b8); }

@keyframes spotlight-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes spotlight-pop {
  from { opacity: 0; transform: translateY(-8px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .spotlight-backdrop, .spotlight-card { animation: none; }
}
@media (max-width: 560px) {
  .spotlight { padding-top: 4vh; }
  .spotlight-card { max-height: 88vh; }
  .spotlight-foot > span { display: none; }
}
