/* ==========================================================================
   COCKPIT TOOLS — search palette, digit-jump toast, blackout screen, and
   speaker-note tier/plan chips. Shared by index.html and presenter.html.
   Chrome only: styled with the --ch-* tokens (app.css), never template tokens,
   so everything here is template-independent.
   z-order (app.css): toolbar 900 · overview 940 · modal 950 · gate 970 · toast 990.
   ========================================================================== */

/* ---------- blank screen (B/W blackout / whiteout) ---------- */

.blank-screen {
  position: fixed;
  inset: 0;
  z-index: 960; /* above stage/overview/modals, below gate + toasts */
  background: #000;
}
.blank-screen.is-white {
  background: #fff;
}

/* ---------- search palette (/) ---------- */

.sr-overlay {
  position: fixed;
  inset: 0;
  z-index: 965;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 11vh;
  background: rgba(0, 0, 0, 0.45);
}
.sr-box {
  display: flex;
  flex-direction: column;
  width: min(680px, 92vw);
  max-height: 64vh;
  overflow: hidden;
  background: var(--ch-bg);
  border: 1px solid var(--ch-line);
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
  font-family: var(--ch-font);
  color: var(--ch-ink);
}
.sr-input {
  padding: 14px 18px;
  font: 500 16px / 1.4 var(--ch-font);
  color: var(--ch-ink);
  background: none;
  border: none;
  outline: none;
  border-bottom: 1px solid var(--ch-line);
}
.sr-input::placeholder {
  color: var(--ch-muted);
}
.sr-results {
  margin: 0;
  padding: 6px;
  list-style: none;
  overflow-y: auto;
}
.sr-item {
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-areas: "num head" "num snippet";
  gap: 2px 12px;
  width: 100%;
  padding: 9px 12px;
  text-align: left;
  background: none;
  border: none;
  border-radius: 8px;
  color: var(--ch-ink);
  font-family: var(--ch-font);
  cursor: pointer;
}
.sr-item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.sr-item.is-selected {
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px var(--ch-line);
}
.sr-num {
  grid-area: num;
  align-self: center;
  text-align: center;
  font: 700 15px / 1 var(--ch-font);
  font-variant-numeric: tabular-nums;
  color: var(--ch-accent);
}
.sr-head {
  grid-area: head;
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.sr-title {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
  font-weight: 600;
}
.sr-layout {
  flex: none;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ch-muted);
}
.sr-snippet {
  grid-area: snippet;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--ch-muted);
}
.sr-snippet mark {
  background: none;
  color: var(--ch-accent);
  font-weight: 700;
}
.sr-none {
  padding: 18px;
  text-align: center;
  font: 500 13px / 1 var(--ch-font);
  color: var(--ch-muted);
}

/* ---------- help legend (keyboard shortcuts) ---------- */

.hp-overlay {
  position: fixed;
  inset: 0;
  z-index: 965;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 9vh;
  background: rgba(0, 0, 0, 0.5);
}
.hp-box {
  width: min(760px, 92vw);
  max-height: 82vh;
  overflow-y: auto;
  background: var(--ch-bg);
  border: 1px solid var(--ch-line);
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
  font-family: var(--ch-font);
  color: var(--ch-ink);
}
.hp-head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: var(--ch-bg);
  border-bottom: 1px solid var(--ch-line);
}
.hp-title {
  font: 700 15px / 1 var(--ch-font);
}
.hp-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 28px;
  padding: 14px 20px 20px;
}
.hp-section {
  break-inside: avoid;
}
.hp-section-title {
  margin: 10px 0 6px;
  font: 700 10px / 1 var(--ch-font);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ch-accent);
}
.hp-rows {
  margin: 0;
}
.hp-row {
  display: grid;
  grid-template-columns: minmax(96px, auto) 1fr;
  gap: 6px 14px;
  align-items: baseline;
  padding: 5px 0;
}
.hp-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
}
.hp-keys kbd {
  min-width: 22px;
  padding: 3px 7px;
  text-align: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--ch-line);
  border-bottom-width: 2px;
  border-radius: 6px;
  font:
    600 11px / 1.3 "SF Mono",
    "JetBrains Mono",
    Menlo,
    monospace;
  color: var(--ch-ink);
}
.hp-desc {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ch-muted);
}

@media (max-width: 620px) {
  .hp-cols {
    grid-template-columns: 1fr;
  }
}

/* ---------- type-a-number jump toast ---------- */

.dj-toast {
  position: fixed;
  left: 50%;
  bottom: 76px; /* clear of the standard toast at 28px */
  transform: translateX(-50%);
  z-index: 965;
  padding: 8px 16px;
  background: var(--ch-bg);
  border: 1px solid var(--ch-line);
  border-radius: 9px;
  font: 500 13px / 1.4 var(--ch-font);
  color: var(--ch-muted);
}
.dj-toast strong {
  color: var(--ch-accent);
  font-variant-numeric: tabular-nums;
}

/* ---------- speaker-note tier badge + planned time ---------- */

.note-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  white-space: normal;
  font-family: var(--ch-font);
}
.note-tier {
  padding: 4px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: 700 10px / 1 var(--ch-font);
  letter-spacing: 0.08em;
}
.note-tier.tier-core {
  background: var(--ch-accent);
  border-color: var(--ch-accent);
  color: #1a1a1a;
}
.note-tier.tier-skim {
  border-color: var(--ch-ink);
  color: var(--ch-ink);
}
.note-tier.tier-skipok {
  border-style: dashed;
  border-color: var(--ch-muted);
  color: var(--ch-muted);
}
.note-plan {
  font: 600 12px / 1 var(--ch-font);
  font-variant-numeric: tabular-nums;
  color: var(--ch-muted);
}
.note-text {
  white-space: pre-wrap;
}
.note-text code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.09);
  font-family: "SF Mono", "JetBrains Mono", Menlo, monospace;
  font-size: 0.9em;
}

@media print {
  .sr-overlay,
  .hp-overlay,
  .dj-toast,
  .blank-screen {
    display: none !important;
  }
}
